sendTransfer
Requests the connected wallet to sign and broadcast a Bitcoin transfer transaction.
Usage
import { request } from '@stacks/connect';
const result = await request('sendTransfer', {
recipients: [
{
address: 'bc1q...address',
amount: 100_000n, // amount in sats
},
],
network: 'mainnet',
});
console.log('Transaction ID:', result.txid);import { request } from '@stacks/connect';
// Multiple recipients
const result = await request('sendTransfer', {
recipients: [
{
address: 'bc1q...address1',
amount: 50_000n,
},
{
address: 'bc1q...address2',
amount: 25_000n,
},
],
});Notes
The
amountis in satoshis (1 BTC = 100,000,000 sats).Multiple recipients can be specified in a single transaction.
The
amounttype is automatically normalized by provider overrides: Xverse expectsnumber, Leather expectsstring.
Signature
Returns
TxidResult
Property
Type
Description
txid
string
The transaction ID of the broadcasted Bitcoin transaction.
Parameters
recipients (required)
Type:
{ address: string; amount: Integer }[]
An array of recipient objects. Each recipient specifies:
Property
Type
Description
address
string
The Bitcoin address of the recipient.
amount
Integer
The amount in satoshis (number, bigint, or string).
network (optional)
Type:
NetworkString
The network to use for the transaction (e.g. 'mainnet', 'testnet').
Last updated
Was this helpful?