Story
Create a staking transaction
Create an unsigned staking transaction for the Story network.
POST
/
api
/
v1
/
story
/
{network}
/
staking
/
stake
Create a staking transaction
curl --request POST \
--url https://api.p2p.org/api/api/v1/story/{network}/staking/stake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1024 (minimum)",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"stakingPeriod": "FLEXIBLE",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/story/{network}/staking/stake"
payload = {
"amount": "1024 (minimum)",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"stakingPeriod": "FLEXIBLE",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
}
}
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({
amount: '1024 (minimum)',
delegatorAddress: '0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07',
stakingPeriod: 'FLEXIBLE',
gas: {maxFeePerGas: 100, maxPriorityFeePerGas: 100, gasLimit: 21000}
})
};
fetch('https://api.p2p.org/api/api/v1/story/{network}/staking/stake', 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/story/{network}/staking/stake",
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([
'amount' => '1024 (minimum)',
'delegatorAddress' => '0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07',
'stakingPeriod' => 'FLEXIBLE',
'gas' => [
'maxFeePerGas' => 100,
'maxPriorityFeePerGas' => 100,
'gasLimit' => 21000
]
]),
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/story/{network}/staking/stake"
payload := strings.NewReader("{\n \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\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/story/{network}/staking/stake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/story/{network}/staking/stake")
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 \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": "1024",
"createdAt": "2025-05-06T10:10:50.455Z",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
},
"stakingPeriod": "SHORT",
"unsignedTransaction": "0x02f901188205230d8459682f008459682f0e83030d4094cccccc0000000000000000000000000000000001893782dace9d90000000b8e4564bcc1f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002103d99d454184facbf6a03ea37eb36f6a50c69842ea3ad42038a8d5537bd15b2594000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Story network:
- `mainnet` — Story mainnet.
- `Aeneid` — Aeneid testnet.
Available options:
mainnet, aeneid Body
application/json
Amount to stake in IP
Example:
"1024 (minimum)"
Delegator EVM Story account address
Example:
"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07"
Staking period. Flexible, SHORT - 90 days, MEDIUM - 360 days, LONG - 540 days
Available options:
FLEXIBLE, SHORT, MEDIUM, LONG Example:
"FLEXIBLE"
Computational effort required to execute the transaction, measured in gas units.
Show child attributes
Show child attributes
Create a staking transaction
curl --request POST \
--url https://api.p2p.org/api/api/v1/story/{network}/staking/stake \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1024 (minimum)",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"stakingPeriod": "FLEXIBLE",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
}
}
'import requests
url = "https://api.p2p.org/api/api/v1/story/{network}/staking/stake"
payload = {
"amount": "1024 (minimum)",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"stakingPeriod": "FLEXIBLE",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
}
}
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({
amount: '1024 (minimum)',
delegatorAddress: '0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07',
stakingPeriod: 'FLEXIBLE',
gas: {maxFeePerGas: 100, maxPriorityFeePerGas: 100, gasLimit: 21000}
})
};
fetch('https://api.p2p.org/api/api/v1/story/{network}/staking/stake', 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/story/{network}/staking/stake",
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([
'amount' => '1024 (minimum)',
'delegatorAddress' => '0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07',
'stakingPeriod' => 'FLEXIBLE',
'gas' => [
'maxFeePerGas' => 100,
'maxPriorityFeePerGas' => 100,
'gasLimit' => 21000
]
]),
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/story/{network}/staking/stake"
payload := strings.NewReader("{\n \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\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/story/{network}/staking/stake")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.p2p.org/api/api/v1/story/{network}/staking/stake")
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 \"amount\": \"1024 (minimum)\",\n \"delegatorAddress\": \"0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07\",\n \"stakingPeriod\": \"FLEXIBLE\",\n \"gas\": {\n \"maxFeePerGas\": 100,\n \"maxPriorityFeePerGas\": 100,\n \"gasLimit\": 21000\n }\n}"
response = http.request(request)
puts response.read_body{
"error": null,
"result": {
"amount": "1024",
"createdAt": "2025-05-06T10:10:50.455Z",
"delegatorAddress": "0x40A27d5E24C44A5c4a9976b4a46a5FAE74a06e07",
"gas": {
"maxFeePerGas": 100,
"maxPriorityFeePerGas": 100,
"gasLimit": 21000
},
"stakingPeriod": "SHORT",
"unsignedTransaction": "0x02f901188205230d8459682f008459682f0e83030d4094cccccc0000000000000000000000000000000001893782dace9d90000000b8e4564bcc1f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002103d99d454184facbf6a03ea37eb36f6a50c69842ea3ad42038a8d5537bd15b2594000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0"
}
}