sendBtcTransaction

import { sendBtcTransaction } from 'sats-connect'

You can request to send an amount of Bitcoin to one or more recipients using the sendBtcTransaction method

const sendBtcOptions = {
  payload: {
    network: {
      type: "Testnet",
    },
    recipients: [
      {
        address: '2NBC9AJ9ttmn1anzL2HvvVML8NWzCfeXFq4',
        amountSats: 1500,
      },
      {
        address: '2NFhRJfbBW8dhswyupAJWSehMz6hN5LjHzR',
        amountSats: 1500,
      },
    ],
    senderAddress: 'paymentAddress',
  },
  onFinish: (response) => {
    alert(response);
  },
  onCancel: () => alert("Canceled"),
};

await sendBtcTransaction(sendBtcOptions);

The user will be prompted to review and sign the transaction in the wallet, with the various recipients and amounts sent.

Last updated