Unified Staking Flow
Create Split Request
Create a split request transaction to split the stake account.
POST
/
api
/
v1
/
unified
/
staking
/
split
Create Split Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/unified/staking/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"amount": 1002282880,
"stakeAccount": "E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F"
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/unified/staking/split"
payload = {
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"amount": 1002282880,
"stakeAccount": "E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F"
}
}
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: {
amount: 1002282880,
stakeAccount: 'E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F'
}
})
};
fetch('https://api.p2p.org/api/api/v1/unified/staking/split', 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/split",
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' => [
'amount' => 1002282880,
'stakeAccount' => 'E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F'
]
]),
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/split"
payload := strings.NewReader("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\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/split")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/unified/staking/split")
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 \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": 1002282880,
"stakerAddress": "BNWgYrN5nbtZaqSZvjfdLMG5PEp7qems57DAdDxqyctu",
"unsignedTransactionData": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...",
"createdAt": "2023-08-24T08:14:50.455Z",
"extraData": {
"network": "testnet",
"stakeAccount": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS",
"splitStakeAccount": "ODQwYThjYmItMmQxZC00ZGU2LTkwYjQtMGUxMDNlZjg4YWFj",
"stakeAuthority": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS",
"baseAccount": "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 split transaction.
Example:
"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw"
Additional chain-specific request parameters.
Example:
{
"amount": 1002282880,
"stakeAccount": "E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F"
}
Create Split Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/unified/staking/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"amount": 1002282880,
"stakeAccount": "E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F"
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/unified/staking/split"
payload = {
"chain": "aptos",
"network": "mainnet",
"stakerAddress": "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
"extra": {
"amount": 1002282880,
"stakeAccount": "E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F"
}
}
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: {
amount: 1002282880,
stakeAccount: 'E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F'
}
})
};
fetch('https://api.p2p.org/api/api/v1/unified/staking/split', 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/split",
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' => [
'amount' => 1002282880,
'stakeAccount' => 'E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F'
]
]),
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/split"
payload := strings.NewReader("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\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/split")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"aptos\",\n \"network\": \"mainnet\",\n \"stakerAddress\": \"9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw\",\n \"extra\": {\n \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/unified/staking/split")
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 \"amount\": 1002282880,\n \"stakeAccount\": \"E96LUCwVTvuQJrN1HrpoHJheQUw9Zk8CtiD3CEpHiA9F\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": 1002282880,
"stakerAddress": "BNWgYrN5nbtZaqSZvjfdLMG5PEp7qems57DAdDxqyctu",
"unsignedTransactionData": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAA...",
"createdAt": "2023-08-24T08:14:50.455Z",
"extraData": {
"network": "testnet",
"stakeAccount": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS",
"splitStakeAccount": "ODQwYThjYmItMmQxZC00ZGU2LTkwYjQtMGUxMDNlZjg4YWFj",
"stakeAuthority": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS",
"baseAccount": "EkCQAwbcH46VP7JvEPEnxy2Qqh1BNub7VwtpjXroXEDS"
}
}
}