Page cover

sendTransfer

Request the signature and broadcast of a Bitcoin transaction

Method name

sendTransfer

Parameters

Parameter
Description
Required
Type

recipients

Array of amounts to transfer by recipient address

array

network

Network for signing: mainnet, testnet, signet, sbtcDevenv or devnet

string

account

Index of account for signing (defaults to active account)

uint

Example request

try {
  const response = await window.LeatherProvider.request("sendTransfer", {
    recipients: [
      {
        address: "tb1qkzvk9hr7uvas23hspvsgqfvyc8h4nngeqjqtnj",
        amount: "10000",
      },
      {
        address: "tb1q7950cllqywrts5cjgee4yz4dc8c8vnyxuc9z07",
        amount: "20000",
      },
    ],
    network: "testnet",
  });

  console.log("Response:", response);
  console.log("Transaction ID:", response.result.txid);
} catch (error) {
  console.log("Request error:", error.error.code, error.error.message);
}

Example response

Sandbox

Install the Leather extension then try out this method below:

Preview

Last updated