Unified Staking Flow
Create Withdrawal Request
Create a withdrawal request transaction to withdraw previously unstaked assets within the network.
POST
/
api
/
v1
/
unified
/
staking
/
withdraw
Create Withdrawal Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/unified/staking/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"stakerPublicKey": "02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4"
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/unified/staking/withdraw"
payload = {
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": { "stakerPublicKey": "02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'aptos',
network: 'mainnet',
stakerAddress: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
extra: {
stakerPublicKey: '02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4'
}
})
};
fetch('https://api.p2p.org/api/api/v1/unified/staking/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.p2p.org/api/api/v1/unified/staking/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([
'chain' => 'aptos',
'network' => 'mainnet',
'stakerAddress' => '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
'extra' => [
'stakerPublicKey' => '02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.p2p.org/api/api/v1/unified/staking/withdraw"
payload := strings.NewReader("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.p2p.org/api/api/v1/unified/staking/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/unified/staking/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": 1002282880,
"stakerAddress": "6ZuLUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9E",
"unsignedTransactionData": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...",
"createdAt": "<unknown>",
"extraData": {
"stakeAccount": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS"
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Target blockchain network in which the transaction is processed (aptos,cardano,celestia,cosmos,polkadot,polygon,sei,solana,eth_ssv,ton_whales,near,sui,grt,xtz,story,tron,hyperliquid,monad).
Available options:
aptos, cardano, celestia, cosmos, polkadot, polygon, sei, solana, eth_ssv, ton_whales, near, sui, grt, xtz, story, tron, hyperliquid, monad Example:
"aptos"
Network environment in which the transaction is processed (mainnet,testnet,celestia-mainnet-beta,celestia-mocha-testnet,cosmoshub-4,kusama,westend,pacific-1,atlantic-2,mainnet-beta,hoodi,aeneid,testnet-nile).
Available options:
mainnet, testnet, celestia-mainnet-beta, celestia-mocha-testnet, cosmoshub-4, kusama, westend, pacific-1, atlantic-2, mainnet-beta, hoodi, aeneid, testnet-nile Example:
"mainnet"
Account address initiating the withdrawal transaction.
Example:
"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw"
Additional chain-specific request parameters.
Example:
{ "stakerPublicKey": "02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4" }
Create Withdrawal Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/unified/staking/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"stakerPublicKey": "02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4"
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/unified/staking/withdraw"
payload = {
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": { "stakerPublicKey": "02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'aptos',
network: 'mainnet',
stakerAddress: '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
extra: {
stakerPublicKey: '02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4'
}
})
};
fetch('https://api.p2p.org/api/api/v1/unified/staking/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.p2p.org/api/api/v1/unified/staking/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([
'chain' => 'aptos',
'network' => 'mainnet',
'stakerAddress' => '9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw',
'extra' => [
'stakerPublicKey' => '02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.p2p.org/api/api/v1/unified/staking/withdraw"
payload := strings.NewReader("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.p2p.org/api/api/v1/unified/staking/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/unified/staking/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"stakerPublicKey\": \"02be65fdd561fee421c4f4564b02e4de31f74836b9b8cd1bbbf9d9c544733614e4\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": 1002282880,
"stakerAddress": "6ZuLUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9E",
"unsignedTransactionData": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...",
"createdAt": "<unknown>",
"extraData": {
"stakeAccount": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS"
}
}
}