Use Signed Transaction
Buy Energy with Signed Transaction Flow
Step 1: Prepare Wallet and Private Key
Ensure you have access to the wallet's private key you intend to use for the transaction.
Verify that the wallet has sufficient TRX balance to execute the transaction.
Step 2: Estimate TRX Required
Use the Estimate of TRX API will be used to calculate the TRX needed for the desired energy amount and rental duration.
Step 3: Generate a Signed Transaction
Option 1: Write your function to generate the signed transaction using the wallet's private key.
Option 2: Use Tronsave Get Signed Transaction API to generate the signed transaction automatically.
Step 4: Create an Order
Use the Create Order API to finalize the transaction.
Pass the response from the signed transaction (if using the API) or your custom-signed transaction.
Include the estimated TRX amount and other required parameters to create the energy purchase order.
API List for Testing - TRON Nile Testnet
Estimate TRX:
POST
https://api-dev.tronsave.io/v0/estimate-trx
Get Signed Transaction:
POST
https://api-dev.tronsave.io/v0/signed-tx
Create order:
POST
https://api-dev.tronsave.io/v0/buy-energy
Last updated