Parabol Config (fetchParabolConfig)

With the FetchParabolConfig function, you can access the configuration information required for lend, permitLend, or permitClaim operations regarding the minimum lend amount, non-fungible note position (ERC-721), and Parabol USD (ERC-20) contracts.

import { SupportedChainIds } from "@parabolfi/core";
import { ParabolServer } from "@parabolfi/server";
 
const parabolServer = new ParabolServer({
  apiKey: process.env.PARABOL_API_KEY,
});
 
const chain = SupportedChainIds.ZKSYNC;
const data = await parabolServer.fetchParabolConfig([chain]);
ℹ️

chain is required.

Response

{
  "324": {
    "NonFungibleNotePositionName": "paraUSD RSP Note NFT-V1",
    "NonFungibleNotePositionVersion": "1",
    "ParabolUSDName": "Parabol USD",
    "ParabolUSDVersion": "1"
  }
}
  • NonFungibleNotePositionName is the name of the non-fungible note position contract.
  • NonFungibleNotePositionVersion is the version of the non-fungible note position contract.
  • ParabolUSDName is the name of the Parabol USD contract.
  • ParabolUSDVersion is the version of the Parabol USD contract.

Example of Permit Lend

import { preparePermitLendSignature } from "@parabolfi/core";
 
const { domain, types, data, deadline } = preparePermitLendSignature({
  walletAddress,
  chainId,
  principal, // principal is the amount of paraUSD to lend
  nonce, // nonce is the nonce of the Parabol USD contract
  ParabolUSDName,
  ParabolUSDVersion,
});

Example of Permit Claim

import { preparePermitClaimSignature } from "@parabolfi/core";
 
const { domain, types, data, deadline } = preparePermitClaimSignature({
  chainId,
  tokenId, // tokenId is the token ID of the non-fungible note position
  nonce, // nonce is the nonce of the NonFungibleNotePosition contract
  NonFungibleNotePositionName,
  NonFungibleNotePositionVersion,
});

For more information, please refer to the Parabol Core SDK page.