Nomination Pools
Withdraw Unbonded Request
Withdrawing tokens within the Polkadot network that were previously unbonded and the following exiting the nomination pool.
POST
/
api
/
v1
/
polkadot
/
{network}
/
staking
/
pool
/
withdraw-unbonded
Withdraw Unbonded Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"poolId": 1,
"extended": false
}
'import requests
url = "https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded"
payload = {
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"poolId": 1,
"extended": False
}
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({
stashAccountAddress: '5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5',
poolId: 1,
extended: false
})
};
fetch('https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded', 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/polkadot/{network}/staking/pool/withdraw-unbonded",
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([
'stashAccountAddress' => '5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5',
'poolId' => 1,
'extended' => false
]),
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/polkadot/{network}/staking/pool/withdraw-unbonded"
payload := strings.NewReader("{\n \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\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/polkadot/{network}/staking/pool/withdraw-unbonded")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded")
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 \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"unsignedTransaction": "<string>",
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"createdAt": "2023-11-07T05:31:56Z",
"unsignedTransactionPayload": "7b226164647265...737326164647265732",
"unsignedTransactionObject": {
"blockHash": "<string>",
"eraPeriod": 123,
"currentEra": 123,
"genesisHash": "<string>",
"metadataRpc": "<string>",
"method": {},
"nonce": 123,
"specVersion": 123,
"transactionVersion": 123,
"tip": 123
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Polkadot network:
- `mainnet` — Polkadot mainnet.
- `kusama` — Kusama mainnet.
- `westend` — Polkadot testnet.
Available options:
mainnet, kusama, westend Body
application/json
Main stash account address which keeps tokens for bonding.
Example:
"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5"
ID of the nomination pool.
Example:
1
Optional boolean parameter indicating whether to include additional metadata in the response.
Example:
false
Related topics
Withdraw Unbonded RequestCreate Withdraw RequestWithdrawalSign and Broadcast TransactionWithdraw Unbonded Request
curl --request POST \
--url https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"poolId": 1,
"extended": false
}
'import requests
url = "https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded"
payload = {
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"poolId": 1,
"extended": False
}
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({
stashAccountAddress: '5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5',
poolId: 1,
extended: false
})
};
fetch('https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded', 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/polkadot/{network}/staking/pool/withdraw-unbonded",
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([
'stashAccountAddress' => '5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5',
'poolId' => 1,
'extended' => false
]),
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/polkadot/{network}/staking/pool/withdraw-unbonded"
payload := strings.NewReader("{\n \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\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/polkadot/{network}/staking/pool/withdraw-unbonded")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/polkadot/{network}/staking/pool/withdraw-unbonded")
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 \"stashAccountAddress\": \"5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5\",\n \"poolId\": 1,\n \"extended\": false\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"unsignedTransaction": "<string>",
"stashAccountAddress": "5H6ryBWChC5w7eaQ4GZjo329sEnhvjetSr6MBEt42mZ5tPw5",
"createdAt": "2023-11-07T05:31:56Z",
"unsignedTransactionPayload": "7b226164647265...737326164647265732",
"unsignedTransactionObject": {
"blockHash": "<string>",
"eraPeriod": 123,
"currentEra": 123,
"genesisHash": "<string>",
"metadataRpc": "<string>",
"method": {},
"nonce": 123,
"specVersion": 123,
"transactionVersion": 123,
"tip": 123
}
}
}