CCC Docs
    Preparing search index...

    Class representing a Bitcoin signer that extends SignerBtc

    Hierarchy

    • SignerBtc
      • BitcoinSigner
    Index
    • Creates an instance of BitcoinSigner.

      Parameters

      • client: Client

        The client instance.

      • name: string

        The name of the signer.

      • icon: string

        The icon URL of the signer.

      • Optional_preferredNetworks: NetworkPreference[]
      • addressType: "auto" | "p2wpkh" | "p2tr" = "auto"

        The address type.

      • Optional_appUri: string

        The application URI.

      • connectionsRepo: JoyIdA.ConnectionsRepo = ...

        The connections repository.

      • network: string = "btc"

      Returns JoyId.BitcoinSigner

    name: string

    The name of the signer.

    icon: string

    The icon URL of the signer.

    addressType: "auto" | "p2wpkh" | "p2tr" = "auto"

    The address type.

    network: string = "btc"
    • Disconnects to the signer.

      Returns Promise<void>

      A promise that resolves when the signer is disconnected.

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

      Returns Promise<void>

      A promise that resolves when the connection is established.

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

      JoyID returns a raw transaction when asked to finalize, and rejects PSBTs with inputs it can't sign. So JoyID is always asked for an unfinalized PSBT, and autoFinalized is handled here. Inputs that already have a JoyID signature are not finalized.

    • Broadcasts a PSBT to the Bitcoin network.

      Parameters

      • _psbtHex: BytesLike
      • Optional_options: SignPsbtOptionsLike

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

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