> For the complete documentation index, see [llms.txt](https://docs.leather.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.leather.io/developers/bitcoin-methods/sendtransfer.md).

# sendTransfer

Request the signature and broadcast of a Bitcoin transaction

## Method name

`sendTransfer`

The app must be connected first, through [`getAddresses`](/developers/methods/getaddresses.md).

## Parameters

<table><thead><tr><th width="156">Parameter</th><th width="396">Description</th><th width="101" data-type="checkbox">Required</th><th width="83">Type</th></tr></thead><tbody><tr><td>recipients</td><td>Array of <code>{ address, amount }</code>. <code>amount</code> is a string of digits in sats. All addresses must be on the same network.</td><td>true</td><td>array</td></tr><tr><td>network</td><td>Network identifier: <code>mainnet</code>, <code>testnet</code>, <code>testnet4</code>, <code>signet</code>, <code>sbtcTestnet</code>, <code>sbtcDevenv</code> or <code>devnet</code>. Defaults to <code>mainnet</code>. The recipient addresses must match it.</td><td>false</td><td>string</td></tr><tr><td>broadcast</td><td>Whether Leather broadcasts the signed transaction. Defaults to <code>true</code>. With <code>false</code>, the result carries the signed <code>transaction</code> and no <code>txid</code>.</td><td>false</td><td>boolean</td></tr><tr><td>account</td><td>Index of account for signing. Defaults to the account the app connected with.</td><td>false</td><td>uint</td></tr></tbody></table>

The `@leather.io/rpc` types mark `network` as required. The extension accepts a request without it.

## Example request

```typescript
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

```json
{
    "jsonrpc": "2.0",
    "id": "52a8fabf-d9a6-4b46-b042-b8c153a23dfc",
    "result": {
        "txid": "f007551f169722ce74104d6673bd46ce193c624b8550889526d1b93820d725f7",
        "transaction": "<signed transaction hex>"
    }
}
```

When the connected account is a Bitcoin multisig vault, Leather proposes the transaction to the co-signers instead of broadcasting it. The result is then `{ transaction, proposalId, status: "proposed" }`. See [Multisig accounts](/developers/methods/getaddresses.md#multisig-accounts).

## Errors

| Code     | Message                                                                 | When                                                                                                                                           |
| -------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `16`     | `Wallet no longer available. Reconnect the app to an available wallet.` | The origin is not connected                                                                                                                    |
| `-32602` | Parameter validation details                                            | An `amount` is not a string of digits, the recipients are on different networks, or they do not match `network`                                |
| `4001`   | `User rejected request`                                                 | The user cancels or closes the window. Leather also sends this after a build, sign or broadcast failure, when the user closes the error screen |

## Sandbox

[Install the Leather extension](https://chromewebstore.google.com/detail/leather/ldinpeekobnhjjdofggfgjlcehhmanlj) then try out this method below:

{% embed url="<https://codesandbox.io/embed/3czwyg?expanddevtools=1&hidenavigation=1&module=/src/index.ts&view=preview>" %}

## Preview

<figure><img src="https://2085786563-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F41U87FfDFo2dIKYr0ZNX%2Fuploads%2FG8onOaDLa72Sl71WJQEa%2FSCR-20240419-niui.png?alt=media&amp;token=e0b00b63-77bf-48dd-a069-b64351c726bf" alt=""><figcaption></figcaption></figure>
