signer-noncemanager.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { AbstractSigner } from "./abstract-signer.js";
  2. import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
  3. import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js";
  4. import type { Signer } from "./signer.js";
  5. /**
  6. * A **NonceManager** wraps another [[Signer]] and automatically manages
  7. * the nonce, ensuring serialized and sequential nonces are used during
  8. * transaction.
  9. */
  10. export declare class NonceManager extends AbstractSigner {
  11. #private;
  12. /**
  13. * The Signer being managed.
  14. */
  15. signer: Signer;
  16. /**
  17. * Creates a new **NonceManager** to manage %%signer%%.
  18. */
  19. constructor(signer: Signer);
  20. getAddress(): Promise<string>;
  21. connect(provider: null | Provider): NonceManager;
  22. getNonce(blockTag?: BlockTag): Promise<number>;
  23. /**
  24. * Manually increment the nonce. This may be useful when managng
  25. * offline transactions.
  26. */
  27. increment(): void;
  28. /**
  29. * Resets the nonce, causing the **NonceManager** to reload the current
  30. * nonce from the blockchain on the next transaction.
  31. */
  32. reset(): void;
  33. sendTransaction(tx: TransactionRequest): Promise<TransactionResponse>;
  34. signTransaction(tx: TransactionRequest): Promise<string>;
  35. signMessage(message: string | Uint8Array): Promise<string>;
  36. signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
  37. }
  38. //# sourceMappingURL=signer-noncemanager.d.ts.map