Getting Started
Staking in the Aptos network using the Staking API consists of several main steps:
- Create a stake transaction.
- Sign and send the transaction to the network.
Get an authentication token to start using Staking API.
A request example is provided using cURL.
1. Create Stake Transaction
Send a POST request to /api/v1/aptos/{network}/staking/delegated/add
endpoint.
Example request (for mainnet
network):
curl --request POST \
--url https://api.p2p.org/api/v1/aptos/mainnet/staking/delegated/add \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '
{
"amount": 1100000000,
"delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
"gas": {
"unitPrice": 100,
"maxGasLimit": 100,
"used": 100
}
}
'
amount
— amount of tokens to stake in Octas. Minimum stake amount is 11 APT (1 APT = 10⁸ Octas).delegatorAddress
— delegator stash account address which keeps tokens.gas
— computational effort required to execute the transaction, measured in gas units.unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.maxGasLimit
— maximum gas limit for the transaction.used
— amount of gas spent for the transaction.
Example response:
{
"result": {
"amount": 1100000000,
"delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
"unsignedTransaction": "0xa571a5bc9b1bfd5fe58e6e09a5be251a3299985494d022959ce206f1f23f752e21000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c096164645f7374616b650002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28080100000000000000400d0300000000006400000000000000e5742068000000000200",
"createdAt": "2023-08-24T08:14:50.455Z"
},
"error": {}
}
amount
— amount of tokens to stake in Octas.delegatorAddress
— delegator stash account address which keeps tokens.unsignedTransaction
— unsigned transaction in hexadecimal format. Sign the transaction and submit it to the blockchain to perform the called action.createdAt
— timestamp of the transaction in the ISO 8601 format.
2. Sign and Send Transaction
Use unsignedTransaction
to sign and send the signed transaction to the Aptos network. By broadcasting this transaction, you're adding the tokens to P2P.ORG delegation pool.
To check the transaction status, send a GET request to /api/v1/aptos/{network}/transaction/status/{transactionHash}]
endpoint.
Example request (for mainnet
network):
curl --request GET \
--url https://api.p2p.org/api/v1/aptos/mainnet/transaction/status/0x8d80b8ed85b578eeb873731101a926221701ee48218f6c9b83895f7ac1535641 \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json'
transactionHash
— hash of the transaction.
Example response:
{
"result": {
"createdAt": "2025-06-24T08:14:50.455Z",
"gas": {
"unitPrice": 100,
"maxGasLimit": 100,
"used": 100
},
"senderAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
"sequenceNumber": 42,
"status": "success",
"transactionHash": "0x8d80b8ed85b578eeb873731101a926221701ee48218f6c9b83895f7ac1535641"
},
"error": {}
}
createdAt
— timestamp of the transaction in the ISO 8601 format.gas
— computational effort required to execute the transaction, measured in gas units.unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.maxGasLimit
— maximum gas limit for the transaction.used
— amount of gas spent for the transaction.
senderAddress
— transaction sender address.sequenceNumber
— number of transactions that have been submitted and committed on chain from the sender account.status
— transaction status:success
,failed
.transactionHash
— hash of the transaction.
What's Next?
Updated 1 day ago