2022-09-05 23:57:11 +03:00
|
|
|
import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
|
|
|
|
import type { TransactionLike } from "../transaction/index.js";
|
2022-09-27 10:45:27 +03:00
|
|
|
import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js";
|
2022-09-05 23:57:11 +03:00
|
|
|
import type { Signer } from "./signer.js";
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* An **AbstractSigner** includes most of teh functionality required
|
|
|
|
* to get a [[Signer]] working as expected, but requires a few
|
|
|
|
* Signer-specific methods be overridden.
|
|
|
|
*
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
export declare abstract class AbstractSigner<P extends null | Provider = null | Provider> implements Signer {
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* The provider this signer is connected to.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
readonly provider: P;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Creates a new Signer connected to %%provider%%.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
constructor(provider?: P);
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Resolves to the Signer address.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
abstract getAddress(): Promise<string>;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Returns the signer connected to %%provider%%.
|
|
|
|
*
|
|
|
|
* This may throw, for example, a Signer connected over a Socket or
|
|
|
|
* to a specific instance of a node may not be transferrable.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
abstract connect(provider: null | Provider): Signer;
|
|
|
|
getNonce(blockTag?: BlockTag): Promise<number>;
|
2022-09-27 10:45:27 +03:00
|
|
|
populateCall(tx: TransactionRequest): Promise<TransactionLike<string>>;
|
2022-09-05 23:57:11 +03:00
|
|
|
populateTransaction(tx: TransactionRequest): Promise<TransactionLike<string>>;
|
2022-09-27 10:45:27 +03:00
|
|
|
estimateGas(tx: TransactionRequest): Promise<bigint>;
|
|
|
|
call(tx: TransactionRequest): Promise<string>;
|
2022-09-05 23:57:11 +03:00
|
|
|
resolveName(name: string): Promise<null | string>;
|
|
|
|
sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
abstract signTransaction(tx: TransactionRequest): Promise<string>;
|
|
|
|
abstract signMessage(message: string | Uint8Array): Promise<string>;
|
|
|
|
abstract signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
|
|
}
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* A **VoidSigner** is a class deisgned to allow an address to be used
|
|
|
|
* in any API which accepts a Signer, but for which there are no
|
|
|
|
* credentials available to perform any actual signing.
|
|
|
|
*
|
|
|
|
* This for example allow impersonating an account for the purpose of
|
|
|
|
* static calls or estimating gas, but does not allow sending transactions.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
export declare class VoidSigner extends AbstractSigner {
|
|
|
|
#private;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* The signer address.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
readonly address: string;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Creates a new **VoidSigner** with %%address%% attached to
|
|
|
|
* %%provider%%.
|
|
|
|
*/
|
2022-09-05 23:57:11 +03:00
|
|
|
constructor(address: string, provider?: null | Provider);
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
connect(provider: null | Provider): VoidSigner;
|
|
|
|
signTransaction(tx: TransactionRequest): Promise<string>;
|
|
|
|
signMessage(message: string | Uint8Array): Promise<string>;
|
|
|
|
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
|
|
}
|
|
|
|
//# sourceMappingURL=abstract-signer.d.ts.map
|