Plans
Plan Transfer
Create a plan to transfer assets to another address
POST
/
accounts
/
{account_id}
/
plan
/
transfer
Plan Transfer
curl --request POST \
--url https://api.example.com/accounts/{account_id}/plan/transferimport requests
url = "https://api.example.com/accounts/{account_id}/plan/transfer"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/accounts/{account_id}/plan/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts/{account_id}/plan/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts/{account_id}/plan/transfer"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/accounts/{account_id}/plan/transfer")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts/{account_id}/plan/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPlan Transfer
Creates a plan to transfer assets from the sub-account’s wallet to another address. Returns a plan ID and EIP-712 digest for signing.Request
POST /accounts/:account_id/plan/transfer
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount to transfer in the asset’s smallest unit |
asset | string | Yes | Asset symbol (e.g., "USDC") |
network | string | Yes | Target network for the transfer. Funds on other chains are bridged automatically. |
recipient | string | Yes | Destination Ethereum address (0x-prefixed) |
Examples
curl -X POST https://prime-api.legend.xyz/accounts/acc_2o0yiljtp378/plan/transfer \
-H "Authorization: Bearer $LEGEND_QUERY_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "1000000",
"asset": "USDC",
"network": "base",
"recipient": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72"
}'
const plan = await client.plan.transfer("acc_2o0yiljtp378", {
amount: "1000000",
asset: "USDC",
network: "base",
recipient: "0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
});
plan = await client.plan.transfer(
"acc_2o0yiljtp378",
amount="1000000",
asset="USDC",
network="base",
recipient="0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
)
use legend_client::TransferParams;
let plan = client.plan.transfer("acc_2o0yiljtp378", &TransferParams {
amount: "1000000".into(),
asset: "USDC".into(),
network: "base".into(),
recipient: "0x8Ba1f109551bD432803012645Ac136ddd64DBA72".into(),
}).await?;
Response (201 Created)
{
"plan_id": "pln_t4r2x9v6j8s1",
"details": {
"quark_operation_actions": [...],
"eip712_data": {
"digest": "0x3c7a...e9d4"
}
},
"expires_at": "2025-06-15T10:32:00Z"
}
digest and call Execute Plan to proceed.⌘I
Plan Transfer
curl --request POST \
--url https://api.example.com/accounts/{account_id}/plan/transferimport requests
url = "https://api.example.com/accounts/{account_id}/plan/transfer"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/accounts/{account_id}/plan/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts/{account_id}/plan/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts/{account_id}/plan/transfer"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/accounts/{account_id}/plan/transfer")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts/{account_id}/plan/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body