Withdrawal

The withdrawal process in the TON network using the Staking API can be done following these steps:

  1. Create an unstake transaction.
  2. Sign and broadcast the transaction to withdrawing staked tokens from a pool.

Staking via a nominator pool

  1. Send a POST request to /api/v1/ton/{network}/staking/nominator/unstake.

    Example request (for testnet):

    curl --request POST \
      --url https://api.p2p.org/api/v1/ton/testnet/staking/nominator/unstake \
      --header 'accept: application/json' \
      --header 'authorization: Bearer <token>' \
      --header 'content-type: application/json' \
      --data '
    {
       "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
       "amount": "1"
    }'
    
    • walletAddress — main account address which keeps tokens, located in the Basechain.
    • amount — amount of tokens to unstake in TON.

    Example response:


  2. Sign and broadcast the unsignedTransaction to the TON network.

Staking via a single nominator pool

  1. Send a POST request to /api/v1/ton/{network}/staking/single-nominator/unstake to create a special memo message for withdrawal.

    Example request (for testnet):

    curl --request POST \
      --url https://api.p2p.org//api/v1/ton/testnet/staking/single-nominator/unstake \
      --header 'accept: application/json' \
      --header 'authorization: Bearer <token>' \
      --header 'content-type: application/json' \
      --data '
    {
      "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
      "amount": "300000"
    }'
    
    • walletAddress — main account address which keeps tokens, located in the Basechain.
    • amount — amount of tokens to unstake in TON.

    Example response:


  2. Sign and broadcast the unsignedTransaction to the TON network.

What's Next?