Signed Transaction
Buy Energy or Bandwidth by submitting a signed TRON transaction — estimate cost, get a signed transaction, then create the order.
The signed-transaction flow lets you buy resources by signing a TRON transaction with your own wallet key. Instead of holding a TronSave balance, you pay per order directly from your wallet. The flow has three API steps:
Estimate TRX — calculate the TRX required for the resource amount and rental duration.
Get a signed transaction — produce a signed transaction, either with your own code or via the TronSave API.
Create an order — submit the signed transaction to finalize the resource purchase.
Before you start
Have access to the private key of the wallet you intend to use for the transaction.
Make sure the wallet holds enough TRX to pay for the order.
The flow
Step 1 — Estimate TRX required
Call the Estimate TRX endpoint to calculate the TRX needed for the desired resource amount and rental duration.
Step 2 — Generate a signed transaction
You have two options:
Option 1: Write your own function to generate the signed transaction using the wallet's private key.
Option 2: Use the TronSave Get Signed Transaction API to generate the signed transaction automatically.
Step 3 — Create an order
Call the Create Order endpoint to finalize the purchase. Pass:
The signed transaction (from the API response, or your own custom-signed transaction).
The estimated TRX amount and other required parameters.
Endpoints (TRON Nile Testnet)
Estimate TRX:
POSThttps://api-dev.tronsave.io/v2/estimate-buy-resourceGet Signed Transaction:
POSThttps://api-dev.tronsave.io/v2/signed-txCreate Order:
POSThttps://api-dev.tronsave.io/v2/buy-resource
To integrate with the Nile Testnet, replace the base URL with https://testnet.tronsave.io/ and follow the same steps.
Next steps
Last updated