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');
  • BUYER_ADDRESS — the buyer's public address.

  • PRIVATE_KEY — the buyer's private key.

  • TRONSAVE_FUND_ADDRESS — the TronSave fund address (see below).

TronSave fund address (TRONSAVE_FUND_ADDRESS):

TWZEhq5JuUVvGtutNgnRBATbF8BnHGyn4S

The 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.

Rate limit: 15 requests per 1 second.

Headers

Header
Value

Content-Type

application/json

Request body

Field
Position
Type
Required
Description

address

body

string

true

The buyer's public address.

privateKey

body

string

true

The buyer's private key.

estimateTrx

body

number

true

The amount of TRX to be paid, in SUN (the estimateTrx value from Step 1).

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

Next steps

Last updated