## Send Trx
`tronWeb.transactionBuilder.sendTrx("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "TZDCUCy3Wn1HhJVseANdrhzqDYCTEue8xT");
`
_Create an unsigned transaction._
Value | Description |
to | Address to send TRX to. |
amount | Amount of TRX to send. |
from | Optional address that is transferring the Tokens. |
## Send Token
`tronWeb.transactionBuilder.sendToken("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "WIN", "TCanwMYEkP1e6ZWSA2gdU6jDEm1TxWMYQF");
`
_Creates an unsigned Token transfer transaction._
Value | Description |
to | Address to send Token to. |
amount | Amount of Tokens to send. |
tokenID | If the function accepts a trc 10 token , the parameter is the id of the token |
from | Optional address that is transferring the Tokens. |
## Purchase Token
`tronWeb.transactionBuilder.purchaseToken("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", 100, "WIN", "TCanwMYEkP1e6ZWSA2gdU6jDEm1TxWMYQF");
`
_Creates an unsigned ICO Token purchase transaction._
Value | Description |
issuerAddress | Address that issued the Token. |
amount | Amount of Tokens to buy. |
tokenID | Name of the Token, matching the exact capitalization. |
buyer | Optional address that is buying the Tokens. |
## Freeze Balance
`tronWeb.transactionBuilder.freezeBalance(tronWeb.toSun(100), 3, "ENERGY", "TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m", "TXPHCbmRmjyRPtDFS6ERTPqUPfJfQSzp2m");
`
_Creates an unsigned freeze TRX transaction._
Value | Description | Data Type |
amount | Amount of TRX (in SUN) to freeze. | Integer |
duration | Length in Days to freeze TRX for. Minimum of 3 days. | Integer |
resource | Resource that you're freezing TRX in order to obtain. Must be either "BANDWIDTH" or "ENERGY". | String |
address (optional) | Address of the owner of the TRX to be frozen (defaults to caller's default address). | String |
receiverAddress | Address of other user receiving the resource. | String |
## 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._
Value | Description | Integer Type |
resource | Resource that you're freezing TRX in order to obtain. Must be either "BANDWIDTH" or "ENERGY". | String |
address (optional) | Address of the owner of the TRX to be unfrozen (defaults to caller's default address). | String |
receiver address | Address of user in which the resource is being removed from, due to unfreeze. | String |
## Withdraw Block Rewards
`tronWeb.transactionBuilder.withdrawBlockRewards("TXPHCzmAmjyERtWES6EXTYqUPfJfQSzp2m");
`
_Creates an unsigned Super Representative award balance withdraw transaction._
Value | Description |
address | Optional address to withdraw from. |
## Apply for Super Representives
`tronWeb.transactionBuilder.applyForSR(address = this.tronWeb.defaultAddress.hex, url = 'google.com');
`
_apply for SR for an address_
value | Description |
address | address for applying for SR, hex string format |
url | website of SR |
## Vote
`tronWeb.transactionBuilder.vote( votes = {srAddress : voteCount}, voterAddress = this.tronWeb.defaultAddress.hex);
`
_vote for an SR_
value | description |
votes | dictionary of SR address : vote count key-value pair |
voterAddress | voter address in HexString |
## Create Token
`tronWeb.transactionBuilder.createToken(options = TOKEN_OPTIONS, issuerAddress = this.tronWeb.defaultAddress.hex);
`
_create a token_
value | description | example |
options | 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
} ` |