import { ChainGetter } from "../chain"; import { CoinPretty } from "@keplr-wallet/unit"; import { AppCurrency } from "@keplr-wallet/types"; import { HasMapStore, IObservableQuery, QuerySharedContext } from "../common"; export interface IObservableQueryBalanceImpl extends IObservableQuery { balance: CoinPretty; currency: AppCurrency; } export interface BalanceRegistry { getBalanceImpl(chainId: string, chainGetter: ChainGetter, bech32Address: string, minimalDenom: string): IObservableQueryBalanceImpl | undefined; } export declare class ObservableQueryBalancesImplMap { protected readonly sharedContext: QuerySharedContext; protected readonly chainId: string; protected readonly chainGetter: ChainGetter; protected readonly balanceRegistries: BalanceRegistry[]; protected address: string; protected balanceImplMap: Map; constructor(sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter, balanceRegistries: BalanceRegistry[], address: string); fetch(): void; protected getBalanceInner(currency: AppCurrency): IObservableQueryBalanceImpl | undefined; get stakable(): IObservableQueryBalanceImpl | undefined; /** * 알려진 모든 Currency들의 balance를 반환환다. */ get balances(): IObservableQueryBalanceImpl[]; /** * 알려진 모든 Currency들 중 0 이상의 잔고를 가진 balance를 반환환다. */ get positiveBalances(): IObservableQueryBalanceImpl[]; /** * Returns that the balances that are not native tokens. * Native token means that the token that exists on the `bank` module. */ get nonNativeBalances(): IObservableQueryBalanceImpl[]; /** * Returns that the balances that are native tokens with greater than 0 balance. * Native token means that the token that exists on the `bank` module. */ get positiveNativeUnstakables(): IObservableQueryBalanceImpl[]; get unstakables(): IObservableQueryBalanceImpl[]; /** * @deprecated */ readonly getBalanceFromCurrency: (currency: AppCurrency) => CoinPretty; readonly getBalance: (currency: AppCurrency) => IObservableQueryBalanceImpl | undefined; } export declare class ObservableQueryBalances extends HasMapStore { protected readonly sharedContext: QuerySharedContext; protected readonly chainId: string; protected readonly chainGetter: ChainGetter; protected balanceRegistries: BalanceRegistry[]; constructor(sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter); addBalanceRegistry(registry: BalanceRegistry): void; getQueryBech32Address(bech32Address: string): ObservableQueryBalancesImplMap; getQueryEthereumHexAddress(ethereumHexAddress: string): ObservableQueryBalancesImplMap; }