import { Address, PostableBytes, TransactionId } from "@iov/bcp"; import amino from "@tendermint/amino-js"; import { AminoTx } from "./types"; interface NodeInfo { readonly network: string; } interface NodeInfoResponse { readonly node_info: NodeInfo; } interface BlockMeta { readonly header: { readonly height: number; readonly time: string; readonly num_txs: number; }; readonly block_id: { readonly hash: string; }; } interface Block { readonly header: { readonly height: number; }; } interface BlocksResponse { readonly block_meta: BlockMeta; readonly block: Block; } interface AuthAccountsResponse { readonly result: { readonly value: amino.BaseAccount; }; } export interface TxsResponse { readonly height: string; readonly txhash: string; readonly raw_log: string; readonly tx: AminoTx; } interface SearchTxsResponse { readonly total_count: string; readonly count: string; readonly page_number: string; readonly page_total: string; readonly limit: string; readonly txs: readonly TxsResponse[]; } interface PostTxsParams {} interface PostTxsResponse { readonly height: string; readonly txhash: string; readonly code?: number; readonly raw_log?: string; } declare type RestClientResponse = | NodeInfoResponse | BlocksResponse | AuthAccountsResponse | TxsResponse | SearchTxsResponse | PostTxsResponse; declare type BroadcastMode = "block" | "sync" | "async"; export declare class RestClient { private readonly client; private readonly mode; constructor(url: string, mode?: BroadcastMode); get(path: string): Promise; post(path: string, params: PostTxsParams): Promise; nodeInfo(): Promise; blocksLatest(): Promise; blocks(height: number): Promise; authAccounts( address: Address, height?: string ): Promise; txs(query: string): Promise; txsById(id: TransactionId): Promise; postTx(tx: PostableBytes): Promise; } export {};