Get Signed Transaction
Generate a signed TRX payment transaction for a resource order — either with your own code or via the TronSave Get Signed Transaction API.
This is Step 2 of the Buy with Signed Transaction flow. After Step 1 — Estimate TRX returns an estimateTrx (the cost of the buy order in SUN), you produce a signed transfer transaction that pays that amount from the buyer's wallet to the TronSave fund address. You then submit it in Step 3 — Create Order.
You can do this two ways: sign the transaction yourself (Option 1), or let the TronSave API sign it for you (Option 2).
Option 1: Write your own function
Using the estimateTrx value from Step 1, build a TRX transfer transaction with transactionBuilder that sends an amount equal to estimateTrx from the buyer's address to the TronSave fund address, then sign it with the buyer's private key:
const dataSendTrx = await tronWeb.transactionBuilder.sendTrx('TRONSAVE_FUND_ADDRESS', estimate_trx, 'BUYER_ADDRESS')
const signed_tx = await tronWeb.trx.sign(dataSendTrx, 'PRIVATE_KEY');TronSave fund address (TRONSAVE_FUND_ADDRESS):
TWZEhq5JuUVvGtutNgnRBATbF8BnHGyn4SThis fund address is for testing purposes only on the TRON Nile network.
TATT1UzHRikft98bRFqApFTsaSw73ycfoSThe result signed_tx is then passed to Step 3 — Create Order.
Option 2: Use the TronSave API
POST https://api.tronsave.io/v2/signed-tx
This endpoint builds and signs the transfer transaction for you, given the buyer's address, private key, and the estimateTrx from Step 1.
Headers
Content-Type
application/json
Request body
address
body
string
true
The buyer's public address.
privateKey
body
string
true
The buyer's private key.
Request body example
Response
Errors
This endpoint does not use an apikey header. Authentication for the overall flow is provided by the signed transaction itself in Step 3 — Create Order; this endpoint only builds and signs the transaction. As a result it returns schema-validation errors (400) rather than 401 when the request is malformed.
400 Bad Request — a required field (address, privateKey, or estimateTrx) is missing or invalid. The message names the offending field:
404 Not Found — the route/path is incorrect:
Request examples
This endpoint requires the buyer's privateKey in the request body. Only call it from a trusted server-side environment, never from client-side code. If you prefer not to send your private key, use Option 1 and sign the transaction locally.
Next steps
Last updated