> 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/stacks-methods/stx_transferstx.md).

# stx\_transferStx

Request a transfer of STX tokens to a specified recipient.

## Method name

`stx_transferStx`

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

## **Parameters**

| Parameter   | Description                                                                | Required | Type               |
| ----------- | -------------------------------------------------------------------------- | -------- | ------------------ |
| `recipient` | Stacks c32-encoded address of the recipient                                | ✅        | `string`           |
| `amount`    | Amount in micro-STX, as an integer                                         | ✅        | `number \| string` |
| `memo`      | Memo for the transaction (defaults to an empty string)                     | ❌        | `string`           |
| `network`   | Network identifier                                                         | ❌        | `string`           |
| `fee`       | Transaction fee in micro-STX. The user can change it before approving      | ❌        | `number \| string` |
| `nonce`     | Transaction nonce. The user can change it before approving                 | ❌        | `number \| string` |
| `sponsored` | Build a sponsored transaction. Leather returns it signed, without a `txid` | ❌        | `boolean`          |

## **Example request**

```typescript
try {
  // Request STX transfer
  const response = await window.LeatherProvider.request("stx_transferStx", {
    recipient: "SP3TB3AJ0XMZ9S6CGY2CQ6R06H1Z6DJQ1SH15ZP2H",
    amount: "1000000", // 1 STX (in microSTX)
    memo: "Payment for services",
  });

  console.log("Response:", response);
} catch (error) {
  console.log("Request error:", error);
}
```

## Example Response

```json
{
    "jsonrpc": "2.0",
    "id": "d3f1a7b0-5e6c-4f18-92a4-8e3b9f7c5c71",
    "result": {
        "txid": "f9c2a8f1e3b1d5a7c8e2f6a9d4b3e1c7f2a5d9b8c6e4f1a3b7d2e9c5f8a1b6c3",
        "transaction": "dead...beef"
    }
}
```

## 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                                            | A parameter fails validation |
| `4001`   | `User rejected request`                                                 | The user closes the window   |

## Sandbox

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

{% embed url="<https://codesandbox.io/p/sandbox/2y33p9>" %}

## Preview

<figure><img src="https://2085786563-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F41U87FfDFo2dIKYr0ZNX%2Fuploads%2FlkwR0R1giznMsDCO1IGS%2FScreenshot%202025-04-29%20at%208.24.13%E2%80%AFPM.png?alt=media&amp;token=4bc61fac-f84c-431b-876e-b3d942185e02" alt="" width="563"><figcaption></figcaption></figure>
