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

Hierarchy (view full)

Constructors

Properties

CKB_SIG_HASH_ALL_TAG: string = "ckb_sighash_all"
CKB_UNLOCK_EVENT_KIND: number = 23334
CKB_UNLOCK_EVENT_CONTENT: string = "Signing a CKB transaction\n\nIMPORTANT: Please verify the integrity and authenticity of connected Nostr client before signing this message\n"
client_: Client

Accessors

Methods

  • Gets the Nostr public key associated with the signer.

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

    A promise that resolves to a string representing the Nostr public key.

  • Gets the internal address, which is the EVM account in this case.

    Returns Promise<string>

    A promise that resolves to a string representing the internal address.

  • 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 identity for verifying signature, usually it's address

    Returns Promise<string>

    A promise that resolves to a string representing the identity

  • 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.

  • Gets an array of addresses associated with the signer as strings.

    Returns Promise<string[]>

    A promise that resolves to an array of addresses as strings.

  • 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.

  • Sends a transaction after signing it.

    Parameters

    • tx: TransactionLike

      The transaction to send, represented as a TransactionLike object.

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

    A promise that resolves to the transaction hash as a Hex string.