TRON Developer Guide—Transaction Management

TRON DAO
2 min readJun 18, 2019

--

Send Trx

tronWeb.transactionBuilder.sendTrx("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "TZDCUCy3Wn1HhJVseANdrhzqDYCTEue8xT");

Create an unsigned transaction.

Send Token

tronWeb.transactionBuilder.sendToken("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "WIN", "TCanwMYEkP1e6ZWSA2gdU6jDEm1TxWMYQF");

Creates an unsigned Token transfer transaction.

Purchase Token

tronWeb.transactionBuilder.purchaseToken("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "WIN", "TCanwMYEkP1e6ZWSA2gdU6jDEm1TxWMYQF");

Creates an unsigned ICO Token purchase transaction.

Freeze Balance

tronWeb.transactionBuilder.freezeBalance(tronWeb.toSun(100), 3, "ENERGY", "TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", "TXPHCbmRmjyRPtDFS6ERTPqUPfJfQSzp2m");

Creates an unsigned freeze TRX transaction.

Unfreeze Balance

tronWeb.transactionBuilder.freezeBalance("ENERGY", "TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", "TXPHCbmRmjyRPtDFS6ERTPqUPfJfQSzp2m");

Creates an unsigned unfreeze TRX transaction. This will unfreeze ALL TRX for that resource and also remove all VOTES.

Withdraw Block Rewards

tronWeb.transactionBuilder.withdrawBlockRewards("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m");

Creates an unsigned Super Representative award balance withdraw transaction.

Apply for Super Representives

tronWeb.transactionBuilder.applyForSR(address = this.tronWeb.defaultAddress.hex, url = 'google.com');

apply for SR for an address

Vote

tronWeb.transactionBuilder.vote( votes = {srAddress : voteCount}, voterAddress = this.tronWeb.defaultAddress.hex);

vote for an SR

Create Token

tronWeb.transactionBuilder.createToken(options = TOKEN_OPTIONS, issuerAddress = this.tronWeb.defaultAddress.hex);

create a token

value    description    exampleoptions  token          {
options name = false,
abbreviation = false,
description = false,
url = false,
totalSupply = 0,
trxRatio = 1, // How much TRX will `tokenRatio` cost?
tokenRatio = 1, // How many tokens will `trxRatio` afford?
saleStart = Date.now(),
saleEnd = false,
freeBandwidth = 0, // The creator's "donated" bandwidth for use by token holders
freeBandwidthLimit = 0, // Out of `totalFreeBandwidth`, the amount each token holder get
frozenAmount = 0,
frozenDuration = 0
}

--

--

TRON DAO
TRON DAO

Written by TRON DAO

The official Medium of TRON DAO.

No responses yet