Withdrawal
The withdrawal process on the Story Protocol using the Staking API consists of two main steps:
- Create an unstaking request.
- Create a withdrawal request.
After each operation, sign and broadcast the transaction to the Story network.
Please note
The unstaking process may take some time depending on the staking configuration. Make sure the lock-up period has passed before attempting to withdraw.
1. Create unstaking request
-
Send a POST request to /api/v1/story/{network}/staking/unstake.
Example request (for
aeneidnetwork):curl --request POST \ --url https://api-test.p2p.org/api/v1/story/aeneid/staking/unstake \ --header 'accept: application/json' \ --header 'authorization: Bearer <token>' \ --header 'content-type: application/json' \ --data '{ "delegatorAddress": "0x3202B5B0602274197CcB22B8c02CEC9539990c7c", "amount": 512, "gas": { "maxFeePerGas": 100, "maxPriorityFeePerGas": 1, "gasLimit": 21000 } }'delegatorAddressā delegator EVM Story account address.amountā amount of tokens to unstake in IP.gasā optional gas settings to execute the transaction:maxFeePerGasāĀ maximum price per unit of gas this transaction will pay for the combined EIP-1559 block's base fee and this transaction's priority fee in Wei.maxPriorityFeePerGasā price per unit of gas in Wei, which is added to the EIP-1559 block's base fee. This added fee is used to incentivize miners to prioritize this transaction.gasLimitā maximum gas limit for the transaction.
Example response:
{ "result": { "unsignedTransaction": "0xf86e808504a817c80082520894c32e3d7c7e6e53d16b9a48d0ae76c70e6adf09f080801ba0f31401df9e6f6d861fdf09d1e69b5f51855f4f63b0179033a6c3871c05ec93da03e0f7d7eab4a3179b29b416d6c75dbe53de763153b7ed9e2c49883c8fca1ef29c", "createdAt": "2025-07-22T12:34:56.789Z" } }-
unsignedTransactionā serialized unsigned transaction in the hexadecimal format (RLP-encoded). Sign the transaction and submit it to the blockchain to perform the called action. Note that it must be signed and broadcasted within ~1 minute. -
createdAtā timestamp of the transaction in the ISO 8601 format.
-
Use
unsignedTransactionto sign and send the signed transaction to the Story network.
2. Create withrawal request
-
Send a POST request to /api/v1/story/{network}/staking/withdraw.
Example request (for
aeneidnetwork):curl --request POST \ --url https://api-test.p2p.org/api/v1/story/aeneid/staking/withdraw \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "delegatorAddress": "0x3202B5B0602274197CcB22B8c02CEC9539990c7c", "amount": 512, "gas": { "maxFeePerGas": 100, "maxPriorityFeePerGas": 1, "gasLimit": 21000 } }'delegatorAddressā delegator EVM Story account address.amountā amount of tokens to withdraw in IP.gasā optional gas settings to execute the transaction:maxFeePerGasāĀ maximum price per unit of gas this transaction will pay for the combined EIP-1559 block's base fee and this transaction's priority fee in Wei.maxPriorityFeePerGasā price per unit of gas in Wei, which is added to the EIP-1559 block's base fee. This added fee is used to incentivize miners to prioritize this transaction.gasLimitā maximum gas limit for the transaction.
Example response:
{ "result": { "unsignedTransaction": "0xf86e808504a817c80082520894c32e3d7c7e6e53d16b9a48d0ae76c70e6adf09f080801ba0f31401df9e6f6d861fdf09d1e69b5f51855f4f63b0179033a6c3871c05ec93da03e0f7d7eab4a3179b29b416d6c75dbe53de763153b7ed9e2c49883c8fca1ef29c", "createdAt": "2025-07-22T12:45:00.123Z" } }-
unsignedTransactionā serialized unsigned transaction in the hexadecimal format (RLP-encoded). Sign the transaction and submit it to the blockchain to perform the called action. Note that it must be signed and broadcasted within ~1 minute. -
createdAtā timestamp of the transaction in the ISO 8601 format.
-
Use
unsignedTransactionto sign and send the signed transaction to the Story Protocol network.
What's Ńext?
- Staking API reference
Updated about 2 months ago