CCC Docs
    Preparing search index...

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    • Gets the internal address associated with the signer.

      Returns Promise<string>

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

    • Gets the identity for verifying signature, usually it's address

      Returns Promise<string>

      A promise that resolves to a string representing the identity

    • Returns Promise<string>

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

    • Connects to the signer.

      Returns Promise<void>

      A promise that resolves when the connection is complete.

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

      Parameters

      • listener: () => void

      Returns () => void

      A function for unregister

    • Check if the signer is connected.

      Returns Promise<boolean>

      A promise that resolves the connection status.

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

      Parameters

      • message: BytesLike

        The message to sign, as a string or BytesLike object.

      Returns Promise<string>

      A promise that resolves to the signature as a string.

      Will throw an error if not implemented.

    • Signs a transaction without preparing information for it. This method is not implemented and should be overridden by subclasses.

      Parameters

      • txLike: TransactionLike

        The transaction to sign, represented as a TransactionLike object.

      Returns Promise<Transaction>

      A promise that resolves to the signed Transaction object.

      Will throw an error if not implemented.

    • Prepares a transaction before signing. This method can be overridden by subclasses to perform any necessary steps, such as adding cell dependencies or witnesses, before the transaction is signed. The default implementation converts the TransactionLike object to a Transaction object without modification.

      Parameters

      Returns Promise<Transaction>

      A promise that resolves to the prepared Transaction object.

      Note that this default implementation does not add any cell dependencies or dummy witnesses. This may lead to an underestimation of transaction size and fees if used with methods like Transaction.completeFee. Subclasses for signers that are intended to sign transactions should override this method to perform necessary preparations.