UNPKG

@keplr-ewallet/ewallet-sdk-cosmos

Version:
49 lines (48 loc) 1.9 kB
type QueryParams = Record<string, string | number | boolean>; type TxQuery = Uint8Array | QueryParams; declare enum WsReadyState { CONNECTING = 0, OPEN = 1, CLOSING = 2, CLOSED = 3, NONE = 4 } interface TxEventMap { close: (e: CloseEvent) => void; error: (e: Event) => void; message: (e: MessageEvent) => void; open: (e: Event) => void; } export declare class TendermintTxTracer { protected readonly url: string; protected readonly wsEndpoint: string; protected readonly options: { wsObject?: new (url: string, protocols?: string | string[]) => WebSocket; }; private ws; private newBlockSubscribes; private txSubscribes; private pendingQueries; private listeners; constructor(url: string, wsEndpoint: string, options?: { wsObject?: new (url: string, protocols?: string | string[]) => WebSocket; }); protected getWsEndpoint(): string; close(): void; get readyState(): WsReadyState; addEventListener<T extends keyof TxEventMap>(type: T, listener: TxEventMap[T]): void; protected readonly onOpen: (e: Event) => void; protected readonly onMessage: (e: MessageEvent) => void; protected readonly onClose: (e: CloseEvent) => void; protected readonly onError: (e: Event) => void; subscribeBlock(handler: (block: any) => void): () => void; protected sendSubscribeBlockRpc(): void; traceTx(query: TxQuery): Promise<any>; subscribeTx(query: TxQuery): Promise<any>; protected sendSubscribeTxRpc(id: number, params: Record<string, string | number | boolean>): void; queryTx(query: TxQuery): Promise<any>; protected query(method: string, params: Record<string, string | number | boolean>): Promise<any>; protected sendQueryRpc(id: number, method: string, params: Record<string, string | number | boolean>): void; private createRandomId; } export {};