@onekeyfe/blockchain-libs
Version:
OneKey Blockchain Libs
29 lines (28 loc) • 1.39 kB
TypeScript
import BigNumber from 'bignumber.js';
import { RestfulRequest } from '../../../basic/request/restful';
import { CoinInfo } from '../../../types/chain';
import { AddressInfo, ClientInfo, FeePricePerUnit, TransactionStatus } from '../../../types/provider';
import { SimpleClient } from '../../abc';
declare type CosmosAddressInfo = AddressInfo & {
accountNumber: number | undefined;
};
declare const GAS_STEP_MULTIPLIER = 10000;
declare class Tendermint extends SimpleClient {
readonly restful: RestfulRequest;
constructor(url: string);
get mainCoinDenom(): string;
getInfo(): Promise<ClientInfo>;
getAddress(address: string): Promise<CosmosAddressInfo>;
getBalances(requests: Array<{
address: string;
coin: Partial<CoinInfo>;
}>): Promise<Array<BigNumber | undefined>>;
getNativeTokenBalances(address: string, coins: Partial<CoinInfo>[]): Promise<BigNumber[]>;
getCW20Balance(address: string, coin: Partial<CoinInfo>): Promise<BigNumber>;
queryContract(contractAddress: string, query: unknown, others?: object): Promise<unknown>;
getBalance(address: string, coin: Partial<CoinInfo>): Promise<BigNumber>;
getFeePricePerUnit(): Promise<FeePricePerUnit>;
getTransactionStatus(txid: string): Promise<TransactionStatus>;
broadcastTransaction(rawTx: string): Promise<string>;
}
export { Tendermint, GAS_STEP_MULTIPLIER };