@gnolang/tm2-js-client
Version:
Tendermint2 JS / TS Client
41 lines (40 loc) • 2.04 kB
TypeScript
import { Tx } from '../../proto';
import { ResponseDeliverTx } from '../../proto/tm2/abci';
import { Provider } from '../provider';
import { ABCIAccount, ABCIResponse } from '../types';
/**
* Extracts the specific balance denomination from the ABCI response
* @param {string | null} abciData the base64-encoded ABCI data
* @param {string} denomination the required denomination
*/
export declare const extractBalanceFromResponse: (abciData: string | null, denomination: string) => number;
/**
* Extracts the account sequence from the ABCI response
* @param {string | null} abciData the base64-encoded ABCI data
*/
export declare const extractSequenceFromResponse: (abciData: string | null) => number;
/**
* Extracts the account number from the ABCI response
* @param {string | null} abciData the base64-encoded ABCI data
*/
export declare const extractAccountNumberFromResponse: (abciData: string | null) => number;
/**
* Extracts the account from the ABCI response
* @param {string | null} abciData the base64-encoded ABCI data
*/
export declare const extractAccountFromResponse: (abciData: string | null) => ABCIAccount;
/**
* Extracts the simulate transaction response from the ABCI response value
* @param {string | null} abciData the base64-encoded ResponseDeliverTx proto message
*/
export declare const extractSimulateFromResponse: (abciResponse: ABCIResponse | null) => ResponseDeliverTx;
/**
* Waits for the transaction to be committed to a block in the chain
* of the specified provider. This helper does a search for incoming blocks
* and checks if a transaction
* @param {Provider} provider the provider instance
* @param {string} hash the base64-encoded hash of the transaction
* @param {number} [fromHeight=latest] the starting height for the search. If omitted, it is the latest block in the chain
* @param {number} [timeout=15000] the timeout in MS for the search
*/
export declare const waitForTransaction: (provider: Provider, hash: string, fromHeight?: number, timeout?: number) => Promise<Tx>;