private/register_withdraw_address
Returns the Ethereum withdraw address that forwards a withdrawal of a forwarded token to a recipient on its home chain, and records it so the forwarder watches it. Takes the wallet, the destination chain id (a key of the route file’s withdraw_forwarding section; Solana is 101, devnet 103) and the recipient. On an EVM chain the recipient must be the account wallet; on Solana it must be a base58 wallet address, which is screened. Repeated calls return the same address; new registrations are rate limited per rolling window. Withdraw to the returned address with private/withdraw. Session keys without unbounded Admin scope must first add it with private/update_whitelisted_recipients.
curl --request POST \
--url https://api.derive.xyz/v3/private/register_withdraw_address \
--header 'Content-Type: application/json' \
--data '
{
"chain_id": 1,
"recipient": "<string>",
"wallet": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/private/register_withdraw_address"
payload = {
"chain_id": 1,
"recipient": "<string>",
"wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({chain_id: 1, recipient: '<string>', wallet: '<string>'})
};
fetch('https://api.derive.xyz/v3/private/register_withdraw_address', 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.derive.xyz/v3/private/register_withdraw_address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain_id' => 1,
'recipient' => '<string>',
'wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.derive.xyz/v3/private/register_withdraw_address"
payload := strings.NewReader("{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.derive.xyz/v3/private/register_withdraw_address")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/register_withdraw_address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"chain_id": 1,
"recipient": "<string>",
"recipient_display": "<string>",
"routes": [
{
"bridge_type": "<string>",
"symbol": "<string>",
"token": "<string>"
}
],
"withdraw_address": "<string>"
}Body
Destination chain: a key of the route file's withdraw_forwarding section. Solana is 101 (devnet 103); every other chain is EVM.
x >= 0Destination address. On an EVM chain it must be wallet. On Solana, a base58 wallet address (not a token or program-derived account).
The account wallet.
Response
Success
x >= 00x bytes32 the factory forwards to.
recipient normalised: checksummed on EVM, base58 on Solana.
The tokens this address forwards.
Show child attributes
Show child attributes
Withdraw a forwarded token to this Ethereum address to send it on to recipient on chain_id.
curl --request POST \
--url https://api.derive.xyz/v3/private/register_withdraw_address \
--header 'Content-Type: application/json' \
--data '
{
"chain_id": 1,
"recipient": "<string>",
"wallet": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/private/register_withdraw_address"
payload = {
"chain_id": 1,
"recipient": "<string>",
"wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({chain_id: 1, recipient: '<string>', wallet: '<string>'})
};
fetch('https://api.derive.xyz/v3/private/register_withdraw_address', 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.derive.xyz/v3/private/register_withdraw_address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain_id' => 1,
'recipient' => '<string>',
'wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.derive.xyz/v3/private/register_withdraw_address"
payload := strings.NewReader("{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.derive.xyz/v3/private/register_withdraw_address")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/register_withdraw_address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain_id\": 1,\n \"recipient\": \"<string>\",\n \"wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"chain_id": 1,
"recipient": "<string>",
"recipient_display": "<string>",
"routes": [
{
"bridge_type": "<string>",
"symbol": "<string>",
"token": "<string>"
}
],
"withdraw_address": "<string>"
}