Connecting to the Wallet
Connect Wallet
This function is designed to initiate the connection process to a user's Bitcoin wallet. It leverages the Sats Connect getAddress API to request a user's payment address (native segwit) and ordinals/runes address (taproot).
It makes use of the getBtcProvider
method we defined in Detecting the Provider.
The getAddresss
method returns a Promise that resolves if the user approves the connection request.
Once resolved, the method returns an array of the userโs wallet address objects, defined as:
Where:
address
The userโs connected address
publicKey
A hex string representing the bytes of the public key of the account.
purpose
The purpose of the address:
payment
is used to manage the userโs bitcoinordinals
is used to manage the userโs ordinals
Last updated