CCC Docs
    Preparing search index...

    Class representing a Bitcoin signer that extends SignerBtc

    Hierarchy

    • SignerBtc
      • Signer
    Index
    provider: BtcProvider

    The provider instance.

    • Returns Promise<
          {
              address: string;
              publicKey: string;
              purpose: AddressPurpose;
              addressType: AddressType;
          },
      >

    • Gets the Bitcoin account address.

      Returns Promise<string>

      A promise that resolves to the Bitcoin account address.

    • Gets the Bitcoin public key.

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

      A promise that resolves to the Bitcoin public key.

    • Connects to the provider by requesting accounts.

      Returns Promise<void>

      A promise that resolves when the connection is established.

    • Disconnects to the signer.

      Returns Promise<void>

      A promise that resolves when the signer is disconnected.

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

      Parameters

      • listener: () => void

      Returns () => void

      A function for unregister

    • Checks if the signer is connected.

      Returns Promise<boolean>

      A promise that resolves to true if connected, false otherwise.

    • Signs a raw message with the Bitcoin account.

      Parameters

      • message: BytesLike

        The message to sign.

      Returns Promise<string>

      A promise that resolves to the signed message.

    • Signs a PSBT using Xverse wallet.

      Parameters

      • psbtHex: BytesLike

        The hex string of PSBT to sign.

      • Optionaloptions: SignPsbtOptionsLike

        Options for signing the PSBT

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

      A promise that resolves to the signed PSBT as a Hex string

      Xverse accepts:

      • psbt: A string representing the PSBT to sign, encoded in base64
      • signInputs: A Record<string, number[]> where:
        • keys are the addresses to use for signing
        • values are the indexes of the inputs to sign with each address

      Xverse returns:

      • psbt: The base64 encoded signed PSBT, which is not finalized

      Xverse has no equivalent of autoFinalized, so when it is enabled the requested inputs are finalized locally after signing. sighashTypes and disableTweakSigner in inputsToSign are not supported by Xverse and are ignored.

    • Broadcasts a PSBT to the Bitcoin network.

      Parameters

      • _psbtHex: BytesLike
      • Optional_options: SignPsbtOptionsLike

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

      Xverse does not support broadcasting a signed PSBT directly. It only supports "Sign and Broadcast" as a single atomic operation via signAndBroadcastPsbt.

    • Sign and broadcast a PSBT.

      Parameters

      • psbtHex: BytesLike

        The hex string of PSBT to sign and broadcast.

      • Optionaloptions: SignPsbtOptionsLike

        Options for signing the PSBT.

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

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