CCC Docs
    Preparing search index...

    Class SignerBtcAbstract

    An abstract class extending the Signer class for Bitcoin-like signing operations. This class provides methods to get Bitcoin account, public key, and internal address, as well as signing transactions.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    client_: Client

    Accessors

    Methods

    • Gets the Bitcoin account associated with the signer.

      Returns Promise<string>

      A promise that resolves to a string representing the Bitcoin account.

    • Gets the Bitcoin public key associated with the signer.

      Returns Promise<BytesLike>

      A promise that resolves to a HexLike value representing the Bitcoin public key.

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

      Returns Promise<string>

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

    • Gets the identity, which is the Bitcoin public key in this case.

      Returns Promise<string>

      A promise that resolves to a string representing the identity

    • Gets an array of Address objects representing the known script addresses for the signer.

      Returns Promise<Address[]>

      A promise that resolves to an array of Address objects.

    • prepare a transaction before signing. This method is not implemented and should be overridden by subclasses.

      Parameters

      • txLike: TransactionLike

        The transaction to prepare, represented as a TransactionLike object.

      Returns Promise<Transaction>

      A promise that resolves to the prepared Transaction object.

    • 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

      • _: () => void

      Returns () => void

      A function for unregister

    • Disconnects to the signer.

      Returns Promise<void>

      A promise that resolves when the signer is disconnected.

    • Check if the signer is connected.

      Returns Promise<boolean>

      A promise that resolves the connection status.

    • Gets the recommended Address object for the signer.

      Parameters

      • Optional_preference: unknown

        Optional preference parameter.

      Returns Promise<Address>

      A promise that resolves to the recommended Address object.

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

    • Find cells of this signer

      Parameters

      • filter: ClientIndexerSearchKeyFilterLike

        The filter for the search key.

      • OptionalwithData: null | boolean

        Whether to include cell data in the response.

      • Optionalorder: "asc" | "desc"

        The order of the returned cells, can be "asc" or "desc".

      • Optionallimit: number

        The maximum number of cells for every querying chunk.

      Returns AsyncGenerator<Cell>

      A async generator that yields all matching cells

    • Find transactions of this signer

      Parameters

      Returns AsyncGenerator<
          {
              txHash: `0x${string}`;
              blockNumber: bigint;
              txIndex: bigint;
              isInput: boolean;
              cellIndex: bigint;
          },
      >

      A async generator that yields all matches transactions

    • Find transactions of this signer

      Parameters

      Returns AsyncGenerator<
          {
              txHash: `0x${string}`;
              blockNumber: bigint;
              txIndex: bigint;
              cells: { isInput: boolean; cellIndex: bigint }[];
          },
      >

      A async generator that yields all matches transactions

    • Find transactions of this signer

      Parameters

      Returns AsyncGenerator<
          | {
              txHash: `0x${string}`;
              blockNumber: bigint;
              txIndex: bigint;
              isInput: boolean;
              cellIndex: bigint;
          }
          | {
              txHash: `0x${string}`;
              blockNumber: bigint;
              txIndex: bigint;
              cells: { isInput: boolean; cellIndex: bigint }[];
          },
      >

      A async generator that yields all matches transactions

    • Gets balance of all addresses

      Returns Promise<bigint>

      A promise that resolves to the balance

    • Signs a message.

      Parameters

      • message: BytesLike

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

      Returns Promise<Signature>

      A promise that resolves to the signature info.

      Will throw an error if not implemented.

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

      Parameters

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

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