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

39 lines
1.9 KiB
TypeScript
Raw Permalink Normal View History

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