@paxoslabs/earn-sdk
Version:
Paxos Labs Earn SDK
80 lines (75 loc) • 3.02 kB
text/typescript
import { Address } from 'viem';
import { C as ChainId } from './vault-config-BjSE7oL8.mjs';
import { V as VaultKey } from './config-BQynVNDC.mjs';
declare const isDepositSpendApproved: ({ vaultKey, sourceChainId, depositTokenSymbol, userAddress, }: {
vaultKey: VaultKey;
sourceChainId: ChainId;
userAddress: Address;
depositTokenSymbol: string;
}) => Promise<{
isApproved: boolean;
allowance: string;
allowanceAsBigInt: string;
decimals: string;
error: Error | undefined;
} | {
isApproved: boolean;
allowance: string;
allowanceAsBigInt: string;
decimals: number;
error: null;
}>;
declare const isWithdrawalSpendApproved: ({ vaultKey, destinationChainId, userAddress, }: {
vaultKey: VaultKey;
destinationChainId: ChainId;
userAddress: Address;
}) => Promise<{
isApproved: boolean;
allowance: string;
allowanceAsBigInt: string;
decimals: string;
error: Error | undefined;
} | {
isApproved: boolean;
allowance: string;
allowanceAsBigInt: string;
decimals: number;
error: null;
}>;
interface GetPreviewFeeParams {
vaultKey: VaultKey;
bridgeAmount: bigint;
sourceChainId: ChainId;
destinationChainId: ChainId;
userAddress: Address;
nativeTokenForBridgeFee?: Address;
}
declare const getBridgeFee: ({ vaultKey, bridgeAmount, sourceChainId, destinationChainId, userAddress, nativeTokenForBridgeFee, }: GetPreviewFeeParams) => Promise<bigint>;
interface GetDepositExchangeRateParams {
vaultKey: VaultKey;
sourceChainId: ChainId;
depositTokenSymbol: string;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
}
/**
* Gets the deposit exchange rate for a vault (tokens per share)
* @throws {Error} If the token address is not found or if there's an error fetching the rate
* @returns Promise<string> The exchange rate as a formatted string representing how many deposit tokens are worth 1 share
*/
declare const getDepositExchangeRate: ({ vaultKey, sourceChainId, depositTokenSymbol, minimumFractionDigits, maximumFractionDigits, }: GetDepositExchangeRateParams) => Promise<string>;
interface GetWithdrawExchangeRateParams {
vaultKey: VaultKey;
sourceChainId: ChainId;
destinationChainId: ChainId;
wantTokenSymbol: string;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
}
/**
* Gets the withdraw exchange rate for a vault (tokens per share)
* @throws {Error} If the token address is not found or if there's an error fetching the rate
* @returns Promise<string> The exchange rate as a formatted string representing how many want tokens are worth 1 share
*/
declare const getWithdrawExchangeRate: ({ vaultKey, sourceChainId, destinationChainId, wantTokenSymbol, minimumFractionDigits, maximumFractionDigits, }: GetWithdrawExchangeRateParams) => Promise<string>;
export { getDepositExchangeRate as a, getWithdrawExchangeRate as b, isWithdrawalSpendApproved as c, getBridgeFee as g, isDepositSpendApproved as i };