import { BigNumber } from '../utils/bignumber'; import { BigNumberish } from '../utils/bignumber'; import { Network } from '../utils/networks'; import { OnceBlockable } from '../utils/web'; import { Transaction } from '../utils/transaction'; export interface Status { type: string; value: { address: string; coins: [{ denom: string; amount: BigNumberish; }]; public_key: { type: string; value: string; }; account_number: BigNumberish; sequence: BigNumberish; }; } export interface AccountState { type: string; value: { address: string; coins: [{ denom: string; amount: BigNumberish; }]; public_key: { type: string; value: string; }; account_number: BigNumberish; sequence: BigNumberish; }; } export interface Block { blockMeta: { blockId: BlockId; header: BlockHeader; }; block: { header: BlockHeader; data: { txs: any; }; evidence: { evidence: any; }; last_commit: { block_id: BlockId; precommits: Array; }; }; } export declare type BlockTag = string | number; export declare type Filter = { fromBlock?: BlockTag; toBlock?: BlockTag; address?: string; topics?: Array>; }; export interface BlockId { hash: string; parts: { total: number; hash: string; }; } export interface BlockHeader { version: { block: number; app: number; }; chainId: string; height: number; time: string; numTxs: number; totalTxs: number; lastBlockId: { hash: string; parts: { total: number; hash: string; }; }; lastCommitHash: string; dataHash?: string; validatorsHash: string; nextValidatorsHash: string; consensusHash: string; appHash: string; lastResultsHash?: string; evidenceHash?: string; proposerAddress: string; } export interface PreCommit { type: number; height: number; round: number; timestamp: string; block_id: BlockId; validator_address: string; validator_index: number; signature: string; } export interface TransactionReceipt { blockNumber?: number; confirmations?: number; status?: number; } export declare type TransactionFee = { amount: Array<{ denom: string; amount: BigNumberish; }>; gas: BigNumberish; }; export declare type TransactionSignature = { publicKey: { type: string; value: string; }; signature: string; }; export declare type TransactionRequest = { type?: string; value?: { msg?: Array<{ type: string; value: any; }>; fee?: TransactionFee | Promise; signatures?: Array; memo?: string; }; nonce?: BigNumberish | Promise; chainId?: string | Promise; fee?: TransactionFee | Promise; }; export interface TransactionResponse extends Transaction { checkTransaction: { gasWanted?: BigNumberish; gasUsed?: BigNumberish; }; deliverTransaction: { log?: string; gasWanted?: BigNumberish; gasUsed?: BigNumberish; tags?: Array<{ key: string; value: string; }>; }; hash: string; blockNumber?: number; confirmations: number; wait: (confirmations?: number) => Promise; } export declare type EventType = string | Array | Filter; export declare type Listener = (...args: Array) => void; export declare abstract class Provider implements OnceBlockable { abstract getNetwork(): Promise; abstract getBlockNumber(): Promise; abstract getTransactionFee(): Promise; abstract getStatus(): Promise; abstract getAccountState(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getAccountNumber(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getBalance(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getTransactionCount(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract sendTransaction(signedTransaction: string | Promise): Promise; abstract getTransaction(transactionHash: string): Promise; abstract isWhitelisted(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract resolveName(name: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract lookupAddress(address: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract on(eventName: EventType, listener: Listener): Provider; abstract once(eventName: EventType, listener: Listener): Provider; constructor(); static isProvider(value: any): value is Provider; }