Withdraw from an ArcherAccount
ArcherAccountWithdraw: a token leg to the owner’s token account and/or a lamport leg to the owner (the account stays rent-exempt). Owner only — a delegate can never withdraw.
curl --request POST \
--url https://api.archer.exchange/v1/account/withdraw \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"amount": "1.5",
"lamports": 123,
"mint": "So11111111111111111111111111111111111111112",
"platform": "self",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/account/withdraw"
payload = {
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"amount": "1.5",
"lamports": 123,
"mint": "So11111111111111111111111111111111111111112",
"platform": "self",
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signer: 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
amount: '1.5',
lamports: 123,
mint: 'So11111111111111111111111111111111111111112',
platform: 'self',
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/account/withdraw', 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.archer.exchange/v1/account/withdraw",
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([
'signer' => 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
'amount' => '1.5',
'lamports' => 123,
'mint' => 'So11111111111111111111111111111111111111112',
'platform' => 'self',
'withInstructions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.archer.exchange/v1/account/withdraw"
payload := strings.NewReader("{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.archer.exchange/v1/account/withdraw")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "create",
"addressLookupTables": [
"<string>"
],
"archerAccount": "<string>",
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}Authorizations
Body
Provide mint + amount and/or lamports.
The wallet that signs. Must be the account's owner: a delegate can never withdraw. Existing clients may keep sending it as owner; send one name only.
"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK"
Token amount, decimal string in the mint's units.
"1.5"
Lamports to withdraw to the owner, leaving the account rent-exempt.
Token to withdraw, to the owner's own token account.
"So11111111111111111111111111111111111111112"
Which platform's account. A wallet holds one account per platform, each independently delegated.
self, treadfi Also return the unsigned instructions under instructions, for composing your own transaction instead of signing ours. Omitted or false leaves the response exactly as it was.
Response
An unsigned transaction for the owner to sign.
create, setDelegate, revokeDelegate, deposit, withdraw The ArcherAccount PDA the action targets.
Base64-encoded unsigned transaction for the owner to sign.
Unsigned instructions, present only when the request set withInstructions.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.archer.exchange/v1/account/withdraw \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"amount": "1.5",
"lamports": 123,
"mint": "So11111111111111111111111111111111111111112",
"platform": "self",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/account/withdraw"
payload = {
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"amount": "1.5",
"lamports": 123,
"mint": "So11111111111111111111111111111111111111112",
"platform": "self",
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signer: 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
amount: '1.5',
lamports: 123,
mint: 'So11111111111111111111111111111111111111112',
platform: 'self',
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/account/withdraw', 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.archer.exchange/v1/account/withdraw",
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([
'signer' => 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
'amount' => '1.5',
'lamports' => 123,
'mint' => 'So11111111111111111111111111111111111111112',
'platform' => 'self',
'withInstructions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.archer.exchange/v1/account/withdraw"
payload := strings.NewReader("{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.archer.exchange/v1/account/withdraw")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"amount\": \"1.5\",\n \"lamports\": 123,\n \"mint\": \"So11111111111111111111111111111111111111112\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "create",
"addressLookupTables": [
"<string>"
],
"archerAccount": "<string>",
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}