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 section.

📘

Key Aptos-specific details

  • chain — always set to aptos for Aptos-related requests.
  • network — environment in which the transaction is processed (testnet or mainnet).
  • stakerAddress — the account address initiating staking, unstaking, or withdrawal operations.
  • amount— amount to stake/unstake/withdraw, denominated in octas (1 APT = 10^8 octas).
  • extra.gas — (optional) allows you to define unitPrice and maxGasLimit for gas management.
  • signature — required for transaction broadcast (signed externally, see below).

Note: Minimum staking amount is 10 APT (test with 11+ APT to account for fees).
Public staking on mainnet requires a minimum 1,000,000 APT delegation to the validator.

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": 1,
    "extra":{
        "gas": {
            "unitPrice": 102,
            "maxGasLimit": 1234
        }
    }
}'
  • chain — blockchain network, always set to aptos for Aptos-related requests.
  • network — environment in which the transaction is processed (mainnet or testnet).
  • stakerAddress — Aptos account address initiating the staking transaction (0x-prefixed hex).
  • amount — amount of tokens to stake, denominated in octas (1 APT = 100,000,000 octas).
  • extra.gas — (optional) custom gas settings for the transaction:
    • unitPrice — gas unit price in octas.
    • maxGasLimit — max gas to be used 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).
  • 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:

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 or hex-encoded format, which contains all transaction details and required signatures.
  • extra.signature — externally produced transaction signature (see signing guide).

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, or error).
  • extraData — additional transaction details:
    • gas — gas settings used for the transaction:
      • maxGasLimit — max gas limit set for the transaction.
      • unitPrice — price per gas unit.
      • used — actual gas used (null if not finalized).
    • createdAt — timestamp of the transaction in ISO 8601 format.
    • transactionHash — hash of the submitted transaction.
    • senderAddress — account address that signed and submitted the transaction.

Unstaking Flow (Unlock)

1. Create Unstaking Request

Send a POST request to /api/v1/unified/staking/unstake

Example request:

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 unbonding transaction.
  • extra — additional request parameters:
    • amount — amount of tokens to unbond (in octas).
    • gas — gas settings for the transaction:
      • unitPrice — gas unit price in octas.
      • maxGasLimit — max gas to be used 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 unbonding 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 unbond (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: Withdrawal is only available after the unbonding period ends
(up to 30 days depending on cycle timing).

Send a POST request to /api/v1/unified/staking/withdraw.

Example request:

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 — gas settings for the transaction:
      • unitPrice — gas unit price in octas.
      • maxGasLimit — max gas to be used 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?