CCC Docs
    Preparing search index...

    Class representing a Bitcoin signer that extends SignerBtc

    Hierarchy

    • SignerBtc
      • BitcoinSigner
    Index

    Constructors

    • Creates an instance of Signer.

      Parameters

      • client: Client

        The client instance.

      • providers: Record<string, BitcoinProvider>

        The providers instance.

      • preferredNetworks: NetworkPreference[] = ...

        All preferred networks

      Returns Okx.BitcoinSigner

    Properties

    providers: Record<string, BitcoinProvider>

    The providers instance.

    Accessors

    Methods

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

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

    • Broadcasts a signed PSBT to the Bitcoin network.

      Parameters

      • psbtHex: BytesLike

        The hex string of signed PSBT to broadcast.

      • Optional_options: SignPsbtOptionsLike

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

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