base-wallet.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { AbstractSigner } from "../providers/index.js";
  2. import type { SigningKey } from "../crypto/index.js";
  3. import type { TypedDataDomain, TypedDataField } from "../hash/index.js";
  4. import type { Provider, TransactionRequest } from "../providers/index.js";
  5. /**
  6. * The **BaseWallet** is a stream-lined implementation of a
  7. * [[Signer]] that operates with a private key.
  8. *
  9. * It is preferred to use the [[Wallet]] class, as it offers
  10. * additional functionality and simplifies loading a variety
  11. * of JSON formats, Mnemonic Phrases, etc.
  12. *
  13. * This class may be of use for those attempting to implement
  14. * a minimal Signer.
  15. */
  16. export declare class BaseWallet extends AbstractSigner {
  17. #private;
  18. /**
  19. * The wallet address.
  20. */
  21. readonly address: string;
  22. /**
  23. * Creates a new BaseWallet for %%privateKey%%, optionally
  24. * connected to %%provider%%.
  25. *
  26. * If %%provider%% is not specified, only offline methods can
  27. * be used.
  28. */
  29. constructor(privateKey: SigningKey, provider?: null | Provider);
  30. /**
  31. * The [[SigningKey]] used for signing payloads.
  32. */
  33. get signingKey(): SigningKey;
  34. /**
  35. * The private key for this wallet.
  36. */
  37. get privateKey(): string;
  38. getAddress(): Promise<string>;
  39. connect(provider: null | Provider): BaseWallet;
  40. signTransaction(tx: TransactionRequest): Promise<string>;
  41. signMessage(message: string | Uint8Array): Promise<string>;
  42. /**
  43. * Returns the signature for %%message%% signed with this wallet.
  44. */
  45. signMessageSync(message: string | Uint8Array): string;
  46. signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
  47. }
  48. //# sourceMappingURL=base-wallet.d.ts.map