Sats connect is a simple javascript library that connects apps to Bitcoin wallets like Xverse to retrieve user wallet addresses and sign transactions (PSBTs).
Developers building apps on the Bitcoin ecosystem can use Sats connect to interact with users' wallets:
-
Retrieve users' wallet address(es)
-
Request the signature of arbitrary messages for authentication purposes
-
Request the signature of partially signed Bitcoin transactions (PSBT)
-
Request BTC or Stacks transfers to one or multiple recipients
-
Request Stacks contract interactions and deployments
-
Inscribe sats with arbitrary content for ordinals & BRC-20 use cases
npm i sats-connect
import Wallet from 'sats-connect';
const response = await Wallet.request('getAccounts', {
purposes: [AddressPurpose.Payment, AddressPurpose.Ordinals, AddressPurpose.Stacks],
message: 'Cool app wants to know your addresses!',
});
await Wallet.request('sendTransfer', {...});
await Wallet.disconnect();
For full documentation, visit docs.xverse.app.
npm run build
npm run dev:example