BitcoinWalletConnector
This is Dynamic’s Bitcoin connector over the basic wallet interface. This can be used to interact with the users Bitcoin wallets.
Field | Description |
---|---|
getBalance(): Promise<string | undefined> | A method to fetch the balance for the connected address |
getConnectedAccounts(): Promise<string[]> | A method to retrieve the current connected address |
getAdditionalAddresses(mainAddress: string): Promise<WalletAdditionalAddress[]> | A method to return the payment and ordinals address (if applicable) as an array of objects |
name: string | The wallet name |
signMessage(messageToSign: string): Promise<string | undefined> | A method to sign a message |
sendRawTransaction(rawTransactionHex: string): Promise<string | undefined> | This method submits a raw transaction to the bitcoin blockchain and returns the transaction ID as the response |
sendBitcoin(BitcoinTransaction): Promise<string | undefined> | A method to send an amount of satoshis to a recipient bitcoin address |
signPsbt(request: BitcoinSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined> | A method to sign a partially signed bitcoin transaction (PSBT) |
signPsbts(request: BitcoinSignPsbtRequest[]): Promise<string[] | undefined> | A method to sign multiple partially signed bitcoin transactions (PSBTs) |
isLedgerAddress(address: string): boolean | A method for determining if the connected address is a ledger wallet |
Type Definitions
What is a satoshi?
This smallest unit allows for transactions involving very small amounts of bitcoin, facilitating microtransactions and improving the granularity of payments in the Bitcoin network.
What is a PSBT?
A partially signed bitcoin transaction (PSBT) is a standard for transactions that have not fully signed. This allows different participants with different keys/signers to sign a transaction without revealing their private keys to others. Multi-sig wallets utilize these. This allows for a multi-step transaction process which is both safer and more efficient.
Send Bitcoin
In this example, we are going to send bitcoin using the wallet connector.
Sign a message
In this example, we are going to sign a message using the wallet connector.
Send a raw transaction to the bitcoin network
In this example, we are going to send a raw transaction as a hex value to the bitcoin network. For information on how to construct the transactionHexString, please refer to this example.
Was this page helpful?