stx_transferStx

Request a transfer of STX tokens to a specified recipient.

Method name

stx_transferStx

Parameters

Parameter
Description
Required
Type

recipient

Stacks c32-encoded address of the recipient

string

amount

Amount of STX to transfer (BigInt constructor compatible)

number | string

memo

Optional memo for the transaction (defaults to an empty string)

string

Example request

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

Sandbox

Install the Leather extension then try out this method below:

Preview

Last updated