export declare type Arrayish = string | ArrayLike; export declare abstract class BigNumber { abstract fromTwos(value: number): BigNumber; abstract toTwos(value: number): BigNumber; abstract add(other: BigNumberish): BigNumber; abstract sub(other: BigNumberish): BigNumber; abstract div(other: BigNumberish): BigNumber; abstract mul(other: BigNumberish): BigNumber; abstract mod(other: BigNumberish): BigNumber; abstract pow(other: BigNumberish): BigNumber; abstract maskn(value: number): BigNumber; abstract eq(other: BigNumberish): boolean; abstract lt(other: BigNumberish): boolean; abstract lte(other: BigNumberish): boolean; abstract gt(other: BigNumberish): boolean; abstract gte(other: BigNumberish): boolean; abstract isZero(): boolean; abstract toNumber(): number; abstract toString(): string; abstract toHexString(): string; } export declare type BigNumberish = BigNumber | string | number | Arrayish; export declare type ConnectionInfo = { url: string; user?: string; password?: string; allowInsecure?: boolean; }; export interface OnceBlockable { once(eventName: "block", handler: () => void): void; } export declare type PollOptions = { timeout?: number; floor?: number; ceiling?: number; interval?: number; onceBlock?: OnceBlockable; }; export declare type SupportedAlgorithms = 'sha256' | 'sha512'; export interface Signature { r: string; s: string; recoveryParam?: number; v?: number; } export declare type Network = { name: string; chainId: number; ensAddress?: string; }; export declare type Networkish = Network | string | number; export declare type CoerceFunc = (type: string, value: any) => any; export declare type ParamType = { name?: string; type: string; indexed?: boolean; components?: Array; }; export declare type EventFragment = { type: string; name: string; anonymous: boolean; inputs: Array; }; export declare type FunctionFragment = { type: string; name: string; constant: boolean; inputs: Array; outputs: Array; payable: boolean; stateMutability: string; }; export declare type UnsignedTransaction = { to?: string; nonce?: number; gasLimit?: BigNumberish; gasPrice?: BigNumberish; data?: Arrayish; value?: BigNumberish; chainId?: number; }; export interface Transaction { hash?: string; to?: string; from?: string; nonce: number; gasLimit: BigNumber; gasPrice: BigNumber; data: string; value: BigNumber; chainId: number; r?: string; s?: string; v?: number; } export declare type BlockTag = string | number; export interface Block { hash: string; parentHash: string; number: number; timestamp: number; nonce: string; difficulty: number; gasLimit: BigNumber; gasUsed: BigNumber; miner: string; extraData: string; transactions: Array; } export declare type Filter = { fromBlock?: BlockTag; toBlock?: BlockTag; address?: string; topics?: Array>; }; export interface Log { blockNumber?: number; blockHash?: string; transactionIndex?: number; removed?: boolean; transactionLogIndex?: number; address: string; data: string; topics: Array; transactionHash?: string; logIndex?: number; } export interface TransactionReceipt { contractAddress?: string; transactionIndex?: number; root?: string; gasUsed?: BigNumber; logsBloom?: string; blockHash?: string; transactionHash?: string; logs?: Array; blockNumber?: number; cumulativeGasUsed?: BigNumber; byzantium: boolean; status?: number; } export declare type TransactionRequest = { to?: string | Promise; from?: string | Promise; nonce?: number | string | Promise; gasLimit?: BigNumberish | Promise; gasPrice?: BigNumberish | Promise; data?: Arrayish | Promise; value?: BigNumberish | Promise; chainId?: number | Promise; }; export interface TransactionResponse extends Transaction { blockNumber?: number; blockHash?: string; timestamp?: number; from: string; raw?: string; wait: (timeout?: number) => Promise; } export declare abstract class Indexed { readonly hash: string; } export interface DeployDescription { readonly inputs: Array; readonly payable: boolean; encode(bytecode: string, params: Array): string; } export interface FunctionDescription { readonly type: "call" | "transaction"; readonly name: string; readonly signature: string; readonly sighash: string; readonly inputs: Array; readonly outputs: Array; readonly payable: boolean; encode(params: Array): string; decode(data: string): any; } export interface EventDescription { readonly name: string; readonly signature: string; readonly inputs: Array; readonly anonymous: boolean; readonly topic: string; encodeTopics(params: Array): Array; decode(data: string, topics?: Array): any; } export interface LogDescription { readonly name: string; readonly signature: string; readonly topic: string; readonly values: Array; } export interface TransactionDescription { readonly name: string; readonly args: Array; readonly signature: string; readonly sighash: string; readonly decode: (data: string) => any; readonly value: BigNumber; } export declare type ContractFunction = (...params: Array) => Promise; export declare type EventFilter = { address?: string; topics?: Array; }; export interface Event extends Log { args: Array; decode: (data: string, topics?: Array) => any; event: string; eventSignature: string; removeListener: () => void; getBlock: () => Promise; getTransaction: () => Promise; getTransactionReceipt: () => Promise; } export declare type EventType = string | Array | Filter; export declare type Listener = (...args: Array) => void; /** * Provider * * Note: We use an abstract class so we can use instanceof to determine if an * object is a Provider. */ export declare abstract class MinimalProvider implements OnceBlockable { abstract getNetwork(): Promise; abstract getBlockNumber(): Promise; abstract getGasPrice(): Promise; abstract getBalance(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getTransactionCount(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getCode(addressOrName: string | Promise, blockTag?: BlockTag | Promise): Promise; abstract getStorageAt(addressOrName: string | Promise, position: BigNumberish | Promise, blockTag?: BlockTag | Promise): Promise; abstract sendTransaction(signedTransaction: string | Promise): Promise; abstract call(transaction: TransactionRequest): Promise; abstract estimateGas(transaction: TransactionRequest): Promise; abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise): Promise; abstract getTransaction(transactionHash: string): Promise; abstract getTransactionReceipt(transactionHash: string): Promise; abstract getLogs(filter: Filter): Promise>; abstract resolveName(name: string | Promise): Promise; abstract lookupAddress(address: string | Promise): Promise; abstract on(eventName: EventType, listener: Listener): MinimalProvider; abstract once(eventName: EventType, listener: Listener): MinimalProvider; abstract listenerCount(eventName?: EventType): number; abstract listeners(eventName: EventType): Array; abstract removeAllListeners(eventName: EventType): MinimalProvider; abstract removeListener(eventName: EventType, listener: Listener): MinimalProvider; abstract waitForTransaction(transactionHash: string, timeout?: number): Promise; } export declare type AsyncProvider = { isMetaMask?: boolean; host?: string; path?: string; sendAsync: (request: any, callback: (error: any, response: any) => void) => void; }; export declare type ProgressCallback = (percent: number) => void; export declare type EncryptOptions = { iv?: Arrayish; entropy?: Arrayish; mnemonic?: string; path?: string; client?: string; salt?: Arrayish; uuid?: string; scrypt?: { N?: number; r?: number; p?: number; }; }; /** * Signer * * Note: We use an abstract class so we can use instanceof to determine if an * object is a Signer. */ export declare abstract class Signer { provider?: MinimalProvider; abstract getAddress(): Promise; abstract signMessage(message: Arrayish | string): Promise; abstract sendTransaction(transaction: TransactionRequest): Promise; } export declare abstract class HDNode { readonly privateKey: string; readonly publicKey: string; readonly mnemonic: string; readonly path: string; readonly chainCode: string; readonly index: number; readonly depth: number; abstract derivePath(path: string): HDNode; } export interface Wordlist { locale: string; getWord(index: number): string; getWordIndex(word: string): number; split(mnemonic: string): Array; join(words: Array): string; } //# sourceMappingURL=types.d.ts.map