Payments

Simple Payment

Send BSV to a recipient using their identity key:

const result = await wallet.pay({
  to: recipientIdentityKey,
  satoshis: 1000
})

console.log('TXID:', result.txid)

The pay() method uses PeerPayClient.sendPayment() from @bsv/message-box-client under the hood, which constructs and delivers a BRC-29 payment to the counterparty in a single call.

Multi-Output Send

The send() method is the core primitive that lets you combine multiple output types in a single transaction.

Output Routing Rules

Fields
Output Type
Satoshis

to only

P2PKH payment

Must be > 0

data only

OP_RETURN inscription

Always 0

to + data

PushDrop token

Must be >= 1

Example: Three Output Types in One Transaction

Data Fields

The data array in output specs accepts multiple types:

Funding a Server Wallet

See the Server Wallet Guide for the complete funding flow.

PaymentOptions Reference

TransactionResult Reference

Last updated