Quick Buy Energy TRONSAVE
This is a typical example of integrating fast energy purchase and sending trtions in only 1 setting.
See how to install and config SDK here
* Tronsave will do all the steps for you:
+ Estimate the energy needed.
+ If you don't have enough energy, TRONSAVE SDK will buy more energy on the TRONSAVE market.
+ Send the transaction.
You only need to sign 2 transactions:
Buy energy transaction
Original transaction
Extra options for send():
Options | Type | Required | Default | Description |
---|---|---|---|---|
useEnergy | boolean | false | false | set True if you want to buy energy quickly |
maxPrice | number | false | The highest price you allow the sdk to buy energy | |
gapBuy | number | false | 0.05% of the estimated energy but cannot exceed 500. | Amount of energy to buy = energy estimated - account energy + gap. |
sponsor | string | false | The sponsor of the order buys energy, if available. |
Last updated