Search for a command to run...
Connect to 1Sat Wallet or any compatible wallet through the standard WalletInterface.
bun add @1sat/connect @1sat/actionsimport { connectWallet, createWalletSession } from '@1sat/connect'
const result = await connectWallet({ autoDetect: true })
if (!result) throw new Error('No BRC-100 wallet available')
const { wallet, identityKey, provider } = result
console.log('Connected', { provider })
const session = createWalletSession(result)
session.on('disconnected', ({ reason }) => {
console.log('Wallet disconnected:', reason)
})
session.start()
// Every provider returns the standard BRC-100 WalletInterface.
const { network } = await wallet.getNetwork({})
const { actions } = await wallet.listActions({ labels: [], limit: 25 })The session checks isAuthenticated before reading the identity key, so a locked wallet does not receive repeated unlock prompts. Stop or disconnect the session when your application no longer needs it.
Add the hosted CWI iframe as a provider when you want a no-install mobile fallback. It participates in the same race as desktop and injected wallets.
const result = await connectWallet({
autoDetect: true,
providers: [{
type: '1sat-web',
name: '1Sat Web Wallet',
url: 'https://1satwallet.com/wallet/cwi',
}],
})Use @1sat/actions for ordinals, BSV21, OpNS, payments, identities, locks, collections, and message sync. Actions accept any standard wallet; they do not depend on how it connected.
import { createContext, deriveDepositAddresses, sendBsv } from '@1sat/actions'
const ctx = createContext(wallet, { chain: 'main' })
const { derivations } = await deriveDepositAddresses.execute(ctx, { count: 1 })
const payment = await sendBsv.execute(ctx, {
requests: [{ address: '1...', satoshis: 1000 }],
})
if (payment.error) throw new Error(payment.error)BRC-100 defines these 28 methods. Do not replace them with a smaller vendor RPC vocabulary; higher-level operations belong in actions.
createActionsignActionabortActionlistActionsinternalizeActionlistOutputsrelinquishOutputgetPublicKeyrevealCounterpartyKeyLinkagerevealSpecificKeyLinkageencryptdecryptcreateHmacverifyHmaccreateSignatureverifySignatureacquireCertificatelistCertificatesproveCertificaterelinquishCertificatediscoverByIdentityKeydiscoverByAttributesisAuthenticatedwaitForAuthenticationgetHeightgetHeaderForHeightgetNetworkgetVersion