@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
38 lines • 2.1 kB
TypeScript
import type { RequestOptions, Token, TokenAmount, WalletTokenExtended } from '@lifi/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 (or TokenExtended) 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 function 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 function getTokenBalancesByChain(walletAddress: string, tokensByChain: {
[chainId: number]: Token[];
}): Promise<{
[chainId: number]: TokenAmount[];
}>;
/**
* Returns the balances of tokens a wallet holds across EVM chains.
* @param walletAddress - A wallet address.
* @param options - Optional request options.
* @returns An object containing the tokens and the amounts organized by chain ids.
* @throws {BaseError} Throws a ValidationError if parameters are invalid.
*/
export declare const getWalletBalances: (walletAddress: string, options?: RequestOptions) => Promise<Record<number, WalletTokenExtended[]>>;
//# sourceMappingURL=balance.d.ts.map