Aptos
Unified API + Aptos Integration Workflow
In the following guide, the integration process for the aptos
chain is covered. The Aptos integration aligns with the general Unified API process but with network-specific parameters.
Get an authentication token to start using the Unified API.
Request examples are provided using cURL.
To check the integration guides for other chains, refer to the Networks Supported section.
Key Aptos-specific details
chain
— always set toaptos
for Aptos-related requests.network
— environment in which the transaction is processed:testnet
ormainnet
.stakerAddress
— account address initiating staking, unstaking or withdrawal operations.amount
— amount of tokens in Octas (1 APT = 10⁸ Octas).extra.gas
— optional settings for gas management.signature
— delegator account signature, required for broadcasting transactions.
Staking Flow
1. Create Stake Request
Send a POST request to /api/v1/unified/staking/stake.
Example request (for testnet
network):
curl --request POST \
--url https://api-test.p2p.org/api/v1/unified/staking/stake \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "aptos",
"network": "testnet",
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"amount": 11,
"extra":{
"gas": {
"unitPrice": 102,
"maxGasLimit": 1234
}
}
}'
chain
— blockchain network, always set toaptos
for Aptos-related requests.network
— environment in which the transaction is processed:mainnet
ortestnet
.stakerAddress
—0x
-prefixed Aptos account address, initiating the staking transaction.amount
— amount of tokens to stake in Octas (1 APT = 10⁸ Octas). Note that minimum staking amount for testing is 11 APT, and onmainnet
, no less than 1 000 000 APT delegation to the validator is required.extra.gas
— optional settings for gas management:unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.maxGasLimit
— maximum gas limit for the transaction.
Example response:
{
"error": null,
"result": {
"amount": 1100000000,
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"unsignedTransactionData": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8800000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c096164645f7374616b650002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d280800ab904100000000400d0300000000006400000000000000bd192087970100000200",
"createdAt": "2025-06-19T06:38:37.373Z"
}
}
amount
— amount of tokens to stake in Octas (1 APT = 10⁸ Octas).stakerAddress
— staking account address receiving the staked tokens.unsignedTransactionData
— unsigned transaction in Base64 or hex-encoded format. Sign the transaction and submit it to the blockchain to perform the called action.createdAt
— timestamp of the transaction in ISO 8601 format.
2. Sign and Send Transaction
Use unsignedTransactionData
to sign the transaction using the Aptos-specific signing logic.
To broadcast the signed transaction to the Aptos network, send a POST request to /api/v1/unified/transaction/broadcast.
Example request (for testnet
network):
curl --request POST \
--url https://api-test.p2p.org/api/v1/unified/transaction/broadcast \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "aptos",
"network": "testnet",
"signedTransaction": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8800000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c096164645f7374616b650002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d280800ab904100000000400d0300000000006400000000000000bd192087970100000200",
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"extra": {
"signature": "0x00204a7d68bc540b902995941b77373cd378f39b0e0ebff42566e03774b0ad2285e940cb030ea54fa24986712ffb5c941f3950a2bf1087b2e588c6c3daa08689b5668fbe469a76351101275f694f1ec45cc7d433e103825e55d20ded63cbbcbe344d01"
}
}'
chain
— blockchain network.network
— environment in which the transaction is processed.stakerAddress
— account address initiating the staking transaction.signedTransaction
— signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.extra.signature
— delegator signature of the transaction externally produced via the signing code.
Example response:
{
"error": null,
"result": {
"status": "pending",
"extraData": {
"gas": {
"maxGasLimit": 200000,
"unitPrice": 100,
"used": null
},
"createdAt": "2025-06-19T06:56:50.979Z",
"transactionHash": "0x3051a37fdb7a3e6aa8fc0429d2896dff53c36d6da8144e438aa3ba9d9cb60810",
"senderAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88"
}
}
}
status
— transaction status:pending
,success
, orfailed
.extraData
— additional transaction details:gas
— computational effort required to execute the transaction, measured in gas units.maxGasLimit
— maximum gas limit for the transaction.unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.used
— amount of gas spent for the transaction.
createdAt
— timestamp of the transaction in ISO 8601 format.transactionHash
— hash of the transaction.senderAddress
— transaction sender address.
Unstaking Flow
1. Create Unlock Request
Send a POST request to /api/v1/unified/staking/unstake
Example request (for testnet
network):
curl --request POST \
--url https://api-test.p2p.org/api/v1/unified/staking/unstake \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "aptos",
"network": "testnet",
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"extra":{
"amount": 1000000000,
"gas": {
"unitPrice": 100,
"maxGasLimit": 1000
}
}
}'
chain
— blockchain network.network
— environment in which the transaction is processed.stakerAddress
— account address initiating the unstaking transaction.extra
— additional request parameters:amount
— amount of tokens to unlock in Octas (1 APT = 10⁸ Octas).gas
— optional settings for gas management:unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.maxGasLimit
— maximum gas limit for the transaction.
Example response:
{
"error": null,
"result": {
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"unsignedTransactionData": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8801000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c06756e6c6f636b0002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d280800ca9a3b00000000e803000000000000640000000000000018e5bf87970100000200",
"createdAt": "2025-06-19T09:33:09.655Z",
"extraData": {
"amount": 1000000000
}
}
}
stakerAddress
— account address initiating the unstaking transaction.unsignedTransactionData
— unsigned transaction in Base64 or hex-encoded format. Sign the transaction and submit it to the blockchain to perform the called action.createdAt
— timestamp of the transaction in ISO 8601 format.extraData
— additional transaction details:amount
— amount of tokens to unlock in Octas.
2. Sign and Send Transaction
Use unsignedTransactionData
to sign and send the transaction following the Aptos-specific signing logic.
3. Create Withdrawal Request
Note that it takes up to 30 days to unlock tokens on Aptos network. During this waiting period, unlocked tokens continue earning rewards. Withdrawal is only available after the unlocking period ends.
Send a POST request to /api/v1/unified/staking/withdraw.
Example request (for testnet
network):
curl --request POST \
--url https://api-test.p2p.org/api/v1/unified/staking/withdraw \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "aptos",
"network": "testnet",
"stakerAddress": "0x2588942932015ae61b7e9b77d41f8ed053dde2b341ccaca57bf6a6ecb4fa511a",
"extra":{
"amount": 99,
"gas": {
"unitPrice": 100,
"maxGasLimit": 1000
}
}
}'
chain
— blockchain network.network
— environment in which the transaction is processed.stakerAddress
— account address initiating the withdrawal transaction.extra
— additional request parameters:amount
— amount of tokens to withdraw in Octas.gas
— optional settings for gas management:unitPrice
— price per unit of gas in Octas for processing the Aptos transaction.maxGasLimit
— maximum gas limit for the transaction.
Example response:
{
"error": null,
"result": {
"stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
"unsignedTransactionData": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8802000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c0877697468647261770002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28086300000000000000e80300000000000064000000000000007f06f587970100000200",
"createdAt": "2025-06-19T10:31:11.615Z",
"extraData": {
"amount": 99
}
}
}
stakerAddress
— account address initiating the withdrawal transaction.unsignedTransactionData
— unsigned transaction in Base64 or hex-encoded format. Sign the transaction and submit it to the blockchain to perform the called action.createdAt
— timestamp of the transaction in ISO 8601 format.extraData
— additional transaction details:amount
— amount of tokens to withdraw in Octas.
4. Sign and Send Transaction
Use unsignedTransactionData
to sign and send the transaction following the Aptos-specific signing logic.
What's Next?
Updated 18 days ago