An abstract class representing a generic signer. This class provides methods to connect, get addresses, and sign transactions.

Hierarchy (view full)

Constructors

Properties

privateKey: `0x${string}`
publicKey: `0x${string}`
client_: Client

Accessors

Methods

  • Signs a message and returns signature only. This method is not implemented and should be overridden by subclasses.

    Parameters

    Returns Promise<`0x${string}`>

    A promise that resolves to the signature as a string.

    Will throw an error if not implemented.

  • Register a listener to be called when this signer is replaced.

    Parameters

    • _: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

    A function for unregister

      • (): void
      • Returns void

  • Gets the recommended address for the signer as a string.

    Parameters

    • Optionalpreference: unknown

      Optional preference parameter.

    Returns Promise<string>

    A promise that resolves to the recommended address as a string.

  • Verify a signature.

    Parameters

    • message: BytesLike

      The original message.

    • signature: string | Signature

      The signature to verify.

    Returns Promise<boolean>

    A promise that resolves to the verification result.

    Will throw an error if not implemented.