Bittap wallet js SDK. This class provides functionality for interacting with a wallet. WalletSdk

The initialization options for the wallet SDK.

Constructors

Properties

_provider: WalletProvider

The wallet provider.

_walletProvider: WalletSdkJsBridge

The wallet provider of bittap wallet js bridge.

Methods

  • Adds a listener for a specific transaction ID and calls a callback function when the transaction occurs.

    Parameters

    • txIds: string[]

      The transaction IDs to listen for.

    Returns void

    addListenTxId

  • Disconnects from the wallet.

    Returns void

    DisConnection

  • Sends taproot assets.

    Parameters

    Returns Promise<ResponseTxInfo>

    • A promise that resolves to the transfer transaction details.

    sendTaprootAssets

    • If receive_addr is not provided.
  • Set the auto-connect attribute. If set to true, the wallet SDK will attempt to automatically connect to the wallet. If set to false, the user will need to manually connect to the wallet.

    Parameters

    • _autoConnection: boolean

      The value of the auto-connect attribute to be set.

    Returns void

  • Registers a callback function to be executed when the account changes.

    Parameters

    • func: ((result: ConnectionResponse) => void)

      The callback function to be executed. Takes an object with network and account information as a parameter.

    Returns void

    setOnAccountChangeHandler

  • Adds a listener for all transactions and calls a callback function when a transaction occurs.

    Parameters

    • func: ((res: ResponseTxInfo) => void)

      The callback function to be called when a transaction occurs. Takes a ResponseTxInfo object as a parameter.

    Returns void

    setOnListenTransactionStatusHandler

  • Signs a message.

    Parameters

    • _msg: string

      The message to sign.

    Returns Promise<string>

    • A promise that resolves to the signed message.

    signMessage

  • Switches the network of the wallet SDK.

    Parameters

    • _network: NetworkType

      The new network type to switch to.

    • Optionalurl: string

      Optional URL for the new network.

    Returns Promise<ConnectionResponse>

    • A promise that resolves to the connection response.

    switchNetwork

  • Transfers BTC assets.

    Parameters

    Returns Promise<ResponseTxInfo>

    • A promise that resolves to the transfer transaction details.

    transferBtc

    • If recv_addr or amount is not provided.
  • Checks if the Bittap Wallet is installed by checking if the 'BittapWalletInjected' property exists on the window object.

    Returns boolean

    • True if the wallet is installed, false otherwise.