You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><strong>Notice</strong>: Only node where <code>storage.balance.history.lookup= true</code> is set in the configuration file supports querying the account's historical balance. The supported official nodes can be queried <ahref="../../using_javatron/backup_restore/#fullnode-data-snapshot">here</a>.</p>
2204
+
<p><strong>Notice</strong>: Only node where <code>storage.balance.history.lookup= true</code> is set in the configuration file supports querying the account's historical balance. The supported official nodes can be queried <ahref="../../using_javatron/backup_restore/#fullnode-data-snapshots">here</a>.</p>
2205
2205
<h2id="fetch-all-balance-changing-transactions-in-a-block">fetch all balance-changing transactions in a block<aclass="headerlink" href="#fetch-all-balance-changing-transactions-in-a-block" title="Permanent link">¶</a></h2>
<h2id="5-submitting-code-and-creating-a-pull-request">5. Submitting Code and Creating a Pull Request<aclass="headerlink" href="#5-submitting-code-and-creating-a-pull-request" title="Permanent link">¶</a></h2>
1924
1924
<h3id="51-submit-a-commit">5.1 Submit a Commit<aclass="headerlink" href="#51-submit-a-commit" title="Permanent link">¶</a></h3>
1925
-
<p>After you have finished writing and testing your code, commit your changes. Please refer to the <ahref="../java-tron/#commit-messages">Commit Specification</a>.</p>
1925
+
<p>After you have finished writing and testing your code, commit your changes. Please refer to the <ahref="../java-tron/#commit-message-specifications">Commit Specification</a>.</p>
The returned JSON data contains all the transaction details, such as the contract type (<code>TransferContract</code>), transfer amount, sender and recipient addresses, etc. <code>"contractRet":"SUCCESS"</code> indicates that the transaction's contract is syntactically correct.</li>
The returned JSON data contains all the transaction details, such as the contract type (<code>TransferContract</code>), transfer amount, sender and recipient addresses, etc. <code>"contractRet":"SUCCESS"</code> indicates that the transaction's contract is syntactically correct.
1864
+
<divclass="highlight"><pre><span></span><code>{
1866
1865
"ret":[
1867
1866
{
1868
1867
"contractRet":"SUCCESS"
@@ -1894,12 +1893,12 @@ <h4 id="query-transaction-details-by-id">Query Transaction Details by ID<a class
<li>Use <code>gettransactioninfobyid <txid></code> to view the transaction's processing result and receipt information (i.e., whether the transaction has been included in a block, its execution result, and resource consumption):
2. Use <code>gettransactioninfobyid <txid></code> to view the transaction's processing result and receipt information (i.e., whether the transaction has been included in a block, its execution result, and resource consumption):</p>
<p>In the returned result, the most important field is <code>blockNumber</code>, which indicates the block height at which the transaction was confirmed. If this value exists, the transaction has been successfully recorded on the blockchain. Additionally, the <code>receipt</code> object records the resources consumed by the transaction, such as bandwidth (<code>net_usage</code>).</p>
1902
-
<divclass="highlight"><pre><span></span><code>{
1900
+
In the returned result, the most important field is <code>blockNumber</code>, which indicates the block height at which the transaction was confirmed. If this value exists, the transaction has been successfully recorded on the blockchain. Additionally, the <code>receipt</code> object records the resources consumed by the transaction, such as bandwidth (<code>net_usage</code>).
@@ -1911,7 +1910,8 @@ <h4 id="query-transaction-details-by-id">Query Transaction Details by ID<a class
1911
1910
}
1912
1911
}
1913
1912
wallet>
1914
-
</code></pre></div>
1913
+
</code></pre></div></li>
1914
+
</ol>
1915
1915
<h3id="method-two-using-curl-direct-http-api-call">Method Two: Using <code>cURL</code> (Direct HTTP API Call)<aclass="headerlink" href="#method-two-using-curl-direct-http-api-call" title="Permanent link">¶</a></h3>
1916
1916
<p>While <code>wallet-cli</code> provides user-friendly interactive commands, more advanced developers or those working in automated scripting scenarios may find it more flexible and efficient to interact with a java-tron node directly via its HTTP API. This section demonstrates how to use <code>cURL</code> (a command-line tool for sending HTTP requests) to call the java-tron node's HTTP API to perform core functions like querying account balances and sending transactions.</p>
1917
1917
<p>Unlike <code>wallet-cli</code>, which automatically handles signing and broadcasting, sending a transaction by directly calling the API requires you to manually complete a standard three-step process: <strong>Create -> Sign -> Broadcast</strong>. This section will show you how to execute this process.</p>
<p><strong>Note:</strong> Because the total staked funds in the network and an individual account's staked funds can change at any time, the amount of Bandwidth an account possesses is not a fixed value.</p>
<p><strong>Daily Free Allowance:</strong> Every account receives a fixed daily allowance of free Bandwidth, which can be modified through a committee proposal <ahref="https://tronscan.io/#/sr/committee">#61</a> and is currently set to 600.</p>
1728
1728
</li>
1729
1729
</ul>
1730
-
<h3id="2-how-bandwidth-is-consumed">2. How Bandwidth is Consumed<aclass="headerlink" href="#2-how-bandwidth-is-consumed" title="Permanent link">¶</a></h3>
1730
+
<h3id="how-bandwidth-is-consumed">How Bandwidth is Consumed<aclass="headerlink" href="#how-bandwidth-is-consumed" title="Permanent link">¶</a></h3>
1731
1731
<p>All transactions, except for query operations, consume Bandwidth. When you initiate a transaction, the system deducts the Bandwidth fee according to a strict priority order based on the transaction type.</p>
1732
1732
<p><strong>Scenario 1: Standard Transactions</strong></p>
1733
1733
<p>The system attempts to pay the Bandwidth fee in the following order:</p>
@@ -1776,9 +1776,9 @@ <h3 id="2-how-bandwidth-is-consumed">2. How Bandwidth is Consumed<a class="heade
<p>You can query an account's current resource status by calling the <code>wallet/getaccountresource</code> HTTP endpoint. In the returned JSON data, use the following formulas to calculate the remaining Bandwidth:</p>
<p>Consumed Energy resources gradually recover over a 24-hour period.</p>
1845
1845
<p><aid="set-fee-limit"></a></p>
1846
-
<h3id="2-how-to-set-fee_limit-essential-for-users">2. How to Set <code>fee_limit</code> (Essential for Users)<aclass="headerlink" href="#2-how-to-set-fee_limit-essential-for-users" title="Permanent link">¶</a></h3>
1846
+
<h3id="how-to-set-fee_limit-essential-for-users">How to Set <code>fee_limit</code> (Essential for Users)<aclass="headerlink" href="#how-to-set-fee_limit-essential-for-users" title="Permanent link">¶</a></h3>
1847
1847
<divclass="admonition note">
1848
1848
<pclass="admonition-title">Note</p>
1849
1849
<p>In this section, "developer" refers to the person who develops and deploys the contract, while "caller" refers to the user or contract that invokes it.
@@ -1872,7 +1872,7 @@ <h3 id="2-how-to-set-fee_limit-essential-for-users">2. How to Set <code>fee_limi
1872
1872
<li><strong>Step 3: Set the Final <code>fee_limit</code></strong>: The recommended <code>fee_limit</code> for the user to set is 200,000 sun.</li>
1873
1873
</ul>
1874
1874
<p><aid="energy-mechanism"></a></p>
1875
-
<h3id="3-energy-consumption-mechanism">3. Energy Consumption Mechanism<aclass="headerlink" href="#3-energy-consumption-mechanism" title="Permanent link">¶</a></h3>
<p><strong>Basic Energy Consumption Rules</strong></p>
1877
1877
<p>When executing smart contract transactions, the system calculates and deducts the Energy required for each instruction sequentially. The consumption of Energy in an account follows these priority principles:</p>
1878
1878
<ol>
@@ -1967,10 +1967,14 @@ <h3 id="how-to-delegate-resources">How to Delegate Resources<a class="headerlink
1967
1967
<h3id="how-to-unstake">How to Unstake<aclass="headerlink" href="#how-to-unstake" title="Permanent link">¶</a></h3>
1968
1968
<p>After staking TRX, you can initiate an unstake operation at any time using the <code>unfreezebalancev2</code> API. However, this process has a time delay and follows specific rules.</p>
1969
1969
<p>After staking TRX, you can initiate an unstake operation at any time using the <code>unfreezebalancev2</code> API. After initiating an unstake, your TRX enters a 14-day pending period. This pending period is TRON network parameter <ahref="https://tronscan.io/#/sr/committee">#70</a> and can be changed in the future through network governance. After the 14-day period has ended, you can withdraw the funds to your account balance using the <code>withdrawexpireunfreeze</code> API.</p>
1970
-
<p>!!! <strong>Important Notes</strong>
1971
-
* <strong>Delegated Resources Cannot Be Unstaked:</strong> You cannot unstake TRX corresponding to resources that are currently delegated. You must first reclaim the resources using <code>undelegateresource</code> before you can unstake that portion of TRX.
1972
-
* <strong>Resource Reclamation:</strong> Unstaking will cause the resources (Energy or Bandwidth) and TRON Power (TP) corresponding to the staked TRX to be synchronously reclaimed by the system. As a result, you will lose the respective Energy or Bandwidth and an equivalent amount of TP.
1973
-
* <strong>Concurrent Operation Limit:</strong> You can have a maximum of 32 unstake operations in the 14-day pending period at any one time. Use the <code>getavailableunfreezecount</code> endpoint to check your remaining unstake capacity.</p>
1970
+
<divclass="admonition important notes">
1971
+
<pclass="admonition-title">Important</p>
1972
+
<ul>
1973
+
<li><strong>Delegated Resources Cannot Be Unstaked:</strong> You cannot unstake TRX corresponding to resources that are currently delegated. You must first reclaim the resources using <code>undelegateresource</code> before you can unstake that portion of TRX.</li>
1974
+
<li><strong>Resource Reclamation:</strong> Unstaking will cause the resources (Energy or Bandwidth) and TRON Power (TP) corresponding to the staked TRX to be synchronously reclaimed by the system. As a result, you will lose the respective Energy or Bandwidth and an equivalent amount of TP.</li>
1975
+
<li><strong>Concurrent Operation Limit:</strong> You can have a maximum of 32 unstake operations in the 14-day pending period at any one time. Use the <code>getavailableunfreezecount</code> endpoint to check your remaining unstake capacity.</li>
1976
+
</ul>
1977
+
</div>
1974
1978
<p><strong>Automatic Effects of Unstaking</strong>: Calling <code>unfreezebalancev2</code> not only initiates a new unstaking process, but it also automatically withdraws any TRX that has already completed its 14-day pending period.</p>
1975
1979
<p><strong>How to Verify Withdrawn Amount</strong>: To find out exactly how much unstaked TRX was automatically withdrawn during a specific unstaking operation, you can query the details of that unstake transaction using the <code>gettransactioninfobyid</code> API and look for the field <code>withdraw_expire_amount</code>, which shows the amount of matured unstaked TRX that was automatically withdrawn in this transaction.</p>
1976
1980
<h4id="reclaiming-tron-power">Reclaiming TRON Power<aclass="headerlink" href="#reclaiming-tron-power" title="Permanent link">¶</a></h4>
@@ -2012,11 +2016,11 @@ <h4 id="reclaiming-tron-power">Reclaiming TRON Power<a class="headerlink" href="
2012
2016
</ol>
2013
2017
</li>
2014
2018
</ul>
2015
-
<p>!!! Important Distinction: Stake 1.0 vs. Stake 2.0
2016
-
Although Stake 2.0 is the current standard, TRX staked via the legacy Stake 1.0 system is still valid and can be redeemed using its corresponding <code>wallet/unfreezebalance</code> API.</p>
2017
-
<divclass="codehilite"><pre><span></span><code>Unstaking TRX from Stake 1.0 will revoke **all** of the account's votes.
2018
-
</code></pre></div>
2019
-
2019
+
<divclass="admonition note">
2020
+
<pclass="admonition-title">Note</p>
2021
+
<p>Stake 1.0 vs. Stake 2.0</p>
2022
+
<p>Although Stake 2.0 is the current standard, TRX staked via the legacy Stake 1.0 system is still valid and can be redeemed using its corresponding <code>wallet/unfreezebalance</code> API. Unstaking TRX from Stake 1.0 will revoke <strong>all</strong> of the account's votes.</p>
2023
+
</div>
2020
2024
<h3id="how-to-cancel-all-unstaking-requests">How to Cancel All Unstaking Requests<aclass="headerlink" href="#how-to-cancel-all-unstaking-requests" title="Permanent link">¶</a></h3>
2021
2025
<p>If you initiate an unstake but change your mind, Stake 2.0 provides an efficient "cancel" feature. You can use the <code>cancelallunfreezev2</code> API to immediately cancel all pending unstake requests, bypassing the 14-day pending period, and get your resources back immediately.</p>
2022
2026
<p><strong>Please note</strong>: this endpoint cancels all of your account's unstaking requests that are currently in the 14-day pending period.</p>
0 commit comments