2023-02-02 12:05:47 +03:00
|
|
|
import { AbstractSigner } from "./abstract-signer.js";
|
|
|
|
import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
|
|
|
|
import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js";
|
|
|
|
import type { Signer } from "./signer.js";
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* A **NonceManager** wraps another [[Signer]] and automatically manages
|
|
|
|
* the nonce, ensuring serialized and sequential nonces are used during
|
|
|
|
* transaction.
|
|
|
|
*/
|
2023-02-02 12:05:47 +03:00
|
|
|
export declare class NonceManager extends AbstractSigner {
|
|
|
|
#private;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* The Signer being managed.
|
|
|
|
*/
|
2023-02-02 12:05:47 +03:00
|
|
|
signer: Signer;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Creates a new **NonceManager** to manage %%signer%%.
|
|
|
|
*/
|
2023-02-02 12:05:47 +03:00
|
|
|
constructor(signer: Signer);
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
connect(provider: null | Provider): NonceManager;
|
|
|
|
getNonce(blockTag?: BlockTag): Promise<number>;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Manually increment the nonce. This may be useful when managng
|
|
|
|
* offline transactions.
|
|
|
|
*/
|
2023-02-02 12:05:47 +03:00
|
|
|
increment(): void;
|
2023-06-02 00:52:58 +03:00
|
|
|
/**
|
|
|
|
* Resets the nonce, causing the **NonceManager** to reload the current
|
|
|
|
* nonce from the blockchain on the next transaction.
|
|
|
|
*/
|
2023-02-02 12:05:47 +03:00
|
|
|
reset(): void;
|
|
|
|
sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
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=signer-noncemanager.d.ts.map
|