APIs

Developer Docs

sendTransfer API method

May 14, 2025

Disclaimer: Leather does not verify the accuracy of transfer requests. Developers must ensure transaction details are correct before submission.

Request the signature and broadcast of a Bitcoin transaction with one or more recipients using a selected account from the user's Leather wallet.

Method name

sendTransfer

Parameters

  • recipients: Array of amounts to transfer by recipient address (required)

  • network: Network for signing: mainnet, testnet, signet, sbtcDevenv or devnet (required)

  • account: Index of account for signing (optional — defaults to active account)

Examples

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

{
  "jsonrpc": "2.0",
  "id": "52a8fabf-d9a6-4b46-b042-b8c153a23dfc",
  "result": {
    "txid": "f007551f169722ce74104d6673bd46ce193c624b8550889526d1b93820d725f7"
  }
}

Use case

Use sendTransfer to automate and simplify user-initiated Bitcoin transactions from a Leather-connected app, especially for multi-recipient use cases or integrated payment workflows.

Sandbox

Try the sendTransfer method live in this CodeSandbox testing environment: 👉 Open Sandbox