The Allnodes API generates serialized unsigned transactions. To send a transaction to the network, you will need experience with TronWeb: https://github.com/tronprotocol/tronweb
In every HTTP request of the Allnodes API, you need to specify your API key via an HTTP header: Authorization: Bearer <YOUR_API_KEY>
TRON API documentation: https://docs.allnodes.com/trx/staking
How to get an API key:
Register an account here: https://www.allnodes.com
Go to the settings of your account: https://www.allnodes.com/settings
Open the API tab.
Click on the "Enable API" button.
Save the "Read and Write API Key" and "Read-Only API Key" in a safe place.
How to Stake
You must freeze at least 1 TRX.
If you have already freezed coins, go to step 3.Send a HTTP POST request to the URL https://www.allnodes.com/api/v1/staking with the following JSON body:
{
"currencySymbol": "TRX",
"action": "freeze"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_STAKE>"
}Example:
curl --location --request POST 'https://www.allnodes.com/api/v1/staking' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currencySymbol": "TRX",
"action": "freeze"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_STAKE>"
}'The response to your request contains:
txID
– transaction ID.
raw_data_hex
– data of unsigned transaction in hexadecimal format.raw_data
- data of unsigned transaction in human friendly format.
Send a HTTP POST request to the URL https://www.allnodes.com/api/v1/staking with the following JSON body:
{
"currencySymbol": "TRX",
"action": "delegate"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_STAKE>"
}
Example:curl --location --request POST 'https://www.allnodes.com/api/v1/staking' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currencySymbol": "TRX",
"action": "delegate"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_STAKE>"
}'The response to your request contains:
txID
– transaction ID.
raw_data_hex
– data of unsigned transaction in hexadecimal format.raw_data
- data of unsigned transaction in human friendly format.
You have successfully delegated your staked coins to Allnodes
How to Withdraw Your Stake
You will first need to unfreeze your stake account and wait for the lockup period to finish (usually, it's about 3 days).
To undelegate your stake, Send a HTTP POST request to the URL https://www.allnodes.com/api/v1/staking with the following JSON body:
{
"currencySymbol": "TRX",
"action": "delegate"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_STAKE>"
}
Example:curl --location --request POST 'https://www.allnodes.com/api/v1/staking' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currencySymbol": "TRX",
"action": "undelegate"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_WITHDRAW>"
}'The response to your request contains:
txID
– transaction ID.
raw_data_hex
– data of unsigned transaction in hexadecimal format.raw_data
- data of unsigned transaction in human friendly format.
Send a HTTP POST request to the URL https://www.allnodes.com/api/v1/staking with the following JSON body:
{
"currencySymbol": "TRX",
"action": "unfreeze"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_WITHDRAW>"
}
Example:curl --location --request POST 'https://www.allnodes.com/api/v1/staking' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currencySymbol": "TRX",
"action": "unfreeze"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_WITHDRAW>"
}'The response to your request contains:
txID
– transaction ID.
raw_data_hex
– data of unsigned transaction in hexadecimal format.raw_data
- data of unsigned transaction in human friendly format.
You have successfully withdrawn your staked coins!
How to claim rewards
Send a HTTP POST request to the URL https://www.allnodes.com/api/v1/staking with the following JSON body:
{
"currencySymbol": "TRX",
"action": "undelegate"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_WITHDRAW>"
}
Example:curl --location --request POST 'https://www.allnodes.com/api/v1/staking' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"currencySymbol": "TRX",
"action": "claim"
"address": "<YOUR_ADDRESS>",
"amount": "<AMOUNT_TO_WITHDRAW>"
}'The response to your request contains:
txID
– transaction ID.
raw_data_hex
– data of unsigned transaction in hexadecimal format.raw_data
- data of unsigned transaction in human friendly format.
You have successfully withdrawn your rewards!