UNPKG

@talismn/api-react-hooks

Version:
23 lines (22 loc) 1.05 kB
import type { Balance } from '@talismn/api'; export type { Balance } from '@talismn/api'; export declare type Status = 'INITIALIZED' | 'PROCESSING' | 'READY' | 'ERROR'; export declare function useBalances(_addresses?: string[], chains?: string[], rpcs?: { [key: string]: string[]; }): { balances: (Balance | null)[]; }; export declare function groupBalancesByChain<B extends Balance>(chainIds: string[], balances: Array<B | null>): { [key: string]: B[]; }; export declare function groupBalancesByAddress<B extends Balance>(balances: Array<B | null>): { [key: string]: B[]; }; export declare type BalanceWithTokens = Balance & { tokens?: string; }; export declare function addTokensToBalances(balances: Array<Balance | null>, tokenDecimals?: number): Array<BalanceWithTokens | null>; export declare type BalanceWithTokensWithPrice = BalanceWithTokens & { usd?: string; }; export declare function addPriceToTokenBalances(balances: Array<BalanceWithTokens | null>, tokenPrice?: string): Array<BalanceWithTokensWithPrice | null>;