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