Approve paraUSD Calldata

The approveParabolUSDCalldata method generates the calldata required to approve spending of paraUSD tokens.

Usage

import { SupportedChainIds, approveParabolUSDCalldata } from "@parabolfi/core";
 
const chainId = SupportedChainIds.ZKSYNC;
const value = "1000"; // 1000 paraUSD in ether units
 
const approveCalldata = approveParabolUSDCalldata(chainId, value);
console.log("Approve paraUSD calldata:", approveCalldata);

Parameters

  • chainId: SupportedChainIds - The chain ID of the network.
  • value: string - The amount of paraUSD to approve, in ether units.

Returns

  • string - The generated calldata for approving paraUSD.
0x095ea7b3...

Notes

  • The generated calldata can be used in a transaction to approve paraUSD spending for another contract or address.
  • This approval is necessary before lending paraUSD.
  • The value should be provided in ether units (1 paraUSD = 1e18 ether).
  • The method will throw a ParabolSDKError if the value is zero, the chain ID is not supported, or if there’s an error generating the calldata.