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

39 lines
1.9 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";
2020-06-01 12:04:12 +03:00
import { Deferrable } from "@ethersproject/properties";
2019-05-15 01:48:48 +03: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 12:04:12 +03:00
abstract signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
2019-05-15 01:48:48 +03:00
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>;
2020-06-01 12:04:12 +03:00
estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag): Promise<string>;
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
2019-05-15 01:48:48 +03:00
getChainId(): Promise<number>;
getGasPrice(): Promise<BigNumber>;
resolveName(name: string): Promise<string>;
2020-06-01 12:04:12 +03:00
checkTransaction(transaction: Deferrable<TransactionRequest>): Deferrable<TransactionRequest>;
populateTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionRequest>;
2019-05-15 01:48:48 +03:00
_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>;
2020-06-01 12:04:12 +03:00
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
2019-05-15 01:48:48 +03:00
connect(provider: Provider): VoidSigner;
}