ethers.js/packages/abstract-signer/index.d.ts

40 lines
1.8 KiB
TypeScript
Raw Normal View History

2019-05-15 01:48:48 +03:00
import { BlockTag, Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { BigNumber } from "@ethersproject/bignumber";
import { Bytes } from "@ethersproject/bytes";
export interface ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
readonly path?: string;
}
export declare abstract class Signer {
readonly provider?: Provider;
abstract getAddress(): Promise<string>;
abstract signMessage(message: Bytes | string): Promise<string>;
abstract signTransaction(transaction: TransactionRequest): Promise<string>;
abstract connect(provider: Provider): Signer;
2019-06-12 00:57:04 +03:00
readonly _isSigner: boolean;
2019-05-15 01:48:48 +03:00
constructor();
getBalance(blockTag?: BlockTag): Promise<BigNumber>;
getTransactionCount(blockTag?: BlockTag): Promise<number>;
estimateGas(transaction: TransactionRequest): Promise<BigNumber>;
call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>;
sendTransaction(transaction: TransactionRequest): Promise<TransactionResponse>;
getChainId(): Promise<number>;
getGasPrice(): Promise<BigNumber>;
resolveName(name: string): Promise<string>;
checkTransaction(transaction: TransactionRequest): TransactionRequest;
populateTransaction(transaction: TransactionRequest): Promise<TransactionRequest>;
_checkProvider(operation?: string): void;
2019-06-12 00:57:04 +03:00
static isSigner(value: any): value is Signer;
2019-05-15 01:48:48 +03:00
}
export declare class VoidSigner extends Signer {
readonly address: string;
constructor(address: string, provider?: Provider);
getAddress(): Promise<string>;
_fail(message: string, operation: string): Promise<any>;
signMessage(message: Bytes | string): Promise<string>;
signTransaction(transaction: TransactionRequest): Promise<string>;
connect(provider: Provider): VoidSigner;
}