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

55 lines
2.6 KiB
TypeScript
Raw Normal View History

2021-06-24 09:13:06 +03:00
import { BlockTag, FeeData, Provider, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
2020-10-19 06:19:16 +03:00
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { Bytes, BytesLike } from "@ethersproject/bytes";
2020-06-01 12:04:12 +03:00
import { Deferrable } from "@ethersproject/properties";
2020-10-19 06:19:16 +03:00
export interface TypedDataDomain {
name?: string;
version?: string;
chainId?: BigNumberish;
verifyingContract?: string;
salt?: BytesLike;
}
export interface TypedDataField {
name: string;
type: string;
}
2019-05-15 01:48:48 +03:00
export interface ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
}
2020-10-19 06:19:16 +03:00
export interface TypedDataSigner {
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
}
2019-05-15 01:48:48 +03:00
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>;
2021-06-24 09:13:06 +03:00
getFeeData(): Promise<FeeData>;
2019-05-15 01:48:48 +03:00
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
}
2020-10-19 06:19:16 +03:00
export declare class VoidSigner extends Signer implements TypedDataSigner {
2019-05-15 01:48:48 +03:00
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>;
2020-10-19 06:19:16 +03:00
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
2019-05-15 01:48:48 +03:00
connect(provider: Provider): VoidSigner;
}
//# sourceMappingURL=index.d.ts.map