JSPM

sats-connect

4.0.1-9f8d7cd
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27416
  • Score
    100M100P100Q154680F
  • License MIT

Package Exports

  • sats-connect
  • sats-connect/dist/index.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sats-connect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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 { request } from 'sats-connect';

Connect Wallet

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

Request a wallet action

await 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