UNPKG

@openocean.finance/widget-sdk

Version:

OpenOcean Any-to-Any Cross-Chain-Swap SDK

30 lines 1.6 kB
import { type Token, type TokenAmount } from '@openocean.finance/widget-types'; /** * Returns the balances of a specific token a wallet holds across all aggregated chains. * @param walletAddress - A wallet address. * @param token - A Token object. * @returns An object containing the token and the amounts on different chains. * @throws {BaseError} Throws a ValidationError if parameters are invalid. */ export declare const getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>; /** * Returns the balances for a list tokens a wallet holds across all aggregated chains. * @param walletAddress - A wallet address. * @param tokens - A list of Token objects. * @returns A list of objects containing the tokens and the amounts on different chains. * @throws {BaseError} Throws a ValidationError if parameters are invalid. */ export declare const getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>; /** * This method queries the balances of tokens for a specific list of chains for a given wallet. * @param walletAddress - A wallet address. * @param tokensByChain - A list of token objects organized by chain ids. * @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains. * @throws {BaseError} Throws a ValidationError if parameters are invalid. */ export declare const getTokenBalancesByChain: (walletAddress: string, tokensByChain: { [chainId: number]: Token[]; }) => Promise<{ [chainId: number]: TokenAmount[]; }>; //# sourceMappingURL=balance.d.ts.map