Skip to content

Sats connect is a simple javascript library that connects apps to Bitcoin wallets

License

Notifications You must be signed in to change notification settings

secretkeylabs/sats-connect

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

db53e46 · Jan 6, 2025
Jul 8, 2024
Oct 6, 2023
Dec 10, 2024
Dec 19, 2024
Nov 1, 2024
Mar 4, 2023
Aug 20, 2024
Sep 2, 2024
Mar 4, 2023
Jan 6, 2025
Jan 6, 2025
Apr 2, 2024

Repository files navigation

logo

API DocsExample AppDiscordXverse

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:

  1. Retrieve users' wallet address(es)

  2. Request the signature of arbitrary messages for authentication purposes

  3. Request the signature of partially signed Bitcoin transactions (PSBT)

  4. Request BTC or Stacks transfers to one or multiple recipients

  5. Request Stacks contract interactions and deployments

  6. Inscribe sats with arbitrary content for ordinals & BRC-20 use cases

Quick start

npm i sats-connect

Usage

import

import Wallet from 'sats-connect';

Connect Wallet

const response = await Wallet.request('getAccounts', {
  purposes: [AddressPurpose.Payment, AddressPurpose.Ordinals, AddressPurpose.Stacks],
  message: 'Cool app wants to know your addresses!',
});

Request a wallet action

await Wallet.request('sendTransfer', {...});

Disconnect Wallet

await Wallet.disconnect();

Documentation

For full documentation, visit docs.xverse.app.

Development

Build the package

npm run build

Run example app

npm run dev:example