2023-03-03 18:25:07 -07: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-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* A **NonceManager** wraps another [[Signer]] and automatically manages
|
|
|
|
* the nonce, ensuring serialized and sequential nonces are used during
|
|
|
|
* transaction.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
export declare class NonceManager extends AbstractSigner {
|
|
|
|
#private;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* The Signer being managed.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
signer: Signer;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Creates a new **NonceManager** to manage %%signer%%.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
constructor(signer: Signer);
|
|
|
|
getAddress(): Promise<string>;
|
|
|
|
connect(provider: null | Provider): NonceManager;
|
|
|
|
getNonce(blockTag?: BlockTag): Promise<number>;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Manually increment the nonce. This may be useful when managng
|
|
|
|
* offline transactions.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07:00
|
|
|
increment(): void;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Resets the nonce, causing the **NonceManager** to reload the current
|
|
|
|
* nonce from the blockchain on the next transaction.
|
|
|
|
*/
|
2023-03-03 18:25:07 -07: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>;
|
|
|
|
}
|
2023-04-27 21:19:55 +09:00
|
|
|
//# sourceMappingURL=signer-noncemanager.d.ts.map
|