UNPKG

@parabolfi/core

Version:

Core utilities for Parabol SDK

103 lines 4.78 kB
import { SupportedChainId } from "../config/global"; import { ParabolData, PartnerConfig } from "../types"; import { Hex } from "viem"; import { Transactions } from "../transactions"; import { TransactionParams } from "../types/transaction"; export declare function createCalldata<T extends Transactions>(transactionType: T, params: TransactionParams<T>): string; /** * Generates calldata for approving ParaUSD spending. * * @param chainId - The ID of the blockchain network. * @param value - The amount of tokens to approve for spending. * @returns The generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the value is zero or the chain ID is invalid. */ export declare function approveParabolUSDCalldata(chainId: SupportedChainId, value: string): string; /** * Generates calldata for approving a Position token transfer. * * @param chainId - The ID of the blockchain network. * @param tokenId - The ID of the token to approve. * @returns The generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the chain ID is invalid. */ export declare function approvePositionCalldata(chainId: SupportedChainId, tokenId: string): string; /** * Generates calldata for approving a Note Position token transfer. * * @param chainId - The ID of the blockchain network. * @returns The generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the chain ID is invalid. */ export declare function approvePositionOperatorCalldata(chainId: SupportedChainId): string; /** * Generates calldata for lending ParaUSD to Reserve Stability Pool (RSP). * * @param walletAddress - The address of the wallet initiating the lend. * @param duration - The duration of the lend in days. * @param principal - The amount of ParaUSD to lend. * @param parabolData - Pre-fetched Parabol data from Parabol API. * @param minLendLimit - The minimum allowed lending amount. * @param partnerId - The ID of the partner. * @param partnerFeeBPS - The partner fee in basis points. * @returns A promise that resolves to the generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the wallet address is invalid, principal is too low, or if note data is unavailable. */ export declare function lendCalldata({ walletAddress, maturity, principal, parabolData, partnerConfig, }: { walletAddress: `0x${string}`; maturity: number; principal: string; parabolData: ParabolData; partnerConfig?: PartnerConfig; }): string; /** * Generates calldata for claiming a Note Position ERC-721 token. * * @param walletAddress - The address of the wallet initiating the claim. * @param tokenId - The ID of the token to claim. * @returns The generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the wallet address is invalid or the tokenId is negative. */ export declare function claimCalldata({ walletAddress, tokenId, }: { walletAddress: `0x${string}`; tokenId: bigint; }): string; /** * Generates calldata for lending ParaUSD with a permit. * * @param walletAddress - The address of the wallet initiating the lend. * @param duration - The duration of the lend in days. * @param principal - The amount of ParaUSD to lend. * @param permitSignature - The signature for the permit. * @param parabolData - Pre-fetched Parabol data. * @param minLendLimit - The minimum allowed lending amount. * @param partnerId - The ID of the partner. * @param partnerFeeBPS - The partner fee in basis points. * @returns A promise that resolves to the generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the wallet address is invalid, principal is too low, permit deadline is invalid, or if note data is unavailable. */ export declare function permitLendCalldata({ walletAddress, maturity, principal, permitSignature, deadline, parabolData, partnerConfig, }: { walletAddress: `0x${string}`; maturity: number; principal: string; permitSignature: Hex; deadline: bigint; parabolData: ParabolData; partnerConfig?: PartnerConfig; }): string; /** * Generates calldata for claiming a Note Position token with a permit. * * @param walletAddress - The address of the wallet initiating the claim. * @param tokenId - The ID of the token to claim. * @param permitSignature - The signature for the permit. * @returns The generated calldata as a hexadecimal string. * @throws {ParabolSDKError} If the wallet address is invalid, tokenId is negative, or permit deadline is invalid. */ export declare function permitClaimCalldata({ walletAddress, tokenId, permitSignature, deadline, }: { walletAddress: `0x${string}`; tokenId: bigint; permitSignature: Hex; deadline: bigint; }): string; //# sourceMappingURL=calldataHelpers.d.ts.map