- A command-line wallet for the TRON network — interactive in Java, agent-first in TypeScript
+ A command-line wallet for the TRON network — interactive in Java, agent-first in TypeScript
@@ -9,7 +9,7 @@
-
+
This repository holds **two independent implementations** that share the same purpose but target different users:
@@ -21,19 +21,19 @@ Both manage the same kind of wallet on the same networks — your address is ide
## At a glance
-| | [**Java**](java/README.md) — the original | [**TypeScript**](ts/README.md) — agent-first rewrite |
-| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **What it is** | The mature, full-feature reference CLI. | A newer rewrite focused on programmatic integration. |
-| **Runtime** | JVM — built with Gradle, run as a `.jar`. Uses the [Trident](https://github.com/tronprotocol/trident) SDK. | [Node.js](https://nodejs.org) **20+**. |
-| **Install** | `git clone` + `./gradlew build` (see [Setup](java/README.md#setup)) | `npm install -g @tron-walletcli/wallet-cli` |
-| **How you drive it** | An **interactive prompt only** — start it, then type commands at `>`. | **One-shot subcommands** — `wallet-cli ` from your shell. Interactive prompts only for secret input. |
-| **Command style** | PascalCase verbs: `RegisterWallet`, `SendCoin`, `GetBalance`. Amounts in **SUN** (1 TRX = 1,000,000 SUN). | Noun-verb subcommands: `create`, `tx send`, `account balance`, with `--flags`. |
-| **Output for scripts** | Human-readable text. | Stable JSON via `-o json` ([`wallet-cli.result.v1`](ts/docs/machine-interface.md)) + fixed exit codes (`0`/`1`/`2`). |
-| **Config / networks** | `config.conf` (net type + full node), or `SwitchNetwork` at runtime. Mainnet · Nile · Shasta · custom. | `--network` flag / `config` command. `tron:mainnet` · `tron:nile` · `tron:shasta`. |
-| **Signing** | Software keystore · Ledger. | Encrypted local keystore · Ledger. Secrets never via argv/env. |
-| **Feature scope** | **The full surface** — plus GasFree gas-less transfers, TRC10 token issuance, on-chain DEX & governance/proposals, and TronLink multi-sig. | **Core wallet ops** — HD wallets, TRX/TRC20/TRC10 transfers, staking & delegation, voting & rewards, contract call/deploy, message signing, and on-chain queries. |
-| **Best for** | People at a terminal who want every TRON capability. | Scripting, CI pipelines, and AI agents. |
-| **Full docs** | [java/README.md](java/README.md) | [ts/README.md](ts/README.md) |
+| | [**Java**](java/README.md) — the original | [**TypeScript**](ts/README.md) — agent-first rewrite |
+| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **What it is** | The mature, full-feature reference CLI. | A newer rewrite focused on programmatic integration. |
+| **Runtime** | JVM — built with Gradle, run as a `.jar`. Uses the [Trident](https://github.com/tronprotocol/trident) SDK. | [Node.js](https://nodejs.org) **20+**. |
+| **Install** | `git clone` + `./gradlew build` (see [Setup](java/README.md#setup)) | `npm install -g @tron-walletcli/wallet-cli` |
+| **How you drive it** | An **interactive prompt only** — start it, then type commands at `>`. | **One-shot subcommands** — `wallet-cli ` from your shell. Interactive prompts only for secret input. |
+| **Command style** | PascalCase verbs: `RegisterWallet`, `SendCoin`, `GetBalance`. Amounts in **SUN** (1 TRX = 1,000,000 SUN). | Noun-verb subcommands: `create`, `tx send`, `account balance`, with `--flags`. |
+| **Output for scripts** | Human-readable text. | Stable JSON via `-o json` ([`wallet-cli.result.v1`](ts/docs/machine-interface.md)) + fixed exit codes (`0`/`1`/`2`). |
+| **Config / networks** | `config.conf` (net type + full node), or `SwitchNetwork` at runtime. Mainnet · Nile · Shasta · custom. | `--network` flag / `config` command. `tron:mainnet` · `tron:nile` · `tron:shasta`. |
+| **Signing** | Software keystore · Ledger. | Encrypted local keystore · Ledger. Secrets never via argv/env. |
+| **Feature scope** | **The full surface** — everything in the TypeScript column, plus TRC10 token issuance and on-chain DEX & governance/proposals. | **Core wallet ops** — HD wallets, TRX/TRC20/TRC10 transfers, staking & delegation, voting & rewards, contract call/deploy, multi-sig, GasFree transfers, message signing, and on-chain queries. |
+| **Best for** | People at a terminal who want every TRON capability. | Scripting, CI pipelines, and AI agents. |
+| **Full docs** | [java/README.md](java/README.md) | [ts/README.md](ts/README.md) |
## Java — get a taste
@@ -72,5 +72,5 @@ Every command has a reference page, and the JSON contract, exit codes, and agent
## Which should I use?
- **Scripting, CI, or building an AI agent?** → the [TypeScript version](ts/README.md) — the JSON envelope and deterministic exit codes exist for exactly this.
-- **Working interactively and want the complete TRON toolkit** — GasFree, TRC10 issuance, on-chain DEX/governance, or multi-sig? → the [Java version](java/README.md).
+- **Working interactively and want the complete TRON toolkit** — TRC10 issuance, or on-chain DEX/governance/proposals? → the [Java version](java/README.md).
- **Just sending TRX/tokens or staking from your own machine?** → either works; the TypeScript CLI is the lighter install (`npm install -g`, no build step).
diff --git a/java/README.md b/java/README.md
index b64f438f1..46462fe76 100644
--- a/java/README.md
+++ b/java/README.md
@@ -4,15 +4,17 @@ The original, full-featured implementation of wallet-cli: an interactive prompt
> For what wallet-cli is and how this compares to the scriptable, JSON-first [TypeScript implementation](../ts/README.md), see the [repository overview](../README.md).
-**Quick links:** [Setup](#setup) · [Quickstart](#quickstart) · [Contents](#contents) · [Commands](#commands) · [Configuration](#configuration) · [GasFree](#gasfree)
+**Quick links:** [Setup](#setup) · [Quickstart](#quickstart) · [Commands](#commands) · [Understanding TRON mechanics](#understanding-tron-mechanics) · [Configuration](docs/reference/config.md)
Need help? Join the [Telegram developer group](https://t.me/TronOfficialDevelopersGroupEn).
## Setup
-### Download Wallet-cli
+### Download
- git clone https://github.com/tronprotocol/wallet-cli.git
+```
+git clone https://github.com/tronprotocol/wallet-cli.git
+```
### Configuration
@@ -30,94 +32,12 @@ fullnode = {
}
```
-You can also switch networks at runtime with the `SwitchNetwork` command — see [Switch network](#switch-network) — so editing `config.conf` is only needed for a custom node or the advanced features below.
-
-
-Full annotated config — optional Solidity node, Ledger debug, account lock, GasFree, TronGrid API key, TronLink multi-sig, and record limits
-
-```
-net {
- type = mainnet
-}
-
-fullnode = {
- ip.list = [
- "fullnode ip : port"
- ]
-}
-
-#soliditynode = {
-# //The IPs in this list can only be totally set to solidity.
-# ip.list = [
-# "ip : solidity port" // default solidity
-# ]
-# // NOTE: solidity node is optional
-#}
-
-# open ledger debug
-# ledger_debug = true
-
-# To use the lock and unlock function of the login account, it is necessary to configure
-# lockAccount = true in the config.conf. The current login account is locked, which means that
-# signatures and transactions are not allowed. After the current login account is locked, it can be
-# unlocked. By default, it will be unlocked again after 300 seconds. Unlocking can specify
-# parameters in seconds.
-
-# lockAccount = true
-
-# To use the gasfree feature, please first apply for an APIkey and apiSecret.
-# For details, please refer to
-# https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform
-gasfree = {
- mainnet = {
- apiKey = ""
- apiSecret = ""
- }
- testnet = {
- apiKey = ""
- apiSecret = ""
- }
-}
-
-# If gRPC requests on the main network are limited in speed, you can apply for an apiKey of Trongrid to improve the user experience
-grpc = {
- mainnet = {
- apiKey = ""
- }
-}
-
-# Set the maximum number of transactions and backup records that can be retained
-maxRecords = 1000
-
-# To use the tronlink multi-sign feature, please first apply for an secretId and secretKey.
-# For details, please refer to
-# https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform
-# If you prefer not to apply, a speed-limited secretId and secretKey will be provided for use:
-# secretId = "TEST", secretKey = "TESTTESTTEST", channel = "test".
-tronlink = {
- mainnet = {
- secretId = ""
- secretKey = ""
- channel = ""
- }
- testnet = {
- secretId = ""
- secretKey = ""
- channel = ""
- }
-}
-```
-
-
+You can also switch networks at runtime with the [`SwitchNetwork`](docs/commands/network.md) command, so editing `config.conf` is only needed for a custom node or advanced features. The **full annotated config** — optional Solidity node, Ledger debug, account lock, GasFree, TronGrid API key, TronLink multi-sig, and record limits — and a field-by-field reference are in [docs/reference/config.md](docs/reference/config.md).
### Build and run
-- connect to fullNode
-
- Take a look at: [java-tron deployment](https://tronprotocol.github.io/documentation-en/developers/deployment/)
- Run fullNode on either your local PC or a remote server.
-
-- compile and run web wallet
+- **Connect to fullNode** — see [java-tron deployment](https://tronprotocol.github.io/documentation-en/developers/deployment/). Run a fullNode on either your local PC or a remote server.
+- **Compile and run**:
```console
$ cd wallet-cli
@@ -126,11 +46,7 @@ tronlink = {
$ java -jar wallet-cli.jar
```
-### Connect to Java-tron
-
-Wallet-cli connects to Java-tron via the gRPC protocol, which can be deployed locally or remotely. Check the **Build and run** section.
-We can configure Java-tron node IP and port in ``src/main/resources/config.conf``, so that wallet-cli server can successfully talk to java-tron nodes.
-Besides that, you can simply use `SwitchNetwork` command to switch among the mainnet, testnets(Nile and Shasta) and custom networks. Please refer to the Switch Network section.
+wallet-cli connects to java-tron via the gRPC protocol, which can be deployed locally or remotely. Configure the java-tron node IP and port in `src/main/resources/config.conf`, or use `SwitchNetwork` to switch among mainnet, testnets (Nile and Shasta), and custom networks.
## Quickstart
@@ -156,2628 +72,57 @@ $ java -jar wallet-cli.jar
> On mainnet these commands move **real funds**. While learning, switch to a testnet with `SwitchNetwork` (Nile or Shasta) and top up from that network's faucet.
-## Contents
-
-Grouped by task — see the [alphabetical command index](#commands) below for a full A–Z list.
-
-- **Setup** — [Setup](#setup) · [Quickstart](#quickstart) · [Build and run](#build-and-run) · [Switch network](#switch-network) · [Current network](#current-network)
-- **Wallets & accounts** — [Create account](#how-to-create-account) · [Wallet commands](#wallet-related-commands) · [Account commands](#account-related-commands) · [Sub accounts](#generate-sub-account) · [Import/export mnemonic](#import-and-export-mnemonic) · [Import/export keystore](#export-import-wallet-keystore) · [Import by Ledger](#import-wallet-by-ledger) · [Login all](#login-all) / [Logout](#logout) · [Lock](#lock) / [Unlock](#unlock)
-- **Transfers & tokens** — [Issue a TRC10 token](#how-to-issue-a-trc10-token) · [TRC10 token info](#how-to-obtain-trc10-token-information) · [Get USDT balance](#get-usdt-balance) · [Transfer USDT](#transfer-usdt) · [Address book](#address-book)
-- **Staking & resources** — [FreezeV2 (Stake 2.0)](#how-to-freezev2) · [Delegate resource](#how-to-delegate-resource) · [Freeze/unfreeze (Stake 1.0, legacy)](#how-to-freezeunfreeze-balance) · [Bandwidth](#how-to-calculate-bandwidth) · [Resource prices & memo fee](#get-resource-prices-and-memo-fee) · [Withdraw balance](#how-to-withdraw-balance)
-- **Voting & rewards** — [Vote](#how-to-vote) · [Brokerage & rewards](#brokerage) · [Create witness](#how-to-create-witness)
-- **Smart contracts** — [Use smart contracts](#how-to-use-smart-contract)
-- **Governance & exchange** — [Proposals](#how-to-operate-with-proposal) · [On-chain exchange](#how-to-trade-on-the-exchange) · [TRON-DEX (market)](#how-to-use-tron-dex-to-sell-asset) · [Multi-signature](#how-to-use-the-multi-signature-feature-of-wallet-cli)
-- **GasFree** — [GasFree support](#gasfree)
-- **Chain data** — [Transaction info](#how-to-get-transaction-information) · [Block info](#how-to-get-block-information) · [Chain parameters](#get-chain-parameters)
+The full first-run walkthrough is in the [getting-started guide](docs/guide/getting-started.md); for a worked end-to-end session, see the [command-line operation flow](docs/guide/command-flow.md). All guides are indexed in [docs/guide/](docs/guide/index.md).
## Commands
-The alphabetical index below links every command to its section. For usage of a specific command, just type it in the terminal after you start the wallet.
-
-| [AddTransactionSign](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [AddressBook](#address-book) | [ApproveProposal](#Approve--disapprove-a-proposal) |
-|:--------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|
-| [AssetIssue](#Issue-trc10-tokens) | [BackupWallet](#Wallet-related-commands) | [BackupWallet2Base64](#Wallet-related-commands) |
-| [BroadcastTransaction](#Some-others) | [CancelAllUnfreezeV2](#How-to-freezev2) | [ChangePassword](#Wallet-related-commands) |
-| [ClearContractABI](#clear-contract-abi) | [ClearWalletKeystore](#clear-wallet-keystore) | [Create2](#create2) |
-| [CreateAccount](#create-account) | [CreateProposal](#Initiate-a-proposal) | [CreateWitness](#create-witness) |
-| [CurrentNetwork](#current-network) | [DelegateResource](#How-to-freezev2) | [DeleteProposal](#Delete-an-existed-proposal) |
-| [DeployContract](#How-to-use-smart-contract) | [EstimateEnergy](#estimate-energy) | [ExchangeCreate](#How-to-trade-on-the-exchange) |
-| [ExchangeInject](#How-to-trade-on-the-exchange) | [ExchangeTransaction](#How-to-trade-on-the-exchange) | [ExchangeWithdraw](#How-to-trade-on-the-exchange) |
-| [ExportWalletKeystore](#export-import-wallet-keystore) | [ExportWalletMnemonic](#import-and-export-mnemonic) | [FreezeBalance](#Delegate-resource) |
-| [FreezeBalanceV2](#How-to-freezev2) | [GasFreeInfo](#gas-free-info) | [GasFreeTrace](#gas-free-trace) |
-| [GasFreeTransfer](#gas-free-transfer) | [GenerateAddress](#Account-related-commands) | [GenerateSubAccount](#generate-sub-account) |
-| [GetAccount](#Account-related-commands) | [GetAccountById](#get-account-by-id) | [GetAccountNet](#Account-related-commands) |
-| [GetAccountResource](#Account-related-commands) | [GetAddress](#Account-related-commands) | [GetAssetIssueByAccount](#How-to-obtain-trc10-token-information) |
-| [GetAssetIssueById](#How-to-obtain-trc10-token-information) | [GetAssetIssueByName](#How-to-obtain-trc10-token-information) | [GetAssetIssueListByName](#How-to-obtain-trc10-token-information) |
-| [GetAvailableUnfreezeCount](#How-to-freezev2) | [GetBalance](#Account-related-commands) | [GetBandwidthPrices](#Get-resource-prices-and-memo-fee) |
-| [GetBlock](#How-to-get-block-information) | [GetBlockById](#How-to-get-block-information) | [GetBlockByIdOrNum](#How-to-get-block-information) |
-| [GetBlockByLatestNum](#How-to-get-block-information) | [GetBlockByLimitNext](#How-to-get-block-information) | [GetBrokerage](#Brokerage) |
-| [GetCanDelegatedMaxSize](#How-to-freezev2) | [GetCanWithdrawUnfreezeAmount](#How-to-freezev2) | [GetChainParameters](#get-chain-parameters) |
-| [GetContract](#Get-details-of-a-smart-contract) | [GetContractInfo](#get-info-of-a-smart-contract) | [GetDelegatedResource](#How-to-delegate-resource) |
-| [GetDelegatedResourceAccountIndex](#How-to-delegate-resource) | [GetDelegatedResourceAccountIndexV2](#How-to-freezev2) | [GetDelegatedResourceV2](#How-to-freezev2) |
-| [GetEnergyPrices](#Get-resource-prices-and-memo-fee) | [GetExchange](#get-exchange-by-id) | [GetMarketOrderByAccount](#How-to-use-tron-dex-to-sell-asset) |
-| [GetMarketOrderById](#How-to-use-tron-dex-to-sell-asset) | [GetMarketOrderListByPair](#How-to-use-tron-dex-to-sell-asset) | [GetMarketPairList](#How-to-use-tron-dex-to-sell-asset) |
-| [GetMarketPriceByPair](#How-to-use-tron-dex-to-sell-asset) | [GetMemoFee](#Get-resource-prices-and-memo-fee) | [GetNextMaintenanceTime](#Some-others) |
-| [GetProposal](#Obtain-proposal-information) | [GetReward](#Brokerage) | [GetTransactionApprovedList](#How-to-use-the-multi-signature-feature-of-wallet-cli) |
-| [GetTransactionById](#How-to-get-transaction-information) | [GetTransactionCountByBlockNum](#How-to-get-transaction-information) | [GetTransactionInfoByBlockNum](#How-to-get-transaction-information) |
-| [GetTransactionInfoById](#How-to-get-transaction-information) | [GetTransactionSignWeight](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [GetUSDTBalance](#get-usdt-balance) |
-| [GetUsdtTransferById](#get-usdt-transfer-by-id) | [ImportWallet](#Wallet-related-commands) | [ImportWalletByBase64](#Wallet-related-commands) |
-| [ImportWalletByKeystore](#export-import-wallet-keystore) | [ImportWalletByLedger](#import-wallet-by-ledger) | [ImportWalletByMnemonic](#import-and-export-mnemonic) |
-| [ListAssetIssue](#How-to-obtain-trc10-token-information) | [ListAssetIssuePaginated](#list-asset-issue-paginated) | [ListExchanges](#How-to-trade-on-the-exchange) |
-| [ListExchangesPaginated](#How-to-trade-on-the-exchange) | [ListNodes](#Some-others) | [ListProposals](#Obtain-proposal-information) |
-| [ListProposalsPaginated](#Obtain-proposal-information) | [ListWitnesses](#Some-others) | [Lock](#lock) |
-| [Login](#Command-line-operation-flow-example) | [LoginAll](#login-all) | [Logout](#logout) |
-| [MarketCancelOrder](#How-to-use-tron-dex-to-sell-asset) | [MarketSellAsset](#How-to-use-tron-dex-to-sell-asset) | [ModifyWalletName](#Modify-wallet-name) |
-| [ParticipateAssetIssue](#Participating-in-the-issue-of-trc10-token) | [RegisterWallet](#Wallet-related-commands) | [ResetWallet](#reset-wallet) |
-| [SendCoin](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [SetAccountId](#set-account-id) | [ShowReceivingQrCode](#show-receiving-qr-code) |
-| [SwitchNetwork](#switch-network) | [SwitchWallet](#switch-wallet) | [TransferAsset](#Trc10-token-transfer) |
-| [TransferUSDT](#transfer-usdt) | [TriggerConstantContract](#trigger-constant-contract) | [TriggerContract](#trigger-smart-contract) |
-| [UnDelegateResource](#How-to-freezev2) | [UnfreezeAsset](#Unfreeze-trc10-token) | [UnfreezeBalance](#How-to-delegate-resource) |
-| [UnfreezeBalanceV2](#How-to-freezev2) | [Unlock](#unlock) | [UpdateAccount](#update-account) |
-| [UpdateAccountPermission](#How-to-use-the-multi-signature-feature-of-wallet-cli) | [UpdateAsset](#Update-parameters-of-trc10-token) | [UpdateBrokerage](#Brokerage) |
-| [UpdateEnergyLimit](#Update-smart-contract-parameters) | [UpdateSetting](#Update-smart-contract-parameters) | [UpdateWitness](#update-witness) |
-| [ViewBackupRecords](#View-backup-records) | [ViewTransactionHistory](#View-transaction-history) | [VoteWitness](#How-to-vote) |
-| [WithdrawBalance](#withdraw-balance) | [WithdrawExpireUnfreeze](#withdraw-expire-unfreeze) | [TronlinkMultiSign](#tronlink-multi-sign) |
-| [EncodingConverter](#encoding-converter) | [GetPrivateKeyByMnemonic](#How-to-get-privateKey-through-mnemonic) | [GetPaginatedNowWitnessList](#Get-paginated-now-witness-list) |
-
-
-Type any one of the listed commands, to display how-to tips.
-
-## How to freeze/unfreeze balance
-
-After the funds are frozen, the corresponding number of shares and bandwidth will be obtained.
-Shares can be used for voting and bandwidth can be used for trading.
-The rules for the use and calculation of share and bandwidth are described later in this article.
-
-**Freeze operation is as follows:**
-
-```console
-> freezeBalance [OwnerAddress] frozen_balance frozen_duration [ResourceCode:0 BANDWIDTH, 1 ENERGY] [receiverAddress]
-```
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-frozen_balance
-> The amount of frozen funds, the unit is Sun.
-> The minimum value is **1000000 Sun(1TRX)**.
-
-frozen_duration
-> Freeze time, this value is currently only allowed for **3 days**.
-
-For example:
-
-```console
-> freezeBalance 100000000 3 1 address
-```
-
-After the freeze operation, frozen funds will be transferred from Account Balance to Frozen,
-You can view frozen funds from your account information.
-After being unfrozen, it is transferred back to Balance by Frozen, and the frozen funds cannot be used for trading.
-
-When more share or bandwidth is needed temporarily, additional funds may be frozen to obtain additional share and bandwidth.
-The unfrozen time is postponed until 3 days after the last freeze operation
-
-After the freezing time expires, funds can be unfroze.
-
-**Unfreeze operation is as follows:**
-
-```console
-> unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH, 1 CPU) [receiverAddress]
-```
-
-## How to vote
-
-Voting requires share. Share can be obtained by freezing funds.
-
-- The share calculation method is: **1** unit of share can be obtained for every **1TRX** frozen.
-- After unfreezing, previous vote will expire. You can avoid the invalidation of the vote by re-freezing and voting.
-
-**NOTE** The Tron Network only records the status of your last vote, which means that each of your votes will overwrite all previous voting results.
-
-For example:
-
-```console
-> freezeBalance 100000000 3 1 address # Freeze 10TRX and acquire 10 units of shares
-
-> votewitness 123455 witness1 4 witness2 6 # Cast 4 votes for witness1 and 6 votes for witness2 at the same time
-
-> votewitness 123455 witness1 10 # Voted 10 votes for witness1
-```
-
-The final result of the above command was 10 votes for witness1 and 0 vote for witness2.
-
-## Brokerage
-
-After voting for the witness, you will receive the rewards. The witness has the right to decide the ratio of brokerage. The default ratio is 20%, and the witness can adjust it.
-
-By default, if a witness is rewarded, he will receive 20% of the whole rewards, and 80% of the rewards will be distributed to his voters.
-
-### GetBrokerage
-
-View the ratio of brokerage of the witness.
-
- > getbrokerage OwnerAddress
-
-OwnerAddress
-> The address of the witness's account, it is a base58check type address.
-
-### GetReward
-
-Query unclaimed reward.
-
- > getreward OwnerAddress
-
-OwnerAddress
-> The address of the voter's account, it is a base58check type address.
-
-### UpdateBrokerage
-
-Update the ratio of brokerage, this command is usually used by a witness account.
-
- > updateBrokerage OwnerAddress brokerage
-
-OwnerAddress
-> The witness's account address is a base58check type address.
-
-brokerage
-> The ratio of brokerage you want to update, from 0 to 100. If the input is 10, it means 10% of the total reward would be distributed to the SR and the rest would be rewarded to all the voters, which is 90% in this case
-
-For example:
-
-```console
-> getbrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h
-
-> getreward TNfu3u8jo1LDWerHGbzs2Pv88Biqd85wEY
-
-> updateBrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h 30
-```
-
-### withdraw balance
-
-> WithdrawBalance [owner_address]
-
-Withdraw voting or block rewards.
-
-Example:
-
-```console
-> WithdrawBalance TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp
-```
-
-## How to calculate bandwidth
-
-The bandwidth calculation rule is:
-
- constant * FrozenFunds * days
-
-Assuming freeze 1TRX(1_000_000 Sun), 3 days, bandwidth obtained = 1 * 1_000_000 * 3 = 3_000_000.
-
-All contracts consume bandwidth, including transferring, transferring of assets, voting, freezing, etc.
-Querying does not consume bandwidth. Each contract needs to consume **100_000 bandwidth**.
-
-If a contract exceeds a certain time (**10s**), this operation does not consume bandwidth.
-
-When the unfreezing operation occurs, the bandwidth is not cleared.
-The next time the freeze is performed, the newly added bandwidth is accumulated.
-
-## How to withdraw balance
-
-After each block is produced, the block award is sent to the account's allowance,
-and a withdraw operation is allowed every **24 hours** from allowance to balance.
-The funds in allowance cannot be locked or traded.
-
-## How to create witness
-
-Applying to become a witness account needs to consume **100_000TRX**.
-This part of the funds will be burned directly.
-
-### create witness
-> CreateWitness [owner_address] url
-Apply to become a super representative candidate.
-
-Example:
-```console
-> CreateWitness TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 007570646174654e616d6531353330363038383733343633
-```
-
-### update witness
-> UpdateWitness
-Edit the URL of the SR's official website.
-
-Example:
-```console
-> UpdateWitness TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 007570646174654e616d6531353330363038383733343633
-```
-
-## How to create account
-
-You can create accounts by transferring funds to non-existing accounts or initiating a transaction to create an account using the **CreateAccount** command.
-Transferring to a non-existent account has minimum restriction amount of **1TRX**.
-Creating an account through the CreateAccount command will still burn **1TRX**.
-
-
-## Command line operation flow example
-
-```console
-$ cd wallet-cli
-$ ./gradlew build
-$ ./gradlew run
-> RegisterWallet 123456 (password = 123456)
-> login 123456
-> getAddress
-address = TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm' # backup it!
-> BackupWallet 123456
-priKey = 1234567890123456789012345678901234567890123456789012345678901234 # backup it!!! (BackupWallet2Base64 option)
-> getbalance
-Balance = 0
-> AssetIssue TestTRX TRX 75000000000000000 1 1 2 "2019-10-02 15:10:00" "2020-07-11" "just for test121212" www.test.com 100 100000 10000 10 10000 1
-> getaccount TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm
-(Print balance: 9999900000
-"assetV2": [
- {
- "key": "1000001",
- "value": 74999999999980000
- }
-],)
- # (cost trx 1000 trx for assetIssue)
- # (You can query the trx balance and other asset balances for any account )
-> TransferAsset TWzrEZYtwzkAxXJ8PatVrGuoSNsexejRiM 1000001 10000
-```
-
-## How to issue a TRC10 token
-
-Each account can only issue **ONE** TRC10 token.
-
-### Issue TRC10 tokens
-
-> AssetIssue [OwnerAddress] AssetName AbbrName TotalSupply TrxNum AssetNum Precision StartDate EndDate Description Url FreeNetLimitPerAccount PublicFreeNetLimit FrozenAmount0 FrozenDays0 [...] FrozenAmountN FrozenDaysN
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-AssetName
-> The name of the issued TRC10 token
-
-AbbrName
-> The abbreviation of TRC10 token
-
-TotalSupply
-> TotalSupply = Account Balance of Issuer + All Frozen Token Amount
-> TotalSupply: Total Issuing Amount
-> Account Balance Of Issuer: At the time of issuance
-> All Frozen Token Amount: Before asset transfer and the issuance
+Every command is documented on a family page under [docs/commands/](docs/commands/index.md). The **[command index](docs/commands/index.md)** has the full A–Z list linking each command to its section; in the wallet, typing any command shows its built-in usage tips.
-TrxNum, AssetNum
-> These two parameters determine the exchange rate when the token is issued.
-> Exchange Rate = TrxNum / AssetNum
-> AssetNum: Unit in base unit of the issued token
-> TrxNum: Unit in SUN (0.000001 TRX)
+### Wallets & accounts
-Precision
-> Precision to how many decimal places
+| Area | Page |
+|---|---|
+| Create / import / export / back up wallets, sub-accounts, login, lock, switch | [wallet](docs/commands/wallet.md) |
+| Account queries, metadata, backup & transaction records, receive QR | [account](docs/commands/account.md) |
+| Switch / show network | [network](docs/commands/network.md) |
-FreeNetLimitPerAccount
-> The maximum amount of bandwidth each account is allowed to use. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only)
+### Transfers & tokens
-PublicFreeNetLimit
-> The maximum total amount of bandwidth which is allowed to use for all accounts. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only)
+| Area | Page |
+|---|---|
+| USDT / TRC20 balance & transfers, address book | [usdt](docs/commands/usdt.md) |
+| Issue / update / transfer / query TRC10 tokens | [transfer-trc10](docs/commands/transfer-trc10.md) |
-StartDate, EndDate
-> The start and end date of token issuance. Within this period time, other users can participate in token issuance.
+### Staking & resources
-FrozenAmount0 FrozenDays0
-> Amount and days of token freeze.
-> FrozenAmount0: Must be bigger than 0
-> FrozenDays0: Must be between 1 and 3653.
+| Area | Page |
+|---|---|
+| FreezeV2 staking, delegation, unbonding (Stake 2.0) | [stake-v2](docs/commands/stake-v2.md) |
+| Legacy freeze / unfreeze / delegation (Stake 1.0) | [stake-v1-legacy](docs/commands/stake-v1-legacy.md) |
+| Resource unit prices & memo fee | [resources](docs/commands/resources.md) |
-Example:
+### Voting, rewards & governance
-```console
-> AssetIssue TestTRX TRX 75000000000000000 1 1 2 "2019-10-02 15:10:00" "2020-07-11" "just for test121212" www.test.com 100 100000 10000 10 10000 1
-> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View published information
-{
- "assetIssue": [
- {
- "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "name": "TestTRX",
- "abbr": "TRX",
- "total_supply": 75000000000000000,
- "frozen_supply": [
- {
- "frozen_amount": 10000,
- "frozen_days": 1
- },
- {
- "frozen_amount": 10000,
- "frozen_days": 10
- }
- ],
- "trx_num": 1,
- "precision": 2,
- "num": 1,
- "start_time": 1570000200000,
- "end_time": 1594396800000,
- "description": "just for test121212",
- "url": "www.test.com",
- "free_asset_net_limit": 100,
- "public_free_asset_net_limit": 100000,
- "id": "1000001"
- }
- ]
-}
-```
-
-### Update parameters of TRC10 token
-
-> UpdateAsset [OwnerAddress] newLimit newPublicLimit description url
-
-Specific meaning of the parameters is the same as that of AssetIssue.
-
-Example:
-
-```console
-> UpdateAsset 1000 1000000 "change description" www.changetest.com
-> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View the modified information
-{
- "assetIssue": [
- {
- "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "name": "TestTRX",
- "abbr": "TRX",
- "total_supply": 75000000000000000,
- "frozen_supply": [
- {
- "frozen_amount": 10000,
- "frozen_days": 1
- },
- {
- "frozen_amount": 10000,
- "frozen_days": 10
- }
- ],
- "trx_num": 1,
- "precision": 2,
- "num": 1,
- "start_time": 1570000200000,
- "end_time": 1594396800000,
- "description": "change description",
- "url": "www.changetest.com",
- "free_asset_net_limit": 1000,
- "public_free_asset_net_limit": 1000000,
- "id": "1000001"
- }
- ]
-}
-```
-
-### TRC10 token transfer
-
-> TransferAsset [OwnerAddress] ToAddress AssertID Amount
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-ToAddress
-> Address of the target account
-
-AssertName
-> TRC10 token ID
-> Example: 1000001
-
-Amount
-> The number of TRC10 token to transfer
-
-Example:
-
-```console
-> TransferAsset TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz 1000001 1000
-> getaccount TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz # View target account information after the transfer
-address: TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz
- assetV2
- {
- id: 1000001
- balance: 1000
- latest_asset_operation_timeV2: null
- free_asset_net_usageV2: 0
- }
-```
-
-### Participating in the issue of TRC10 token
-
- > ParticipateAssetIssue [OwnerAddress] ToAddress AssetID Amount
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-ToAddress
-> Account address of TRC10 issuers
-
-AssertName
-> TRC10 token ID
-> Example: 1000001
-
-Amount
-> The number of TRC10 token to transfers
-
-The participation process must happen during the release of TRC10, otherwise an error may occur.
-
-Example:
-
-```console
-> ParticipateAssetIssue TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ 1000001 1000
-> getaccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW # View remaining balance
-address: TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW
-assetV2
- {
- id: 1000001
- balance: 1000
- latest_asset_operation_timeV2: null
- free_asset_net_usageV2: 0
- }
-```
-### list asset issue paginated
-
-> ListAssetIssuePaginated address code salt
-
-Query the list of all the tokens by pagination.Returns a list of Tokens that succeed the Token located at offset.
-
-Example:
-
-```console
-> ListAssetIssuePaginated 0 1
-```
-
-### Unfreeze TRC10 token
-
-To unfreeze all TRC10 token which are supposed to be unfrozen after the freezing period.
-
- > unfreezeasset [OwnerAddress]
-
-## How to obtain TRC10 token information
-
-ListAssetIssue
-> Obtain all of the published TRC10 token information
-
-GetAssetIssueByAccount
-> Obtain TRC10 token information based on issuing address
-
-GetAssetIssueById
-> Obtain TRC10 token Information based on ID
-
-GetAssetIssueByName
-> Obtain TRC10 token Information based on names
-
-GetAssetIssueListByName
-> Obtain a list of TRC10 token information based on names
-
-## How to operate with proposal
-
-Any proposal-related operations, except for viewing operations, must be performed by committee members.
-
-### Initiate a proposal
-
- > createProposal [OwnerAddress] id0 value0 ... idN valueN
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-id0
-> The serial number of the parameter. Every parameter of TRON network has a serial number. Please refer to "http://tronscan.org/#/sr/committee"
-
-Value0
-> The modified value
-
-In the example, modification No.4 (modifying token issuance fee) costs 1000TRX as follows:
-
-```console
-> createProposal 4 1000
-> listproposals # View initiated proposal
-{
- "proposals": [
- {
- "proposal_id": 1,
- "proposer_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "parameters": [
- {
- "key": 4,
- "value": 1000
- }
- ],
- "expiration_time": 1567498800000,
- "create_time": 1567498308000
- }
- ]
-}
-```
-
-The corresponding id is 1.
-
-### Approve / Disapprove a proposal
-
- > approveProposal [OwnerAddress] id is_or_not_add_approval
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-id
-> ID of the initiated proposal
-> Example: 1
+| Area | Page |
+|---|---|
+| Vote for SRs, brokerage & rewards, witnesses | [vote-reward](docs/commands/vote-reward.md) |
+| Governance proposals | [proposals](docs/commands/proposals.md) |
+| On-chain exchange (Bancor) | [exchange](docs/commands/exchange.md) |
+| TRON-DEX order market | [dex](docs/commands/dex.md) |
+| Multi-signature: permissions, co-signing, TronLink multi-sign | [multisig](docs/commands/multisig.md) |
-is_or_not_add_approval
-> true for approve; false for disapprove
-
-Example:
-
-```console
-> ApproveProposal 1 true # in favor of the offer
-> ApproveProposal 1 false # Cancel the approved proposal
-```
-
-### Delete an existed proposal
-
- > deleteProposal [OwnerAddress] proposalId
-
-proposalId
-> ID of the initiated proposal
-> Example: 1
-
-The proposal must be canceled by the supernode that initiated the proposal.
-
-Example:
-
- > DeleteProposal 1
-
-### Obtain proposal information
-
-ListProposals
-> Obtain a list of initiated proposals
-
-ListProposalsPaginated
-> Use the paging mode to obtain the initiated proposal
-
-GetProposal
-> Obtain proposal information based on the proposal ID
-
-## How to trade on the exchange
-
-The trading and price fluctuations of trading pairs are in accordance with the Bancor Agreement,
-which can be found in TRON's [related documents](https://tronprotocol.github.io/documentation-en/clients/wallet-cli-command/#dex).
-
-### Create a trading pair
-
-> exchangeCreate [OwnerAddress] first_token_id first_token_balance second_token_id second_token_balance
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-First_token_id, first_token_balance
-> ID and amount of the first token
-
-second_token_id, second_token_balance
-> ID and amount of the second token
->
-> The ID is the ID of the issued TRC10 token.
-> If it is TRX, the ID is "_".
-> The amount must be greater than 0, and less than 1,000,000,000,000,000.
-
-Example:
-
-> exchangeCreate 1000001 10000 _ 10000
- # Create trading pairs with the IDs of 1000001 and TRX, with amount 10000 for both.
-
-### get exchange by id
-> getExchange
-Query exchange pair based on id (Confirmed state).
-
-Example:
-
-```console
-> getExchange 1
-```
-
-### Capital injection
-
-> exchangeInject [OwnerAddress] exchange_id token_id quant
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-exchange_id
-> The ID of the trading pair to be funded
-
-token_id, quant
-> TokenId and quantity (unit in base unit) of capital injection
-
-When conducting a capital injection, depending on its quantity (quant), a proportion
-of each token in the trading pair will be withdrawn from the account, and injected into the trading
-pair. Depending on the difference in the balance of the transaction, the same amount of money for
-the same token would vary.
-
-### Transactions
-
-> exchangeTransaction [OwnerAddress] exchange_id token_id quant expected
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-exchange_id
-> ID of the trading pair
-
-token_id, quant
-> The ID and quantity of tokens being exchanged, equivalent to selling
-
-expected
-> Expected quantity of another token
-
-expected must be less than quant, or an error will be reported.
-
-Example:
-
-> ExchangeTransaction 1 1000001 100 80
-
-It is expected to acquire the 80 TRX by exchanging 1000001 from the trading pair ID of 1, and the amount is 100.(Equivalent to selling an amount of 100 tokenID - 1000001, at a price of 80 TRX, in trading pair ID - 1).
-
-### Capital Withdrawal
-
-> exchangeWithdraw [OwnerAddress] exchange_id token_id quant
-
-OwnerAddress (optional)
-> The address of the account which initiated the transaction.
-> Default: the address of the login account.
-
-Exchange_id
-
->
-The ID of the trading pair to be withdrawn
-
-Token_id, quant
-> TokenId and quantity (unit in base unit) of capital withdrawal
-
-When conducting a capital withdrawal, depending on its quantity (quant), a proportion of each token
-in the transaction pair is withdrawn from the trading pair, and injected into the account. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary.
-
-### Obtain information on trading pairs
-
-ListExchanges
-> List trading pairs
-
-ListExchangesPaginated
-> List trading pairs by page
-
-## How to use the multi-signature feature of wallet-cli?
-
-Multi-signature allows other users to access the account in order to better manage it. There are
-three types of accesses:
-
-- owner: access to the owner of account
-- active: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes.
-- witness: only for witness, block production authorization will be granted to one of the other users.
-
-The rest of the users will be granted
-
-```console
-> Updateaccountpermission TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ {"owner_permission":{"type":0,"permission_name":"owner","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"witness_permission":{"type":1,"permission_name":"witness","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"active_permissions":[{"type":2,"permission_name":"active12323","threshold":2,"operations":"7fff1fc0033e0000000000000000000000000000000000000000000000000000","keys":[{"address":"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR","weight":1},{"address":"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP","weight":1}]}]}
-```
-or
-```console
-wallet> updateAccountPermission
-=== UpdateAccountPermission Interactive Mode ===
-
-Select permission to modify:
-1. owner_permission
-2. witness_permission
-3. active_permissions
-4. Add new active_permission
-5. Delete active_permission
-6. Show preview and Confirm
-7. Exit
->
-```
+### Contracts, GasFree & chain data
-The account TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ gives the owner access to itself, active access to
-TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR and TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP. Active access will
-need signatures from both accounts in order to take effect.
+| Area | Page |
+|---|---|
+| Deploy, trigger, and inspect smart contracts | [contract](docs/commands/contract.md) |
+| GasFree gas-less TRC20 transfers | [gasfree](docs/commands/gasfree.md) |
+| Transactions, blocks, chain parameters, encoding utilities | [chain-data](docs/commands/chain-data.md) |
-If the account is not a witness, it's not necessary to set witness_permission, otherwise an error will occur.
+## Understanding TRON mechanics
-### Signed transaction
+These are worth understanding up front to avoid surprises (all indexed in [docs/concepts/](docs/concepts/index.md)):
-> SendCoin TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 10000000000000000
-
-Will show "Please confirm and input your permission id, if input y or Y means default 0, other
-non-numeric characters will cancel transaction."
-
-This will require the transfer authorization of active access. Enter: 2
-
-Then select accounts and put in local password, i.e. TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR needs a
-private key TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR to sign a transaction.
-
-Select another account and enter the local password. i.e. TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP will
-need a private key of TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP to sign a transaction.
-
-The weight of each account is 1, threshold of access is 2. When the requirements are met, users
-will be notified with “Send 10000000000000000 Sun to TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW
-successful !!”.
-
-This is how multiple accounts user multi-signature when using the same cli.
-Use the instruction addTransactionSign according to the obtained transaction hex string if
-signing at multiple cli. After signing, the users will need to broadcast final transactions
-manually.
-
-## Obtain weight information according to transaction
-
- > getTransactionSignWeight
- 0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101
-
-The information displays as follows:
-
-```json
-{
- "result":{
- "code":"PERMISSION_ERROR",
- "message":"Signature count is 2 more than key counts of permission : 1"
- },
- "permission":{
- "operations":"7fff1fc0033e0100000000000000000000000000000000000000000000000000",
- "keys":[
- {
- "address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "weight":1
- }
- ],
- "threshold":1,
- "id":2,
- "type":"Active",
- "permission_name":"active"
- },
- "transaction":{
- "result":{
- "result":true
- },
- "txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
- "transaction":{
- "signature":[
- "c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
- "3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
- ],
- "txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "amount":10000000000000000,
- "owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
- },
- "type_url":"type.googleapis.com/protocol.TransferContract"
- },
- "type":"TransferContract",
- "Permission_id":2
- }
- ],
- "ref_block_bytes":"0318",
- "ref_block_hash":"60e195d3609c8661",
- "expiration":1554123306262,
- "timestamp":1554101706260
- },
- "raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
- }
- }
-}
-```
-
-### Get signature information according to transactions
-
- > getTransactionApprovedList
- 0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101
-
-```json
-{
- "result":{
-
- },
- "approved_list":[
- "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP",
- "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR"
- ],
- "transaction":{
- "result":{
- "result":true
- },
- "txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
- "transaction":{
- "signature":[
- "c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
- "3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
- ],
- "txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "amount":10000000000000000,
- "owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
- },
- "type_url":"type.googleapis.com/protocol.TransferContract"
- },
- "type":"TransferContract",
- "Permission_id":2
- }
- ],
- "ref_block_bytes":"0318",
- "ref_block_hash":"60e195d3609c8661",
- "expiration":1554123306262,
- "timestamp":1554101706260
- },
- "raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
- }
- }
-}
-```
-
-## How to use smart contract
-
-### deploy smart contracts
-
-> DeployContract [ownerAddress] contractName ABI byteCode constructor params isHex fee_limit consume_user_resource_percent origin_energy_limit value token_value token_id(e.g: TRXTOKEN, use # if don't provided) library:address,...>
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-contractName
-> Name of smart contract
-
-ABI
-> Compile generated ABI code
-
-byteCode
-> Compile generated byte code
-
-constructor, params, isHex
-> Define the format of the bytecode, which determines the way to parse byteCode from parameters
-
-fee_limit
-> Transaction allows for the most consumed TRX
-
-consume_user_resource_percent
-> Percentage of user resource consumed, in the range [0, 100]
-
-origin_energy_limit
-> The most amount of developer Energy consumed by trigger contract once
-
-value
-> The amount of trx transferred to the contract account
-
-token_value
-> Number of TRX10
-
-token_id
-> TRX10 Id
-
-Example:
-
-```
-> deployContract normalcontract544 [{"constant":false,"inputs":[{"name":"i","type":"uint256"}],"name": "findArgsByIndexTest","outputs":[{"name":"z","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
-608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029 # # false 1000000000 75 50000 0 0 #
-```
-
-Get the result of the contract execution with the getTransactionInfoById command:
-
-```console
-> getTransactionInfoById 4978dc64ff746ca208e51780cce93237ee444f598b24d5e9ce0da885fb3a3eb9
-{
- "id": "8c1f57a5e53b15bb0a0a0a0d4740eda9c31fbdb6a63bc429ec2113a92e8ff361",
- "fee": 6170500,
- "blockNumber": 1867,
- "blockTimeStamp": 1567499757000,
- "contractResult": [
- "6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029"
- ],
- "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
- "receipt": {
- "energy_fee": 6170500,
- "energy_usage_total": 61705,
- "net_usage": 704,
- "result": "SUCCESS"
- }
-}
-```
-
-### trigger smart contract
-
-> TriggerContract [ownerAddress] contractAddress method args isHex fee_limit value token_value token_id
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-contractAddress
-> Smart contract address
-
-method
-> The name of function and parameters, please refer to the example
-
-args
-> Parameter value, if you want to call `receive`, pass '#' instead
-
-isHex
-> The format of the parameters method and args, is hex string or not
-
-fee_limit
-> The most amount of trx allows for the consumption
-
-token_value
-> Number of TRX10
-
-token_id
-> TRC10 id, If not, use ‘#’ instead
-
-Example:
-
-```console
-> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest(uint256) 0 false
-1000000000 0 0 #
-# Get the result of the contract execution with the getTransactionInfoById command
-> getTransactionInfoById 7d9c4e765ea53cf6749d8a89ac07d577141b93f83adc4015f0b266d8f5c2dec4
-{
- "id": "de289f255aa2cdda95fbd430caf8fde3f9c989c544c4917cf1285a088115d0e8",
- "fee": 8500,
- "blockNumber": 2076,
- "blockTimeStamp": 1567500396000,
- "contractResult": [
- ""
- ],
- "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
- "receipt": {
- "energy_fee": 8500,
- "energy_usage_total": 85,
- "net_usage": 314,
- "result": "REVERT"
- },
- "result": "FAILED",
- "resMessage": "REVERT opcode executed"
-}
-```
-
-### trigger constant contract
-
-> TriggerConstantContract [ownerAddress] contractAddress method args isHex fee_limit value token_value token_id
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-contractAddress
-> Smart contract address
-
-method
-> The name of function and parameters, please refer to the example
-
-args
-> Parameter value, if you want to call `receive`, pass '#' instead
-
-isHex
-> The format of the parameters method and args, is hex string or not
-
-fee_limit
-> The most amount of trx allows for the consumption
-
-token_value
-> Number of TRX10
-
-token_id
-> TRC10 id, If not, use ‘#’ instead
-
-Example:
-
-```console
-> TriggerConstantContract TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true
-```
-
-### clear contract abi
-
-> ClearContractABI [ownerAddress] contractAddress
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-contractAddress
-> Contract address
-
-Example:
-
-```console
-> ClearContractABI TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs
-```
-
-### get details of a smart contract
-
-> GetContract contractAddress
-
-contractAddress
-> smart contract address
-
-Example:
-
-```console
-> GetContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG
-{
- "origin_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
- "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
- "abi": {
- "entrys": [
- {
- "name": "findArgsByIndexTest",
- "inputs": [
- {
- "name": "i",
- "type": "uint256"
- }
- ],
- "outputs": [
- {
- "name": "z",
- "type": "uint256"
- }
- ],
- "type": "Function",
- "stateMutability": "Nonpayable"
- }
- ]
- },
- "bytecode": "608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029",
- "consume_user_resource_percent": 75,
- "name": "normalcontract544",
- "origin_energy_limit": 50000,
- "code_hash": "23423cece3b4866263c15357b358e5ac261c218693b862bcdb90fa792d5714e6"
-}
-```
-### get info of a smart contract
-
-> GetContractInfo contractAddress
-
-contractAddress
-> smart contract address
-
-Example:
-
-```console
-> GetContractInfo TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG
-```
-
-### update smart contract parameters
-
-> UpdateEnergyLimit [ownerAddress] contract_address energy_limit # Update parameter energy_limit
-> UpdateSetting [ownerAddress] contract_address consume_user_resource_percent # Update parameter consume_user_resource_percent
-
-### create2
-
-> Create2 address code salt
-
-Predict the contract address generated after deploying a contract. Among them, address is the contract address for executing the create 2 instruction, code is the bytecode of the contract to be deployed, and salt is a random salt value.
-
-Example:
-
-```console
-> Create2 TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 5f805460ff1916600190811790915560649055606319600255 2132
-```
-
-### estimate-energy
-
-> EstimateEnergy owner_address(use # if you own) contract_address method args isHex [value token_value token_id(e.g: TRXTOKEN, use # if don't provided)]
-
-Estimate the energy required for the successful execution of smart contract transactions. (Confirmed state).
-
-Example:
-
-```console
-> EstimateEnergy TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true
-```
-
-## How to delegate resource
-
-### delegate resource
-
- > freezeBalance [OwnerAddress] frozen_balance frozen_duration [ResourceCode:0 BANDWIDTH, 1 ENERGY] [receiverAddress]
-
-The latter two parameters are optional parameters. If not set, the TRX is frozen to obtain
-resources for its own use; if it is not empty, the acquired resources are used by receiverAddress.
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-frozen_balance
-> The amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000sun.
-
-frozen_duration
-> frezen duration, 3 days
-
-ResourceCode
-> 0 BANDWIDTH;1 ENERGY
-
-receiverAddress
-> target account address
-
-### unfreeze delegated resource
-
- > unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH, 1 CPU) [receiverAddress]
-
-The latter two parameters are optional. If they are not set, the BANDWIDTH resource is unfreeze
-by default; when the receiverAddress is set, the delegate resources are unfreezed.
-
-### get resource delegation information
-
-getDelegatedResource fromAddress toAddress
-> get the information from the fromAddress to the toAddress resource delegate
-
-getDelegatedResourceAccountIndex address
-> get the information that address is delegated to other account resources
-
-
-## How to freezev2
-
-### freezev2/unfreezev2 resource
-
- > freezeBalanceV2 [OwnerAddress] frozen_balance [ResourceCode:0 BANDWIDTH,1 ENERGY,2 TRON_POWER]
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-frozen_balance
-> The amount of frozen, the unit is the smallest unit (Sun), the minimum is 1000000sun.
-
-ResourceCode
-> 0 BANDWIDTH;1 ENERGY
-
-Example:
-```console
-wallet> FreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000000000000 0
-txid is 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d
-wallet> GetTransactionById 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "4faa3772fa3d3e4792e8126cafed2dc2c5c069cd09c29532f0119bc982bf356004772e16fad86e401f5818c35b96d214d693efab06997ca2f07044d4494f12fd01"
- ],
- "txID":"82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "frozen_balance":1000000000000000,
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
- },
- "type_url":"type.googleapis.com/protocol.FreezeBalanceV2Contract"
- },
- "type":"FreezeBalanceV2Contract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671109891800,
- "timestamp":1671088291796
- },
- "raw_data_hex":"0a020000220819b59068c6058ff440d8ada5afd1305a5c083612580a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e747261637412200a154159e3741a68ec3e1ebba80ad809d5ccd31674236e1080809aa6eaafe30170d4fffea4d130"
-}
-```
-
- > unfreezeBalanceV2 [OwnerAddress] unfreezeBalance ResourceCode(0 BANDWIDTH,1 ENERGY,2 TRON_POWER)
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-unfreezeBalance
-> The amount of unfreeze, the unit is the smallest unit (Sun)
-
-ResourceCode
-> 0 BANDWIDTH;1 ENERGY
-
-Example:
-```console
-wallet> UnFreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 9000000 0
-txid is dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634
-wallet> GetTransactionById dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "f73a278f742c11e8e5ede693ca09b0447a804fcb28ea2bfdfd8545bb05da7be44bd08cfaa92bd4d159178f763fcf753f28d5296bd0c3d4557532cce3b256b9da00"
- ],
- "txID":"dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e",
- "unfreeze_balance":9000000
- },
- "type_url":"type.googleapis.com/protocol.UnfreezeBalanceV2Contract"
- },
- "type":"UnfreezeBalanceV2Contract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671119916913,
- "timestamp":1671098316907
- },
- "raw_data_hex":"0a020000220819b59068c6058ff440f19e89b4d1305a5a083712560a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121c0a154159e3741a68ec3e1ebba80ad809d5ccd31674236e10c0a8a50470ebf0e2a9d130"
-}
-```
-
-### delegate/undelegate resource
-
- > delegateResource [OwnerAddress] balance ResourceCode(0 BANDWIDTH,1 ENERGY), ReceiverAddress [lock]
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-balance
-> The amount of delegate, the unit is the smallest unit (Sun), the minimum is 1000000sun.
-
-ResourceCode
-> 0 BANDWIDTH;1 ENERGY
-
-ReceiverAddress
-> The address of the account
-
-lock
-> default is false, set true if need lock delegate for 3 days
-
-Example:
-```console
-wallet> DelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 10000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3 true
-txid is 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed
-wallet> GetTransactionById 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "1f57fd78456136faadc5091b47f5fd27a8e1181621e49129df6a4062499429fb48ee72e5f9a9ff5bfb7f2575f01f4076f7d4b89ca382d36af46a6fa4bc749f4301"
- ],
- "txID":"363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "balance":10000000,
- "receiver_address":"419a9afe56e155ef0ff3f680d00ecf19deff60bdca",
- "lock":true,
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
- },
- "type_url":"type.googleapis.com/protocol.DelegateResourceContract"
- },
- "type":"DelegateResourceContract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671120059226,
- "timestamp":1671098459216
- },
- "raw_data_hex":"0a020000220819b59068c6058ff440daf691b4d1305a720839126e0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412350a154159e3741a68ec3e1ebba80ad809d5ccd31674236e1880ade2042215419a9afe56e155ef0ff3f680d00ecf19deff60bdca280170d0c8eba9d130"
-}
-
-```
-
- > unDelegateResource [OwnerAddress] balance ResourceCode(0 BANDWIDTH,1 ENERGY), ReceiverAddress
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-balance
-> The amount of unDelegate, the unit is the smallest unit (Sun)
-
-ResourceCode
-> 0 BANDWIDTH;1 ENERGY
-
-ReceiverAddress
-> The address of the account
-
-Example:
-```console
-wallet> UnDelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3
-txid is feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c
-wallet> GetTransactionById feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "85a41a4e44780ffbe0841a44fd71cf621f129d98e84984cfca68e03364f781aa7f9d44177af0b40d82da052feec9f47a399ed6e51be66c5db07cb13477dcde8c01"
- ],
- "txID":"feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "balance":1000000,
- "receiver_address":"419a9afe56e155ef0ff3f680d00ecf19deff60bdca",
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
- },
- "type_url":"type.googleapis.com/protocol.UnDelegateResourceContract"
- },
- "type":"UnDelegateResourceContract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671120342283,
- "timestamp":1671098742280
- },
- "raw_data_hex":"0a020000220819b59068c6058ff4408b9aa3b4d1305a71083a126d0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412320a154159e3741a68ec3e1ebba80ad809d5ccd31674236e18c0843d2215419a9afe56e155ef0ff3f680d00ecf19deff60bdca7088ecfca9d130"
-}
-```
-### withdraw expire unfreeze
-> withdrawExpireUnfreeze [OwnerAddress]
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-Example:
-```console
-wallet> withdrawexpireunfreeze TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
-txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
-wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "f8f02b5aa634b8666862a6d2ed68fcfd90afc616d14062952b0b09f0404d9bca6c4d3dc6dab082784950ff1ded235a07dab0d738c8a202be9451d5ca92b8eece01"
- ],
- "txID":"e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
- },
- "type_url":"type.googleapis.com/protocol.WithdrawExpireUnfreezeContract"
- },
- "type":"WithdrawExpireUnfreezeContract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671122055318,
- "timestamp":1671100455315
- },
- "raw_data_hex":"0a020000220819b59068c6058ff44096e18bb5d1305a5a083812560a3b747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746864726177457870697265556e667265657a65436f6e747261637412170a154159e3741a68ec3e1ebba80ad809d5ccd31674236e7093b3e5aad130"
-}
-```
-> cancelAllUnfreezeV2 [OwnerAddress]
-
-OwnerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-Example:
-```console
-wallet> cancelAllUnfreezeV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
-txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
-wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
-{
- "ret":[
- {
- "contractRet":"SUCCESS"
- }
- ],
- "signature":[
- "f8f02b5aa634b8666862a6d2ed68fcfd90afc616d14062952b0b09f0404d9bca6c4d3dc6dab082784950ff1ded235a07dab0d738c8a202be9451d5ca92b8eece01"
- ],
- "txID":"e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147",
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
- },
- "type_url":"type.googleapis.com/protocol.CancelAllUnfreezeV2"
- },
- "type":"CancelAllUnfreezeV2Contract"
- }
- ],
- "ref_block_bytes":"0000",
- "ref_block_hash":"19b59068c6058ff4",
- "expiration":1671122055318,
- "timestamp":1671100455315
- },
- "raw_data_hex":"0a020000220819b59068c6058ff44096e18bb5d1305a5a083812560a3b747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746864726177457870697265556e667265657a65436f6e747261637412170a154159e3741a68ec3e1ebba80ad809d5ccd31674236e7093b3e5aad130"
-}
-```
-
-### get resource delegation information use v2 API
-
- > getDelegatedResourceV2 fromAddress toAddress
-> get the information from the fromAddress to the toAddress resource delegate use v2 API
-
-fromAddress
-> The address of the account that start the delegate
-
-toAddress
-> The address of the account that receive the delegate
-
-Example:
-```console
-wallet> getDelegatedResourceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3
-{
- "delegatedResource": [
- {
- "from": "TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh",
- "to": "TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3",
- "frozen_balance_for_bandwidth": 10000000
- }
- ]
-}
-```
-
- > getDelegatedResourceAccountIndexV2 address
-> get the information that address is delegated to other account resources use v2 API
-
-address
-> The address of the account that start the delegate or receive the delegate
-
-Example:
-```console
-wallet> getDelegatedResourceAccountIndexV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
-{
- "account": "TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh",
- "toAccounts": [
- "TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3"
- ]
-}
-```
-
- > getcandelegatedmaxsize ownerAddress type
-> get the max size that the ownerAddress can delegate use delegateResource
-
-ownerAddress
-> The address of the account that start the delegate, optional, default is the address of the login account.
-
-type
-> 0 bandwidth, 1 energy
-
-Example:
-```console
-wallet> getCanDelegatedMaxSize TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 0
-{
- "max_size": 999999978708334
-}
-```
-
- > getavailableunfreezecount ownerAddress
-> get the available unfreeze count that the ownerAddress can call unfreezeBalanceV2
-
-ownerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-Example:
-```console
-wallet> getAvailableUnfreezeCount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
-{
- "count": 31
-}
-```
-
- > getcanwithdrawunfreezeamount ownerAddress timestamp
-> get the withdraw unfreeze amount that the ownerAddress can get by withdrawexpireunfreeze
-
-ownerAddress
-> The address of the account that initiated the transaction, optional, default is the address of the login account.
-
-timestamp
-> get can withdraw unfreeze amount until timestamp,
-
-
-Example:
-```console
-wallet> getCanWithdrawUnfreezeAmount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1671100335000
-{
- "amount": 9000000
-}
-```
-## Get resource prices and memo fee
- > getbandwidthprices
-> get historical unit price of bandwidth
-
-Example:
-```console
-wallet> getBandwidthPrices
-{
- "prices": "0:10,1606537680000:40,1614238080000:140,1626581880000:1000,1626925680000:140,1627731480000:1000"
-}
-```
- > getenergyprices
-> get historical unit price of energy
-
-Example:
-```console
-wallet> getEnergyPrices
-{
- "prices": "0:100,1575871200000:10,1606537680000:40,1614238080000:140,1635739080000:280,1681895880000:420"
-}
-```
- > getmemofee
-> get memo fee
-
-Example:
-```console
-wallet> getMemoFee
-{
- "prices": "0:0,1675492680000:1000000"
-}
-```
-
-### get chain parameters
-
-> GetChainParameters
-
-Show all parameters that the blockchain committee can set.
-Example:
-
-```console
-> GetChainParameters
-```
-
-## import and export mnemonic
- >ImportWalletByMnemonic
->Import wallet, you need to set a password, mnemonic
-
-Example:
-```console
-wallet> ImportWalletByMnemonic
-Please input password.
-password:
-Please input password again.
-password:
-Please enter 12 words (separated by spaces) [Attempt 1/3]:
-```
-
-> ExportWalletMnemonic
->export mnemonic of the address in the wallet
-
-Example:
-```console
-wallet> ExportWalletMnemonic
-Please input your password.
-password:
-exportWalletMnemonic successful !!
-a*ert tw*st co*rect mat*er pa*s g*ther p*t p*sition s*op em*ty coc*nut aband*n
-```
-
-## generate sub account
- >GenerateSubAccount
->generate subaccount using the mnemonic in the wallet
-
-Example:
-```console
-wallet> GenerateSubAccount
-Please input your password.
-password:
-
-=== Sub Account Generator ===
------------------------------
-Default Address: TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo
-Default Path: m/44'/195'/0'/0/1
------------------------------
-
-1. Generate Default Path
-2. Change Account
-3. Custom Path
-
-Enter your choice (1-3): 1
-mnemonic file : ./Mnemonic/TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json
-Generate a sub account successful, keystore file name is TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json
-generateSubAccount successful.
-```
-## clear wallet keystore
- >ClearWalletKeystore
->clear wallet keystore of the login account
-
-Example:
-```console
-wallet> ClearWalletKeystore
-
-Warning: Dangerous operation!
-This operation will permanently delete the Wallet&Mnemonic files of the Address: TABWx7yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq
-Warning: The private key and mnemonic words will be permanently lost and cannot be recovered!
-Continue? (y/Y to proceed):y
-
-Final confirmation:
-Please enter: 'DELETE' to confirm the delete operation:
-Confirm: (DELETE): DELETE
-
-File deleted successfully:
-- /wallet-cli/Wallet/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json
-- /wallet-cli/Mnemonic/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json
-ClearWalletKeystore successful !!!
-```
-## export import wallet keystore
- >ExportWalletKeystore
->export the wallet keystore to the format of tronlink wallet
-
-Example:
-```console
-wallet> ExportWalletKeystore tronlink /tmp
-Please input your password.
-password:
-exported keystore file : /tmp/TYdhEg8b7tXm92UDbRDXPtJNU6T9xVGbbo.json
-exportWalletKeystore successful !!
-```
- >ImportWalletByKeystore
->import the keystore file of tronlink wallet to wallet-cli
-
-Example:
-```console
-wallet> ImportWalletByKeystore tronlink /tmp/tronlink.json
-Please input password.
-password:
-Please input password again.
-password:
-fileName = TYQq6zp51unQDNELmT4xKMWh5WLcwpCDZJ.json
-importWalletByKeystore successful !!
-```
-## import wallet by ledger
- >ImportWalletByLedger
->import the derived account of ledger to wallet-cli
-
-Example:
-```console
-wallet> ImportWalletByLedger
-((Note:This will pair Ledger to user your hardward wallet)
-Only one Ledger device is supported. If you have multiple devices, please ensure only one is connected.
-Ledger device found: Nano X
-Please input password.
-password:
-Please input password again.
-password:
--------------------------------------------------
-Default Account Address: TAT1dA8F9HXGqmhvMCjxCKAD29YxDRw81y
-Default Path: m/44'/195'/0'/0/0
--------------------------------------------------
-1. Import Default Account
-2. Change Path
-3. Custom Path
-Select an option: 1
-Import a wallet by Ledger successful, keystore file : ./Wallet/Ledger-TAT1dA8F9HXGqmhvMCjxCKAD29YxDRw81y.json
-You are now logged in, and you can perform operations using this account.
-```
-## login all
-> LoginAll
->Multiple Keystore accounts can be logged in with a unified password
-
-Example:
-```console
-wallet> loginall
-Please input your password.
-password:
-Use user defined config file in current dir
-[========================================] 100%
-The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
-The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
-The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
-The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
-The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
-Please choose between 1 and 5
-5
-LoginAll successful !!!
-```
-
-## logout
-> Logout
-> Log out of the current wallet account.
-
-Example:
-```console
-wallet> Logout
-Logout successful !!!
-```
-
-## lock
-> Lock
->To use the lock function of the login account, it is necessary to configure **lockAccount = true** in the **config.conf**.
-The current login account is locked, which means that signatures and transactions are not allowed.
-
-Example:
-```console
-wallet> lock
-lock successful !!!
-```
-
-## unlock
-> Unlock
->To use the unlock function of the login account, it is necessary to configure **lockAccount = true** in the **config.conf**.
-After the current login account is locked, it can be unlocked. By default, it will be unlocked again after 300 seconds. Unlocking can specify parameters in seconds.
-
-Example:
-```console
-wallet> unlock 60
-Please input your password.
-password:
-unlock successful !!!
-```
-
-## switch network
- > SwitchNetwork
->This command allows for flexible network switching at any time.
->`switchnetwork local` will switch to the network configured in local config.conf.
-
-Example:
-```console
-wallet> switchnetwork
-Please select network:
-1. MAIN
-2. NILE
-3. SHASTA
-Enter numbers to select a network (1-3):1
-Now, current network is : MAIN
-SwitchNetwork successful !!!
-```
-```console
-wallet> switchnetwork main
-Now, current network is : MAIN
-SwitchNetwork successful !!!
-```
-
-```console
-wallet> switchnetwork empty localhost:50052
-Now, current network is : CUSTOM
-SwitchNetwork successful !!!
-```
-
-## current network
- > CurrentNetwork
->View current network.
-
-Example:
-```console
-wallet> currentnetwork
-currentNetwork: NILE
-```
-
-```console
-wallet> currentnetwork
-current network: CUSTOM
-fullNode: EMPTY, solidityNode: localhost:50052
-```
-## GasFree
-
-Wallet-cli now supports GasFree integration. This guide explains the new commands and provides instructions on how to use them.
-
-For more details, please refer to [GasFree Documentation](https://gasfree.io/specification) and [TronLink User Guide For GasFree](https://support.tronlink.org/hc/en-us/articles/38903684778393-GasFree-User-Guide).
-
-Prerequisites
-API Credentials: Users must obtain the API Key and API Secret from GasFree for authentication. Please refer to the official [application form](https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform) for instructions on setting up API authentication.
-
-New Commands:
-
-### Gas Free info
-> GasFreeInfo
-Query GasFree Information
-Function: Retrieve the basic info, including the GasFree address associated with your current wallet address.
-Note: The GasFree address is automatically activated upon the first transfer, which may incur an activation fee.
-
-Example:
-```console
-wallet> gasfreeinfo
-balanceOf(address):70a08231
-{
- "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
- "active":true,
- "tokenBalance":998696000,
- "activateFee":0,
- "transferFee":2000,
- "maxTransferValue":998694000
-}
-gasFreeInfo: successful !!
-```
-
-```console
-wallet> gasfreeinfo TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe
-balanceOf(address):70a08231
-{
- "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
- "active":true,
- "tokenBalance":998696000,
- "activateFee":0,
- "transferFee":2000,
- "maxTransferValue":998694000
-}
-gasFreeInfo: successful !!
-```
-### Gas Free transfer
-> GasFreeTransfer
-Submit GasFree Transfer
-Function: Submit a gas-free token transfer request.
-
-Example:
-```console
-wallet> gasfreetransfer TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT 100000
-
-GasFreeTransfer result: {
- "code":200,
- "data":{
- "amount":100000,
- "providerAddress":"TKtWbdzEq5ss9vTS9kwRhBp5mXmBfBns3E",
- "apiKey":"",
- "accountAddress":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
- "signature":"",
- "targetAddress":"TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT",
- "maxFee":2000000,
- "version":1,
- "nonce":8,
- "tokenAddress":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
- "createdAt":1747909635678,
- "expiredAt":1747909695000,
- "estimatedTransferFee":2000,
- "id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0",
- "state":"WAITING",
- "estimatedActivateFee":0,
- "gasFreeAddress":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER",
- "updatedAt":1747909635678
- }
-}
-GasFreeTransfer successful !!!
-```
-
-### Gas Free trace
-> GasFreeTrace
-Track Transfer Status
-Function: Check the progress of a GasFree transfer using the traceId obtained from GasFreeTransfer.
-
-Example:
-```console
-wallet> gasfreetrace 6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0
-GasFreeTrace result: {
- "code":200,
- "data":{
- "amount":100000,
- "providerAddress":"TKtWbdzEq5ss9vTS9kwRhBp5mXmBfBns3E",
- "txnTotalCost":102000,
- "accountAddress":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
- "txnActivateFee":0,
- "estimatedTotalCost":102000,
- "targetAddress":"TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT",
- "txnBlockTimestamp":1747909638000,
- "txnTotalFee":2000,
- "nonce":8,
- "estimatedTotalFee":2000,
- "tokenAddress":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
- "txnHash":"858f9a00776163b1f8a34467b9c5727657f8971a9f4e9d492f0a247fac0384f9",
- "txnBlockNum":57175988,
- "createdAt":1747909635678,
- "expiredAt":1747909695000,
- "estimatedTransferFee":2000,
- "txnState":"ON_CHAIN",
- "id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0",
- "state":"CONFIRMING",
- "estimatedActivateFee":0,
- "gasFreeAddress":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER",
- "txnTransferFee":2000,
- "txnAmount":100000
- }
-}
-GasFreeTrace: successful!!
-```
-
-## switch wallet
- > SwitchWallet
->After logging in with the LoginAll command, you can switch wallets
-
-Example:
-```console
-wallet> switchwallet
-The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
-The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
-The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
-The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
-The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
-Please choose between 1 and 5
-5
-SwitchWallet successful !!!
-```
-
-## reset wallet
- > ResetWallet
->Use the resetWallet command to delete all local wallet's Keystore files and mnemonic files, and guide you to re register or import the wallet through prompts
-
-Example:
-```console
-wallet> resetwallet
-User defined config file doesn't exists, use default config file in jar
-
-Warning: Dangerous operation!
-This operation will permanently delete the Wallet&Mnemonic files
-Warning: The private key and mnemonic words will be permanently lost and cannot be recovered!
-Continue? (y/Y to proceed, c/C to cancel):
-y
-
-Final confirmation:
-Please enter: 'DELETE' to confirm the delete operation:
-Confirm: (DELETE): DELETE
-resetWallet successful !!!
-Now, you can RegisterWallet or ImportWallet again. Or import the wallet through other means.
-```
-
-## create account
-> CreateAccount
->This command can create a new account with an inactive address and burn a 1-trx handling fee for it
-
-Example:
-```console
-wallet> createaccount TDJ13zZzT3w91WMBm98gC3mwL7NbA6sQPA
-{
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "owner_address":"TQLaB7L8o3ikjRVcN7tTjMZsRYPJ23XZbd",
- "account_address":"TDJ13zZzT3w91WMBm98gC3mwL7NbA6sQPA"
- },
- "type_url":"type.googleapis.com/protocol.AccountCreateContract"
- },
- "type":"AccountCreateContract"
- }
- ],
- "ref_block_bytes":"91a4",
- "ref_block_hash":"2bfcd3bb597f3d40",
- "expiration":1745333676000,
- "timestamp":1745333618318
- },
- "raw_data_hex":"0a0291a422082bfcd3bb597f3d4040e0cff9efe5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe532"
-}
-Before sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d4040e0cff9efe5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe532
-Please confirm and input your permission id, if input y/Y means default 0, other non-numeric characters will cancel transaction.
-y
-Please choose your key for sign.
-The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
-The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
-The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
-The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
-The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
-Please choose between 1 and 5
-1
-After sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d404083bd9cfae5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe5321241ce53add4f75fe1838aa7e0a4e2411b3bbfce1d2164d68dac18507ed87e22ae503f65592a1161640834b3c0cef43c28f20b2d335120cc78b6f745a82ea95e451100
-TxId is 26d6fcdfdc0018097ec4166eb140e19ebd597bea2212579d2f6d921b0ad6e56f
-CreateAccount successful !!
-```
-
-### set account id
-
-> SetAccountId [owner_address] account_id
-
-Sets a custom unique identifier (Account ID) for an account.
-
-Example:
-
-```console
-> SetAccountId TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 100
-```
-
-### update account
-
-> UpdateAccount [owner_address] account_name
-
-Modify account name.
-
-Example:
-
-```console
-> UpdateAccount test-name
-```
-
-### Modify wallet name
-> ModifyWalletName new_wallet_name
-
-Modify wallet's name.
-
-Example:
-```console
-wallet> ModifyWalletName new-name
-Modify Wallet Name successful !!
-```
-
-### View backup records
-> ViewBackupRecords
-
-View backup records. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
-
-Example:
-```console
-wallet> ViewBackupRecords
-
-=== View Backup Records ===
-1. View all records
-2. Filter by time range
-Choose an option (1-2): 1
-```
-### View transaction history
-> ViewTransactionHistory
-
-View transaction history. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
-
-Example:
-```console
-wallet> ViewTransactionHistory
-====================================
- TRANSACTION VIEWER
-====================================
-
-MAIN MENU:
-1. View all transactions
-2. Filter by time range
-3. Help
-4. Exit
-Select option: 1
-```
-
-
-## Wallet related commands
-
-**RegisterWallet**
-> Register your wallet, you need to set the wallet password and generate the address and private key.
-
-**BackupWallet**
-> Back up your wallet, you need to enter your wallet password and export the private key.hex string format, such
-as: 1234567890123456789012345678901234567890123456789012345678901234
-
-**BackupWallet2Base64**
-> Back up your wallet, you need to enter your wallet password and export the private key.base64 format, such as: ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU=
-
-**ChangePassword**
-> Modify the password of an account
-
-**ImportWallet**
-> Import wallet, you need to set a password, hex String format
-
-**ImportWalletByBase64**
-> Import wallet, you need to set a password, base64 format
-
-## Account related commands
-
-**GenerateAddress**
-> Generate an address and print out the address and private key
-
-**GetAccount**
-> Get account information based on address
-**GetAccountById**
-> Get account details information through account id
-
-**GetAccountNet**
-> The usage of bandwidth
-
-**GetAccountResource**
-> The usage of bandwidth and energy
-
-**GetAddress**
-> Get the address of the current login account
-
-**GetBalance**
-> Get the balance of the current login account
-
-## How to get transaction information
-
-**GetTransactionById**
-> Get transaction information based on transaction id
-
-**GetTransactionCountByBlockNum**
-> Get the number of transactions in the block based on the block height
-
-**GetTransactionInfoById**
-> Get transaction-info based on transaction id, generally used to check the result of a smart contract trigger
-
-**GetTransactionInfoByBlockNum**
-> Get the list of transaction information in the block based on the block height
-
-## How to get block information
-
-**GetBlock**
-> Get the block according to the block number; if you do not pass the parameter, get the latest block
-
-**GetBlockById**
-> Get block based on blockID
-
-**GetBlockByIdOrNum**
-> Get blocks based on their ID or block height. If no parameters are passed, Get the header block.
-
-**GetBlockByLatestNum n**
-> Get the latest n blocks, where 0 < n < 100
-
-**GetBlockByLimitNext startBlockId endBlockId**
-> Get the block in the range [startBlockId, endBlockId)
-
-## Some others
-
-**GetNextMaintenanceTime**
-> Get the start time of the next maintain period
-
-**ListNodes**
-> Get other peer information
-
-**ListWitnesses**
-> Get all miner node information
-
-**BroadcastTransaction**
-> Broadcast the transaction, where the transaction is in hex string format.
-
-## How to use tron-dex to sell asset
-
-### MarketSellAsset
-
-Create an order to sell asset
-
-> MarketSellAsset owner_address sell_token_id sell_token_quantity buy_token_id buy_token_quantity
-
-ownerAddress
-> The address of the account that initiated the transaction
-
-sell_token_id, sell_token_quantity
-> ID and amount of the token want to sell
-
-buy_token_id, buy_token_quantity
-> ID and amount of the token want to buy
-
-Example:
-
-```console
-MarketSellAsset TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 1000001 200 _ 100
-
-Get the result of the contract execution with the getTransactionInfoById command:
-getTransactionInfoById 10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374
-
-{
- "id": "10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374",
- "blockNumber": 669,
- "blockTimeStamp": 1578983493000,
- "contractResult": [
- ""
- ],
- "receipt": {
- "net_usage": 264
- }
-}
-```
-
-### GetMarketOrderByAccount
-
-Get the order created by account(just include active status)
-
-> GetMarketOrderByAccount ownerAddress
-
-ownerAddress
-> The address of the account that created market order
-
-Example:
-
-```console
-GetMarketOrderByAccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW
-{
- "orders": [
- {
- "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
- "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
- "create_time": 1578983490000,
- "sell_token_id": "_",
- "sell_token_quantity": 100,
- "buy_token_id": "1000001",
- "buy_token_quantity": 200,
- "sell_token_quantity_remain": 100
- }
- ]
-}
-```
-
-### GetMarketOrderById
-
-Get the specific order by order_id
-
-> GetMarketOrderById orderId
-
-Example:
-
-```console
-GetMarketOrderById fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0
-{
- "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
- "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
- "create_time": 1578983490000,
- "sell_token_id": "_",
- "sell_token_quantity": 100,
- "buy_token_id": "1000001",
- "buy_token_quantity": 200,
-}
-```
-
-### GetMarketPairList
-
-Get market pair list
-
-Example:
-
-```console
-GetMarketPairList
-{
- "orderPair": [
- {
- "sell_token_id": "_",
- "buy_token_id": "1000001"
- }
- ]
-}
-```
-
-### GetMarketOrderListByPair
-
-Get order list by pair
-
-> GetMarketOrderListByPair sell_token_id buy_token_id
-
-sell_token_id
-> ID of the token want to sell
-
-buy_token_id
-> ID of the token want to buy
-
-Example:
-
-```console
-GetMarketOrderListByPair _ 1000001
-{
- "orders": [
- {
- "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
- "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
- "create_time": 1578983490000,
- "sell_token_id": "_",
- "sell_token_quantity": 100,
- "buy_token_id": "1000001",
- "buy_token_quantity": 200,
- "sell_token_quantity_remain": 100
- }
- ]
-}
-```
-
-### GetMarketPriceByPair
-
-Get market price by pair
-
-> GetMarketPriceByPair sell_token_id buy_token_id
-
-sell_token_id
-> ID of the token want to sell
-
-buy_token_id
-> ID of the token want to buy
-
-Example:
-
-```console
-GetMarketPriceByPair _ 1000001
-{
- "sell_token_id": "_",
- "buy_token_id": "1000001",
- "prices": [
- {
- "sell_token_quantity": 100,
- "buy_token_quantity": 200
- }
- ]
-}
-```
-
-### MarketCancelOrder
-
-Cancel the order
-
-> MarketCancelOrder owner_address order_id
-
-owner_address
-> the account address who have created the order
-
-order_id
-> the order id which want to cancel
-
-Example:
-
-```console
-MarketCancelOrder TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0
-```
-
-Get the result of the contract execution with the getTransactionInfoById command:
-```console
-getTransactionInfoById b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27
-{
- "id": "b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27",
- "blockNumber": 1582,
- "blockTimeStamp": 1578986232000,
- "contractResult": [
- ""
- ],
- "receipt": {
- "net_usage": 283
- }
-}
-```
-### Address book
-> AddressBook
-
-Addition, deletion, modification, and search of address book.
-
-Example:
-```console
-wallet> AddressBook
-
-MAIN MENU:
-1. addAddress
-2. editAddress
-3. delAddress
-4. getAddressBook
-Select option: 1
-```
-### show receiving qr code
-> show-receiving-qr-code
-
-Display Receive Payment QR Code for the current address.
-Executing this command requires installing 'qrencode' on the terminal in advance.
-Debian/Ubuntu:
-sudo apt install qrencode
-CentOS:
-sudo yum install qrencode
-RHEL/Fedora:
-sudo dnf install qrencode
-macOS:
-brew install qrencode
-
-Example:
-```console
-wallet> ShowReceivingQrCode
-█████████████████████████████████████
-████ ▄▄▄▄▄ ██▄▀▀ ▄ ▀▄▀ ▀▀█ ▄▄▄▄▄ ████
-████ █ █ █▄ ▀▄ ▀▄▀▀███ █ █ ████
-████ █▄▄▄█ ██▀▄██▀▄▀▄▀ ▀██ █▄▄▄█ ████
-████▄▄▄▄▄▄▄█ ▀ █ ▀ ▀ ▀ ▀ █▄▄▄▄▄▄▄████
-████▄ █▄▄▄▄▄█ ██ ▀▀██▀ ██▀▄▀▀████
-████▄█▀▄█▀▄▀▄▄█▀█▄█▀▄ █▀██▄ █▄▄ ▄████
-████ █▄█▄ ▄▄▄██▀ ▀█▀▄██▄█▄▄ █ █ ▄████
-████ ▄▀▄▀▄▄▀ ▄█▄ ▀ ▀█ █ ██▀▀█▄▄▄████
-████▄█▀ ██▄██ ▄ ██ ██ █ ▄▄▄ ▄████
-████▄▀▀ ▀█▄█▀▄▀▀█▄█▄█▀ ▀▄▀█ ▄▄▄ ▄████
-████▄██▄█▄▄▄▀ ▄▀ ▀██ ▄▄ ▄▄▄ ▄▄▄████
-████ ▄▄▄▄▄ █ █▀▄ ▀ █▄▀▄ █▄█ ▄█▄ ████
-████ █ █ █▄▀▀ ██ ▄▄ █ ▄ ▄▄▄██████
-████ █▄▄▄█ █ ▀█▀█▄█▄▀▀█▄ ▄█ ██▀▄████
-████▄▄▄▄▄▄▄█▄▄██▄██ ▀▀▄▄▄▄█ ▀ ████
-█████████████████████████████████████
-TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp
-```
-### get usdt balance
-> GetUSDTBalance
-
-Get the current USDT balance of the account.
-
-Example:
-```console
-wallet> getusdtbalance
-balanceOf(address):70a08231
-Execution result = {
- "constant_result": [
- "0000000000000000000000000000000000000000000000000000000000000000"
- ],
- "result": {
- "result": true
- },
- "energy_used": 4062,
- "energy_penalty": 3127
-}
-USDT balance = 0
-```
-### get usdt transfer by id
-> GetUsdtTransferById
-
-Get USDT transfer transaction summary based on transaction ID.
-
-Example:
-```console
-wallet> GetUsdtTransferById b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a
-{
- "id":"b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a",
- "type":"TriggerSmartContract(transferUSDT)",
- "from":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
- "to":"TGDjv2KKD4UqEmFTnZgLzup5WWjTex4Mvq",
- "amount":100,
- "tronscanQueryUrl":"https://nile.tronscan.org/#/transaction/b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a"
-}
-```
-### transfer usdt
-> TransferUSDT
-
-Make a USDT transfer.
-
-Example:
-```console
-wallet> transferusdt TR311sD6KasRnofj5RnFiFBA2rH8RH2kYk 1
-balanceOf(address):70a08231
-Execution result = {
- "constant_result": [
- "000000000000000000000000000000000000000000000000000000006544ae57"
- ],
- "result": {
- "result": true
- },
- "energy_used": 935
-}
-USDT balance = 1698999895
-transfer(address,uint256):a9059cbb
-It is estimated that 345 bandwidth and 29650 energy will be consumed.
-Execution result = {
- "constant_result": [
- "0000000000000000000000000000000000000000000000000000000000000000"
- ],
- "result": {
- "result": true
- },
- "energy_used": 29650,
- "logs": [
- {
- "address": "NaMomAhUzuFzMNFzzQHVNsR8xbmP3A5LT",
- "topics": [
- "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
- "000000000000000000000000caf9798d70a3c609b600f163e53cfe8f586e1b9f",
- "000000000000000000000000a5418b8da12e73075abb46375e7a15c758ea21fc"
- ],
- "data": "0000000000000000000000000000000000000000000000000000000000000001"
- }
- ]
-}
-{
- "raw_data":{
- "contract":[
- {
- "parameter":{
- "value":{
- "data":"a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc0000000000000000000000000000000000000000000000000000000000000001",
- "owner_address":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
- "contract_address":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf"
- },
- "type_url":"type.googleapis.com/protocol.TriggerSmartContract"
- },
- "type":"TriggerSmartContract"
- }
- ],
- "ref_block_bytes":"08c7",
- "ref_block_hash":"c02252c2ae3b92e1",
- "expiration":1761639507000,
- "fee_limit":1000000000,
- "timestamp":1761639448851
- },
- "raw_data_hex":"0a0208c72208c02252c2ae3b92e140b8c896cfa2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc03"
-}
-Before sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e140b8c896cfa2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc03
-Please confirm and input your permission id, if input y/Y means default 0, other non-numeric characters will cancel transaction.
-y
-Please choose your key for sign.
-
-No. Address Name
-1 TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8 test
-Please choose No. between 1 and 1, or enter search to search wallets
-1
-Please input your password.
-Lxc1992117
-After sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e1409fb0b9d9a2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc031241a776830e5cd054c6a94631b6d62704e249e7587ab3f036e5e4fac15cbf49e671262532e094e1a32ad858272da3e101958102df61b0f72f26756a94b608883a6f01
-TxId is 9c8d4b84e9a71ccaad86b0a96f790067d3fc7ea85c26b425e5d748b81d31a8b8
-Transfer 1 to TR311sD6KasRnofj5RnFiFBA2rH8RH2kYk broadcast successful.
-Please check the given transaction id to get the result on blockchain using getTransactionInfoById command.
-```
-### tronlink multi sign
-> TronlinkMultiSign
-
-Create multi sign transactions and view the multi sign transaction list through the tronlink service.
-
-Example:
-```console
-wallet> tronlinkmultisign
-
-=== Multi-Sign Manager ===
-1. Multi-sign transaction list
-2. Create multi-sign transaction
-0. Exit
-Please enter the number to operate:
-```
-
-### encoding converter
-> EncodingConverter
-
-A Useful Encoding Converter.
-
-Example:
-```console
-wallet> EncodingConverter
-
-==============================
- Encoding Converter (CLI)
-==============================
-1) TRON - EVM Address
-2) Base64 Encode / Decode
-3) Base58Check Encode / Decode
-4) Public Key -> Address
-5) Private Key -> Public Key & Address
-0) Exit
->
-```
-
-### How to get privateKey through mnemonic
-> GetPrivateKeyByMnemonic
-
-Get the private key through mnemonics.
-
-Example:
-```console
-wallet> GetPrivateKeyByMnemonic
-
-Please enter 12 or 24 words (separated by spaces) [Attempt 1/3]:
-```
-### Get paginated now witness list
-> GetPaginatedNowWitnessList
-
-Get paginated now witness list.
-
-Example:
-```console
-wallet> getPaginatedNowWitnessList 0 2
-{
- "witnesses": [
- {
- "address": "TJmka325yjJKeFpQDwKSQAoNwEyNGhsaEV",
- "voteCount": 5405926918,
- "url": "http://sr-8.com",
- "totalProduced": 1801675,
- "totalMissed": 456,
- "latestBlockNum": 64577529,
- "latestSlotNum": 590063589,
- "isJobs": true
- },
- {
- "address": "TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG",
- "voteCount": 2322244615,
- "url": "http://sr-27.com",
- "totalProduced": 1807756,
- "totalMissed": 619,
- "latestBlockNum": 64577530,
- "latestSlotNum": 590063590,
- "isJobs": true
- }
- ]
-}
-```
+- [Resources: bandwidth, energy & shares](docs/concepts/resources.md) — how freezing produces resources, and how bandwidth is calculated
+- [Staking models: Stake 1.0 vs 2.0](docs/concepts/staking-models.md) — the two freeze generations and which commands belong to each
+- [Multi-signature concepts](docs/concepts/multisig.md) — permission types, keys, weights, and thresholds
diff --git a/java/docs/commands/account.md b/java/docs/commands/account.md
new file mode 100644
index 000000000..f81ea3fc4
--- /dev/null
+++ b/java/docs/commands/account.md
@@ -0,0 +1,196 @@
+# Account commands
+
+Query and update on-chain accounts, manage account metadata, and view local records.
+
+## How to create account
+
+You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Transferring to a non-existent account has a minimum restriction amount of **1 TRX**. Creating an account through the `CreateAccount` command still burns **1 TRX**.
+
+## CreateAccount
+
+Create a new account with an inactive address, burning a 1-TRX handling fee for it.
+
+```console
+> CreateAccount [OwnerAddress] Address
+```
+
+Example:
+
+```console
+wallet> createaccount TDJ13zZzT3w91WMBm98gC3mwL7NbA6sQPA
+{
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "owner_address":"TQLaB7L8o3ikjRVcN7tTjMZsRYPJ23XZbd",
+ "account_address":"TDJ13zZzT3w91WMBm98gC3mwL7NbA6sQPA"
+ },
+ "type_url":"type.googleapis.com/protocol.AccountCreateContract"
+ },
+ "type":"AccountCreateContract"
+ }
+ ],
+ "ref_block_bytes":"91a4",
+ "ref_block_hash":"2bfcd3bb597f3d40",
+ "expiration":1745333676000,
+ "timestamp":1745333618318
+ },
+ "raw_data_hex":"0a0291a422082bfcd3bb597f3d4040e0cff9efe5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe532"
+}
+Before sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d4040e0cff9efe5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe532
+Please confirm and input your permission id, if input y/Y means default 0, other non-numeric characters will cancel transaction.
+y
+Please choose your key for sign.
+The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
+The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
+The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
+The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
+The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
+Please choose between 1 and 5
+1
+After sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d404083bd9cfae5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe5321241ce53add4f75fe1838aa7e0a4e2411b3bbfce1d2164d68dac18507ed87e22ae503f65592a1161640834b3c0cef43c28f20b2d335120cc78b6f745a82ea95e451100
+TxId is 26d6fcdfdc0018097ec4166eb140e19ebd597bea2212579d2f6d921b0ad6e56f
+CreateAccount successful !!
+```
+
+## GenerateAddress
+
+Generate an address and print out the address and private key.
+
+## GetAccount
+
+Get account information based on an address.
+
+```console
+> GetAccount Address
+```
+
+## GetAccountById
+
+Get account details through an account ID.
+
+```console
+> GetAccountById accountId
+```
+
+## GetAccountNet
+
+Show the usage of bandwidth.
+
+```console
+> GetAccountNet Address
+```
+
+## GetAccountResource
+
+Show the usage of bandwidth and energy.
+
+```console
+> getAccountResource Address
+```
+
+## GetAddress
+
+Get the address of the current login account. Takes no parameters.
+
+## GetBalance
+
+Get the balance of the current login account, or of `Address` when one is given.
+
+```console
+> GetBalance [Address]
+```
+
+## SetAccountId
+
+Set a custom unique identifier (Account ID) for an account.
+
+```console
+> SetAccountId [owner_address] account_id
+```
+
+```console
+> SetAccountId TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 100
+```
+
+## UpdateAccount
+
+Modify the account name.
+
+```console
+> UpdateAccount [owner_address] account_name
+```
+
+```console
+> UpdateAccount test-name
+```
+
+## ViewBackupRecords
+
+View backup records. You can configure the maximum number of records that `maxRecords` can retain in [`config.conf`](../reference/config.md), excluding the number of buffer records.
+
+```console
+wallet> ViewBackupRecords
+
+=== View Backup Records ===
+1. View all records
+2. Filter by time range
+Choose an option (1-2): 1
+```
+
+## ViewTransactionHistory
+
+View transaction history. You can configure the maximum number of records that `maxRecords` can retain in [`config.conf`](../reference/config.md), excluding the number of buffer records.
+
+```console
+wallet> ViewTransactionHistory
+====================================
+ TRANSACTION VIEWER
+====================================
+
+MAIN MENU:
+1. View all transactions
+2. Filter by time range
+3. Help
+4. Exit
+Select option: 1
+```
+
+## ShowReceivingQrCode
+
+Display a receive-payment QR code for the current address. This command requires `qrencode` to be installed on the terminal in advance:
+
+- Debian/Ubuntu: `sudo apt install qrencode`
+- CentOS: `sudo yum install qrencode`
+- RHEL/Fedora: `sudo dnf install qrencode`
+- macOS: `brew install qrencode`
+
+```console
+wallet> ShowReceivingQrCode
+█████████████████████████████████████
+████ ▄▄▄▄▄ ██▄▀▀ ▄ ▀▄▀ ▀▀█ ▄▄▄▄▄ ████
+████ █ █ █▄ ▀▄ ▀▄▀▀███ █ █ ████
+████ █▄▄▄█ ██▀▄██▀▄▀▄▀ ▀██ █▄▄▄█ ████
+████▄▄▄▄▄▄▄█ ▀ █ ▀ ▀ ▀ ▀ █▄▄▄▄▄▄▄████
+████▄ █▄▄▄▄▄█ ██ ▀▀██▀ ██▀▄▀▀████
+████▄█▀▄█▀▄▀▄▄█▀█▄█▀▄ █▀██▄ █▄▄ ▄████
+████ █▄█▄ ▄▄▄██▀ ▀█▀▄██▄█▄▄ █ █ ▄████
+████ ▄▀▄▀▄▄▀ ▄█▄ ▀ ▀█ █ ██▀▀█▄▄▄████
+████▄█▀ ██▄██ ▄ ██ ██ █ ▄▄▄ ▄████
+████▄▀▀ ▀█▄█▀▄▀▀█▄█▄█▀ ▀▄▀█ ▄▄▄ ▄████
+████▄██▄█▄▄▄▀ ▄▀ ▀██ ▄▄ ▄▄▄ ▄▄▄████
+████ ▄▄▄▄▄ █ █▀▄ ▀ █▄▀▄ █▄█ ▄█▄ ████
+████ █ █ █▄▀▀ ██ ▄▄ █ ▄ ▄▄▄██████
+████ █▄▄▄█ █ ▀█▀█▄█▄▀▀█▄ ▄█ ██▀▄████
+████▄▄▄▄▄▄▄█▄▄██▄██ ▀▀▄▄▄▄█ ▀ ████
+█████████████████████████████████████
+TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp
+```
+
+## See also
+
+- [wallet](wallet.md) — create / import / session management
+- [chain-data](chain-data.md) — transaction and block queries
+- [usdt](usdt.md) — token balances and the address book
diff --git a/java/docs/commands/chain-data.md b/java/docs/commands/chain-data.md
new file mode 100644
index 000000000..0c118029d
--- /dev/null
+++ b/java/docs/commands/chain-data.md
@@ -0,0 +1,122 @@
+# Chain data & utilities
+
+Query transactions, blocks, and chain parameters, plus local encoding utilities.
+
+## How to get transaction information
+
+### GetTransactionById
+
+Get transaction information based on a transaction ID.
+
+### GetTransactionCountByBlockNum
+
+Get the number of transactions in the block based on the block height.
+
+```console
+> GetTransactionCountByBlockNum number
+```
+
+### GetTransactionInfoById
+
+Get transaction info based on a transaction ID, generally used to check the result of a smart contract trigger.
+
+### GetTransactionInfoByBlockNum
+
+Get the list of transaction information in the block based on the block height.
+
+```console
+> GetTransactionInfoByBlockNum number
+```
+
+## How to get block information
+
+### GetBlock
+
+Get the block according to the block number; if you do not pass the parameter, get the latest block.
+
+```console
+> GetBlock [BlockNum]
+```
+
+### GetBlockById
+
+Get a block based on block ID.
+
+### GetBlockByIdOrNum
+
+Get blocks based on their ID or block height. If no parameters are passed, get the header block.
+
+### GetBlockByLatestNum
+
+```console
+> GetBlockByLatestNum n
+```
+
+Get the latest `n` blocks, where 0 < n < 100.
+
+### GetBlockByLimitNext
+
+```console
+> GetBlockByLimitNext startBlockId endBlockId
+```
+
+Get the block in the range [startBlockId, endBlockId).
+
+## Chain parameters & nodes
+
+### GetChainParameters
+
+Show all parameters that the blockchain committee can set.
+
+```console
+> GetChainParameters
+```
+
+### GetNextMaintenanceTime
+
+Get the start time of the next maintenance period.
+
+### ListNodes
+
+Get other peer information.
+
+### BroadcastTransaction
+
+Broadcast the transaction, where the transaction is in hex-string format.
+
+## Local utilities
+
+### EncodingConverter
+
+A useful encoding converter.
+
+```console
+wallet> EncodingConverter
+
+==============================
+ Encoding Converter (CLI)
+==============================
+1) TRON - EVM Address
+2) Base64 Encode / Decode
+3) Base58Check Encode / Decode
+4) Public Key -> Address
+5) Private Key -> Public Key & Address
+0) Exit
+>
+```
+
+### GetPrivateKeyByMnemonic
+
+Get the private key through mnemonics.
+
+```console
+wallet> GetPrivateKeyByMnemonic
+
+Please enter 12 or 24 words (separated by spaces) [Attempt 1/3]:
+```
+
+## See also
+
+- [account](account.md) — account-level queries
+- [vote-reward](vote-reward.md) — witness lists
+- [resources](resources.md) — resource unit prices
diff --git a/java/docs/commands/contract.md b/java/docs/commands/contract.md
new file mode 100644
index 000000000..224143f31
--- /dev/null
+++ b/java/docs/commands/contract.md
@@ -0,0 +1,249 @@
+# Smart contracts
+
+Deploy, trigger, and inspect smart contracts.
+
+## DeployContract
+
+```console
+> DeployContract [ownerAddress] contractName ABI byteCode constructor params isHex fee_limit consume_user_resource_percent origin_energy_limit value token_value token_id(e.g: TRXTOKEN, use # if don't provided) library:address,...>
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `contractName` — name of the smart contract.
+- `ABI` — compile-generated ABI code.
+- `byteCode` — compile-generated byte code.
+- `constructor`, `params`, `isHex` — define the format of the bytecode, which determines the way to parse `byteCode` from parameters.
+- `fee_limit` — the most TRX the transaction is allowed to consume.
+- `consume_user_resource_percent` — percentage of user resource consumed, in the range [0, 100].
+- `origin_energy_limit` — the most developer Energy consumed by triggering the contract once.
+- `value` — the amount of TRX transferred to the contract account.
+- `token_value` — number of TRC10.
+- `token_id` — TRC10 id.
+
+Example:
+
+```console
+> deployContract normalcontract544 [{"constant":false,"inputs":[{"name":"i","type":"uint256"}],"name": "findArgsByIndexTest","outputs":[{"name":"z","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]
+608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029 # # false 1000000000 75 50000 0 0 #
+```
+
+Get the result of the contract execution with the `getTransactionInfoById` command:
+
+```console
+> getTransactionInfoById 4978dc64ff746ca208e51780cce93237ee444f598b24d5e9ce0da885fb3a3eb9
+{
+ "id": "8c1f57a5e53b15bb0a0a0a0d4740eda9c31fbdb6a63bc429ec2113a92e8ff361",
+ "fee": 6170500,
+ "blockNumber": 1867,
+ "blockTimeStamp": 1567499757000,
+ "contractResult": [
+ "6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029"
+ ],
+ "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
+ "receipt": {
+ "energy_fee": 6170500,
+ "energy_usage_total": 61705,
+ "net_usage": 704,
+ "result": "SUCCESS"
+ }
+}
+```
+
+## DeployConstantContract
+
+Run a contract deployment as a **constant (read-only) call** — the deployment is executed locally against the node and is **not broadcast** to the chain, so it can be used to check the result and energy cost of a deployment beforehand.
+
+```console
+> DeployConstantContract ownerAddress(use # if you own) byteCode constructor params isHex [value token_value token_id]
+```
+
+Takes 5 parameters, or 8 when the trailing `value token_value token_id` group is supplied.
+
+- `ownerAddress` — the address of the account that initiated the transaction; use `#` if it is your own login account.
+- `byteCode` — compile-generated byte code.
+- `constructor`, `params`, `isHex` — the constructor signature and its argument values; `isHex` selects how they are parsed. If either `constructor` or `params` is `#`, no arguments are appended to the byte code.
+- `value` — the amount of TRX transferred to the contract account.
+- `token_value` — number of TRC10.
+- `token_id` — TRC10 id; use `#` if not provided.
+
+## TriggerContract
+
+```console
+> TriggerContract [ownerAddress] contractAddress method args isHex fee_limit value token_value token_id
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `contractAddress` — smart contract address.
+- `method` — the name of the function and parameters; refer to the example.
+- `args` — parameter value; if you want to call `receive`, pass `#` instead.
+- `isHex` — the format of the parameters `method` and `args`; hex string or not.
+- `fee_limit` — the most TRX allowed for consumption.
+- `token_value` — number of TRC10.
+- `token_id` — TRC10 id; if not, use `#` instead.
+
+Example:
+
+```console
+> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest(uint256) 0 false
+1000000000 0 0 #
+# Get the result of the contract execution with the getTransactionInfoById command
+> getTransactionInfoById 7d9c4e765ea53cf6749d8a89ac07d577141b93f83adc4015f0b266d8f5c2dec4
+{
+ "id": "de289f255aa2cdda95fbd430caf8fde3f9c989c544c4917cf1285a088115d0e8",
+ "fee": 8500,
+ "blockNumber": 2076,
+ "blockTimeStamp": 1567500396000,
+ "contractResult": [
+ ""
+ ],
+ "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
+ "receipt": {
+ "energy_fee": 8500,
+ "energy_usage_total": 85,
+ "net_usage": 314,
+ "result": "REVERT"
+ },
+ "result": "FAILED",
+ "resMessage": "REVERT opcode executed"
+}
+```
+
+## TriggerConstantContract
+
+```console
+> TriggerConstantContract [ownerAddress] contractAddress method args isHex fee_limit value token_value token_id
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `contractAddress` — smart contract address.
+- `method` — the name of the function and parameters; refer to the example.
+- `args` — parameter value; if you want to call `receive`, pass `#` instead.
+- `isHex` — the format of the parameters `method` and `args`; hex string or not.
+- `fee_limit` — the most TRX allowed for consumption.
+- `token_value` — number of TRC10.
+- `token_id` — TRC10 id; if not, use `#` instead.
+
+Example:
+
+```console
+> TriggerConstantContract TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true
+```
+
+## ClearContractABI
+
+```console
+> ClearContractABI [ownerAddress] contractAddress
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `contractAddress` — contract address.
+
+Example:
+
+```console
+> ClearContractABI TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs
+```
+
+## GetContract
+
+Get the details of a smart contract.
+
+```console
+> GetContract contractAddress
+```
+
+`contractAddress` — smart contract address.
+
+Example:
+
+```console
+> GetContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG
+{
+ "origin_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "contract_address": "TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds",
+ "abi": {
+ "entrys": [
+ {
+ "name": "findArgsByIndexTest",
+ "inputs": [
+ {
+ "name": "i",
+ "type": "uint256"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "z",
+ "type": "uint256"
+ }
+ ],
+ "type": "Function",
+ "stateMutability": "Nonpayable"
+ }
+ ]
+ },
+ "bytecode": "608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029",
+ "consume_user_resource_percent": 75,
+ "name": "normalcontract544",
+ "origin_energy_limit": 50000,
+ "code_hash": "23423cece3b4866263c15357b358e5ac261c218693b862bcdb90fa792d5714e6"
+}
+```
+
+## GetContractInfo
+
+Get the info of a smart contract.
+
+```console
+> GetContractInfo contractAddress
+```
+
+`contractAddress` — smart contract address.
+
+Example:
+
+```console
+> GetContractInfo TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG
+```
+
+## UpdateEnergyLimit / UpdateSetting
+
+Update smart contract parameters.
+
+```console
+> UpdateEnergyLimit [ownerAddress] contract_address energy_limit # Update parameter energy_limit
+> UpdateSetting [ownerAddress] contract_address consume_user_resource_percent # Update parameter consume_user_resource_percent
+```
+
+## Create2
+
+Predict the contract address generated after deploying a contract. `address` is the contract address for executing the create2 instruction, `code` is the bytecode of the contract to be deployed, and `salt` is a random salt value.
+
+```console
+> Create2 address code salt
+```
+
+Example:
+
+```console
+> Create2 TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 5f805460ff1916600190811790915560649055606319600255 2132
+```
+
+## EstimateEnergy
+
+Estimate the energy required for the successful execution of a smart contract transaction (confirmed state).
+
+```console
+> EstimateEnergy owner_address(use # if you own) contract_address method args isHex [value token_value token_id(e.g: TRXTOKEN, use # if don't provided)]
+```
+
+Example:
+
+```console
+> EstimateEnergy TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true
+```
+
+## See also
+
+- [usdt](usdt.md) — TRC20 transfers via contract calls
+- [concepts/resources](../concepts/resources.md) — energy consumption
diff --git a/java/docs/commands/dex.md b/java/docs/commands/dex.md
new file mode 100644
index 000000000..c25c08f00
--- /dev/null
+++ b/java/docs/commands/dex.md
@@ -0,0 +1,203 @@
+# TRON-DEX market
+
+The on-chain order market — create and cancel sell orders, and query orders, pairs, and prices.
+
+## MarketSellAsset
+
+Create an order to sell asset.
+
+```console
+> MarketSellAsset owner_address sell_token_id sell_token_quantity buy_token_id buy_token_quantity
+```
+
+- `ownerAddress` — the address of the account that initiated the transaction.
+- `sell_token_id`, `sell_token_quantity` — ID and amount of the token you want to sell.
+- `buy_token_id`, `buy_token_quantity` — ID and amount of the token you want to buy.
+
+Example:
+
+```console
+MarketSellAsset TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 1000001 200 _ 100
+
+Get the result of the contract execution with the getTransactionInfoById command:
+getTransactionInfoById 10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374
+
+{
+ "id": "10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374",
+ "blockNumber": 669,
+ "blockTimeStamp": 1578983493000,
+ "contractResult": [
+ ""
+ ],
+ "receipt": {
+ "net_usage": 264
+ }
+}
+```
+
+## GetMarketOrderByAccount
+
+Get the orders created by an account (only includes active status).
+
+```console
+> GetMarketOrderByAccount ownerAddress
+```
+
+`ownerAddress` — the address of the account that created the market order.
+
+Example:
+
+```console
+GetMarketOrderByAccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW
+{
+ "orders": [
+ {
+ "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
+ "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
+ "create_time": 1578983490000,
+ "sell_token_id": "_",
+ "sell_token_quantity": 100,
+ "buy_token_id": "1000001",
+ "buy_token_quantity": 200,
+ "sell_token_quantity_remain": 100
+ }
+ ]
+}
+```
+
+## GetMarketOrderById
+
+Get the specific order by `order_id`.
+
+```console
+> GetMarketOrderById orderId
+```
+
+Example:
+
+```console
+GetMarketOrderById fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0
+{
+ "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
+ "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
+ "create_time": 1578983490000,
+ "sell_token_id": "_",
+ "sell_token_quantity": 100,
+ "buy_token_id": "1000001",
+ "buy_token_quantity": 200,
+}
+```
+
+## GetMarketPairList
+
+Get the market pair list.
+
+```console
+GetMarketPairList
+{
+ "orderPair": [
+ {
+ "sell_token_id": "_",
+ "buy_token_id": "1000001"
+ }
+ ]
+}
+```
+
+## GetMarketOrderListByPair
+
+Get the order list by pair.
+
+```console
+> GetMarketOrderListByPair sell_token_id buy_token_id
+```
+
+- `sell_token_id` — ID of the token you want to sell.
+- `buy_token_id` — ID of the token you want to buy.
+
+Example:
+
+```console
+GetMarketOrderListByPair _ 1000001
+{
+ "orders": [
+ {
+ "order_id": "fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0",
+ "owner_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
+ "create_time": 1578983490000,
+ "sell_token_id": "_",
+ "sell_token_quantity": 100,
+ "buy_token_id": "1000001",
+ "buy_token_quantity": 200,
+ "sell_token_quantity_remain": 100
+ }
+ ]
+}
+```
+
+## GetMarketPriceByPair
+
+Get the market price by pair.
+
+```console
+> GetMarketPriceByPair sell_token_id buy_token_id
+```
+
+- `sell_token_id` — ID of the token you want to sell.
+- `buy_token_id` — ID of the token you want to buy.
+
+Example:
+
+```console
+GetMarketPriceByPair _ 1000001
+{
+ "sell_token_id": "_",
+ "buy_token_id": "1000001",
+ "prices": [
+ {
+ "sell_token_quantity": 100,
+ "buy_token_quantity": 200
+ }
+ ]
+}
+```
+
+## MarketCancelOrder
+
+Cancel the order.
+
+```console
+> MarketCancelOrder owner_address order_id
+```
+
+- `owner_address` — the account address which created the order.
+- `order_id` — the order id which you want to cancel.
+
+Example:
+
+```console
+MarketCancelOrder TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0
+```
+
+Get the result of the contract execution with the `getTransactionInfoById` command:
+
+```console
+getTransactionInfoById b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27
+{
+ "id": "b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27",
+ "blockNumber": 1582,
+ "blockTimeStamp": 1578986232000,
+ "contractResult": [
+ ""
+ ],
+ "receipt": {
+ "net_usage": 283
+ }
+}
+```
+
+## See also
+
+- [proposals](proposals.md) — on-chain governance proposals
+- [exchange](exchange.md) — the built-in Bancor exchange
+- [transfer-trc10](transfer-trc10.md) — issue the TRC10 assets being traded
diff --git a/java/docs/commands/exchange.md b/java/docs/commands/exchange.md
new file mode 100644
index 000000000..1851d7173
--- /dev/null
+++ b/java/docs/commands/exchange.md
@@ -0,0 +1,84 @@
+# Exchange (Bancor)
+
+The built-in on-chain exchange. The trading and price fluctuations of trading pairs are in accordance with the Bancor Agreement, which can be found in TRON's [related documents](https://tronprotocol.github.io/documentation-en/clients/wallet-cli-command/#dex).
+
+## ExchangeCreate
+
+Create a trading pair.
+
+```console
+> exchangeCreate [OwnerAddress] first_token_id first_token_balance second_token_id second_token_balance
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `first_token_id`, `first_token_balance` — ID and amount of the first token.
+- `second_token_id`, `second_token_balance` — ID and amount of the second token. The ID is the ID of the issued TRC10 token. If it is TRX, the ID is `_`. The amount must be greater than 0, and less than 1,000,000,000,000,000.
+
+Example:
+
+```console
+> exchangeCreate 1000001 10000 _ 10000
+ # Create trading pairs with the IDs of 1000001 and TRX, with amount 10000 for both.
+```
+
+## GetExchange
+
+Query exchange pair based on id (confirmed state).
+
+```console
+> getExchange 1
+```
+
+## ExchangeInject
+
+Capital injection. When conducting a capital injection, depending on its quantity (`quant`), a proportion of each token in the trading pair will be withdrawn from the account and injected into the trading pair. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary.
+
+```console
+> exchangeInject [OwnerAddress] exchange_id token_id quant
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `exchange_id` — the ID of the trading pair to be funded.
+- `token_id`, `quant` — tokenId and quantity (unit in base unit) of capital injection.
+
+## ExchangeTransaction
+
+```console
+> exchangeTransaction [OwnerAddress] exchange_id token_id quant expected
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `exchange_id` — ID of the trading pair.
+- `token_id`, `quant` — the ID and quantity of tokens being exchanged, equivalent to selling.
+- `expected` — expected quantity of another token. `expected` must be less than `quant`, or an error will be reported.
+
+Example:
+
+```console
+> ExchangeTransaction 1 1000001 100 80
+```
+
+It is expected to acquire 80 TRX by exchanging 1000001 from the trading pair with ID 1, and the amount is 100. (Equivalent to selling an amount of 100 tokenID - 1000001, at a price of 80 TRX, in trading pair ID - 1.)
+
+## ExchangeWithdraw
+
+Capital withdrawal. When conducting a capital withdrawal, depending on its quantity (`quant`), a proportion of each token in the transaction pair is withdrawn from the trading pair and injected into the account. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary.
+
+```console
+> exchangeWithdraw [OwnerAddress] exchange_id token_id quant
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `Exchange_id` — the ID of the trading pair to be withdrawn.
+- `Token_id`, `quant` — tokenId and quantity (unit in base unit) of capital withdrawal.
+
+## Obtain information on trading pairs
+
+- `ListExchanges` — list trading pairs.
+- `ListExchangesPaginated` — list trading pairs by page.
+
+## See also
+
+- [proposals](proposals.md) — on-chain governance proposals
+- [dex](dex.md) — the TRON-DEX order market
+- [transfer-trc10](transfer-trc10.md) — issue the TRC10 assets being traded
diff --git a/java/docs/commands/gasfree.md b/java/docs/commands/gasfree.md
new file mode 100644
index 000000000..4b0b74ff5
--- /dev/null
+++ b/java/docs/commands/gasfree.md
@@ -0,0 +1,119 @@
+# GasFree transfers
+
+Wallet-cli supports GasFree integration — gas-free TRC20 transfers via the GasFree service.
+
+For more details, see the [GasFree Documentation](https://gasfree.io/specification) and the [TronLink User Guide for GasFree](https://support.tronlink.org/hc/en-us/articles/38903684778393-GasFree-User-Guide).
+
+**Prerequisites.** You must obtain an **API Key** and **API Secret** from GasFree for authentication, and set them in [`config.conf`](../reference/config.md). See the official [application form](https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform) for how to set up API authentication.
+
+## GasFreeInfo
+
+Query GasFree information — retrieve basic info, including the GasFree address associated with your current wallet address. The GasFree address is automatically activated upon the first transfer, which may incur an activation fee.
+
+For the current wallet address:
+
+```console
+wallet> gasfreeinfo
+balanceOf(address):70a08231
+{
+ "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
+ "active":true,
+ "tokenBalance":998696000,
+ "activateFee":0,
+ "transferFee":2000,
+ "maxTransferValue":998694000
+}
+gasFreeInfo: successful !!
+```
+
+For a specified address:
+
+```console
+wallet> gasfreeinfo TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe
+balanceOf(address):70a08231
+{
+ "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
+ "active":true,
+ "tokenBalance":998696000,
+ "activateFee":0,
+ "transferFee":2000,
+ "maxTransferValue":998694000
+}
+gasFreeInfo: successful !!
+```
+
+## GasFreeTransfer
+
+Submit a gas-free token transfer request.
+
+```console
+wallet> gasfreetransfer TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT 100000
+
+GasFreeTransfer result: {
+ "code":200,
+ "data":{
+ "amount":100000,
+ "providerAddress":"TKtWbdzEq5ss9vTS9kwRhBp5mXmBfBns3E",
+ "apiKey":"",
+ "accountAddress":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
+ "signature":"",
+ "targetAddress":"TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT",
+ "maxFee":2000000,
+ "version":1,
+ "nonce":8,
+ "tokenAddress":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
+ "createdAt":1747909635678,
+ "expiredAt":1747909695000,
+ "estimatedTransferFee":2000,
+ "id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0",
+ "state":"WAITING",
+ "estimatedActivateFee":0,
+ "gasFreeAddress":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER",
+ "updatedAt":1747909635678
+ }
+}
+GasFreeTransfer successful !!!
+```
+
+## GasFreeTrace
+
+Track transfer status — check the progress of a GasFree transfer using the `id` (trace ID) obtained from `GasFreeTransfer`.
+
+```console
+wallet> gasfreetrace 6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0
+GasFreeTrace result: {
+ "code":200,
+ "data":{
+ "amount":100000,
+ "providerAddress":"TKtWbdzEq5ss9vTS9kwRhBp5mXmBfBns3E",
+ "txnTotalCost":102000,
+ "accountAddress":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
+ "txnActivateFee":0,
+ "estimatedTotalCost":102000,
+ "targetAddress":"TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT",
+ "txnBlockTimestamp":1747909638000,
+ "txnTotalFee":2000,
+ "nonce":8,
+ "estimatedTotalFee":2000,
+ "tokenAddress":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
+ "txnHash":"858f9a00776163b1f8a34467b9c5727657f8971a9f4e9d492f0a247fac0384f9",
+ "txnBlockNum":57175988,
+ "createdAt":1747909635678,
+ "expiredAt":1747909695000,
+ "estimatedTransferFee":2000,
+ "txnState":"ON_CHAIN",
+ "id":"6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0",
+ "state":"CONFIRMING",
+ "estimatedActivateFee":0,
+ "gasFreeAddress":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER",
+ "txnTransferFee":2000,
+ "txnAmount":100000
+ }
+}
+GasFreeTrace: successful!!
+```
+
+## See also
+
+- [reference/config](../reference/config.md) — GasFree API key / secret setup
+- [usdt](usdt.md) — regular (non-gas-free) TRC20 transfers
diff --git a/java/docs/commands/index.md b/java/docs/commands/index.md
new file mode 100644
index 000000000..b13d849d4
--- /dev/null
+++ b/java/docs/commands/index.md
@@ -0,0 +1,164 @@
+# Command reference
+
+Commands are grouped into family pages below; the A–Z index links each command to its owning page. Every family page is populated. Links point to the owning page (open it and jump to the command's section).
+
+Type any command in the interactive wallet to see its built-in usage tips.
+
+## By family
+
+| Family | Page |
+|---|---|
+| Wallet management | [wallet.md](wallet.md) |
+| Account commands | [account.md](account.md) |
+| Network | [network.md](network.md) |
+| TRC10 tokens | [transfer-trc10.md](transfer-trc10.md) |
+| USDT & TRC20 | [usdt.md](usdt.md) |
+| Staking (Stake 2.0) | [stake-v2.md](stake-v2.md) |
+| Staking (Stake 1.0, legacy) | [stake-v1-legacy.md](stake-v1-legacy.md) |
+| Resource prices & withdrawals | [resources.md](resources.md) |
+| Voting, rewards & witnesses | [vote-reward.md](vote-reward.md) |
+| Smart contracts | [contract.md](contract.md) |
+| Proposals | [proposals.md](proposals.md) |
+| Exchange (Bancor) | [exchange.md](exchange.md) |
+| TRON-DEX market | [dex.md](dex.md) |
+| Multi-signature | [multisig.md](multisig.md) |
+| GasFree transfers | [gasfree.md](gasfree.md) |
+| Chain data & utilities | [chain-data.md](chain-data.md) |
+
+## A–Z index
+
+| Command | Page |
+|---|---|
+| AddTransactionSign | [multisig.md#sendcoin-signed-transaction](multisig.md#sendcoin-signed-transaction) |
+| AddressBook | [usdt.md#addressbook](usdt.md#addressbook) |
+| ApproveProposal | [proposals.md#approveproposal](proposals.md#approveproposal) |
+| AssetIssue | [transfer-trc10.md#assetissue](transfer-trc10.md#assetissue) |
+| BackupWallet | [wallet.md#backupwallet](wallet.md#backupwallet) |
+| BackupWallet2Base64 | [wallet.md#backupwallet2base64](wallet.md#backupwallet2base64) |
+| BroadcastTransaction | [chain-data.md#broadcasttransaction](chain-data.md#broadcasttransaction) |
+| CancelAllUnfreezeV2 | [stake-v2.md#cancelallunfreezev2](stake-v2.md#cancelallunfreezev2) |
+| ChangePassword | [wallet.md#changepassword](wallet.md#changepassword) |
+| ClearContractABI | [contract.md#clearcontractabi](contract.md#clearcontractabi) |
+| ClearWalletKeystore | [wallet.md#clearwalletkeystore](wallet.md#clearwalletkeystore) |
+| Create2 | [contract.md#create2](contract.md#create2) |
+| CreateAccount | [account.md#createaccount](account.md#createaccount) |
+| CreateProposal | [proposals.md#createproposal](proposals.md#createproposal) |
+| CreateWitness | [vote-reward.md#createwitness](vote-reward.md#createwitness) |
+| CurrentNetwork | [network.md#currentnetwork](network.md#currentnetwork) |
+| DelegateResource | [stake-v2.md#delegateresource-undelegateresource](stake-v2.md#delegateresource-undelegateresource) |
+| DeleteProposal | [proposals.md#deleteproposal](proposals.md#deleteproposal) |
+| DeployConstantContract | [contract.md#deployconstantcontract](contract.md#deployconstantcontract) |
+| DeployContract | [contract.md#deploycontract](contract.md#deploycontract) |
+| EncodingConverter | [chain-data.md#encodingconverter](chain-data.md#encodingconverter) |
+| EstimateEnergy | [contract.md#estimateenergy](contract.md#estimateenergy) |
+| ExchangeCreate | [exchange.md#exchangecreate](exchange.md#exchangecreate) |
+| ExchangeInject | [exchange.md#exchangeinject](exchange.md#exchangeinject) |
+| ExchangeTransaction | [exchange.md#exchangetransaction](exchange.md#exchangetransaction) |
+| ExchangeWithdraw | [exchange.md#exchangewithdraw](exchange.md#exchangewithdraw) |
+| ExportWalletKeystore | [wallet.md#exportwalletkeystore](wallet.md#exportwalletkeystore) |
+| ExportWalletMnemonic | [wallet.md#exportwalletmnemonic](wallet.md#exportwalletmnemonic) |
+| FreezeBalance | [stake-v1-legacy.md#how-to-freezeunfreeze-balance](stake-v1-legacy.md#how-to-freezeunfreeze-balance) |
+| FreezeBalanceV2 | [stake-v2.md#freezebalancev2-unfreezebalancev2](stake-v2.md#freezebalancev2-unfreezebalancev2) |
+| GasFreeInfo | [gasfree.md#gasfreeinfo](gasfree.md#gasfreeinfo) |
+| GasFreeTrace | [gasfree.md#gasfreetrace](gasfree.md#gasfreetrace) |
+| GasFreeTransfer | [gasfree.md#gasfreetransfer](gasfree.md#gasfreetransfer) |
+| GenerateAddress | [account.md#generateaddress](account.md#generateaddress) |
+| GenerateSubAccount | [wallet.md#generatesubaccount](wallet.md#generatesubaccount) |
+| GetAccount | [account.md#getaccount](account.md#getaccount) |
+| GetAccountById | [account.md#getaccountbyid](account.md#getaccountbyid) |
+| GetAccountNet | [account.md#getaccountnet](account.md#getaccountnet) |
+| GetAccountResource | [account.md#getaccountresource](account.md#getaccountresource) |
+| GetAddress | [account.md#getaddress](account.md#getaddress) |
+| GetAssetIssueByAccount | [transfer-trc10.md#how-to-obtain-trc10-token-information](transfer-trc10.md#how-to-obtain-trc10-token-information) |
+| GetAssetIssueById | [transfer-trc10.md#how-to-obtain-trc10-token-information](transfer-trc10.md#how-to-obtain-trc10-token-information) |
+| GetAssetIssueByName | [transfer-trc10.md#how-to-obtain-trc10-token-information](transfer-trc10.md#how-to-obtain-trc10-token-information) |
+| GetAssetIssueListByName | [transfer-trc10.md#how-to-obtain-trc10-token-information](transfer-trc10.md#how-to-obtain-trc10-token-information) |
+| GetAvailableUnfreezeCount | [stake-v2.md#getavailableunfreezecount](stake-v2.md#getavailableunfreezecount) |
+| GetBalance | [account.md#getbalance](account.md#getbalance) |
+| GetBandwidthPrices | [resources.md#getbandwidthprices](resources.md#getbandwidthprices) |
+| GetBlock | [chain-data.md#getblock](chain-data.md#getblock) |
+| GetBlockById | [chain-data.md#getblockbyid](chain-data.md#getblockbyid) |
+| GetBlockByIdOrNum | [chain-data.md#getblockbyidornum](chain-data.md#getblockbyidornum) |
+| GetBlockByLatestNum | [chain-data.md#getblockbylatestnum](chain-data.md#getblockbylatestnum) |
+| GetBlockByLimitNext | [chain-data.md#getblockbylimitnext](chain-data.md#getblockbylimitnext) |
+| GetBrokerage | [vote-reward.md#getbrokerage](vote-reward.md#getbrokerage) |
+| GetCanDelegatedMaxSize | [stake-v2.md#getcandelegatedmaxsize](stake-v2.md#getcandelegatedmaxsize) |
+| GetCanWithdrawUnfreezeAmount | [stake-v2.md#getcanwithdrawunfreezeamount](stake-v2.md#getcanwithdrawunfreezeamount) |
+| GetChainParameters | [chain-data.md#getchainparameters](chain-data.md#getchainparameters) |
+| GetContract | [contract.md#getcontract](contract.md#getcontract) |
+| GetContractInfo | [contract.md#getcontractinfo](contract.md#getcontractinfo) |
+| GetDelegatedResource | [stake-v1-legacy.md#get-resource-delegation-information](stake-v1-legacy.md#get-resource-delegation-information) |
+| GetDelegatedResourceAccountIndex | [stake-v1-legacy.md#get-resource-delegation-information](stake-v1-legacy.md#get-resource-delegation-information) |
+| GetDelegatedResourceAccountIndexV2 | [stake-v2.md#getdelegatedresourceaccountindexv2](stake-v2.md#getdelegatedresourceaccountindexv2) |
+| GetDelegatedResourceV2 | [stake-v2.md#getdelegatedresourcev2](stake-v2.md#getdelegatedresourcev2) |
+| GetEnergyPrices | [resources.md#getenergyprices](resources.md#getenergyprices) |
+| GetExchange | [exchange.md#getexchange](exchange.md#getexchange) |
+| GetMarketOrderByAccount | [dex.md#getmarketorderbyaccount](dex.md#getmarketorderbyaccount) |
+| GetMarketOrderById | [dex.md#getmarketorderbyid](dex.md#getmarketorderbyid) |
+| GetMarketOrderListByPair | [dex.md#getmarketorderlistbypair](dex.md#getmarketorderlistbypair) |
+| GetMarketPairList | [dex.md#getmarketpairlist](dex.md#getmarketpairlist) |
+| GetMarketPriceByPair | [dex.md#getmarketpricebypair](dex.md#getmarketpricebypair) |
+| GetMemoFee | [resources.md#getmemofee](resources.md#getmemofee) |
+| GetNextMaintenanceTime | [chain-data.md#getnextmaintenancetime](chain-data.md#getnextmaintenancetime) |
+| GetPaginatedNowWitnessList | [vote-reward.md#getpaginatednowwitnesslist](vote-reward.md#getpaginatednowwitnesslist) |
+| GetPrivateKeyByMnemonic | [chain-data.md#getprivatekeybymnemonic](chain-data.md#getprivatekeybymnemonic) |
+| GetProposal | [proposals.md#obtain-proposal-information](proposals.md#obtain-proposal-information) |
+| GetReward | [vote-reward.md#getreward](vote-reward.md#getreward) |
+| GetTransactionApprovedList | [multisig.md#gettransactionapprovedlist](multisig.md#gettransactionapprovedlist) |
+| GetTransactionById | [chain-data.md#gettransactionbyid](chain-data.md#gettransactionbyid) |
+| GetTransactionCountByBlockNum | [chain-data.md#gettransactioncountbyblocknum](chain-data.md#gettransactioncountbyblocknum) |
+| GetTransactionInfoByBlockNum | [chain-data.md#gettransactioninfobyblocknum](chain-data.md#gettransactioninfobyblocknum) |
+| GetTransactionInfoById | [chain-data.md#gettransactioninfobyid](chain-data.md#gettransactioninfobyid) |
+| GetTransactionSignWeight | [multisig.md#gettransactionsignweight](multisig.md#gettransactionsignweight) |
+| GetUSDTBalance | [usdt.md#getusdtbalance](usdt.md#getusdtbalance) |
+| GetUsdtTransferById | [usdt.md#getusdttransferbyid](usdt.md#getusdttransferbyid) |
+| ImportWallet | [wallet.md#importwallet](wallet.md#importwallet) |
+| ImportWalletByBase64 | [wallet.md#importwalletbybase64](wallet.md#importwalletbybase64) |
+| ImportWalletByKeystore | [wallet.md#importwalletbykeystore](wallet.md#importwalletbykeystore) |
+| ImportWalletByLedger | [wallet.md#importwalletbyledger](wallet.md#importwalletbyledger) |
+| ImportWalletByMnemonic | [wallet.md#importwalletbymnemonic](wallet.md#importwalletbymnemonic) |
+| ListAssetIssue | [transfer-trc10.md#how-to-obtain-trc10-token-information](transfer-trc10.md#how-to-obtain-trc10-token-information) |
+| ListAssetIssuePaginated | [transfer-trc10.md#listassetissuepaginated](transfer-trc10.md#listassetissuepaginated) |
+| ListExchanges | [exchange.md#obtain-information-on-trading-pairs](exchange.md#obtain-information-on-trading-pairs) |
+| ListExchangesPaginated | [exchange.md#obtain-information-on-trading-pairs](exchange.md#obtain-information-on-trading-pairs) |
+| ListNodes | [chain-data.md#listnodes](chain-data.md#listnodes) |
+| ListProposals | [proposals.md#obtain-proposal-information](proposals.md#obtain-proposal-information) |
+| ListProposalsPaginated | [proposals.md#obtain-proposal-information](proposals.md#obtain-proposal-information) |
+| ListWitnesses | [vote-reward.md#listwitnesses](vote-reward.md#listwitnesses) |
+| Lock | [wallet.md#lock](wallet.md#lock) |
+| Login | [../guide/command-flow.md](../guide/command-flow.md) |
+| LoginAll | [wallet.md#loginall](wallet.md#loginall) |
+| Logout | [wallet.md#logout](wallet.md#logout) |
+| MarketCancelOrder | [dex.md#marketcancelorder](dex.md#marketcancelorder) |
+| MarketSellAsset | [dex.md#marketsellasset](dex.md#marketsellasset) |
+| ModifyWalletName | [wallet.md#modifywalletname](wallet.md#modifywalletname) |
+| ParticipateAssetIssue | [transfer-trc10.md#participateassetissue](transfer-trc10.md#participateassetissue) |
+| RegisterWallet | [wallet.md#registerwallet](wallet.md#registerwallet) |
+| ResetWallet | [wallet.md#resetwallet](wallet.md#resetwallet) |
+| SendCoin | [multisig.md#sendcoin-signed-transaction](multisig.md#sendcoin-signed-transaction) |
+| SetAccountId | [account.md#setaccountid](account.md#setaccountid) |
+| ShowReceivingQrCode | [account.md#showreceivingqrcode](account.md#showreceivingqrcode) |
+| SwitchNetwork | [network.md#switchnetwork](network.md#switchnetwork) |
+| SwitchWallet | [wallet.md#switchwallet](wallet.md#switchwallet) |
+| TransferAsset | [transfer-trc10.md#transferasset](transfer-trc10.md#transferasset) |
+| TransferUSDT | [usdt.md#transferusdt](usdt.md#transferusdt) |
+| TriggerConstantContract | [contract.md#triggerconstantcontract](contract.md#triggerconstantcontract) |
+| TriggerContract | [contract.md#triggercontract](contract.md#triggercontract) |
+| TronlinkMultiSign | [multisig.md#tronlinkmultisign](multisig.md#tronlinkmultisign) |
+| UnDelegateResource | [stake-v2.md#delegateresource-undelegateresource](stake-v2.md#delegateresource-undelegateresource) |
+| UnfreezeAsset | [transfer-trc10.md#unfreezeasset](transfer-trc10.md#unfreezeasset) |
+| UnfreezeBalance | [stake-v1-legacy.md#unfreezebalance-undelegate](stake-v1-legacy.md#unfreezebalance-undelegate) |
+| UnfreezeBalanceV2 | [stake-v2.md#freezebalancev2-unfreezebalancev2](stake-v2.md#freezebalancev2-unfreezebalancev2) |
+| Unlock | [wallet.md#unlock](wallet.md#unlock) |
+| UpdateAccount | [account.md#updateaccount](account.md#updateaccount) |
+| UpdateAccountPermission | [multisig.md#updateaccountpermission](multisig.md#updateaccountpermission) |
+| UpdateAsset | [transfer-trc10.md#updateasset](transfer-trc10.md#updateasset) |
+| UpdateBrokerage | [vote-reward.md#updatebrokerage](vote-reward.md#updatebrokerage) |
+| UpdateEnergyLimit | [contract.md#updateenergylimit-updatesetting](contract.md#updateenergylimit-updatesetting) |
+| UpdateSetting | [contract.md#updateenergylimit-updatesetting](contract.md#updateenergylimit-updatesetting) |
+| UpdateWitness | [vote-reward.md#updatewitness](vote-reward.md#updatewitness) |
+| ViewBackupRecords | [account.md#viewbackuprecords](account.md#viewbackuprecords) |
+| ViewTransactionHistory | [account.md#viewtransactionhistory](account.md#viewtransactionhistory) |
+| VoteWitness | [vote-reward.md#how-to-vote](vote-reward.md#how-to-vote) |
+| WithdrawBalance | [vote-reward.md#withdrawbalance](vote-reward.md#withdrawbalance) |
+| WithdrawExpireUnfreeze | [stake-v2.md#withdrawexpireunfreeze](stake-v2.md#withdrawexpireunfreeze) |
diff --git a/java/docs/commands/multisig.md b/java/docs/commands/multisig.md
new file mode 100644
index 000000000..2a514d2f1
--- /dev/null
+++ b/java/docs/commands/multisig.md
@@ -0,0 +1,197 @@
+# Multi-signature
+
+Configure account permissions, co-sign transactions, inspect signature weight, and use TronLink multi-sign. For the underlying permission model, see [concepts/multisig](../concepts/multisig.md).
+
+## How to use the multi-signature feature of wallet-cli
+
+Multi-signature allows other users to access the account in order to better manage it. There are three types of access:
+
+- **owner**: access to the owner of the account.
+- **active**: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes.
+- **witness**: only for witness; block production authorization will be granted to one of the other users.
+
+## UpdateAccountPermission
+
+```console
+> Updateaccountpermission TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ {"owner_permission":{"type":0,"permission_name":"owner","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"witness_permission":{"type":1,"permission_name":"witness","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"active_permissions":[{"type":2,"permission_name":"active12323","threshold":2,"operations":"7fff1fc0033e0000000000000000000000000000000000000000000000000000","keys":[{"address":"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR","weight":1},{"address":"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP","weight":1}]}]}
+```
+
+or
+
+```console
+wallet> updateAccountPermission
+=== UpdateAccountPermission Interactive Mode ===
+
+Select permission to modify:
+1. owner_permission
+2. witness_permission
+3. active_permissions
+4. Add new active_permission
+5. Delete active_permission
+6. Show preview and Confirm
+7. Exit
+>
+```
+
+The account TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ gives the owner access to itself, active access to TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR and TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP. Active access will need signatures from both accounts in order to take effect.
+
+If the account is not a witness, it's not necessary to set `witness_permission`, otherwise an error will occur.
+
+## SendCoin (signed transaction)
+
+```console
+> SendCoin TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 10000000000000000
+```
+
+Will show "Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction."
+
+This will require the transfer authorization of active access. Enter: 2
+
+Then select accounts and put in the local password, i.e. TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR needs a private key of TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR to sign a transaction.
+
+Select another account and enter the local password, i.e. TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP will need a private key of TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP to sign a transaction.
+
+The weight of each account is 1, threshold of access is 2. When the requirements are met, users will be notified with "Send 10000000000000000 Sun to TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW successful !!".
+
+This is how multiple accounts use multi-signature when using the same cli. Use the instruction `addTransactionSign` according to the obtained transaction hex string if signing at multiple cli. After signing, the users will need to broadcast final transactions manually.
+
+## GetTransactionSignWeight
+
+Obtain weight information according to a transaction.
+
+```console
+> getTransactionSignWeight
+0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101
+```
+
+The information displays as follows:
+
+```json
+{
+ "result":{
+ "code":"PERMISSION_ERROR",
+ "message":"Signature count is 2 more than key counts of permission : 1"
+ },
+ "permission":{
+ "operations":"7fff1fc0033e0100000000000000000000000000000000000000000000000000",
+ "keys":[
+ {
+ "address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "weight":1
+ }
+ ],
+ "threshold":1,
+ "id":2,
+ "type":"Active",
+ "permission_name":"active"
+ },
+ "transaction":{
+ "result":{
+ "result":true
+ },
+ "txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
+ "transaction":{
+ "signature":[
+ "c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
+ "3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
+ ],
+ "txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "amount":10000000000000000,
+ "owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
+ },
+ "type_url":"type.googleapis.com/protocol.TransferContract"
+ },
+ "type":"TransferContract",
+ "Permission_id":2
+ }
+ ],
+ "ref_block_bytes":"0318",
+ "ref_block_hash":"60e195d3609c8661",
+ "expiration":1554123306262,
+ "timestamp":1554101706260
+ },
+ "raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
+ }
+ }
+}
+```
+
+## GetTransactionApprovedList
+
+Get signature information according to a transaction.
+
+```console
+> getTransactionApprovedList
+0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101
+```
+
+```json
+{
+ "result":{
+
+ },
+ "approved_list":[
+ "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP",
+ "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR"
+ ],
+ "transaction":{
+ "result":{
+ "result":true
+ },
+ "txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
+ "transaction":{
+ "signature":[
+ "c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
+ "3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
+ ],
+ "txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "amount":10000000000000000,
+ "owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
+ },
+ "type_url":"type.googleapis.com/protocol.TransferContract"
+ },
+ "type":"TransferContract",
+ "Permission_id":2
+ }
+ ],
+ "ref_block_bytes":"0318",
+ "ref_block_hash":"60e195d3609c8661",
+ "expiration":1554123306262,
+ "timestamp":1554101706260
+ },
+ "raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
+ }
+ }
+}
+```
+
+## TronlinkMultiSign
+
+Create multi-sign transactions and view the multi-sign transaction list through the TronLink service. Requires a `secretId` and `secretKey` — see [`config.conf`](../reference/config.md).
+
+```console
+wallet> tronlinkmultisign
+
+=== Multi-Sign Manager ===
+1. Multi-sign transaction list
+2. Create multi-sign transaction
+0. Exit
+Please enter the number to operate:
+```
+
+## See also
+
+- [concepts/multisig](../concepts/multisig.md) — permission / weight / threshold model
+- [wallet](wallet.md) — managing the keystores used to co-sign
diff --git a/java/docs/commands/network.md b/java/docs/commands/network.md
new file mode 100644
index 000000000..1d084c1a0
--- /dev/null
+++ b/java/docs/commands/network.md
@@ -0,0 +1,57 @@
+# Network commands
+
+Switch between and inspect the configured TRON networks. The three built-in networks are `MAIN`, `NILE`, and `SHASTA`; you can also point at a custom endpoint. See the [configuration reference](../reference/config.md) for how networks are configured locally.
+
+## SwitchNetwork
+
+Switch networks at any time. `switchnetwork local` switches to the network configured in your local `config.conf`.
+
+Interactive selection:
+
+```console
+wallet> switchnetwork
+Please select network:
+1. MAIN
+2. NILE
+3. SHASTA
+Enter numbers to select a network (1-3):1
+Now, current network is : MAIN
+SwitchNetwork successful !!!
+```
+
+Direct selection by name:
+
+```console
+wallet> switchnetwork main
+Now, current network is : MAIN
+SwitchNetwork successful !!!
+```
+
+Custom endpoint (`switchnetwork `, `empty` to omit one):
+
+```console
+wallet> switchnetwork empty localhost:50052
+Now, current network is : CUSTOM
+SwitchNetwork successful !!!
+```
+
+## CurrentNetwork
+
+View the current network.
+
+```console
+wallet> currentnetwork
+currentNetwork: NILE
+```
+
+For a custom network, the node endpoints are shown:
+
+```console
+wallet> currentnetwork
+current network: CUSTOM
+fullNode: EMPTY, solidityNode: localhost:50052
+```
+
+## See also
+
+- [reference/config](../reference/config.md) — node endpoint configuration
diff --git a/java/docs/commands/proposals.md b/java/docs/commands/proposals.md
new file mode 100644
index 000000000..64c58ec8c
--- /dev/null
+++ b/java/docs/commands/proposals.md
@@ -0,0 +1,87 @@
+# Proposals
+
+On-chain governance proposals. Any proposal-related operations, except for viewing operations, must be performed by committee members.
+
+## CreateProposal
+
+Initiate a proposal.
+
+```console
+> createProposal [OwnerAddress] id0 value0 ... idN valueN
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `id0` — the serial number of the parameter. Every parameter of the TRON network has a serial number. Please refer to `http://tronscan.org/#/sr/committee`.
+- `Value0` — the modified value.
+
+In the example, modification No.4 (modifying token issuance fee) costs 1000 TRX as follows:
+
+```console
+> createProposal 4 1000
+> listproposals # View initiated proposal
+{
+ "proposals": [
+ {
+ "proposal_id": 1,
+ "proposer_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "parameters": [
+ {
+ "key": 4,
+ "value": 1000
+ }
+ ],
+ "expiration_time": 1567498800000,
+ "create_time": 1567498308000
+ }
+ ]
+}
+```
+
+The corresponding id is 1.
+
+## ApproveProposal
+
+Approve / disapprove a proposal.
+
+```console
+> approveProposal [OwnerAddress] id is_or_not_add_approval
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `id` — ID of the initiated proposal. Example: 1.
+- `is_or_not_add_approval` — true for approve; false for disapprove.
+
+Example:
+
+```console
+> ApproveProposal 1 true # in favor of the offer
+> ApproveProposal 1 false # Cancel the approved proposal
+```
+
+## DeleteProposal
+
+Delete an existing proposal. The proposal must be canceled by the supernode that initiated the proposal.
+
+```console
+> deleteProposal [OwnerAddress] proposalId
+```
+
+`proposalId` — ID of the initiated proposal. Example: 1.
+
+Example:
+
+```console
+> DeleteProposal 1
+```
+
+## Obtain proposal information
+
+- `ListProposals` — obtain a list of initiated proposals.
+- `ListProposalsPaginated` — use the paging mode to obtain the initiated proposals.
+- `GetProposal` — obtain proposal information based on the proposal ID.
+
+## See also
+
+- [exchange](exchange.md) — the built-in Bancor exchange
+- [dex](dex.md) — the TRON-DEX order market
+- [multisig](multisig.md) — committee/multi-sig operations
diff --git a/java/docs/commands/resources.md b/java/docs/commands/resources.md
new file mode 100644
index 000000000..769dfc481
--- /dev/null
+++ b/java/docs/commands/resources.md
@@ -0,0 +1,42 @@
+# Resource prices & memo fee
+
+Query historical resource unit prices and the memo fee. For how bandwidth and energy work, see [concepts/resources](../concepts/resources.md). Reward withdrawal (`WithdrawBalance`) lives on the [voting & rewards](vote-reward.md) page.
+
+## GetBandwidthPrices
+
+Get the historical unit price of bandwidth.
+
+```console
+wallet> getBandwidthPrices
+{
+ "prices": "0:10,1606537680000:40,1614238080000:140,1626581880000:1000,1626925680000:140,1627731480000:1000"
+}
+```
+
+## GetEnergyPrices
+
+Get the historical unit price of energy.
+
+```console
+wallet> getEnergyPrices
+{
+ "prices": "0:100,1575871200000:10,1606537680000:40,1614238080000:140,1635739080000:280,1681895880000:420"
+}
+```
+
+## GetMemoFee
+
+Get the memo fee.
+
+```console
+wallet> getMemoFee
+{
+ "prices": "0:0,1675492680000:1000000"
+}
+```
+
+## See also
+
+- [concepts/resources](../concepts/resources.md) — bandwidth / energy model and bandwidth calculation
+- [stake-v2](stake-v2.md) — freeze TRX to obtain resources
+- [chain-data](chain-data.md) — `GetChainParameters` and other chain queries
diff --git a/java/docs/commands/stake-v1-legacy.md b/java/docs/commands/stake-v1-legacy.md
new file mode 100644
index 000000000..aab565883
--- /dev/null
+++ b/java/docs/commands/stake-v1-legacy.md
@@ -0,0 +1,71 @@
+# Staking (Stake 1.0, legacy)
+
+> ⚠️ **Legacy.** These are the pre–Stake 2.0 freeze commands, kept for reference. New usage should prefer [Stake 2.0](stake-v2.md). For the difference between the two models, see [concepts/staking-models](../concepts/staking-models.md).
+
+Legacy freeze/unfreeze and resource delegation (v1). Bandwidth mechanics are explained in [concepts/resources](../concepts/resources.md).
+
+## How to freeze/unfreeze balance
+
+After the funds are frozen, the corresponding number of shares and bandwidth will be obtained. Shares can be used for voting and bandwidth can be used for trading. The rules for the use and calculation of share and bandwidth are described in [concepts/resources](../concepts/resources.md).
+
+**Freeze operation is as follows:**
+
+```console
+> freezeBalance [OwnerAddress] frozen_balance frozen_duration [ResourceCode:0 BANDWIDTH, 1 ENERGY] [receiverAddress]
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `frozen_balance` — the amount of frozen funds, the unit is Sun. The minimum value is **1000000 Sun (1 TRX)**.
+- `frozen_duration` — freeze time, this value is currently only allowed for **3 days**.
+
+For example:
+
+```console
+> freezeBalance 100000000 3 1 address
+```
+
+After the freeze operation, frozen funds will be transferred from Account Balance to Frozen. You can view frozen funds from your account information. After being unfrozen, it is transferred back to Balance from Frozen, and the frozen funds cannot be used for trading.
+
+When more share or bandwidth is needed temporarily, additional funds may be frozen to obtain additional share and bandwidth. The unfrozen time is postponed until 3 days after the last freeze operation.
+
+After the freezing time expires, funds can be unfrozen.
+
+**Unfreeze operation is as follows:**
+
+```console
+> unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH, 1 CPU) [receiverAddress]
+```
+
+## How to delegate resource
+
+### FreezeBalance (delegate)
+
+```console
+> freezeBalance [OwnerAddress] frozen_balance frozen_duration [ResourceCode:0 BANDWIDTH, 1 ENERGY] [receiverAddress]
+```
+
+The latter two parameters are optional. If not set, the TRX is frozen to obtain resources for its own use; if not empty, the acquired resources are used by `receiverAddress`.
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `frozen_balance` — the amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000 sun.
+- `frozen_duration` — frozen duration, 3 days.
+- `ResourceCode` — 0 BANDWIDTH; 1 ENERGY.
+- `receiverAddress` — target account address.
+
+### UnfreezeBalance (undelegate)
+
+```console
+> unfreezeBalance [OwnerAddress] ResourceCode(0 BANDWIDTH, 1 CPU) [receiverAddress]
+```
+
+The latter two parameters are optional. If they are not set, the BANDWIDTH resource is unfrozen by default; when the `receiverAddress` is set, the delegated resources are unfrozen.
+
+### Get resource delegation information
+
+- `getDelegatedResource fromAddress toAddress` — get the information from the `fromAddress` to the `toAddress` resource delegate.
+- `getDelegatedResourceAccountIndex address` — get the information that `address` is delegated to other accounts' resources.
+
+## See also
+
+- [stake-v2](stake-v2.md) — the current staking model (Stake 2.0)
+- [concepts/staking-models](../concepts/staking-models.md) · [concepts/resources](../concepts/resources.md)
diff --git a/java/docs/commands/stake-v2.md b/java/docs/commands/stake-v2.md
new file mode 100644
index 000000000..42debeb2f
--- /dev/null
+++ b/java/docs/commands/stake-v2.md
@@ -0,0 +1,411 @@
+# Staking (Stake 2.0)
+
+FreezeV2-based staking, resource delegation, and unfreeze withdrawal — the current staking model. For the difference from the legacy model, see [concepts/staking-models](../concepts/staking-models.md).
+
+## FreezeBalanceV2 / UnfreezeBalanceV2
+
+### FreezeBalanceV2
+
+```console
+> freezeBalanceV2 [OwnerAddress] frozen_balance [ResourceCode:0 BANDWIDTH,1 ENERGY,2 TRON_POWER]
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `frozen_balance` — the amount of frozen, the unit is the smallest unit (Sun), the minimum is 1000000 sun.
+- `ResourceCode` — 0 BANDWIDTH; 1 ENERGY.
+
+Example:
+
+```console
+wallet> FreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000000000000 0
+txid is 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d
+wallet> GetTransactionById 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "4faa3772fa3d3e4792e8126cafed2dc2c5c069cd09c29532f0119bc982bf356004772e16fad86e401f5818c35b96d214d693efab06997ca2f07044d4494f12fd01"
+ ],
+ "txID":"82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "frozen_balance":1000000000000000,
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
+ },
+ "type_url":"type.googleapis.com/protocol.FreezeBalanceV2Contract"
+ },
+ "type":"FreezeBalanceV2Contract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671109891800,
+ "timestamp":1671088291796
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff440d8ada5afd1305a5c083612580a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e747261637412200a154159e3741a68ec3e1ebba80ad809d5ccd31674236e1080809aa6eaafe30170d4fffea4d130"
+}
+```
+
+### UnfreezeBalanceV2
+
+```console
+> unfreezeBalanceV2 [OwnerAddress] unfreezeBalance ResourceCode(0 BANDWIDTH,1 ENERGY,2 TRON_POWER)
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `unfreezeBalance` — the amount of unfreeze, the unit is the smallest unit (Sun).
+- `ResourceCode` — 0 BANDWIDTH; 1 ENERGY.
+
+Example:
+
+```console
+wallet> UnFreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 9000000 0
+txid is dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634
+wallet> GetTransactionById dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "f73a278f742c11e8e5ede693ca09b0447a804fcb28ea2bfdfd8545bb05da7be44bd08cfaa92bd4d159178f763fcf753f28d5296bd0c3d4557532cce3b256b9da00"
+ ],
+ "txID":"dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e",
+ "unfreeze_balance":9000000
+ },
+ "type_url":"type.googleapis.com/protocol.UnfreezeBalanceV2Contract"
+ },
+ "type":"UnfreezeBalanceV2Contract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671119916913,
+ "timestamp":1671098316907
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff440f19e89b4d1305a5a083712560a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121c0a154159e3741a68ec3e1ebba80ad809d5ccd31674236e10c0a8a50470ebf0e2a9d130"
+}
+```
+
+## DelegateResource / UnDelegateResource
+
+### DelegateResource
+
+```console
+> delegateResource [OwnerAddress] balance ResourceCode(0 BANDWIDTH,1 ENERGY), ReceiverAddress [lock]
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `balance` — the amount of delegate, the unit is the smallest unit (Sun), the minimum is 1000000 sun.
+- `ResourceCode` — 0 BANDWIDTH; 1 ENERGY.
+- `ReceiverAddress` — the address of the account.
+- `lock` — default is false, set true if you need to lock the delegate for 3 days.
+
+Example:
+
+```console
+wallet> DelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 10000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3 true
+txid is 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed
+wallet> GetTransactionById 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "1f57fd78456136faadc5091b47f5fd27a8e1181621e49129df6a4062499429fb48ee72e5f9a9ff5bfb7f2575f01f4076f7d4b89ca382d36af46a6fa4bc749f4301"
+ ],
+ "txID":"363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "balance":10000000,
+ "receiver_address":"419a9afe56e155ef0ff3f680d00ecf19deff60bdca",
+ "lock":true,
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
+ },
+ "type_url":"type.googleapis.com/protocol.DelegateResourceContract"
+ },
+ "type":"DelegateResourceContract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671120059226,
+ "timestamp":1671098459216
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff440daf691b4d1305a720839126e0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412350a154159e3741a68ec3e1ebba80ad809d5ccd31674236e1880ade2042215419a9afe56e155ef0ff3f680d00ecf19deff60bdca280170d0c8eba9d130"
+}
+
+```
+
+### UnDelegateResource
+
+```console
+> unDelegateResource [OwnerAddress] balance ResourceCode(0 BANDWIDTH,1 ENERGY), ReceiverAddress
+```
+
+- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `balance` — the amount of unDelegate, the unit is the smallest unit (Sun).
+- `ResourceCode` — 0 BANDWIDTH; 1 ENERGY.
+- `ReceiverAddress` — the address of the account.
+
+Example:
+
+```console
+wallet> UnDelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3
+txid is feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c
+wallet> GetTransactionById feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "85a41a4e44780ffbe0841a44fd71cf621f129d98e84984cfca68e03364f781aa7f9d44177af0b40d82da052feec9f47a399ed6e51be66c5db07cb13477dcde8c01"
+ ],
+ "txID":"feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "balance":1000000,
+ "receiver_address":"419a9afe56e155ef0ff3f680d00ecf19deff60bdca",
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
+ },
+ "type_url":"type.googleapis.com/protocol.UnDelegateResourceContract"
+ },
+ "type":"UnDelegateResourceContract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671120342283,
+ "timestamp":1671098742280
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff4408b9aa3b4d1305a71083a126d0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412320a154159e3741a68ec3e1ebba80ad809d5ccd31674236e18c0843d2215419a9afe56e155ef0ff3f680d00ecf19deff60bdca7088ecfca9d130"
+}
+```
+
+## WithdrawExpireUnfreeze
+
+```console
+> withdrawExpireUnfreeze [OwnerAddress]
+```
+
+`OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+
+Example:
+
+```console
+wallet> withdrawexpireunfreeze TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
+txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
+wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "f8f02b5aa634b8666862a6d2ed68fcfd90afc616d14062952b0b09f0404d9bca6c4d3dc6dab082784950ff1ded235a07dab0d738c8a202be9451d5ca92b8eece01"
+ ],
+ "txID":"e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
+ },
+ "type_url":"type.googleapis.com/protocol.WithdrawExpireUnfreezeContract"
+ },
+ "type":"WithdrawExpireUnfreezeContract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671122055318,
+ "timestamp":1671100455315
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff44096e18bb5d1305a5a083812560a3b747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746864726177457870697265556e667265657a65436f6e747261637412170a154159e3741a68ec3e1ebba80ad809d5ccd31674236e7093b3e5aad130"
+}
+```
+
+## CancelAllUnfreezeV2
+
+```console
+> cancelAllUnfreezeV2 [OwnerAddress]
+```
+
+`OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+
+Example:
+
+```console
+wallet> cancelAllUnfreezeV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
+txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
+wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147
+{
+ "ret":[
+ {
+ "contractRet":"SUCCESS"
+ }
+ ],
+ "signature":[
+ "f8f02b5aa634b8666862a6d2ed68fcfd90afc616d14062952b0b09f0404d9bca6c4d3dc6dab082784950ff1ded235a07dab0d738c8a202be9451d5ca92b8eece01"
+ ],
+ "txID":"e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147",
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "owner_address":"4159e3741a68ec3e1ebba80ad809d5ccd31674236e"
+ },
+ "type_url":"type.googleapis.com/protocol.CancelAllUnfreezeV2"
+ },
+ "type":"CancelAllUnfreezeV2Contract"
+ }
+ ],
+ "ref_block_bytes":"0000",
+ "ref_block_hash":"19b59068c6058ff4",
+ "expiration":1671122055318,
+ "timestamp":1671100455315
+ },
+ "raw_data_hex":"0a020000220819b59068c6058ff44096e18bb5d1305a5a083812560a3b747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5769746864726177457870697265556e667265657a65436f6e747261637412170a154159e3741a68ec3e1ebba80ad809d5ccd31674236e7093b3e5aad130"
+}
+```
+
+## Query delegation (v2 API)
+
+### GetDelegatedResourceV2
+
+Get the information from the `fromAddress` to the `toAddress` resource delegate using the v2 API.
+
+```console
+> getDelegatedResourceV2 fromAddress toAddress
+```
+
+- `fromAddress` — the address of the account that starts the delegate.
+- `toAddress` — the address of the account that receives the delegate.
+
+Example:
+
+```console
+wallet> getDelegatedResourceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3
+{
+ "delegatedResource": [
+ {
+ "from": "TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh",
+ "to": "TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3",
+ "frozen_balance_for_bandwidth": 10000000
+ }
+ ]
+}
+```
+
+### GetDelegatedResourceAccountIndexV2
+
+Get the information that `address` is delegated to other accounts' resources using the v2 API.
+
+```console
+> getDelegatedResourceAccountIndexV2 address
+```
+
+`address` — the address of the account that starts the delegate or receives the delegate.
+
+Example:
+
+```console
+wallet> getDelegatedResourceAccountIndexV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
+{
+ "account": "TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh",
+ "toAccounts": [
+ "TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3"
+ ]
+}
+```
+
+### GetCanDelegatedMaxSize
+
+Get the max size that the `ownerAddress` can delegate using `delegateResource`.
+
+```console
+> getcandelegatedmaxsize ownerAddress type
+```
+
+- `ownerAddress` — the address of the account that starts the delegate, optional, default is the address of the login account.
+- `type` — 0 bandwidth, 1 energy.
+
+Example:
+
+```console
+wallet> getCanDelegatedMaxSize TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 0
+{
+ "max_size": 999999978708334
+}
+```
+
+### GetAvailableUnfreezeCount
+
+Get the available unfreeze count that the `ownerAddress` can call with `unfreezeBalanceV2`.
+
+```console
+> getavailableunfreezecount ownerAddress
+```
+
+`ownerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+
+Example:
+
+```console
+wallet> getAvailableUnfreezeCount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh
+{
+ "count": 31
+}
+```
+
+### GetCanWithdrawUnfreezeAmount
+
+Get the withdraw unfreeze amount that the `ownerAddress` can get by `withdrawexpireunfreeze`.
+
+```console
+> getcanwithdrawunfreezeamount ownerAddress timestamp
+```
+
+- `ownerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
+- `timestamp` — get can-withdraw unfreeze amount until timestamp.
+
+Example:
+
+```console
+wallet> getCanWithdrawUnfreezeAmount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1671100335000
+{
+ "amount": 9000000
+}
+```
+
+## See also
+
+- [stake-v1-legacy](stake-v1-legacy.md) — the legacy freeze model
+- [concepts/staking-models](../concepts/staking-models.md) · [concepts/resources](../concepts/resources.md)
+- [resources](resources.md) — resource unit prices
diff --git a/java/docs/commands/transfer-trc10.md b/java/docs/commands/transfer-trc10.md
new file mode 100644
index 000000000..3492cafbe
--- /dev/null
+++ b/java/docs/commands/transfer-trc10.md
@@ -0,0 +1,203 @@
+# TRC10 tokens
+
+Issue, update, transfer, and query TRC10 assets.
+
+## How to issue a TRC10 token
+
+Each account can only issue **ONE** TRC10 token.
+
+### AssetIssue
+
+```console
+> AssetIssue [OwnerAddress] AssetName AbbrName TotalSupply TrxNum AssetNum Precision StartDate EndDate Description Url FreeNetLimitPerAccount PublicFreeNetLimit FrozenAmount0 FrozenDays0 [...] FrozenAmountN FrozenDaysN
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `AssetName` — the name of the issued TRC10 token.
+- `AbbrName` — the abbreviation of the TRC10 token.
+- `TotalSupply` — TotalSupply = Account Balance of Issuer + All Frozen Token Amount. TotalSupply: total issuing amount. Account Balance of Issuer: at the time of issuance. All Frozen Token Amount: before asset transfer and the issuance.
+- `TrxNum`, `AssetNum` — these two parameters determine the exchange rate when the token is issued. Exchange Rate = TrxNum / AssetNum. AssetNum: unit in base unit of the issued token. TrxNum: unit in SUN (0.000001 TRX).
+- `Precision` — precision to how many decimal places.
+- `FreeNetLimitPerAccount` — the maximum amount of bandwidth each account is allowed to use. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only).
+- `PublicFreeNetLimit` — the maximum total amount of bandwidth which is allowed to use for all accounts. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only).
+- `StartDate`, `EndDate` — the start and end date of token issuance. Within this period, other users can participate in token issuance.
+- `FrozenAmount0`, `FrozenDays0` — amount and days of token freeze. FrozenAmount0: must be bigger than 0. FrozenDays0: must be between 1 and 3653.
+
+Example:
+
+```console
+> AssetIssue TestTRX TRX 75000000000000000 1 1 2 "2019-10-02 15:10:00" "2020-07-11" "just for test121212" www.test.com 100 100000 10000 10 10000 1
+> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View published information
+{
+ "assetIssue": [
+ {
+ "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "name": "TestTRX",
+ "abbr": "TRX",
+ "total_supply": 75000000000000000,
+ "frozen_supply": [
+ {
+ "frozen_amount": 10000,
+ "frozen_days": 1
+ },
+ {
+ "frozen_amount": 10000,
+ "frozen_days": 10
+ }
+ ],
+ "trx_num": 1,
+ "precision": 2,
+ "num": 1,
+ "start_time": 1570000200000,
+ "end_time": 1594396800000,
+ "description": "just for test121212",
+ "url": "www.test.com",
+ "free_asset_net_limit": 100,
+ "public_free_asset_net_limit": 100000,
+ "id": "1000001"
+ }
+ ]
+}
+```
+
+### UpdateAsset
+
+Update parameters of a TRC10 token.
+
+```console
+> UpdateAsset [OwnerAddress] newLimit newPublicLimit description url
+```
+
+The specific meaning of the parameters is the same as that of `AssetIssue`.
+
+Example:
+
+```console
+> UpdateAsset 1000 1000000 "change description" www.changetest.com
+> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View the modified information
+{
+ "assetIssue": [
+ {
+ "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
+ "name": "TestTRX",
+ "abbr": "TRX",
+ "total_supply": 75000000000000000,
+ "frozen_supply": [
+ {
+ "frozen_amount": 10000,
+ "frozen_days": 1
+ },
+ {
+ "frozen_amount": 10000,
+ "frozen_days": 10
+ }
+ ],
+ "trx_num": 1,
+ "precision": 2,
+ "num": 1,
+ "start_time": 1570000200000,
+ "end_time": 1594396800000,
+ "description": "change description",
+ "url": "www.changetest.com",
+ "free_asset_net_limit": 1000,
+ "public_free_asset_net_limit": 1000000,
+ "id": "1000001"
+ }
+ ]
+}
+```
+
+### TransferAsset
+
+TRC10 token transfer.
+
+```console
+> TransferAsset [OwnerAddress] ToAddress AssertID Amount
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `ToAddress` — address of the target account.
+- `AssertID` — TRC10 token ID (the CLI prints this parameter name as `AssertID`). Example: 1000001.
+- `Amount` — the number of TRC10 token to transfer.
+
+Example:
+
+```console
+> TransferAsset TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz 1000001 1000
+> getaccount TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz # View target account information after the transfer
+address: TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz
+ assetV2
+ {
+ id: 1000001
+ balance: 1000
+ latest_asset_operation_timeV2: null
+ free_asset_net_usageV2: 0
+ }
+```
+
+### ParticipateAssetIssue
+
+Participate in the issuance of a TRC10 token.
+
+```console
+> ParticipateAssetIssue [OwnerAddress] ToAddress AssetID Amount
+```
+
+- `OwnerAddress` (optional) — the address of the account which initiated the transaction. Default: the address of the login account.
+- `ToAddress` — account address of TRC10 issuers.
+- `AssetID` — TRC10 token ID. Example: 1000001.
+- `Amount` — the number of TRC10 token to transfer.
+
+The participation process must happen during the release of TRC10, otherwise an error may occur.
+
+Example:
+
+```console
+> ParticipateAssetIssue TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ 1000001 1000
+> getaccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW # View remaining balance
+address: TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW
+assetV2
+ {
+ id: 1000001
+ balance: 1000
+ latest_asset_operation_timeV2: null
+ free_asset_net_usageV2: 0
+ }
+```
+
+### ListAssetIssuePaginated
+
+Query the list of all the tokens by pagination. Returns a list of tokens that succeed the token located at offset.
+
+```console
+> ListAssetIssuePaginated address code salt
+```
+
+Example:
+
+```console
+> ListAssetIssuePaginated 0 1
+```
+
+### UnfreezeAsset
+
+Unfreeze all TRC10 token which are supposed to be unfrozen after the freezing period.
+
+```console
+> unfreezeasset [OwnerAddress]
+```
+
+## How to obtain TRC10 token information
+
+| Command | Description |
+|---|---|
+| `ListAssetIssue` | Obtain all of the published TRC10 token information. |
+| `GetAssetIssueByAccount Address` | Obtain TRC10 token information based on issuing address. |
+| `getAssetIssueById AssetId` | Obtain TRC10 token information based on ID. |
+| `GetAssetIssueByName AssetName` | Obtain TRC10 token information based on names. |
+| `getAssetIssueListByName AssetName` | Obtain a list of TRC10 token information based on names. |
+
+## See also
+
+- [usdt](usdt.md) — TRC20 (USDT) transfers
+- [exchange](exchange.md) · [dex](dex.md) — trade TRC10 assets on the exchange / DEX
diff --git a/java/docs/commands/usdt.md b/java/docs/commands/usdt.md
new file mode 100644
index 000000000..b78968fcf
--- /dev/null
+++ b/java/docs/commands/usdt.md
@@ -0,0 +1,152 @@
+# USDT & TRC20 transfers
+
+TRC20 (USDT) balance, transfers, and the recipient address book.
+
+> The USDT commands (`GetUSDTBalance`, `TransferUSDT`, `GetUsdtTransferById`) run only on the **mainnet, Nile, and Shasta** networks. On any other network they report `This command does not support the current network.`
+
+## GetUSDTBalance
+
+Get the USDT balance of the login account, or of `Address` when one is given.
+
+```console
+> GetUSDTBalance [Address]
+```
+
+```console
+wallet> getusdtbalance
+balanceOf(address):70a08231
+Execution result = {
+ "constant_result": [
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ ],
+ "result": {
+ "result": true
+ },
+ "energy_used": 4062,
+ "energy_penalty": 3127
+}
+USDT balance = 0
+```
+
+## TransferUSDT
+
+Make a USDT transfer.
+
+```console
+> TransferUSDT [OwnerAddress] ToAddress Amount
+```
+
+```console
+wallet> transferusdt TR311sD6KasRnofj5RnFiFBA2rH8RH2kYk 1
+balanceOf(address):70a08231
+Execution result = {
+ "constant_result": [
+ "000000000000000000000000000000000000000000000000000000006544ae57"
+ ],
+ "result": {
+ "result": true
+ },
+ "energy_used": 935
+}
+USDT balance = 1698999895
+transfer(address,uint256):a9059cbb
+It is estimated that 345 bandwidth and 29650 energy will be consumed.
+Execution result = {
+ "constant_result": [
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ ],
+ "result": {
+ "result": true
+ },
+ "energy_used": 29650,
+ "logs": [
+ {
+ "address": "NaMomAhUzuFzMNFzzQHVNsR8xbmP3A5LT",
+ "topics": [
+ "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
+ "000000000000000000000000caf9798d70a3c609b600f163e53cfe8f586e1b9f",
+ "000000000000000000000000a5418b8da12e73075abb46375e7a15c758ea21fc"
+ ],
+ "data": "0000000000000000000000000000000000000000000000000000000000000001"
+ }
+ ]
+}
+{
+ "raw_data":{
+ "contract":[
+ {
+ "parameter":{
+ "value":{
+ "data":"a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc0000000000000000000000000000000000000000000000000000000000000001",
+ "owner_address":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
+ "contract_address":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf"
+ },
+ "type_url":"type.googleapis.com/protocol.TriggerSmartContract"
+ },
+ "type":"TriggerSmartContract"
+ }
+ ],
+ "ref_block_bytes":"08c7",
+ "ref_block_hash":"c02252c2ae3b92e1",
+ "expiration":1761639507000,
+ "fee_limit":1000000000,
+ "timestamp":1761639448851
+ },
+ "raw_data_hex":"0a0208c72208c02252c2ae3b92e140b8c896cfa2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc03"
+}
+Before sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e140b8c896cfa2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc03
+Please confirm and input your permission id, if input y/Y means default 0, other non-numeric characters will cancel transaction.
+y
+Please choose your key for sign.
+
+No. Address Name
+1 TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8 test
+Please choose No. between 1 and 1, or enter search to search wallets
+1
+Please input your password.
+********
+After sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e1409fb0b9d9a2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc031241a776830e5cd054c6a94631b6d62704e249e7587ab3f036e5e4fac15cbf49e671262532e094e1a32ad858272da3e101958102df61b0f72f26756a94b608883a6f01
+TxId is 9c8d4b84e9a71ccaad86b0a96f790067d3fc7ea85c26b425e5d748b81d31a8b8
+Transfer 1 to TR311sD6KasRnofj5RnFiFBA2rH8RH2kYk broadcast successful.
+Please check the given transaction id to get the result on blockchain using getTransactionInfoById command.
+```
+
+## GetUsdtTransferById
+
+Get a USDT transfer transaction summary based on transaction ID.
+
+```console
+> GetUsdtTransferById txId
+```
+
+```console
+wallet> GetUsdtTransferById b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a
+{
+ "id":"b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a",
+ "type":"TriggerSmartContract(transferUSDT)",
+ "from":"TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8",
+ "to":"TGDjv2KKD4UqEmFTnZgLzup5WWjTex4Mvq",
+ "amount":100,
+ "tronscanQueryUrl":"https://nile.tronscan.org/#/transaction/b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d2b984802143a"
+}
+```
+
+## AddressBook
+
+Add, delete, modify, and search the address book.
+
+```console
+wallet> AddressBook
+
+MAIN MENU:
+1. addAddress
+2. editAddress
+3. delAddress
+4. getAddressBook
+Select option: 1
+```
+
+## See also
+
+- [transfer-trc10](transfer-trc10.md) — TRC10 native tokens
+- [contract](contract.md) — general smart-contract calls
diff --git a/java/docs/commands/vote-reward.md b/java/docs/commands/vote-reward.md
new file mode 100644
index 000000000..38ff86fff
--- /dev/null
+++ b/java/docs/commands/vote-reward.md
@@ -0,0 +1,150 @@
+# Voting, rewards & witnesses
+
+Vote for super representatives, manage brokerage and claim rewards, and create / update witnesses.
+
+## How to vote
+
+Voting requires share. Share can be obtained by freezing funds.
+
+- The share calculation method is: **1** unit of share can be obtained for every **1 TRX** frozen.
+- After unfreezing, the previous vote will expire. You can avoid invalidating the vote by re-freezing and voting.
+
+**NOTE** The TRON network only records the status of your last vote, which means that each of your votes will overwrite all previous voting results.
+
+For example:
+
+```console
+> freezeBalance 100000000 3 1 address # Freeze 10TRX and acquire 10 units of shares
+
+> votewitness 123455 witness1 4 witness2 6 # Cast 4 votes for witness1 and 6 votes for witness2 at the same time
+
+> votewitness 123455 witness1 10 # Voted 10 votes for witness1
+```
+
+The final result of the above command was 10 votes for witness1 and 0 vote for witness2.
+
+## Brokerage
+
+After voting for a witness, you will receive rewards. The witness has the right to decide the ratio of brokerage. The default ratio is 20%, and the witness can adjust it.
+
+By default, if a witness is rewarded, they will receive 20% of the whole rewards, and 80% of the rewards will be distributed to their voters.
+
+### GetBrokerage
+
+View the ratio of brokerage of the witness.
+
+```console
+> getbrokerage OwnerAddress
+```
+
+`OwnerAddress` — the address of the witness's account, a base58check-type address.
+
+### GetReward
+
+Query unclaimed reward.
+
+```console
+> getreward OwnerAddress
+```
+
+`OwnerAddress` — the address of the voter's account, a base58check-type address.
+
+### UpdateBrokerage
+
+Update the ratio of brokerage. This command is usually used by a witness account.
+
+```console
+> updateBrokerage OwnerAddress brokerage
+```
+
+- `OwnerAddress` — the witness's account address, a base58check-type address.
+- `brokerage` — the ratio of brokerage you want to update, from 0 to 100. If the input is 10, it means 10% of the total reward would be distributed to the SR and the rest would be rewarded to all the voters, which is 90% in this case.
+
+Example:
+
+```console
+> getbrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h
+
+> getreward TNfu3u8jo1LDWerHGbzs2Pv88Biqd85wEY
+
+> updateBrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h 30
+```
+
+## WithdrawBalance
+
+Withdraw voting or block rewards.
+
+After each block is produced, the block award is sent to the account's allowance, and a withdraw operation is allowed every **24 hours** from allowance to balance. The funds in allowance cannot be locked or traded.
+
+```console
+> WithdrawBalance [owner_address]
+```
+
+```console
+> WithdrawBalance TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp
+```
+
+## How to create witness
+
+Applying to become a witness account needs to consume **100_000 TRX**. This part of the funds will be burned directly.
+
+### CreateWitness
+
+Apply to become a super representative candidate.
+
+```console
+> CreateWitness [owner_address] url
+```
+
+```console
+> CreateWitness TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 007570646174654e616d6531353330363038383733343633
+```
+
+### UpdateWitness
+
+Edit the URL of the SR's official website.
+
+```console
+> UpdateWitness TEDapYSVvAZ3aYH7w8N9tMEEFKaNKUD5Bp 007570646174654e616d6531353330363038383733343633
+```
+
+## ListWitnesses
+
+Get all miner node information.
+
+## GetPaginatedNowWitnessList
+
+Get the paginated current witness list.
+
+```console
+wallet> getPaginatedNowWitnessList 0 2
+{
+ "witnesses": [
+ {
+ "address": "TJmka325yjJKeFpQDwKSQAoNwEyNGhsaEV",
+ "voteCount": 5405926918,
+ "url": "http://sr-8.com",
+ "totalProduced": 1801675,
+ "totalMissed": 456,
+ "latestBlockNum": 64577529,
+ "latestSlotNum": 590063589,
+ "isJobs": true
+ },
+ {
+ "address": "TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG",
+ "voteCount": 2322244615,
+ "url": "http://sr-27.com",
+ "totalProduced": 1807756,
+ "totalMissed": 619,
+ "latestBlockNum": 64577530,
+ "latestSlotNum": 590063590,
+ "isJobs": true
+ }
+ ]
+}
+```
+
+## See also
+
+- [concepts/resources](../concepts/resources.md) — how shares are earned
+- [stake-v2](stake-v2.md) — freeze TRX to obtain vote share
diff --git a/java/docs/commands/wallet.md b/java/docs/commands/wallet.md
new file mode 100644
index 000000000..b7a8b4e1f
--- /dev/null
+++ b/java/docs/commands/wallet.md
@@ -0,0 +1,253 @@
+# Wallet management
+
+Create, import, export, and manage local wallets, plus session state (login / lock / switch).
+
+For the concepts behind keystores and secrets, see the [Setup / Configuration reference](../reference/config.md). For a full first-run walkthrough, see the [getting-started guide](../guide/getting-started.md).
+
+## RegisterWallet
+
+Register your wallet. You need to set the wallet password; this generates the address and private key.
+
+## ImportWallet
+
+Import a wallet from a hex-string private key. You need to set a password.
+
+## ImportWalletByBase64
+
+Import a wallet from a base64 private key. You need to set a password.
+
+## ImportWalletByMnemonic
+
+Import a wallet from a mnemonic. You need to set a password and enter the mnemonic.
+
+```console
+wallet> ImportWalletByMnemonic
+Please input password.
+password:
+Please input password again.
+password:
+Please enter 12 words (separated by spaces) [Attempt 1/3]:
+```
+
+## ExportWalletMnemonic
+
+Export the mnemonic of the address in the wallet.
+
+```console
+wallet> ExportWalletMnemonic
+Please input your password.
+password:
+exportWalletMnemonic successful !!
+a*ert tw*st co*rect mat*er pa*s g*ther p*t p*sition s*op em*ty coc*nut aband*n
+```
+
+## ExportWalletKeystore
+
+Export the wallet keystore in the TronLink wallet format.
+
+```console
+wallet> ExportWalletKeystore tronlink /tmp
+Please input your password.
+password:
+exported keystore file : /tmp/TYdhEg8b7tXm92UDbRDXPtJNU6T9xVGbbo.json
+exportWalletKeystore successful !!
+```
+
+## ImportWalletByKeystore
+
+Import a TronLink-format keystore file into wallet-cli.
+
+```console
+wallet> ImportWalletByKeystore tronlink /tmp/tronlink.json
+Please input password.
+password:
+Please input password again.
+password:
+fileName = TYQq6zp51unQDNELmT4xKMWh5WLcwpCDZJ.json
+importWalletByKeystore successful !!
+```
+
+## ImportWalletByLedger
+
+Import a derived account from a Ledger device into wallet-cli.
+
+```console
+wallet> ImportWalletByLedger
+((Note:This will pair Ledger to user your hardward wallet)
+Only one Ledger device is supported. If you have multiple devices, please ensure only one is connected.
+Ledger device found: Nano X
+Please input password.
+password:
+Please input password again.
+password:
+-------------------------------------------------
+Default Account Address: TAT1dA8F9HXGqmhvMCjxCKAD29YxDRw81y
+Default Path: m/44'/195'/0'/0/0
+-------------------------------------------------
+1. Import Default Account
+2. Change Path
+3. Custom Path
+Select an option: 1
+Import a wallet by Ledger successful, keystore file : ./Wallet/Ledger-TAT1dA8F9HXGqmhvMCjxCKAD29YxDRw81y.json
+You are now logged in, and you can perform operations using this account.
+```
+
+## BackupWallet
+
+Back up your wallet. You need to enter your wallet password; it exports the private key in hex-string format, such as: `1234567890123456789012345678901234567890123456789012345678901234`
+
+## BackupWallet2Base64
+
+Back up your wallet. You need to enter your wallet password; it exports the private key in base64 format, such as: `ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU=`
+
+## ChangePassword
+
+Modify the password of an account.
+
+## GenerateSubAccount
+
+Generate a sub-account using the mnemonic in the wallet.
+
+```console
+wallet> GenerateSubAccount
+Please input your password.
+password:
+
+=== Sub Account Generator ===
+-----------------------------
+Default Address: TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo
+Default Path: m/44'/195'/0'/0/1
+-----------------------------
+
+1. Generate Default Path
+2. Change Account
+3. Custom Path
+
+Enter your choice (1-3): 1
+mnemonic file : ./Mnemonic/TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json
+Generate a sub account successful, keystore file name is TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json
+generateSubAccount successful.
+```
+
+## ClearWalletKeystore
+
+Clear the wallet keystore of the login account.
+
+```console
+wallet> ClearWalletKeystore
+
+Warning: Dangerous operation!
+This operation will permanently delete the Wallet&Mnemonic files of the Address: TABWx7yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq
+Warning: The private key and mnemonic words will be permanently lost and cannot be recovered!
+Continue? (y/Y to proceed):y
+
+Final confirmation:
+Please enter: 'DELETE' to confirm the delete operation:
+Confirm: (DELETE): DELETE
+
+File deleted successfully:
+- /wallet-cli/Wallet/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json
+- /wallet-cli/Mnemonic/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json
+ClearWalletKeystore successful !!!
+```
+
+## ResetWallet
+
+Delete all local wallet keystore files and mnemonic files, and follow the prompts to re-register or import a wallet.
+
+```console
+wallet> resetwallet
+User defined config file doesn't exists, use default config file in jar
+
+Warning: Dangerous operation!
+This operation will permanently delete the Wallet&Mnemonic files
+Warning: The private key and mnemonic words will be permanently lost and cannot be recovered!
+Continue? (y/Y to proceed, c/C to cancel):
+y
+
+Final confirmation:
+Please enter: 'DELETE' to confirm the delete operation:
+Confirm: (DELETE): DELETE
+resetWallet successful !!!
+Now, you can RegisterWallet or ImportWallet again. Or import the wallet through other means.
+```
+
+## LoginAll
+
+Log in to multiple keystore accounts with a unified password.
+
+```console
+wallet> loginall
+Please input your password.
+password:
+Use user defined config file in current dir
+[========================================] 100%
+The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
+The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
+The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
+The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
+The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
+Please choose between 1 and 5
+5
+LoginAll successful !!!
+```
+
+## Logout
+
+Log out of the current wallet account.
+
+```console
+wallet> Logout
+Logout successful !!!
+```
+
+## Lock
+
+Lock the login account so that signatures and transactions are not allowed. Requires `lockAccount = true` in [`config.conf`](../reference/config.md).
+
+```console
+wallet> lock
+lock successful !!!
+```
+
+## Unlock
+
+Unlock a locked login account. By default it re-locks after 300 seconds; you can pass the unlock duration in seconds. Requires `lockAccount = true` in [`config.conf`](../reference/config.md).
+
+```console
+wallet> unlock 60
+Please input your password.
+password:
+unlock successful !!!
+```
+
+## SwitchWallet
+
+After logging in with `LoginAll`, switch between wallets.
+
+```console
+wallet> switchwallet
+The 1th keystore file name is TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json
+The 2th keystore file name is TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json
+The 3th keystore file name is TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json
+The 4th keystore file name is Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json
+The 5th keystore file name is TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json
+Please choose between 1 and 5
+5
+SwitchWallet successful !!!
+```
+
+## ModifyWalletName
+
+Modify the wallet's name.
+
+```console
+wallet> ModifyWalletName new-name
+Modify Wallet Name successful !!
+```
+
+## See also
+
+- [account](account.md) — account queries and metadata
+- [network](network.md) — switch between networks
+- [multisig](multisig.md) · [concepts/multisig](../concepts/multisig.md)
diff --git a/java/docs/concepts/index.md b/java/docs/concepts/index.md
new file mode 100644
index 000000000..eb217b343
--- /dev/null
+++ b/java/docs/concepts/index.md
@@ -0,0 +1,11 @@
+# Concepts
+
+Background on the TRON mechanics behind the commands. These are worth understanding up front to avoid surprises.
+
+| Concept | What it covers |
+|---|---|
+| [Resources: bandwidth, energy & shares](resources.md) | How freezing produces resources, and how bandwidth is calculated |
+| [Staking models: Stake 1.0 vs 2.0](staking-models.md) | The two freeze generations and which commands belong to each |
+| [Multi-signature concepts](multisig.md) | Permission types, keys, weights, and thresholds |
+
+For the commands themselves, see the [command index](../commands/index.md); to get started, see the [guides](../guide/index.md).
diff --git a/java/docs/concepts/multisig.md b/java/docs/concepts/multisig.md
new file mode 100644
index 000000000..265e8d7c6
--- /dev/null
+++ b/java/docs/concepts/multisig.md
@@ -0,0 +1,28 @@
+# Multi-signature concepts
+
+Multi-signature allows other users to access an account in order to better manage it. This is the model behind the [multi-sign commands](../commands/multisig.md).
+
+## Permission types
+
+There are three types of access:
+
+- **owner** — access to the owner of the account.
+- **active** — access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes.
+- **witness** — only for witness; block production authorization will be granted to one of the other users.
+
+If an account is not a witness, it is not necessary to set `witness_permission`, otherwise an error will occur.
+
+## Keys, weights, and threshold
+
+A permission lists one or more keys, each with a **weight**, and a **threshold**. A transaction under that permission is valid once the combined weight of the collected signatures meets the threshold.
+
+For example, if a permission grants active access to two accounts each with weight 1 and a threshold of 2, both must sign before the transaction takes effect. Signatures can be gathered on the same CLI, or across multiple CLIs using `addTransactionSign` on the transaction hex string — after which the final transaction is broadcast manually.
+
+You can inspect progress with:
+
+- [`getTransactionSignWeight`](../commands/multisig.md#gettransactionsignweight) — current accumulated weight vs the permission threshold.
+- [`getTransactionApprovedList`](../commands/multisig.md#gettransactionapprovedlist) — which accounts have already approved.
+
+## See also
+
+- [commands/multisig](../commands/multisig.md) — the commands themselves
diff --git a/java/docs/concepts/resources.md b/java/docs/concepts/resources.md
new file mode 100644
index 000000000..acb686e22
--- /dev/null
+++ b/java/docs/concepts/resources.md
@@ -0,0 +1,36 @@
+# Resources: bandwidth, energy & shares
+
+TRON accounts obtain resources by freezing (staking) TRX. This page collects the mechanics that the operation pages refer to.
+
+## Shares and bandwidth from freezing
+
+After funds are frozen, the corresponding number of shares and bandwidth is obtained. Shares can be used for voting and bandwidth can be used for trading.
+
+- **Share** — 1 unit of share can be obtained for every 1 TRX frozen. Shares are used for [voting](../commands/vote-reward.md#how-to-vote). After unfreezing, a previous vote will expire.
+- **Bandwidth** — consumed by contracts (transfers, asset transfers, voting, freezing, etc.). Querying does not consume bandwidth.
+
+## How to calculate bandwidth
+
+The bandwidth calculation rule is:
+
+```
+constant * FrozenFunds * days
+```
+
+Assuming freeze of 1 TRX (1_000_000 Sun) for 3 days, bandwidth obtained = 1 * 1_000_000 * 3 = 3_000_000.
+
+All contracts consume bandwidth, including transferring, transferring of assets, voting, freezing, etc. Querying does not consume bandwidth. Each contract needs to consume **100_000 bandwidth**.
+
+If a contract exceeds a certain time (**10s**), this operation does not consume bandwidth.
+
+When the unfreezing operation occurs, the bandwidth is not cleared. The next time the freeze is performed, the newly added bandwidth is accumulated.
+
+## Resource prices
+
+Historical unit prices for bandwidth and energy, and the memo fee, are queryable — see [commands/resources](../commands/resources.md).
+
+## See also
+
+- [commands/stake-v2](../commands/stake-v2.md) — the current staking model
+- [commands/stake-v1-legacy](../commands/stake-v1-legacy.md) — legacy freeze
+- [concepts/staking-models](staking-models.md)
diff --git a/java/docs/concepts/staking-models.md b/java/docs/concepts/staking-models.md
new file mode 100644
index 000000000..b9cd0dc7e
--- /dev/null
+++ b/java/docs/concepts/staking-models.md
@@ -0,0 +1,28 @@
+# Staking models: Stake 1.0 vs 2.0
+
+wallet-cli supports two generations of the TRON staking mechanism. New usage should prefer Stake 2.0.
+
+## Stake 1.0 (legacy)
+
+The original model, driven by `freezeBalance` / `unfreezeBalance`:
+
+- Freezing specifies a `frozen_duration`, currently only allowed to be **3 days**.
+- After the freezing time expires, funds can be unfrozen; when the unfreezing operation occurs, bandwidth is not cleared.
+- Resource delegation is expressed through the optional `receiverAddress` parameter of the same freeze/unfreeze commands.
+
+See [commands/stake-v1-legacy](../commands/stake-v1-legacy.md).
+
+## Stake 2.0 (current)
+
+The current model, driven by `freezeBalanceV2` / `unfreezeBalanceV2`, with resource delegation and an explicit unbonding/withdrawal flow:
+
+- `freezeBalanceV2` stakes TRX for BANDWIDTH, ENERGY, or TRON_POWER.
+- `delegateResource` / `unDelegateResource` delegate resources to another account (optionally locked for 3 days).
+- `unfreezeBalanceV2` begins unbonding; `withdrawExpireUnfreeze` withdraws the amount once it has expired; `cancelAllUnfreezeV2` cancels pending unfreezes.
+- Dedicated v2 query commands report delegation state and available/withdrawable amounts.
+
+See [commands/stake-v2](../commands/stake-v2.md).
+
+## See also
+
+- [concepts/resources](resources.md) — what shares, bandwidth, and energy are
diff --git a/java/docs/guide/command-flow.md b/java/docs/guide/command-flow.md
new file mode 100644
index 000000000..8fa03a444
--- /dev/null
+++ b/java/docs/guide/command-flow.md
@@ -0,0 +1,34 @@
+# Command-line operation flow
+
+A worked end-to-end example of an interactive session: build and run, register, back up, inspect, issue an asset, and transfer it.
+
+```console
+$ cd wallet-cli
+$ ./gradlew build
+$ ./gradlew run
+> RegisterWallet 123456 (password = 123456)
+> login 123456
+> getAddress
+address = TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm' # backup it!
+> BackupWallet 123456
+priKey = 1234567890123456789012345678901234567890123456789012345678901234 # backup it!!! (BackupWallet2Base64 option)
+> getbalance
+Balance = 0
+> AssetIssue TestTRX TRX 75000000000000000 1 1 2 "2019-10-02 15:10:00" "2020-07-11" "just for test121212" www.test.com 100 100000 10000 10 10000 1
+> getaccount TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm
+(Print balance: 9999900000
+"assetV2": [
+ {
+ "key": "1000001",
+ "value": 74999999999980000
+ }
+],)
+ # (cost trx 1000 trx for assetIssue)
+ # (You can query the trx balance and other asset balances for any account )
+> TransferAsset TWzrEZYtwzkAxXJ8PatVrGuoSNsexejRiM 1000001 10000
+```
+
+## See also
+
+- [getting-started](getting-started.md) — the shorter quickstart
+- [commands/transfer-trc10](../commands/transfer-trc10.md) — details of `AssetIssue` / `TransferAsset`
diff --git a/java/docs/guide/getting-started.md b/java/docs/guide/getting-started.md
new file mode 100644
index 000000000..c1866ed0e
--- /dev/null
+++ b/java/docs/guide/getting-started.md
@@ -0,0 +1,40 @@
+# Getting started
+
+The first-run flow: build, create an account, unlock it, inspect it, and send your first TRX — all from the interactive prompt.
+
+## Quickstart
+
+Build, create an account, and send your first transfer — all from the interactive prompt:
+
+```console
+# 1. Build
+$ git clone https://github.com/tronprotocol/wallet-cli.git
+$ cd wallet-cli && ./gradlew build && cd build/libs
+
+# 2. Start the interactive wallet
+$ java -jar wallet-cli.jar
+
+# 3. In the wallet prompt: create an account (or ImportWallet), unlock, and inspect it
+> RegisterWallet 123456 # create a keystore with password 123456
+> Login # unlock the account
+> GetAddress # show your address
+> GetBalance # TRX balance
+
+# 4. Send 1 TRX (amounts are in SUN; 1 TRX = 1,000,000 SUN)
+> SendCoin 1000000
+```
+
+> On mainnet these commands move **real funds**. While learning, switch to a testnet with `SwitchNetwork` (Nile or Shasta) and top up from that network's faucet.
+
+## How to create account
+
+You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Transferring to a non-existent account has a minimum restriction amount of **1 TRX**. Creating an account through the `CreateAccount` command still burns **1 TRX**.
+
+See [commands/account](../commands/account.md) for the full `CreateAccount` example.
+
+## Next steps
+
+- [command-flow](command-flow.md) — a worked end-to-end session
+- [commands/wallet](../commands/wallet.md) — create / import / back up wallets
+- [commands/network](../commands/network.md) — switch to a testnet
+- [concepts/resources](../concepts/resources.md) — bandwidth and energy
diff --git a/java/docs/guide/index.md b/java/docs/guide/index.md
new file mode 100644
index 000000000..bc3bfd7f4
--- /dev/null
+++ b/java/docs/guide/index.md
@@ -0,0 +1,10 @@
+# Guides
+
+Task-oriented walkthroughs for wallet-cli (Java).
+
+| Guide | What it covers |
+|---|---|
+| [Getting started](getting-started.md) | Build, create an account, unlock, and send your first TRX |
+| [Command-line operation flow](command-flow.md) | A worked end-to-end interactive session |
+
+For per-command reference, see the [command index](../commands/index.md); for TRON mechanics, see [concepts](../concepts/index.md).
diff --git a/java/docs/plan-standard-cli-ledger.md b/java/docs/plan-standard-cli-ledger.md
deleted file mode 100644
index b6a23a358..000000000
--- a/java/docs/plan-standard-cli-ledger.md
+++ /dev/null
@@ -1,627 +0,0 @@
-# Plan: Ledger support in Standard CLI
-
-**Status:** Ready to implement
-**Spike basis:** `docs/spike-standard-cli-ledger.md`
-**Approach:** Option A — reuse keystore + password auth, narrow `LedgerSigner`
-abstraction injected into the existing sign sites.
-**Estimated effort:** 1.5–2 working days net coding (excluding reviewer-run
-hardware smoke).
-
-## 1. Goal
-
-All standard CLI commands that currently produce a signed transaction must
-work when the resolved wallet is a Ledger keystore — without prompts on
-stdin/stdout, with structured JSON output, with deterministic exit codes,
-and with explicit error codes for every failure mode.
-
-The user authenticates exactly as for software wallets:
-`MASTER_PASSWORD` env var or `--password-stdin`. The Ledger device must be
-connected at sign time and the user must press the on-device confirmation
-button. The 60-second device timeout that the existing REPL path enforces
-applies unchanged.
-
-### Reach: standard-CLI signing commands through one sign exit
-
-The change converges on `WalletApi.signTransactionForCli` — the single sign
-exit shared by every standard-CLI signing command. After this plan ships,
-every `*ForCli` method that goes through that exit and whose transaction type
-is supported by the existing Ledger allowlist (e.g. `sendCoinForCli`,
-`triggerContractForCli`, `freezeBalanceForCli`, `voteWitnessForCli`,
-`accountPermissionUpdateForCli`, …) gains Ledger support simultaneously, plus
-the gasfree path through `WalletApiWrapper`.
-
-This high reach-per-effort ratio is the central justification for the work.
-
-## 2. Non-goals
-
-- **Ledger import / pairing in standard CLI.** Path selection requires a
- human in the loop; users run `importwalletbyledger` once in REPL.
-- **Password-less Ledger signing** (a future `--ledger-path` direct mode).
-- **Refactoring REPL Ledger paths.** The two REPL sign sites
- (`WalletApi.signTransaction(...)` overloads) are not touched.
-- **Configurable timeout.** REPL hard-codes 60 seconds; standard CLI
- inherits the same constant. `--ledger-timeout` is deferred.
-- **Multi-device disambiguation flag.** Documented behavior on multi-device
- setups; `--ledger-device` is deferred.
-- **Unifying `wf.getName().contains("Ledger")` vs `isLedgerUser()` detection
- inconsistency.** Out of scope.
-
-## 3. Mental model
-
-- Ledger keystores share the WalletFile JSON shape with software keystores.
- Their encrypted payload is a UTF-8 BIP44 path string instead of a 32-byte
- private key. The address is plaintext.
-- Standard CLI's existing `authenticate()` flow loads the keystore and
- verifies the password identically for both wallet types.
-- The two diverge at the **signing call**: software wallets sign locally
- with the decrypted private key; Ledger wallets send an APDU and wait for
- the on-device confirmation button.
-- The keystore password's role for Ledger wallets is format consistency,
- not security. Funds are protected by the device, not the password.
-
-## 4. Architecture
-
-### 4.1 The `LedgerSigner` interface
-
-```
-package org.tron.walletcli.cli.ledger;
-
-interface LedgerSigner {
- LedgerSignOutcome sign(Chain.Transaction transaction,
- String bip44Path,
- String address,
- boolean gasfree);
-}
-```
-
-`LedgerSignOutcome` is a value type:
-
-```
-final class LedgerSignOutcome {
- enum Status {
- OK,
- NOT_CONNECTED,
- APP_NOT_OPEN,
- SIGN_BY_HASH_DISABLED,
- ALREADY_SIGNING,
- USER_REJECTED,
- TIMEOUT,
- SIGN_FAILED,
- }
- Status status;
- String message; // human-readable detail, never user-prompt-style
- Chain.Transaction signedTransaction; // populated when status == OK and not gasfree
- String gasfreeSignature; // populated when status == OK and gasfree == true
-}
-```
-
-The interface lives in the standard-CLI package because both implementations
-exist for the standard CLI use case (production + test fake). REPL is not a
-client.
-
-### 4.2 The single implementation: `NonInteractiveLedgerSigner`
-
-```
-package org.tron.walletcli.cli.ledger;
-
-final class NonInteractiveLedgerSigner implements LedgerSigner {
- private final OutputFormatter formatter;
- private final SystemOutSuppressor suppressor;
- NonInteractiveLedgerSigner(OutputFormatter formatter,
- SystemOutSuppressor suppressor) { ... }
-
- @Override
- public LedgerSignOutcome sign(...) { ... }
-}
-```
-
-Internal flow (derived from spike F1–F8):
-
-1. `HidServicesWrapper.getInstance().getHidDevice(address, path)` →
- `null` ⇒ `NOT_CONNECTED`; throws ⇒ `NOT_CONNECTED` (with caught message).
-2. Pre-check `LedgerSignResult.getLastTransactionState(devicePath)` → if
- `SIGN_RESULT_SIGNING`, return `ALREADY_SIGNING` (mirrors REPL line-58
- check, but typed instead of printed).
-3. Defensively reset `TransactionSignManager.setTransaction(null)` and
- `setGasfreeSignature(null)`.
-4. Emit one stderr info line via the formatter:
- `"Please confirm transaction on Ledger device for " + address`.
-5. Open the suppressor (redirects `System.out` for the duration of the HID
- call) and invoke
- `LedgerEventListener.getInstance().executeSignListen(device, tx, path, gasfree)`.
-6. Close the suppressor regardless of outcome (try/finally).
-7. Inspect the listener's recorded last APDU response (see §4.4 patch):
- `0x6511` ⇒ `APP_NOT_OPEN`; `0x6a8c` ⇒ `SIGN_BY_HASH_DISABLED`; other
- non-empty bytes ⇒ `SIGN_FAILED` with hex in `message`.
-8. Otherwise derive outcome from post-sign state:
- - signature present in `TransactionSignManager` ⇒ `OK`
- - `LedgerSignResult.getLastTransactionState` ==
- `SIGN_RESULT_REJECTED` ⇒ `USER_REJECTED`
- - else ⇒ `TIMEOUT`
-9. `finally`: always reset `TransactionSignManager` transaction +
- signature fields and close the HID device.
-
-The implementation is roughly 180 LOC including imports and Javadoc.
-
-### 4.3 Wire-up: inject signer into `WalletApi` and `WalletApiWrapper`
-
-No back-reference interface, no hook indirection. Both classes get a
-nullable `LedgerSigner` field with a setter:
-
-```
-class WalletApi {
- private LedgerSigner ledgerSigner; // null in REPL; set in standard CLI
- public void setLedgerSigner(LedgerSigner s) { this.ledgerSigner = s; }
- public LedgerSigner getLedgerSigner() { return ledgerSigner; }
-}
-
-class WalletApiWrapper {
- public void setLedgerSigner(LedgerSigner s) {
- if (wallet != null) wallet.setLedgerSigner(s);
- }
-}
-```
-
-`StandardCliRunner.authenticate()`, after constructing the `WalletApi`,
-calls `wrapper.setLedgerSigner(new NonInteractiveLedgerSigner(...))`
-unconditionally. The signer is cheap to construct and idle when no Ledger
-sign happens.
-
-REPL never calls these setters; the field stays `null`; existing REPL
-paths continue to call `LedgerSignUtil.requestLedgerSignLogic` directly.
-**Zero REPL behavior change.**
-
-### 4.4 Sign-site changes
-
-Two edits, plus a 5-line additive patch.
-
-#### 4.4.1 `WalletApi.signTransactionForCli` (line 1064-1093)
-
-Existing Ledger branch:
-
-```java
-if (isLedgerFile) {
- boolean result = LedgerSignUtil.requestLedgerSignLogic(transaction, ledgerPath, wf.getAddress(), false);
- if (!result) { recordLastCliOperationError(...); return null; }
- transaction = TransactionSignManager.getInstance().getTransaction();
- Response.TransactionSignWeight weight = getTransactionSignWeight(transaction);
- if (ENOUGH_PERMISSION) { ...return transaction; }
- HidDevice hidDevice = HidServicesWrapper.getInstance().getHidDevice(...);
- if (hidDevice == null) { ...return null; }
- Optional state = LedgerSignResult.getLastTransactionState(hidDevice.getPath());
- boolean confirmed = state.isPresent() && SUCCESS.equals(state.get());
- if (NOT_ENOUGH_PERMISSION && confirmed && multi) { return transaction; }
- throw new CancelException(weight.getResult().getMessage());
-}
-```
-
-New branch:
-
-```java
-if (isLedgerFile) {
- if (this.ledgerSigner != null) {
- LedgerSignOutcome r = this.ledgerSigner.sign(transaction, ledgerPath, wf.getAddress(), false);
- if (r.status != OK) {
- recordLastCliOperationError(r.errorCode() + ": " + r.message);
- throw new CommandErrorException(r.errorCode(), r.message);
- }
- transaction = r.signedTransaction; // signer extracts from TransactionSignManager
- Response.TransactionSignWeight weight = getTransactionSignWeight(transaction);
- if (ENOUGH_PERMISSION) { return transaction; }
- if (NOT_ENOUGH_PERMISSION && multi) { return transaction; }
- throw new CancelException(weight.getResult().getMessage());
- }
- // Legacy path retained as safety net; unreachable when signer is injected.
- boolean result = LedgerSignUtil.requestLedgerSignLogic(...);
- /* existing 25 lines unchanged */
-}
-```
-
-The post-sign permission-weight verification (lines 1073-1093) stays in
-`WalletApi`. The signer's job ends at "got a signature back"; the
-multi-permission semantics belong to `WalletApi`.
-
-When `ledgerSigner != null` (standard CLI), the legacy 25-line block is
-unreachable. Kept as a safety net for the (currently impossible) case
-where a non-standard-CLI caller reaches this method.
-
-#### 4.4.2 `WalletApiWrapper.gasFreeTransferInternal` (line 3268-3286)
-
-The method already takes a `boolean standardCli` parameter. Branch
-explicitly:
-
-```java
-if (isLedgerFile) {
- Chain.Transaction transaction = ...;
- String signature = null;
- if (standardCli) {
- if (this.wallet.getLedgerSigner() == null) {
- throw new CommandErrorException("execution_error",
- "Standard CLI Ledger signer not initialized");
- }
- LedgerSignOutcome r = this.wallet.getLedgerSigner().sign(transaction, ledgerPath, wf.getAddress(), true);
- if (r.status != OK) {
- throw new CommandErrorException(r.errorCode(), r.message);
- }
- signature = r.gasfreeSignature;
- } else {
- // REPL path: existing behavior, byte-for-byte
- boolean ledgerResult = LedgerSignUtil.requestLedgerSignLogic(transaction, ledgerPath, wf.getAddress(), true);
- if (ledgerResult) signature = TransactionSignManager.getInstance().getGasfreeSignature();
- if (signature == null) {
- TransactionSignManager.getInstance().setTransaction(null);
- TransactionSignManager.getInstance().setGasfreeSignature(null);
- System.out.println("Listening ledger did not obtain signature.");
- return false;
- }
- TransactionSignManager.getInstance().setTransaction(null);
- TransactionSignManager.getInstance().setGasfreeSignature(null);
- }
- /* rest of method unchanged: signature validation + submit */
-}
-```
-
-REPL path is preserved literally; standard-CLI path uses the signer.
-
-#### 4.4.3 `LedgerEventListener` 5-line additive patch
-
-`NonInteractiveLedgerSigner` needs to read the last APDU response after
-calling `executeSignListen`. The cheapest seam is to record it as a field:
-
-```java
-private byte[] lastSendResult;
-public byte[] getLastSendResultBytes() { return lastSendResult; }
-
-// inside executeSignListen, line 81:
-this.lastSendResult = handleTransSign(hidDevice, transaction, path, gasfree);
-byte[] sendResult = this.lastSendResult;
-```
-
-Pure addition; no existing caller reads this; REPL is unaffected.
-`LedgerEventListener` is a process-wide singleton and is single-threaded
-in practice (REPL and standard CLI never run concurrently in the same JVM).
-
-### 4.5 Stdout suppression
-
-REPL prints inside `LedgerEventListener` and the unchanged-for-REPL
-`LedgerSignUtil` would pollute JSON output if they reach stdout during a
-standard-CLI sign. The bridge wraps the HID-call section in a
-`SystemOutSuppressor` (try-with-resources):
-
-```
-final class SystemOutSuppressor implements AutoCloseable {
- static SystemOutSuppressor capture(); // saves System.out, swaps for sink
- String drained(); // captured bytes (for --verbose echo)
- @Override public void close(); // restores System.out
-}
-```
-
-Phase 0 must grep for an existing equivalent before we write a new one.
-If nothing exists, we write it (~50 LOC).
-
-In `--verbose` mode the captured content is replayed to stderr, prefixed
-with `[ledger-noise]`. In other modes it is discarded.
-
-## 5. Files touched
-
-| File | Change | LOC |
-|------|--------|-----|
-| **NEW** `cli/ledger/LedgerSigner.java` | Interface | 15 |
-| **NEW** `cli/ledger/LedgerSignOutcome.java` | Value type + Status enum | 60 |
-| **NEW** `cli/ledger/NonInteractiveLedgerSigner.java` | Implementation | 180 |
-| **NEW** `cli/ledger/SystemOutSuppressor.java` | Stdout capture util (Phase 0 may make this reuse) | 50 |
-| `cli/StandardCliRunner.java` | Construct + inject signer in `authenticate()` | +8 |
-| `walletcli/WalletApiWrapper.java` | Add `setLedgerSigner` delegating to `WalletApi`; replace 1 sign branch (gasfree) under `if (standardCli)` | +30, -10 |
-| `walletserver/WalletApi.java` | Add `ledgerSigner` field/setter/getter; replace Ledger branch in `signTransactionForCli` | +25, -15 |
-| `ledger/listener/LedgerEventListener.java` | Add `lastSendResult` field + accessor | +5 |
-| **NEW** `cli/ledger/NonInteractiveLedgerSignerTest.java` | Bridge unit tests (12) | 250 |
-| **NEW** `cli/ledger/LedgerSignOutcomeTest.java` | Trivial coverage | 30 |
-| `cli/StandardCliRunnerTest.java` | Five integration tests with `FakeLedgerSigner` | +120 |
-| **NEW** `docs/qa-ledger-smoke.md` | Manual QA runbook | 80 |
-| `docs/standard-cli-contract-spec.md` | Additive subsection on Ledger error codes | +40 |
-| `docs/standard-cli-user-manual.md` | "Using Ledger" section | +60 |
-| `docs/release-notes-wallet-cli-*.md` | Bullet point | +3 |
-
-**Net: ~810 LOC added, ~25 LOC removed.** ~400 LOC of that is tests.
-
-## 6. Behavior specification
-
-### 6.1 Discovery
-
-- Exactly one connected Ledger whose Tron-app-derived address at the
- keystore's path matches the keystore's address ⇒ proceed.
-- Zero matching devices ⇒ `ledger_not_connected` (exit 1).
-- Multiple connected devices ⇒ the standard CLI validates the derived address
- at the keystore path and uses the matching device. If no connected device
- derives the keystore address at that path, return `ledger_not_connected`.
- A future `--ledger-device` flag may make multi-device selection explicit.
-
-### 6.2 Stderr output
-
-Exactly one info line per sign attempt, on stderr:
-
-```
-Please confirm transaction on Ledger device for TXxx...
-```
-
-No further progress output. On failure, the structured error message
-appears in stderr (text mode) or in the JSON envelope's `message` field
-(JSON mode).
-
-### 6.3 Stdout
-
-- `--output json`: stdout contains exactly one JSON envelope.
-- `--output text`: stdout contains exactly the result string the command
- produces (transaction id on success, nothing on failure).
-- The suppressor guarantees no listener prints reach stdout.
-
-### 6.4 Error code → exit code
-
-All Ledger errors are execution errors (exit 1).
-
-| Error code | Trigger |
-|-----------|---------|
-| `ledger_not_connected` | No matching device, or HID transport failure |
-| `ledger_app_not_open` | APDU `0x6511` |
-| `ledger_sign_by_hash_disabled` | APDU `0x6a8c` |
-| `ledger_unsupported_contract` | Transaction type is outside the Ledger allowlist |
-| `ledger_already_signing` | `LedgerSignResult` indicates a prior sign is still `SIGNING` |
-| `ledger_user_rejected` | `LedgerSignResult` is `SIGN_RESULT_REJECTED` after wait |
-| `ledger_timeout` | 60-second wait elapsed without confirm or reject state |
-| `ledger_sign_failed` | Any other failure |
-
-All codes start with `ledger_` for prefix matching by agents.
-
-### 6.5 Singleton state hygiene
-
-`NonInteractiveLedgerSigner.sign(...)` invariants:
-
-- Always reset `TransactionSignManager` transaction + signature fields in
- a `finally`.
-- Always close the HID device in a `finally`.
-- Never throws. Always returns an outcome; the caller (sign-site code)
- translates non-`OK` to `CommandErrorException`.
-
-## 7. Phased delivery (~1.5–2 days net coding)
-
-### Phase 0 — confirmation grep (≤ 1 hour, code-only)
-
-- Verify no `SystemOutSuppressor`-equivalent already exists (grep
- `System.setOut`, look for utility classes).
-- Confirm `OutputFormatter.info(...)` writes to stderr in both text and
- JSON modes (it should, per existing usage).
-- Confirm singletons `HidServicesWrapper.getInstance()` and
- `LedgerEventListener.getInstance()` have a testable seam (existing
- pattern in the codebase, or PowerMock setup).
-
-If any answer surprises, update §4.5 / §8.1 before Phase 1.
-
-### Phase 1 — full signer + tests (~½–1 day)
-
-Deliverables:
-
-- `LedgerSigner` interface
-- `LedgerSignOutcome` value type
-- `NonInteractiveLedgerSigner` with **all 8 Status values reachable**
- (no half-baked stubs)
-- `SystemOutSuppressor` (or reuse if Phase 0 found one)
-- `LedgerEventListener` 5-line additive patch
-- `NonInteractiveLedgerSignerTest` — 12 unit tests covering each
- enum value + state-cleanup invariants + stderr message shape
-- `LedgerSignOutcomeTest` — trivial coverage
-
-Acceptance: tests green; `NonInteractiveLedgerSigner.sign(...)` is
-callable in isolation with mock collaborators.
-
-### Phase 2 — wire to both sign sites + integration tests (~½ day)
-
-Deliverables:
-
-- `WalletApi.setLedgerSigner` field/setter/getter
-- `WalletApiWrapper.setLedgerSigner` delegation
-- `signTransactionForCli` Ledger branch routes through `ledgerSigner`
- when injected; legacy block kept as safety net
-- `gasFreeTransferInternal` Ledger branch splits on `standardCli`
-- `StandardCliRunner.authenticate()` constructs and injects
- `NonInteractiveLedgerSigner`
-- `StandardCliRunnerTest` — 5 integration tests:
- 1. `gasFreeTransferSucceedsWithFakeLedgerSigner`
- 2. `gasFreeTransferReportsLedgerUserRejected`
- 3. `sendCoinSucceedsWithFakeLedgerSigner`
- 4. `sendCoinReportsLedgerNotConnected`
- 5. `nonLedgerCommandsUnaffectedByInjectedSigner`
-
-Acceptance: gasfree and one mainline command both flow through the
-signer end-to-end with a `FakeLedgerSigner`; software-wallet sign paths
-are unchanged.
-
-### Phase 3 — documentation (~2 hours)
-
-Deliverables:
-
-- `docs/qa-ledger-smoke.md` — 5-step manual runbook (§8.3)
-- `docs/standard-cli-user-manual.md` "Using Ledger" section
-- `docs/standard-cli-contract-spec.md` additive subsection on Ledger
- error codes
-- Release notes bullet
-
-Acceptance: docs reviewed.
-
-### Phase 4 — merge gate (reviewer-driven, not author time)
-
-PR description explicitly states:
-
-> Author has no physical Ledger. The following items are unverified by
-> the author and require a reviewer-driven smoke test (see
-> `docs/qa-ledger-smoke.md`):
->
-> - All 5 steps of the runbook
-> - One REPL Ledger sign (regression check on the additive listener
-> patch)
->
-> All other behavior is verified by unit and integration tests with
-> mocked HID and listener state.
-
-Merge requires:
-
-- All automated tests green
-- A reviewer with a Ledger device runs `qa-ledger-smoke.md` and confirms
- all 5 steps
-- A reviewer runs **one** Ledger sign in REPL and confirms output is
- visually identical to before this PR
-
-## 8. Test strategy
-
-### 8.1 Unit tests (`NonInteractiveLedgerSignerTest`)
-
-12 tests, each ~20 LOC. Mock collaborators: `HidServicesWrapper`,
-`LedgerEventListener`, `LedgerSignResult`, `TransactionSignManager`.
-
-| Test | Setup | Asserts |
-|------|-------|---------|
-| `signSucceedsWhenUserConfirms` | mock device valid; signature set in TSM; state SUCCESS | outcome `OK`, signature populated |
-| `returnsNotConnectedWhenDeviceMissing` | wrapper returns null | outcome `NOT_CONNECTED` |
-| `returnsNotConnectedWhenWrapperThrows` | wrapper throws `IllegalStateException` | outcome `NOT_CONNECTED` |
-| `returnsAppNotOpenOn0x6511` | `lastSendResult = [0x65, 0x11]` | outcome `APP_NOT_OPEN` |
-| `returnsSignByHashDisabledOn0x6a8c` | `lastSendResult = [0x6a, 0x8c]` | outcome `SIGN_BY_HASH_DISABLED` |
-| `returnsSignFailedOnUnknownApduResponse` | `lastSendResult = [0xff, 0xff]` | outcome `SIGN_FAILED`, message contains hex |
-| `returnsAlreadySigningWhenStateIsSigning` | LedgerSignResult returns `SIGNING` before sign | outcome `ALREADY_SIGNING`, listener never called |
-| `returnsUserRejectedWhenStateIsRejected` | post-sign state `SIGN_RESULT_REJECTED` | outcome `USER_REJECTED` |
-| `returnsTimeoutWhenNeitherStateNorSignaturePresent` | post-sign neither | outcome `TIMEOUT` |
-| `clearsTransactionSignManagerOnEveryExitPath` | parameterized by every outcome | TSM cleared afterwards |
-| `closesHidDeviceOnEveryExitPath` | parameterized | mock HidDevice.close() invoked |
-| `emitsExactlyOneStderrInfoLine` | success path | formatter recorded one info call, message contains address |
-
-### 8.2 Integration tests (`StandardCliRunnerTest`)
-
-5 tests, each ~25 LOC, using `FakeLedgerSigner` (test-package class that
-records calls and returns programmable outcomes).
-
-(Listed in Phase 2 deliverables.)
-
-### 8.3 Manual QA (hardware, reviewer)
-
-`docs/qa-ledger-smoke.md`:
-
-```
-Manual smoke (requires Ledger Nano S/X with Tron app installed)
-
-Pre-req: importwalletbyledger via REPL, set local password P, note address A.
-
-1. Normal sign:
- echo "P" | wallet-cli --password-stdin --output json \
- --wallet ledger-alpha send-coin --to --amount 1
- → confirm on device → expect {"success": true, "data": {...}}
- → stderr contains "Please confirm transaction on Ledger device for A"
-
-2. User rejects:
- same command → press REJECT on device
- → expect exit 1, JSON: {"success": false, "error": "ledger_user_rejected"}
-
-3. Device disconnected:
- unplug Ledger, run same command
- → expect exit 1, error: "ledger_not_connected"
-
-4. Tron app not open:
- plug device, leave at home screen (don't open Tron app)
- → expect exit 1, error: "ledger_app_not_open"
-
-5. REPL regression (independent of standard CLI):
- ./gradlew run → login as ledger wallet → SendCoin one transaction
- → confirm on device → success message identical to pre-PR output
-```
-
-5 minutes total with a connected device.
-
-### 8.4 What is **not** automatically tested
-
-- Real APDU exchange timing
-- Real disconnect-mid-sign behavior
-- Real 60s timeout wall clock
-- Signature cryptographic validity
-
-Covered by manual runbook.
-
-## 9. Risk register
-
-| Risk | Likelihood | Impact | Mitigation |
-|------|-----------|--------|------------|
-| `LedgerEventListener` singleton state leaks between two sequential signs in same JVM | Low | Medium | Bridge resets state in `finally`. Unit-tested. |
-| `SystemOutSuppressor` interferes with logging that uses `System.out` underneath | Medium | Low | Suppress only around HID-call section; verbose mode replays to stderr. |
-| Reviewer with Ledger device unavailable | Low | High (PR cannot merge) | Confirm reviewer assignment before Phase 1. Runbook is 5 minutes. |
-| `executeSignListen` blocks longer than 60s under JVM load | Low | Low | Acceptable; matches REPL behavior. |
-| Disconnect mid-sign produces unanticipated state | Medium | Medium | Catch all in bridge → `SIGN_FAILED`. Manual QA step 3 verifies. |
-| `wf.getName().contains("Ledger")` rule fails for renamed wallets | Low | Low | Out of scope; existing REPL has the same limitation. |
-| Singleton mocking turns out harder than expected (Phase 0 finds no seam) | Low | Medium | Either add a thin testable seam (~50 LOC) or use PowerMock. Decide in Phase 0. |
-
-## 10. REPL impact summary
-
-The change is 95% additive + standard-CLI-isolated. **REPL paths that
-exist before this PR do exactly the same thing after.**
-
-| REPL scenario | Affected? |
-|---|---|
-| REPL + software wallet sign | No — code path entirely untouched |
-| REPL + Ledger sign (REPL `signTransaction` overloads) | No — still calls `LedgerSignUtil` directly |
-| REPL using gasfree transfer | No — `if (standardCli)` branch leaves the `else` path byte-for-byte |
-| REPL invoking `LedgerEventListener` | Only sees an additive 5-line patch (one new field, one getter, one assignment) |
-
-REPL regression scope is therefore **one** smoke test: a single REPL
-Ledger sign confirms the listener patch did not perturb behavior. Step 5
-of the QA runbook covers this.
-
-## 11. Success criteria
-
-- `gas-free-transfer` and at least one mainline sign command (e.g.
- `send-coin`) work end-to-end against a Ledger keystore via standard
- CLI, verified by reviewer-run smoke runbook.
-- All eight `ledger_*` error codes are produced by at least one
- automated test.
-- JSON-mode stdout contains exactly one envelope per command; no
- ledger-related noise leaks through.
-- REPL Ledger flow output is visually identical to before (verified by
- step 5 of QA runbook).
-- Test coverage: unit tests reach every enum value; integration tests
- reach OK + at least two error paths.
-- Documentation: user manual updated, contract spec subsection added,
- QA runbook present, release notes updated.
-- No new dependency on a physical device for unit/CI tests.
-
-## 12. User-facing documentation outline
-
-`docs/standard-cli-user-manual.md` will gain:
-
-```
-### Using Ledger
-
-1. **Pair the device once via the REPL**:
- ./gradlew run
- > importwalletbyledger
- Choose a path, set a local password (this password unlocks the
- keystore that points at your Ledger account; it does not unlock the
- device itself).
-
-2. **Sign from standard CLI**:
- echo "$LEDGER_KEYSTORE_PASSWORD" | wallet-cli \
- --password-stdin --output json --wallet ledger-alpha \
- send-coin --to TXxx... --amount 1000000
-
- - The Ledger must be connected, unlocked, with the Tron app open.
- - You will see one stderr line: "Please confirm transaction on
- Ledger device for ...".
- - Press the confirm button on the device.
- - On success, stdout contains a JSON envelope with the transaction id.
-
-**About the password**: the keystore password protects the BIP44 path
-metadata, not your funds. Your private key never leaves the device. A
-Ledger keystore without the device connected cannot sign even with the
-correct password.
-
-**Error codes** (in JSON envelope `error` field): `ledger_not_connected`,
-`ledger_app_not_open`, `ledger_sign_by_hash_disabled`,
-`ledger_unsupported_contract`, `ledger_already_signing`,
-`ledger_user_rejected`, `ledger_timeout`, `ledger_sign_failed`.
-```
-
-`docs/standard-cli-contract-spec.md` will gain an additive subsection
-under Auth/Errors documenting the eight `ledger_*` codes.
diff --git a/java/docs/qa-ledger-smoke.md b/java/docs/qa-ledger-smoke.md
deleted file mode 100644
index b1a012110..000000000
--- a/java/docs/qa-ledger-smoke.md
+++ /dev/null
@@ -1,125 +0,0 @@
-# QA: Ledger smoke test (Standard CLI)
-
-This runbook is the merge gate for the Standard CLI Ledger feature when the
-PR author does not have a physical Ledger device. A reviewer with hardware
-runs all 5 steps and confirms each outcome before approving the PR.
-
-**Time:** ~5 minutes with a connected device.
-
-## Prerequisites
-
-- A Ledger Nano S or Nano X
-- Tron app installed on the device, "Sign By Hash" set to **Allowed** in
- the app's settings
-- A wallet imported via REPL once:
- ```
- ./gradlew run
- > importwalletbyledger
- ```
- Choose a default path, set a local password, note the wallet name (the
- file name will start with `Ledger-`).
-
-For brevity, the rest of this runbook uses:
-
-- `P` = the local keystore password from the import step
-- `A` = the Tron address shown after import
-- `W` = the wallet name (e.g. `ledger-alpha`)
-- `R` = a destination address (any valid Tron address; doesn't need to be
- funded — broadcast may fail downstream, but the sign outcome is what we
- are verifying)
-
-## Build
-
-```
-./gradlew shadowJar
-```
-
-Output: `build/libs/wallet-cli.jar`.
-
-## Step 1 — Normal sign (success path)
-
-```
-echo "$P" | java -jar build/libs/wallet-cli.jar \
- --password-stdin --output json \
- --wallet $W \
- send-coin --to $R --amount 1
-```
-
-Press the **confirm** button on the device when prompted.
-
-**Expected:**
-
-- stderr contains exactly one line: `Please confirm transaction on Ledger device for A`
-- stdout contains a single JSON envelope with `"success": true`
-- Exit code `0`
-- No other text on stdout
-
-## Step 2 — User rejects
-
-Run the same command as Step 1. Press **reject** on the device instead.
-
-**Expected:**
-
-- stdout JSON: `"success": false`, `"error": "ledger_user_rejected"`
-- Exit code `1`
-- stderr contains the confirmation notice + the error message
-
-## Step 3 — Device disconnected
-
-Unplug the Ledger. Run the same command.
-
-**Expected:**
-
-- stdout JSON: `"success": false`, `"error": "ledger_not_connected"`
-- Exit code `1`
-
-## Step 4 — Tron app not open
-
-Reconnect the device. Leave it on the home screen — do **not** open the
-Tron app. Run the same command.
-
-**Expected:**
-
-- stdout JSON: `"success": false`, `"error": "ledger_app_not_open"`
-- Exit code `1`
-
-(Some Ledger firmware versions surface this as `ledger_not_connected`
-instead — accept either.)
-
-## Step 5 — REPL regression check
-
-This step is independent of the Standard CLI changes. It verifies the
-5-line additive patch to `LedgerEventListener` did not perturb the REPL
-sign path.
-
-```
-./gradlew run
-> login
-[enter password P]
-> sendcoin $R 1
-```
-
-Press confirm on the device when prompted.
-
-**Expected:**
-
-- The REPL produces output visually identical to the pre-PR REPL behavior.
- Specifically: the prompts, color codes, and final `Send 1 to R successful !!`
- line all appear as before.
-
-## Sign-off template
-
-```
-- [ ] Step 1 (success) passed
-- [ ] Step 2 (reject) passed
-- [ ] Step 3 (disconnected) passed
-- [ ] Step 4 (app not open) passed
-- [ ] Step 5 (REPL regression) passed
-
-Tested on:
-- Ledger model: ___________________
-- Ledger firmware: ________________
-- Tron app version: _______________
-- Date: __________________________
-- Reviewer: ______________________
-```
diff --git a/java/docs/reference/config.md b/java/docs/reference/config.md
new file mode 100644
index 000000000..f2b4622bd
--- /dev/null
+++ b/java/docs/reference/config.md
@@ -0,0 +1,119 @@
+# Configuration reference
+
+Full reference for `config.conf`. wallet-cli reads the node config from `src/main/resources/config.conf`. You can also switch networks at runtime with the [`SwitchNetwork`](../commands/network.md) command, so editing `config.conf` is only needed for a custom node or the advanced features below.
+
+## Minimal config
+
+A minimal `config.conf` only needs a network type and a full node to talk to:
+
+```
+net {
+ type = mainnet
+}
+
+fullnode = {
+ ip.list = [
+ "fullnode ip : port"
+ ]
+}
+```
+
+## Full annotated config
+
+Optional Solidity node, Ledger debug, account lock, GasFree, TronGrid API key, TronLink multi-sig, and record limits:
+
+```
+net {
+ type = mainnet
+}
+
+fullnode = {
+ ip.list = [
+ "fullnode ip : port"
+ ]
+}
+
+#soliditynode = {
+# //The IPs in this list can only be totally set to solidity.
+# ip.list = [
+# "ip : solidity port" // default solidity
+# ]
+# // NOTE: solidity node is optional
+#}
+
+# open ledger debug
+# ledger_debug = true
+
+# To use the lock and unlock function of the login account, it is necessary to configure
+# lockAccount = true in the config.conf. The current login account is locked, which means that
+# signatures and transactions are not allowed. After the current login account is locked, it can be
+# unlocked. By default, it will be unlocked again after 300 seconds. Unlocking can specify
+# parameters in seconds.
+
+# lockAccount = true
+
+# To use the gasfree feature, please first apply for an APIkey and apiSecret.
+# For details, please refer to
+# https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform
+gasfree = {
+ mainnet = {
+ apiKey = ""
+ apiSecret = ""
+ }
+ testnet = {
+ apiKey = ""
+ apiSecret = ""
+ }
+}
+
+# If gRPC requests on the main network are limited in speed, you can apply for an apiKey of Trongrid to improve the user experience
+grpc = {
+ mainnet = {
+ apiKey = ""
+ }
+}
+
+# Set the maximum number of transactions and backup records that can be retained
+maxRecords = 1000
+
+# To use the tronlink multi-sign feature, please first apply for an secretId and secretKey.
+# For details, please refer to
+# https://docs.google.com/forms/d/e/1FAIpQLSc5EB1X8JN7LA4SAVAG99VziXEY6Kv6JxmlBry9rUBlwI-GaQ/viewform
+# If you prefer not to apply, a speed-limited secretId and secretKey will be provided for use:
+# secretId = "TEST", secretKey = "TESTTESTTEST", channel = "test".
+tronlink = {
+ mainnet = {
+ secretId = ""
+ secretKey = ""
+ channel = ""
+ }
+ testnet = {
+ secretId = ""
+ secretKey = ""
+ channel = ""
+ }
+}
+```
+
+## Field summary
+
+| Field | Purpose |
+|---|---|
+| `net.type` | Network type (e.g. `mainnet`). |
+| `fullnode.ip.list` | Full node endpoint(s) `ip : port`. |
+| `soliditynode.ip.list` | Optional Solidity node endpoint(s). |
+| `ledger_debug` | Enable Ledger debug output. |
+| `lockAccount` | Enable the [`Lock`/`Unlock`](../commands/wallet.md#lock) feature (default unlock duration 300 seconds). |
+| `gasfree.{mainnet,testnet}.apiKey` / `apiSecret` | [GasFree](../commands/gasfree.md) credentials. |
+| `grpc.mainnet.apiKey` | TronGrid API key to raise gRPC rate limits. |
+| `maxRecords` | Maximum retained transactions / backup records. |
+| `tronlink.{mainnet,testnet}.secretId` / `secretKey` / `channel` | [TronLink multi-sign](../commands/multisig.md#tronlinkmultisign) credentials. |
+
+## Connecting to Java-tron
+
+wallet-cli connects to Java-tron via the gRPC protocol, which can be deployed locally or remotely. Configure the Java-tron node IP and port in `src/main/resources/config.conf` so wallet-cli can talk to the node. You can also use `SwitchNetwork` to switch among mainnet, testnets (Nile and Shasta), and custom networks — see [commands/network](../commands/network.md).
+
+## See also
+
+- [../../README.md](../../README.md) — install and build steps
+- [commands/network](../commands/network.md) · [commands/gasfree](../commands/gasfree.md) · [commands/multisig](../commands/multisig.md)
diff --git a/java/docs/spike-standard-cli-ledger.md b/java/docs/spike-standard-cli-ledger.md
deleted file mode 100644
index f958c6ab4..000000000
--- a/java/docs/spike-standard-cli-ledger.md
+++ /dev/null
@@ -1,266 +0,0 @@
-# Spike: Ledger support in Standard CLI — offline source-code findings
-
-## Purpose
-
-Resolve the open assumptions in `docs/plan-standard-cli-ledger.md` so the
-implementation plan can be promoted from "pragmatic / hand-wavy" to
-"ready-to-implement" without requiring a physical Ledger device.
-
-This spike is **source-code only**. It does not run anything against a real
-device. Items that genuinely require hardware are isolated in §"Items that
-still need hardware verification" at the bottom.
-
-## Method
-
-Read the existing REPL Ledger sign path end-to-end and document its
-behavior. Where REPL already encodes a behavior, treat that as authoritative
-(it has been shipped against real devices for a long time).
-
-Files inspected:
-
-- `org.tron.ledger.LedgerSignUtil`
-- `org.tron.ledger.listener.LedgerEventListener`
-- `org.tron.ledger.listener.BaseListener`
-- `org.tron.ledger.listener.TransactionSignManager`
-- `org.tron.ledger.LedgerSignResult` (referenced; behavior inferred from call sites)
-- `org.tron.ledger.wrapper.HidServicesWrapper` (referenced)
-- `org.tron.walletserver.WalletApi` — sign sites and `signTransactionForCli`
-- `org.tron.walletcli.WalletApiWrapper` — gasfree sign site
-- `org.tron.walletcli.cli.StandardCliRunner` — auth path
-
-## Findings
-
-### F1: Standard CLI uses exactly **two** Ledger sign sites, not four
-
-Standard CLI's process pipeline only touches two of the four sign sites that
-the original plan listed:
-
-| Site | File / line | Triggered by |
-|------|-------------|--------------|
-| `signTransactionForCli(...)` Ledger branch | `WalletApi.java:1064-1093` | All standard-CLI sign commands (transfer, vote, freeze, …) via `processTransactionExtentionForCli` and `processTransactionForCli` |
-| GasFree sign branch | `WalletApiWrapper.java:3268-3286` | Standard-CLI `gas-free-transfer` only |
-
-The other two sites (`signTransaction(Chain.Transaction)` at line 904 and
-`signTransaction(Chain.Transaction, boolean multi)` at line 956) are
-**REPL-exclusive**. They are reached via `processTransactionExtention` /
-`processTransaction`, which standard CLI does not call.
-
-This shrinks the standard-CLI risk surface to two sites.
-
-### F2: REPL's "60-second timeout" is a polling loop with cooperative early exit, not a blocking wait
-
-`LedgerEventListener.executeSignListen` (`LedgerEventListener.java:78`) calls
-`waitAndShutdownWithInput()` (line 45), which:
-
-1. Spawns a background thread that runs `sleepNoInterruption(60)`.
-2. `BaseListener.sleepNoInterruption` (BaseListener.java:23) sleeps in 100ms
- chunks, checking `LedgerEventListener.getInstance().getLedgerSignEnd()` on
- each wake-up. If the flag is set, it exits early.
-3. Main thread `join()`s on this background thread.
-
-When the user presses confirm or reject, `hidDataReceived` (line 150) calls
-`doLedgerSignEnd()` (line 213), which sets `ledgerSignEnd = true`. The
-sleeping thread sees this within 100ms and returns.
-
-**Implication**: cancellation is already cooperative. We do **not** need
-`Future.cancel(true)` to work on the underlying HID call. To enforce a
-shorter timeout from outside, we set the same flag (or its replacement) and
-the existing loop exits.
-
-The constant `TRANSACTION_SIGN_TIMEOUT = 60` is hard-coded at
-`LedgerEventListener.java:27`.
-
-### F3: APDU error codes are already pattern-matched in REPL — they just print, they do not return
-
-`LedgerEventListener.handleTransSign` (line 104-148) hard-codes two APDU
-status words:
-
-| APDU | Constant in source | Existing REPL behavior |
-|------|--------------------|------------------------|
-| `0x6a8c` | `SIGN_BY_HASH` | Print "Please first set 'Sign By Hash' to 'Allowed' in Ledger TRON Settings" |
-| `0x6511` | `APP_IS_OPEN` | Print "Please ensure The Tron app is open in your Ledger device" |
-| Other non-empty response | (unhandled) | (no message) |
-| `null`/empty response | (success path) | Submitted; wait for button |
-
-The function returns the raw response bytes. Callers currently only check
-`response == null` (= submitted, wait). We can map the same bytes to typed
-error codes without changing the underlying APDU exchange logic.
-
-### F4: Confirm vs reject vs timeout outcomes are recorded in two static stores
-
-After `executeSignListen` returns, the outcome is determined by inspecting:
-
-1. **`TransactionSignManager` (singleton)** — `getTransaction()` and
- `getTransactionSignList()`/`getGasfreeSignature()`. If a signature is
- present here, the user pressed confirm.
-2. **`LedgerSignResult` (file-backed state)** —
- `getLastTransactionState(devicePath)` returns a string enum:
- - `SIGN_RESULT_SIGNING` (still in progress)
- - `SIGN_RESULT_SUCCESS` (user confirmed)
- - `SIGN_RESULT_REJECTED` (user rejected) — set via `updateAllSigningToReject` in the cancel branch (line 166 / 178)
- - `SIGN_RESULT_CANCEL` (timed out after device responded) — set when `isTimeOutShutdown` is true at the moment of HID response (line 205)
-
-REPL's existing `executeSignListen` collapses all four into a single
-`boolean ret = true`, which is why surface-level it looks like REPL "loses
-information." It does not — the information is in the two stores; REPL just
-does not consult them at the call site.
-
-A non-interactive bridge can poll both stores after `executeSignListen`
-returns and emit a precise outcome.
-
-### F5: The pre-sign HID device discovery is already non-interactive
-
-`LedgerSignUtil.requestLedgerSignLogic` (`LedgerSignUtil.java:21`) reaches
-the device via `HidServicesWrapper.getInstance().getHidDevice(address, path)`
-(line 37). That call:
-
-- Returns the unique device whose Tron-app-derived address at `path` matches
- the requested `address`.
-- Returns `null` if no match is found.
-- Throws `IllegalStateException` on transport-layer failures (the existing
- call site catches this and treats it as `null`).
-
-There is no `selectDevice()` prompt, no menu, no `lineReader`. The
-discovery code is reusable as-is for standard CLI.
-
-### F6: REPL's interactive noise on the sign path is concentrated in `LedgerSignUtil` and the listener
-
-The pollution sources (in standard-CLI terms) on the sign path are:
-
-| Where | What |
-|-------|------|
-| `LedgerSignUtil` | 8 × `System.out.println`, 4 × ANSI color escape, on every reachable branch |
-| `LedgerEventListener.handleTransSign` | 2 × `System.out.println` for APDU error codes, 1 × ANSI |
-| `LedgerEventListener.waitAndShutdownWithInput` | 2 × `System.out.printf` (timeout banner) |
-| `LedgerEventListener.hidDataReceived` | 4 × `System.out.println` on confirm / cancel |
-| `LedgerEventListener.executeSignListen` | 1 × `System.out.println` ("Transaction sign request is sent to Ledger") |
-
-None of these go through any abstracted output channel. They are all direct
-`System.out` writes. The standard-CLI bridge must:
-
-1. Replace the `LedgerSignUtil` wrapper entirely (it is the highest-volume
- noise source and provides nothing standard CLI needs).
-2. Either (a) refactor the listener's prints into a callback / sink, or (b)
- leave them in place and rely on the existing standard-CLI stream
- suppressor. **Recommendation: (b) for MVP**, because `LedgerEventListener`
- is a singleton shared with REPL and refactoring its output channel ripples
- into REPL output. Suppressing during the bridge call is sufficient.
-
-### F7: `HidServicesWrapper.getHidDevice` is silent on stdout
-
-By inspection of the call shape and how REPL uses it (no surrounding
-"discovering devices…" banner around the call), this function does not
-print. The standard-CLI bridge can call it without suppressors. (Confirmed
-from REPL behavior: pre-sign device lookup happens silently.)
-
-### F8: Singleton state lifecycles
-
-| Singleton | Lifetime | Risk for standard CLI |
-|-----------|----------|------------------------|
-| `LedgerEventListener.INSTANCE` | Process | Holds `isTimeOutShutdown` and `ledgerSignEnd` `AtomicBoolean`s; both are reset on each `executeSignListen` call (lines 85, 73). One-shot CLI invocations are safe. Within a single process, two consecutive sign operations are also safe because each call resets. |
-| `TransactionSignManager.INSTANCE` | Process | Holds the in-flight transaction and signature. REPL clears `setTransaction(null)` after consumption. The bridge must do the same on every exit path (success, reject, timeout, exception). |
-| `LedgerSignResult` (file-backed) | Disk | Records last state per device path. Bridge must check this **after** `executeSignListen` to derive outcome. The file accumulates entries; existing REPL code does not prune it. Not a correctness concern. |
-
-For standard CLI's typical "one process per command" usage, the singleton
-risk is minimal. The defensive pattern is: reset `TransactionSignManager`
-state in a `finally` block.
-
-### F9: Standard CLI's Ledger detection rule is `wf.getName().contains("Ledger")`
-
-All three Ledger sign branches in `WalletApi.java` (lines 910, 973, 1064)
-test `wf.getName().contains("Ledger")` rather than the
-`WalletApi.isLedgerUser()` boolean. The boolean is set in the wrapper's
-login paths and used in `WalletApi.removeWallet(...)` (line 3670), but **not**
-on the sign path.
-
-The naming convention is enforced by `WalletApi.java:4652-4654`, which
-auto-prefixes `Ledger-` to any wallet that started with that prefix. So:
-
-- **Source of truth on the sign path: filename prefix `Ledger-`**
-- **Source of truth on the cleanup path: `isLedgerUser` boolean**
-
-This is a latent inconsistency. For this plan we **do not** unify it (out of
-scope and risky); we follow the existing sign-path convention (filename) so
-behavior is identical to REPL.
-
-### F10: GasFree path uses `gasfree=true` which short-circuits contract-type validation
-
-`LedgerSignUtil.requestLedgerSignLogic(transaction, path, address, gasfree)`
-takes a `gasfree` boolean. When `true`, line 23-26 skips the
-`ContractTypeChecker.canUseLedgerSign(...)` precheck. The bridge's sign
-method therefore needs the same parameter / a sibling method.
-
-## Implications for design
-
-### Outcome enum is fully derivable
-
-```
-NO_DEVICE ← getHidDevice returned null
-APP_NOT_OPEN ← handleTransSign returned 0x6511
-SIGN_BY_HASH_DISABLED ← handleTransSign returned 0x6a8c
-SUBMIT_FAILED ← handleTransSign returned other non-empty bytes
-ALREADY_SIGNING ← LedgerSignResult.getLastTransactionState was SIGN_RESULT_SIGNING before we started
-USER_CONFIRMED ← signature found in TransactionSignManager after wait
-USER_REJECTED ← LedgerSignResult.getLastTransactionState became SIGN_RESULT_REJECTED
-TIMEOUT ← wait returned but neither signature nor reject state
-```
-
-Every transition above is derivable from existing public state. No hardware
-needed to design this.
-
-### The bridge can polls the same state REPL writes
-
-REPL writes `LedgerSignResult` and `TransactionSignManager` from the HID
-callback thread. The bridge reads the same state on the calling thread
-after `executeSignListen` returns. This is the cleanest possible coupling
-that avoids forking the shared listener.
-
-### Stdout suppression scope
-
-The bridge wraps `LedgerSignUtil`-equivalent operations. The wrapping must
-suppress stdout because:
-
-- `LedgerEventListener.handleTransSign` will still print on APDU errors.
-- `LedgerEventListener.waitAndShutdownWithInput` will still print the timeout
- banner.
-- `LedgerEventListener.hidDataReceived` will still print on confirm / cancel.
-
-These are not on our refactor target (shared with REPL). The bridge must
-redirect `System.out` for the duration of the call. The runner already has
-`OutputFormatter` machinery for stream suppression; the bridge reuses it.
-
-## Items that still need hardware verification
-
-These remain as Phase-end manual-QA gates, not blockers for design:
-
-| Item | Manual test |
-|------|-------------|
-| Real timing of `0x6a8c` and `0x6511` responses (synchronous vs delayed) | Try with "Sign By Hash" disabled / Tron app closed |
-| Disconnect mid-sign: does `hidDataReceived` fire with a special code, or does the timeout simply elapse? | Pull USB while waiting for confirmation |
-| Does the device reset its signing state when disconnected/reconnected? | Disconnect, reconnect, retry sign |
-| 60-second wall-clock accuracy of `sleepNoInterruption` under JVM contention | Run with high CPU load |
-
-The bridge's defensive design (catch all exceptions → `SUBMIT_FAILED`,
-clean `TransactionSignManager` in `finally`) covers all the above without
-requiring us to know the exact answer.
-
-## Conclusions for the plan
-
-1. **Refactor target shrinks to two sign sites for standard CLI MVP**
- (`WalletApi.signTransactionForCli` Ledger branch + `WalletApiWrapper`
- gasfree branch). The other two sign sites stay REPL-only.
-
-2. **The `LedgerSigner` abstraction the elegant version called for is still
- right** — but it can be applied just to the two standard-CLI sites,
- leaving REPL's two sites untouched. This is a smaller refactor than
- "introduce signer for all four sites."
-
-3. **No `Future.cancel(true)` needed.** Cooperative cancellation via the
- existing `ledgerSignEnd` flag is sufficient.
-
-4. **No "minimum viable error codes" compromise.** All seven outcome enum
- values are derivable from existing state; the plan can ship the full
- taxonomy from day one.
-
-5. **Manual QA gates remain unchanged.** A reviewer with a real Ledger runs
- a runbook to verify the four hardware-verifiable items before merge.
diff --git a/java/docs/standard-cli-user-manual.md b/java/docs/standard-cli-user-manual.md
deleted file mode 100644
index 6b999232e..000000000
--- a/java/docs/standard-cli-user-manual.md
+++ /dev/null
@@ -1,2959 +0,0 @@
-# wallet-cli Standard CLI User Manual
-
-> Complete reference for the TRON wallet-cli command-line interface (Standard CLI mode).
-> This manual covers every supported command, organized by category.
-
----
-
-## Table of Contents
-
-1. [Introduction](#1-introduction)
-2. [Getting Started](#2-getting-started)
-3. [Key Concepts](#3-key-concepts)
-4. [General Usage](#4-general-usage)
-5. [Global Options](#5-global-options)
-6. [Authentication](#6-authentication)
-7. [Wallet Management](#7-wallet-management) (9 commands)
-8. [Transfers & Transactions](#8-transfers--transactions) (12 commands)
-9. [Staking & Resources](#9-staking--resources) (10 commands)
-10. [Query - Account & Balance](#10-query---account--balance) (7 commands)
-11. [Query - Blockchain](#11-query---blockchain) (8 commands)
-12. [Query - Assets & Tokens](#12-query---assets--tokens) (6 commands)
-13. [Query - Network & Chain Info](#13-query---network--chain-info) (6 commands)
-14. [Query - Delegation & Staking Info](#14-query---delegation--staking-info) (7 commands)
-15. [Query - Witnesses, Proposals & Exchanges](#15-query---witnesses-proposals--exchanges) (10 commands)
-16. [Query - Market Orders](#16-query---market-orders) (5 commands)
-17. [Query - GasFree](#17-query---gasfree) (2 commands)
-18. [Smart Contracts](#18-smart-contracts) (9 commands)
-19. [Witnesses & Voting](#19-witnesses--voting) (4 commands)
-20. [Proposals](#20-proposals) (3 commands)
-21. [DEX & Exchanges](#21-dex--exchanges) (5 commands)
-22. [Help](#22-help) (1 command)
-23. [Common Scenarios](#23-common-scenarios)
-24. [Exit Codes & Error Handling](#24-exit-codes--error-handling)
-25. [Appendix](#25-appendix)
-
----
-
-## 1. Introduction
-
-**wallet-cli** is a command-line wallet for the [TRON](https://tron.network/) blockchain. It lets you create wallets, send TRX and tokens, stake resources, vote for Super Representatives, deploy smart contracts, and query on-chain data -- all from your terminal.
-
-The **Standard CLI mode** is designed for scripting, automation, and AI-agent integration. It features:
-
-- **No interactive prompts** -- every input is provided via flags and environment variables
-- **Structured JSON output** -- machine-parseable results via `--output json`
-- **Deterministic exit codes** -- `0` for success, `1` for execution errors, `2` for usage errors
-- **Environment-based authentication** -- `MASTER_PASSWORD` env var for wallet unlock
-
----
-
-## 2. Getting Started
-
-### Prerequisites
-
-- **Java 8** or later installed on your system
-
-### Build
-
-```bash
-./gradlew shadowJar
-```
-
-This produces `build/libs/wallet-cli.jar`.
-
-### Run Your First Command
-
-```bash
-# Check the current network
-java -jar build/libs/wallet-cli.jar --network nile current-network
-```
-
-Throughout this manual we use `wallet-cli` as a shorthand for `java -jar build/libs/wallet-cli.jar`. You can create an alias for convenience:
-
-```bash
-alias wallet-cli='java -jar /path/to/wallet-cli.jar'
-```
-
-### Quick Start: Create a Wallet and Check Balance
-
-```bash
-# 1. Create a new wallet (password is set via environment variable)
-export MASTER_PASSWORD="YourStrongPassword123"
-wallet-cli register-wallet --name my-wallet
-
-# 2. List your wallets
-wallet-cli list-wallet
-
-# 3. Check your balance (on Nile testnet)
-wallet-cli --network nile get-balance
-
-# 4. Send 1 TRX to another address (1 TRX = 1,000,000 SUN)
-wallet-cli --network nile send-coin --to TRecipientAddress... --amount 1000000
-```
-
----
-
-## 3. Key Concepts
-
-### SUN and TRX
-
-TRX is the native currency of the TRON blockchain. Amounts in wallet-cli are specified in **SUN**, the smallest unit:
-
-| TRX | SUN |
-|-----|-----|
-| 1 TRX | 1,000,000 SUN |
-| 0.1 TRX | 100,000 SUN |
-| 0.000001 TRX | 1 SUN |
-
-**Example:** To send 10 TRX, use `--amount 10000000`.
-
-### Addresses
-
-TRON addresses are in **Base58Check** format, starting with `T`. Example: `TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL`
-
-### Networks
-
-| Network | Description | Use Case |
-|---------|-------------|----------|
-| `main` | TRON Mainnet | Real transactions with real TRX |
-| `nile` | Nile Testnet | Testing and development (free test TRX) |
-| `shasta` | Shasta Testnet | Legacy testnet |
-| `custom` | Custom node | Private/local nodes |
-
-### Resources: Bandwidth and Energy
-
-TRON uses two resources to process transactions:
-- **Bandwidth** -- consumed by all transactions (data transfer)
-- **Energy** -- consumed by smart contract calls
-
-You obtain these resources by **staking (freezing) TRX**. Resource type codes:
-- `0` = Bandwidth
-- `1` = Energy
-- `2` = TRON_POWER -- accepted by freeze/unfreeze only when the network enables `getAllowNewResourceModel`; not delegatable
-
----
-
-## 4. General Usage
-
-```
-wallet-cli [global-options] [command-options]
-```
-
-- **Global options** must come **before** the command name
-- **Command options** come **after** the command name
-- Option values can use space or `=` syntax: `--network nile` or `--network=nile`
-- Boolean options default to `false` and can be specified as: `--multi`, `--multi=true`, `--multi=yes`, `--multi=1`
-
-### Getting Help
-
-```bash
-# Global help (lists all commands)
-wallet-cli --help
-
-# Help for a specific command
-wallet-cli send-coin --help
-```
-
-### Command Aliases
-
-Every command has a no-dash alias for convenience. For example, `send-coin` can also be written as `sendcoin`. Both are equivalent.
-
----
-
-## 5. Global Options
-
-These flags apply to **all commands** and must appear **before** the command name.
-
-| Flag | Value | Default | Description |
-|------|-------|---------|-------------|
-| `--output` | `text` or `json` | `text` | Output format. Use `json` for machine-parseable output. |
-| `--network` | `main`, `nile`, `shasta`, `custom` | (from config) | Select which TRON network to connect to. |
-| `--wallet` | name or file path | (active wallet) | Choose which wallet file to authenticate with. |
-| `--grpc-endpoint` | `host:port` | (from network) | Override the gRPC endpoint for both fullnode and soliditynode communication. |
-| `--quiet` | (none) | off | Suppress informational messages on stderr. |
-| `--verbose` | (none) | off | Enable debug-level logging. |
-| `-h`, `--help` | (none) | off | Show help information. |
-| `--version` | (none) | off | Show version information. |
-| `--interactive` | (none) | off | Launch the interactive REPL mode instead. |
-
-**Notes:**
-- `--quiet` and `--verbose` cannot be used together.
-- `--output json` wraps all output in a JSON envelope (see [Exit Codes & Error Handling](#24-exit-codes--error-handling)).
-
-### Examples
-
-```bash
-# Query in JSON format on Nile testnet
-wallet-cli --output json --network nile get-balance --address TNPee...
-
-# Use a specific wallet file
-wallet-cli --wallet my-trading-wallet get-address
-
-# Connect to a custom node
-wallet-cli --network custom --grpc-endpoint 192.168.1.100:50051 get-block
-```
-
----
-
-## 6. Authentication
-
-Some commands require wallet authentication (signing transactions, reading private keys). Authentication is handled entirely through the `MASTER_PASSWORD` environment variable.
-
-### How It Works
-
-1. **Set your password** as an environment variable:
- ```bash
- export MASTER_PASSWORD="YourWalletPassword"
- ```
-
-2. **wallet-cli** automatically uses this password to unlock the active wallet keystore file.
-
-3. If `MASTER_PASSWORD` is not set and the command requires authentication, it fails with an error.
-
-### Authentication Requirement Levels
-
-| Level | Description | Example Commands |
-|-------|-------------|------------------|
-| **Required** | Must be authenticated. Fails without `MASTER_PASSWORD`. | `send-coin`, `freeze-balance-v2`, `deploy-contract` |
-| **Conditional** | Required only when certain options are omitted. | `get-balance` (required if `--address` not provided) |
-| **Not required** | No authentication needed. | `get-account`, `get-block`, `list-witnesses` |
-
-### Wallet Selection
-
-Wallets are stored as encrypted keystore files in the `Wallet/` directory. The CLI determines which wallet to use in this order:
-
-1. `--wallet` flag (explicit override)
-2. The active wallet (set via `set-active-wallet`)
-3. Error if neither is available
-
-### Security Tips
-
-- Never hardcode `MASTER_PASSWORD` in scripts checked into version control.
-- Use environment variable injection from a secrets manager in CI/CD pipelines.
-- Consider using `env -i MASTER_PASSWORD=... wallet-cli ...` to limit exposure.
-
----
-
-## 7. Wallet Management
-
-Commands for creating, listing, and managing local wallet files.
-
----
-
-### `register-wallet`
-
-Create a new wallet with a mnemonic seed phrase.
-
-| | |
-|---|---|
-| **Alias** | `registerwallet` |
-| **Auth** | Not required (but `MASTER_PASSWORD` must be set to encrypt the keystore) |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Display name for the wallet |
-| `--words` | No | number | Mnemonic word count: `12` or `24` (default: `12`) |
-
-```bash
-export MASTER_PASSWORD="MySecurePass123"
-wallet-cli register-wallet --name "my-main-wallet"
-wallet-cli register-wallet --name "high-security" --words 24
-```
-
-**Output (JSON):**
-```json
-{
- "success": true,
- "data": {
- "keystore": "UTC--2024-01-01T00-00-00.000000000Z--TAddress.json",
- "address": "TXyz...",
- "wallet_name": "my-main-wallet",
- "mnemonic_keystore": "mnemonic--TXyz....json"
- }
-}
-```
-
----
-
-### `list-wallet`
-
-List all wallets in the `Wallet/` directory with their active status.
-
-| | |
-|---|---|
-| **Alias** | `listwallet` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli list-wallet
-```
-
-**Output (text):**
-```
-Name Address Active
-my-main-wallet TXyz...abc *
-trading-wallet TAbc...xyz
-```
-
-> **Note:** If a keystore file in `Wallet/` is corrupt or unreadable, it still appears in the list with an `error` field in JSON mode (and `[ERROR]` placeholder in text mode) rather than failing the entire command.
-
----
-
-### `set-active-wallet`
-
-Set the active wallet for subsequent commands. Provide either `--address` or `--name`, not both.
-
-| | |
-|---|---|
-| **Alias** | `setactivewallet` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | One of address/name | string | Wallet address (Base58Check) |
-| `--name` | One of address/name | string | Wallet display name |
-
-```bash
-wallet-cli set-active-wallet --address TXyz...abc
-wallet-cli set-active-wallet --name "trading-wallet"
-```
-
----
-
-### `get-active-wallet`
-
-Display the currently active wallet.
-
-| | |
-|---|---|
-| **Alias** | `getactivewallet` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli get-active-wallet
-```
-
----
-
-### `modify-wallet-name`
-
-Change the display name of the currently authenticated wallet.
-
-| | |
-|---|---|
-| **Alias** | `modifywalletname` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | New wallet display name |
-
-```bash
-wallet-cli modify-wallet-name --name "my-new-name"
-```
-
----
-
-### `generate-sub-account`
-
-Generate a sub-account (child wallet) from the parent wallet's mnemonic using HD derivation.
-
-| | |
-|---|---|
-| **Alias** | `generatesubaccount` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--index` | Yes | number | Derivation path index (0-99) |
-| `--name` | Yes | string | Display name for the sub-account |
-
-```bash
-wallet-cli generate-sub-account --index 0 --name "sub-wallet-0"
-```
-
----
-
-### `clear-wallet-keystore`
-
-Delete the keystore file of the currently authenticated wallet.
-
-| | |
-|---|---|
-| **Alias** | `clearwalletkeystore` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--force` | No | boolean | Skip confirmation (required in non-interactive CLI mode) |
-
-```bash
-wallet-cli clear-wallet-keystore --force
-```
-
-> **Warning:** This permanently deletes the wallet keystore file. Make sure you have your mnemonic backed up.
-
----
-
-### `reset-wallet`
-
-Delete **all** wallet and mnemonic files. This is a destructive operation that requires an explicit confirmation token.
-
-| | |
-|---|---|
-| **Alias** | `resetwallet` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--confirm` | No | string | Must be exactly `delete-all-wallets` to proceed |
-
-```bash
-# Dry run -- shows what would be deleted
-wallet-cli reset-wallet
-
-# Actually delete all wallets
-wallet-cli reset-wallet --confirm delete-all-wallets
-```
-
-> **Note:** Without `--confirm`, this command performs a dry run. The dry-run output includes `files` (wallet/mnemonic keystores), `ledger_files` (Ledger device metadata), and `config_files` (e.g., `.active-wallet`) — showing everything that would be deleted.
-
-> **Warning:** This permanently deletes ALL wallet and mnemonic files, Ledger metadata, and active wallet configuration. There is no undo.
-
----
-
-## 8. Transfers & Transactions
-
-Commands for sending TRX, transferring tokens, and managing accounts.
-
----
-
-### `send-coin`
-
-Send TRX to another address.
-
-| | |
-|---|---|
-| **Alias** | `sendcoin` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--to` | Yes | address | Recipient address |
-| `--amount` | Yes | number | Amount in SUN (1 TRX = 1,000,000 SUN) |
-| `--owner` | No | address | Sender address (default: current wallet) |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Enable multi-signature mode |
-
-```bash
-# Send 10 TRX
-wallet-cli --network nile send-coin --to TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL --amount 10000000
-
-# Send with JSON output
-wallet-cli --output json --network nile send-coin --to TNPee... --amount 1000000
-```
-
----
-
-### `transfer-usdt`
-
-Transfer USDT (TRC20 token). Automatically estimates energy and calculates the fee limit.
-
-| | |
-|---|---|
-| **Alias** | `transferusdt` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--to` | Yes | address | Recipient address |
-| `--amount` | Yes | number | Amount in smallest unit (1 USDT = 1,000,000 units) |
-| `--owner` | No | address | Sender address (default: current wallet) |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Enable multi-signature mode |
-
-```bash
-# Transfer 1 USDT
-wallet-cli --network nile transfer-usdt --to TNPee... --amount 1000000
-```
-
-> **Note:** This command is only available on networks that have a known USDT contract address (mainnet and Nile).
-
----
-
-### `transfer-asset`
-
-Transfer a TRC10 token.
-
-| | |
-|---|---|
-| **Alias** | `transferasset` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--to` | Yes | address | Recipient address |
-| `--asset` | Yes | string | Asset name or ID |
-| `--amount` | Yes | number | Amount to transfer |
-| `--owner` | No | address | Sender address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile transfer-asset --to TNPee... --asset "MyToken" --amount 100
-```
-
----
-
-### `create-account`
-
-Create a new account on the TRON blockchain (activates an address on-chain).
-
-| | |
-|---|---|
-| **Alias** | `createaccount` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | The new account address to activate |
-| `--owner` | No | address | Creator address (pays the fee) |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile create-account --address TNewAddress...
-```
-
----
-
-### `update-account`
-
-Set or update the name of an account on-chain. An account name can only be set once.
-
-| | |
-|---|---|
-| **Alias** | `updateaccount` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Account name |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-account --name "MyAccountName"
-```
-
----
-
-### `set-account-id`
-
-Set a unique account ID for your account.
-
-| | |
-|---|---|
-| **Alias** | `setaccountid` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Account ID |
-| `--owner` | No | address | Owner address |
-
-```bash
-wallet-cli --network nile set-account-id --id "my-unique-id"
-```
-
----
-
-### `asset-issue`
-
-Create (issue) a new TRC10 token.
-
-| | |
-|---|---|
-| **Alias** | `assetissue` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Token name |
-| `--abbr` | Yes | string | Token abbreviation |
-| `--total-supply` | Yes | number | Total supply |
-| `--trx-num` | Yes | number | TRX amount per token unit in ICO |
-| `--ico-num` | Yes | number | Token amount per TRX unit in ICO |
-| `--start-time` | Yes | number | ICO start time (Unix timestamp in milliseconds) |
-| `--end-time` | Yes | number | ICO end time (Unix timestamp in milliseconds) |
-| `--url` | Yes | string | Project URL |
-| `--free-net-limit` | Yes | number | Free bandwidth limit per account |
-| `--public-free-net-limit` | Yes | number | Total public free bandwidth limit |
-| `--precision` | No | number | Token precision / decimal places (default: 0) |
-| `--description` | No | string | Token description |
-| `--owner` | No | address | Issuer address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile asset-issue \
- --name "MyToken" \
- --abbr "MTK" \
- --total-supply 1000000000 \
- --trx-num 1 \
- --ico-num 1 \
- --start-time 1735689600000 \
- --end-time 1738368000000 \
- --url "https://mytoken.example.com" \
- --free-net-limit 5000 \
- --public-free-net-limit 50000 \
- --precision 6 \
- --description "My awesome token"
-```
-
----
-
-### `update-asset`
-
-Update parameters of an existing TRC10 token you own.
-
-| | |
-|---|---|
-| **Alias** | `updateasset` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--description` | Yes | string | New token description |
-| `--url` | Yes | string | New project URL |
-| `--new-limit` | Yes | number | New free bandwidth limit per account |
-| `--new-public-limit` | Yes | number | New total public free bandwidth limit |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-asset \
- --description "Updated description" \
- --url "https://newurl.example.com" \
- --new-limit 10000 \
- --new-public-limit 100000
-```
-
----
-
-### `participate-asset-issue`
-
-Participate in a TRC10 token ICO by purchasing tokens from the issuer.
-
-| | |
-|---|---|
-| **Alias** | `participateassetissue` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--to` | Yes | address | Asset issuer's address |
-| `--asset` | Yes | string | Asset name |
-| `--amount` | Yes | number | Amount of TRX to spend |
-| `--owner` | No | address | Participant address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile participate-asset-issue \
- --to TIssuerAddress... \
- --asset "MyToken" \
- --amount 1000000
-```
-
----
-
-### `update-account-permission`
-
-Update account permissions to configure multi-signature control.
-
-| | |
-|---|---|
-| **Alias** | `updateaccountpermission` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | Yes | address | Account address to update |
-| `--permissions` | Yes | string | Permissions configuration as a JSON string |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-account-permission \
- --owner TMyAddress... \
- --permissions '{"owner":{"type":0,"permission_name":"owner","threshold":2,"keys":[{"address":"TAddr1...","weight":1},{"address":"TAddr2...","weight":1}]}}'
-```
-
----
-
-### `broadcast-transaction`
-
-Broadcast a pre-signed transaction to the network.
-
-| | |
-|---|---|
-| **Alias** | `broadcasttransaction` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--transaction` | Yes | string | Signed transaction as a hex string |
-
-```bash
-wallet-cli --network nile broadcast-transaction --transaction 0a8e010a...
-```
-
----
-
-### `gas-free-transfer`
-
-Transfer tokens using the GasFree service (the sender does not pay gas fees).
-
-| | |
-|---|---|
-| **Alias** | `gasfreetransfer` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--to` | Yes | address | Recipient address |
-| `--amount` | Yes | number | Amount to transfer |
-
-```bash
-wallet-cli --network nile gas-free-transfer --to TNPee... --amount 1000000
-```
-
----
-
-## 9. Staking & Resources
-
-Commands for freezing/unfreezing TRX, delegating resources, and managing the Stake 2.0 system.
-
----
-
-### `freeze-balance-v2`
-
-Freeze TRX to obtain bandwidth or energy using **Stake 2.0** (the current staking mechanism).
-
-| | |
-|---|---|
-| **Alias** | `freezebalancev2` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--amount` | Yes | number | Amount to freeze in SUN |
-| `--resource` | No | number | Resource type: `0` = Bandwidth, `1` = Energy, `2` = TRON_POWER (only when getAllowNewResourceModel enabled; default: `0`) |
-| `--owner` | No | address | Owner address |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-# Freeze 100 TRX for energy
-wallet-cli --network nile freeze-balance-v2 --amount 100000000 --resource 1
-
-# Freeze 50 TRX for bandwidth
-wallet-cli --network nile freeze-balance-v2 --amount 50000000 --resource 0
-```
-
----
-
-### `unfreeze-balance-v2`
-
-Unfreeze previously frozen TRX under **Stake 2.0**. Unfrozen TRX enters a waiting period before it can be withdrawn.
-
-| | |
-|---|---|
-| **Alias** | `unfreezebalancev2` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--amount` | Yes | number | Amount to unfreeze in SUN |
-| `--resource` | No | number | Resource type: `0` = Bandwidth, `1` = Energy, `2` = TRON_POWER (only when getAllowNewResourceModel enabled; default: `0`) |
-| `--owner` | No | address | Owner address |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile unfreeze-balance-v2 --amount 50000000 --resource 1
-```
-
----
-
-### `withdraw-expire-unfreeze`
-
-Withdraw TRX that has completed the unfreeze waiting period.
-
-| | |
-|---|---|
-| **Alias** | `withdrawexpireunfreeze` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile withdraw-expire-unfreeze
-```
-
----
-
-### `cancel-all-unfreeze-v2`
-
-Cancel all pending unfreeze operations, returning the TRX to frozen state.
-
-| | |
-|---|---|
-| **Alias** | `cancelallunfreezev2` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile cancel-all-unfreeze-v2
-```
-
----
-
-### `delegate-resource`
-
-Delegate bandwidth or energy to another address. The recipient can use the resources, but the TRX remains yours.
-
-| | |
-|---|---|
-| **Alias** | `delegateresource` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--amount` | Yes | number | Amount of frozen TRX to delegate (in SUN) |
-| `--resource` | Yes | number | Resource type: `0` = Bandwidth, `1` = Energy |
-| `--receiver` | Yes | address | Receiver address |
-| `--lock` | No | boolean | Lock the delegation (cannot be undelegated during lock period) |
-| `--lock-period` | No | number | Lock period in blocks (only with `--lock`) |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-# Delegate 100 TRX worth of energy to another address
-wallet-cli --network nile delegate-resource \
- --amount 100000000 \
- --resource 1 \
- --receiver TReceiverAddr...
-
-# Delegate with lock
-wallet-cli --network nile delegate-resource \
- --amount 50000000 \
- --resource 0 \
- --receiver TReceiverAddr... \
- --lock \
- --lock-period 28800
-```
-
----
-
-### `undelegate-resource`
-
-Reclaim previously delegated bandwidth or energy from another address.
-
-| | |
-|---|---|
-| **Alias** | `undelegateresource` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--amount` | Yes | number | Amount to undelegate in SUN |
-| `--resource` | Yes | number | Resource type: `0` = Bandwidth, `1` = Energy |
-| `--receiver` | Yes | address | Address to reclaim from |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile undelegate-resource \
- --amount 100000000 \
- --resource 1 \
- --receiver TReceiverAddr...
-```
-
----
-
-### `withdraw-balance`
-
-Withdraw witness (Super Representative) block rewards.
-
-| | |
-|---|---|
-| **Alias** | `withdrawbalance` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | No | address | Witness address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile withdraw-balance
-```
-
----
-
-### `freeze-balance` (deprecated)
-
-Freeze TRX using the legacy Stake 1.0 system. **Use `freeze-balance-v2` instead.**
-
-| | |
-|---|---|
-| **Alias** | `freezebalance` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--amount` | Yes | number | Amount to freeze in SUN |
-| `--duration` | Yes | number | Freeze duration in days |
-| `--resource` | No | number | Resource type: `0` = Bandwidth, `1` = Energy, `2` = TRON_POWER (only when getAllowNewResourceModel enabled; default: `0`) |
-| `--receiver` | No | address | Delegate the frozen resources to this address |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile freeze-balance --amount 100000000 --duration 3 --resource 1
-```
-
----
-
-### `unfreeze-balance` (deprecated)
-
-Unfreeze TRX under the legacy Stake 1.0 system. **Use `unfreeze-balance-v2` instead.**
-
-| | |
-|---|---|
-| **Alias** | `unfreezebalance` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--resource` | No | number | Resource type: `0` = Bandwidth, `1` = Energy, `2` = TRON_POWER (only when getAllowNewResourceModel enabled; default: `0`) |
-| `--receiver` | No | address | Receiver address (if resources were delegated) |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile unfreeze-balance --resource 1
-```
-
----
-
-### `unfreeze-asset`
-
-Unfreeze a previously frozen TRC10 asset.
-
-| | |
-|---|---|
-| **Alias** | `unfreezeasset` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile unfreeze-asset
-```
-
----
-
-## 10. Query - Account & Balance
-
-Commands for querying account information and balances. These do **not** require authentication when an explicit address is provided.
-
----
-
-### `get-address`
-
-Display the address of the currently logged-in wallet.
-
-| | |
-|---|---|
-| **Alias** | `getaddress` |
-| **Auth** | Required |
-
-No options.
-
-```bash
-wallet-cli get-address
-```
-
----
-
-### `get-balance`
-
-Get the TRX balance of an address. Returns both SUN and TRX values.
-
-| | |
-|---|---|
-| **Alias** | `getbalance` |
-| **Auth** | Required if `--address` is omitted; not required if `--address` is provided |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | No | address | Address to query (default: current wallet) |
-
-```bash
-# Query own wallet balance (requires auth)
-wallet-cli --network nile get-balance
-
-# Query any address (no auth needed)
-wallet-cli --network nile get-balance --address TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
-
-# JSON output
-wallet-cli --output json --network nile get-balance --address TNPee...
-```
-
-**JSON output:**
-```json
-{
- "success": true,
- "data": {
- "balance_sun": 1000000,
- "balance_trx": "1.000000"
- }
-}
-```
-
----
-
-### `get-usdt-balance`
-
-Get the USDT (TRC20) balance of an address.
-
-| | |
-|---|---|
-| **Alias** | `getusdtbalance` |
-| **Auth** | Required if `--address` is omitted; not required if `--address` is provided |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | No | address | Address to query (default: current wallet) |
-
-```bash
-wallet-cli --network nile get-usdt-balance --address TNPee...
-```
-
----
-
-### `get-account`
-
-Get detailed account information including balance, assets, permissions, and more.
-
-| | |
-|---|---|
-| **Alias** | `getaccount` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-account --address TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
-```
-
----
-
-### `get-account-by-id`
-
-Get account information using an account ID (set via `set-account-id`).
-
-| | |
-|---|---|
-| **Alias** | `getaccountbyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Account ID |
-
-```bash
-wallet-cli --network nile get-account-by-id --id "my-unique-id"
-```
-
----
-
-### `get-account-net`
-
-Get bandwidth (net) information for an account.
-
-| | |
-|---|---|
-| **Alias** | `getaccountnet` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-account-net --address TNPee...
-```
-
----
-
-### `get-account-resource`
-
-Get resource information (bandwidth and energy) for an account.
-
-| | |
-|---|---|
-| **Alias** | `getaccountresource` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-account-resource --address TNPee...
-```
-
----
-
-## 11. Query - Blockchain
-
-Commands for querying blocks and transactions.
-
----
-
-### `get-block`
-
-Get a block by number, or the latest block if no number is specified.
-
-| | |
-|---|---|
-| **Alias** | `getblock` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--number` | No | number | Block number (default: latest block) |
-
-```bash
-# Get the latest block
-wallet-cli --network nile get-block
-
-# Get a specific block
-wallet-cli --network nile get-block --number 1000000
-```
-
----
-
-### `get-block-by-id`
-
-Get a block by its hash (block ID).
-
-| | |
-|---|---|
-| **Alias** | `getblockbyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Block hash / ID |
-
-```bash
-wallet-cli --network nile get-block-by-id --id 00000000001e8480...
-```
-
----
-
-### `get-block-by-id-or-num`
-
-Get a block by either its hash or number (auto-detected).
-
-| | |
-|---|---|
-| **Alias** | `getblockbyidornum` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--value` | Yes | string | Block number or block hash |
-
-```bash
-wallet-cli --network nile get-block-by-id-or-num --value 1000000
-wallet-cli --network nile get-block-by-id-or-num --value 00000000001e8480...
-```
-
----
-
-### `get-block-by-latest-num`
-
-Get the most recent N blocks.
-
-| | |
-|---|---|
-| **Alias** | `getblockbylatestnum` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--count` | Yes | number | Number of blocks to retrieve |
-
-```bash
-wallet-cli --network nile get-block-by-latest-num --count 5
-```
-
----
-
-### `get-block-by-limit-next`
-
-Get blocks in a range `[start, end)`.
-
-| | |
-|---|---|
-| **Alias** | `getblockbylimitnext` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--start` | Yes | number | Start block number (inclusive) |
-| `--end` | Yes | number | End block number (exclusive) |
-
-```bash
-wallet-cli --network nile get-block-by-limit-next --start 1000000 --end 1000005
-```
-
----
-
-### `get-transaction-by-id`
-
-Get a transaction by its transaction ID (hash).
-
-| | |
-|---|---|
-| **Alias** | `gettransactionbyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Transaction ID |
-
-```bash
-wallet-cli --network nile get-transaction-by-id --id abc123def456...
-```
-
----
-
-### `get-transaction-info-by-id`
-
-Get detailed transaction execution info (fee, energy usage, logs, etc.).
-
-| | |
-|---|---|
-| **Alias** | `gettransactioninfobyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Transaction ID |
-
-```bash
-wallet-cli --network nile get-transaction-info-by-id --id abc123def456...
-```
-
----
-
-### `get-transaction-count-by-block-num`
-
-Get the number of transactions in a specific block.
-
-| | |
-|---|---|
-| **Alias** | `gettransactioncountbyblocknum` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--number` | Yes | number | Block number |
-
-```bash
-wallet-cli --network nile get-transaction-count-by-block-num --number 1000000
-```
-
----
-
-## 12. Query - Assets & Tokens
-
-Commands for querying TRC10 asset information.
-
----
-
-### `get-asset-issue-by-account`
-
-Get all TRC10 assets issued by a specific account.
-
-| | |
-|---|---|
-| **Alias** | `getassetissuebyaccount` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Issuer account address |
-
-```bash
-wallet-cli --network nile get-asset-issue-by-account --address TIssuer...
-```
-
----
-
-### `get-asset-issue-by-id`
-
-Get a TRC10 asset by its numeric ID.
-
-| | |
-|---|---|
-| **Alias** | `getassetissuebyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Asset ID |
-
-```bash
-wallet-cli --network nile get-asset-issue-by-id --id "1000001"
-```
-
----
-
-### `get-asset-issue-by-name`
-
-Get a TRC10 asset by name (returns the first match).
-
-| | |
-|---|---|
-| **Alias** | `getassetissuebyname` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Asset name |
-
-```bash
-wallet-cli --network nile get-asset-issue-by-name --name "MyToken"
-```
-
----
-
-### `get-asset-issue-list-by-name`
-
-Get all TRC10 assets matching a name (may return multiple).
-
-| | |
-|---|---|
-| **Alias** | `getassetissuelistbyname` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Asset name |
-
-```bash
-wallet-cli --network nile get-asset-issue-list-by-name --name "MyToken"
-```
-
----
-
-### `list-asset-issue`
-
-List all TRC10 assets on the network.
-
-| | |
-|---|---|
-| **Alias** | `listassetissue` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile list-asset-issue
-```
-
----
-
-### `list-asset-issue-paginated`
-
-List TRC10 assets with pagination.
-
-| | |
-|---|---|
-| **Alias** | `listassetissuepaginated` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--offset` | Yes | number | Starting offset |
-| `--limit` | Yes | number | Number of results per page |
-
-```bash
-wallet-cli --network nile list-asset-issue-paginated --offset 0 --limit 20
-```
-
----
-
-## 13. Query - Network & Chain Info
-
-Commands for querying network parameters and chain state.
-
----
-
-### `current-network`
-
-Display the currently connected network name.
-
-| | |
-|---|---|
-| **Alias** | `currentnetwork` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile current-network
-```
-
----
-
-### `get-chain-parameters`
-
-Get all TRON chain parameters (proposal-adjustable settings).
-
-| | |
-|---|---|
-| **Alias** | `getchainparameters` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-chain-parameters
-```
-
----
-
-### `get-bandwidth-prices`
-
-Get the history of bandwidth prices on the network.
-
-| | |
-|---|---|
-| **Alias** | `getbandwidthprices` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-bandwidth-prices
-```
-
----
-
-### `get-energy-prices`
-
-Get the history of energy prices on the network.
-
-| | |
-|---|---|
-| **Alias** | `getenergyprices` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-energy-prices
-```
-
----
-
-### `get-memo-fee`
-
-Get the current fee for adding a memo to transactions.
-
-| | |
-|---|---|
-| **Alias** | `getmemofee` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-memo-fee
-```
-
----
-
-### `get-next-maintenance-time`
-
-Get the timestamp of the next maintenance period (when votes are tallied).
-
-| | |
-|---|---|
-| **Alias** | `getnextmaintenancetime` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-next-maintenance-time
-```
-
----
-
-## 14. Query - Delegation & Staking Info
-
-Commands for querying resource delegation and staking status.
-
----
-
-### `get-delegated-resource`
-
-Get resources delegated between two addresses (Stake 1.0).
-
-| | |
-|---|---|
-| **Alias** | `getdelegatedresource` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--from` | Yes | address | Delegator address |
-| `--to` | Yes | address | Recipient address |
-
-```bash
-wallet-cli --network nile get-delegated-resource --from TFrom... --to TTo...
-```
-
----
-
-### `get-delegated-resource-v2`
-
-Get resources delegated between two addresses (Stake 2.0).
-
-| | |
-|---|---|
-| **Alias** | `getdelegatedresourcev2` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--from` | Yes | address | Delegator address |
-| `--to` | Yes | address | Recipient address |
-
-```bash
-wallet-cli --network nile get-delegated-resource-v2 --from TFrom... --to TTo...
-```
-
----
-
-### `get-delegated-resource-account-index`
-
-Get the list of addresses that have delegated resources to/from a given address (Stake 1.0).
-
-| | |
-|---|---|
-| **Alias** | `getdelegatedresourceaccountindex` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-delegated-resource-account-index --address TAddr...
-```
-
----
-
-### `get-delegated-resource-account-index-v2`
-
-Get the list of addresses that have delegated resources to/from a given address (Stake 2.0).
-
-| | |
-|---|---|
-| **Alias** | `getdelegatedresourceaccountindexv2` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-delegated-resource-account-index-v2 --address TAddr...
-```
-
----
-
-### `get-can-delegated-max-size`
-
-Get the maximum amount of a resource type that can be delegated.
-
-| | |
-|---|---|
-| **Alias** | `getcandelegatedmaxsize` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--owner` | Yes | address | Owner address |
-| `--type` | Yes | number | Resource type: `0` = Bandwidth, `1` = Energy |
-
-```bash
-wallet-cli --network nile get-can-delegated-max-size --owner TAddr... --type 1
-```
-
----
-
-### `get-available-unfreeze-count`
-
-Get how many unfreeze operations are currently available for an address.
-
-| | |
-|---|---|
-| **Alias** | `getavailableunfreezecount` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-available-unfreeze-count --address TAddr...
-```
-
----
-
-### `get-can-withdraw-unfreeze-amount`
-
-Get the amount of TRX that can be withdrawn from expired unfreeze operations.
-
-| | |
-|---|---|
-| **Alias** | `getcanwithdrawunfreezeamount` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-| `--timestamp` | No | number | Timestamp in milliseconds (default: current time) |
-
-```bash
-wallet-cli --network nile get-can-withdraw-unfreeze-amount --address TAddr...
-```
-
----
-
-## 15. Query - Witnesses, Proposals & Exchanges
-
-Commands for querying Super Representatives, governance proposals, and on-chain exchanges.
-
----
-
-### `list-nodes`
-
-List all nodes connected to the current node.
-
-| | |
-|---|---|
-| **Alias** | `listnodes` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile list-nodes
-```
-
----
-
-### `list-witnesses`
-
-List all Super Representatives (witnesses) on the network.
-
-| | |
-|---|---|
-| **Alias** | `listwitnesses` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile list-witnesses
-```
-
----
-
-### `get-brokerage`
-
-Get the brokerage ratio (commission rate) of a witness.
-
-| | |
-|---|---|
-| **Alias** | `getbrokerage` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Witness address |
-
-```bash
-wallet-cli --network nile get-brokerage --address TWitness...
-```
-
----
-
-### `get-reward`
-
-Get the unclaimed voting reward for an address.
-
-| | |
-|---|---|
-| **Alias** | `getreward` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Address to query |
-
-```bash
-wallet-cli --network nile get-reward --address TAddr...
-```
-
----
-
-### `list-proposals`
-
-List all governance proposals.
-
-| | |
-|---|---|
-| **Alias** | `listproposals` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile list-proposals
-```
-
----
-
-### `list-proposals-paginated`
-
-List governance proposals with pagination.
-
-| | |
-|---|---|
-| **Alias** | `listproposalspaginated` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--offset` | Yes | number | Starting offset |
-| `--limit` | Yes | number | Number of results per page |
-
-```bash
-wallet-cli --network nile list-proposals-paginated --offset 0 --limit 10
-```
-
----
-
-### `get-proposal`
-
-Get details of a specific governance proposal.
-
-| | |
-|---|---|
-| **Alias** | `getproposal` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | number | Proposal ID |
-
-```bash
-wallet-cli --network nile get-proposal --id 1
-```
-
----
-
-### `list-exchanges`
-
-List all on-chain Bancor exchanges.
-
-| | |
-|---|---|
-| **Alias** | `listexchanges` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile list-exchanges
-```
-
----
-
-### `list-exchanges-paginated`
-
-List on-chain exchanges with pagination.
-
-| | |
-|---|---|
-| **Alias** | `listexchangespaginated` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--offset` | Yes | number | Starting offset |
-| `--limit` | Yes | number | Number of results per page |
-
-```bash
-wallet-cli --network nile list-exchanges-paginated --offset 0 --limit 10
-```
-
----
-
-### `get-exchange`
-
-Get details of a specific on-chain exchange.
-
-| | |
-|---|---|
-| **Alias** | `getexchange` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Exchange ID |
-
-```bash
-wallet-cli --network nile get-exchange --id "1"
-```
-
----
-
-## 16. Query - Market Orders
-
-Commands for querying the on-chain decentralized market.
-
----
-
-### `get-market-order-by-account`
-
-Get all market orders placed by a specific account.
-
-| | |
-|---|---|
-| **Alias** | `getmarketorderbyaccount` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Account address |
-
-```bash
-wallet-cli --network nile get-market-order-by-account --address TAddr...
-```
-
----
-
-### `get-market-order-by-id`
-
-Get a specific market order by its ID.
-
-| | |
-|---|---|
-| **Alias** | `getmarketorderbyid` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | Order ID (hex) |
-
-```bash
-wallet-cli --network nile get-market-order-by-id --id abc123...
-```
-
----
-
-### `get-market-order-list-by-pair`
-
-Get all market orders for a specific trading pair.
-
-| | |
-|---|---|
-| **Alias** | `getmarketorderlistbypair` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--sell-token` | Yes | string | Sell token name (use `_` for TRX) |
-| `--buy-token` | Yes | string | Buy token name (use `_` for TRX) |
-
-```bash
-wallet-cli --network nile get-market-order-list-by-pair --sell-token _ --buy-token MyToken
-```
-
----
-
-### `get-market-pair-list`
-
-List all available market trading pairs.
-
-| | |
-|---|---|
-| **Alias** | `getmarketpairlist` |
-| **Auth** | Not required |
-
-No options.
-
-```bash
-wallet-cli --network nile get-market-pair-list
-```
-
----
-
-### `get-market-price-by-pair`
-
-Get the current market price for a trading pair.
-
-| | |
-|---|---|
-| **Alias** | `getmarketpricebypair` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--sell-token` | Yes | string | Sell token name (use `_` for TRX) |
-| `--buy-token` | Yes | string | Buy token name (use `_` for TRX) |
-
-```bash
-wallet-cli --network nile get-market-price-by-pair --sell-token _ --buy-token MyToken
-```
-
----
-
-## 17. Query - GasFree
-
-Commands for the GasFree service (gasless transfers).
-
----
-
-### `gas-free-info`
-
-Get GasFree service eligibility and configuration info for an address.
-
-| | |
-|---|---|
-| **Alias** | `gasfreeinfo` |
-| **Auth** | Required if `--address` is omitted; not required if `--address` is provided |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | No | string | Address to query (default: current wallet) |
-
-```bash
-wallet-cli --network nile gas-free-info --address TAddr...
-```
-
----
-
-### `gas-free-trace`
-
-Trace the status of a GasFree transaction.
-
-| | |
-|---|---|
-| **Alias** | `gasfreetrace` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | string | GasFree transaction ID |
-
-```bash
-wallet-cli --network nile gas-free-trace --id "gasfree-tx-id..."
-```
-
----
-
-## 18. Smart Contracts
-
-Commands for deploying, calling, and managing smart contracts.
-
----
-
-### `deploy-contract`
-
-Deploy a new smart contract to the blockchain.
-
-| | |
-|---|---|
-| **Alias** | `deploycontract` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--name` | Yes | string | Contract name |
-| `--abi` | Yes | string | Contract ABI as a JSON string |
-| `--bytecode` | Yes | string | Contract bytecode (hex) |
-| `--fee-limit` | Yes | number | Maximum fee in SUN |
-| `--constructor` | No | string | Constructor signature (e.g., `constructor(uint256,address)`) |
-| `--params` | No | string | Constructor parameters (provide with `--constructor`) |
-| `--consume-user-resource-percent` | No | number | Caller's resource share percent, 0-100 (default: 0) |
-| `--origin-energy-limit` | No | number | Max energy the deployer will provide (default: 10,000,000) |
-| `--value` | No | number | TRX sent with deployment in SUN (default: 0) |
-| `--token-value` | No | number | TRC10 token value (default: 0) |
-| `--token-id` | No | string | TRC10 token ID |
-| `--library` | No | string | Library link in format `LibName:TAddress` |
-| `--compiler-version` | No | string | Solidity compiler version |
-| `--owner` | No | address | Deployer address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-> **Note:** `--constructor` and `--params` must be provided together.
-
-```bash
-wallet-cli --network nile deploy-contract \
- --name "MyContract" \
- --abi '[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"}]' \
- --bytecode "608060405234801561001057600080fd5b50..." \
- --fee-limit 1000000000 \
- --consume-user-resource-percent 50 \
- --origin-energy-limit 10000000
-```
-
----
-
-### `trigger-contract`
-
-Call a smart contract function that modifies state (sends a transaction).
-
-| | |
-|---|---|
-| **Alias** | `triggercontract` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--method` | Yes | string | Method signature (e.g., `transfer(address,uint256)`) |
-| `--fee-limit` | Yes | number | Maximum fee in SUN |
-| `--params` | No | string | Method parameters |
-| `--value` | No | number | TRX to send with the call in SUN (default: 0) |
-| `--token-value` | No | number | TRC10 token value (default: 0) |
-| `--token-id` | No | string | TRC10 token ID |
-| `--owner` | No | address | Caller address |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-# Call a contract method
-wallet-cli --network nile trigger-contract \
- --contract TContractAddr... \
- --method "transfer(address,uint256)" \
- --params '"TRecipient...",1000000' \
- --fee-limit 100000000
-```
-
----
-
-### `trigger-constant-contract`
-
-Call a read-only (view/pure) smart contract function. Does not create a transaction or cost resources.
-
-| | |
-|---|---|
-| **Alias** | `triggerconstantcontract` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--method` | Yes | string | Method signature (e.g., `balanceOf(address)`) |
-| `--params` | No | string | Method parameters |
-| `--owner` | No | address | Caller address |
-
-```bash
-# Check USDT balance of an address (read-only call)
-wallet-cli --network nile trigger-constant-contract \
- --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf \
- --method "balanceOf(address)" \
- --params '"TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"' \
- --owner TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
-```
-
----
-
-### `estimate-energy`
-
-Estimate how much energy a contract call would consume, without actually executing it.
-
-| | |
-|---|---|
-| **Alias** | `estimateenergy` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--method` | Yes | string | Method signature |
-| `--params` | No | string | Method parameters |
-| `--value` | No | number | Call value in SUN (default: 0) |
-| `--token-value` | No | number | Token value (default: 0) |
-| `--token-id` | No | string | Token ID |
-| `--owner` | No | address | Caller address |
-
-```bash
-wallet-cli --network nile estimate-energy \
- --contract TContractAddr... \
- --method "transfer(address,uint256)" \
- --params '"TRecipient...",1000000' \
- --owner TMyAddr...
-```
-
----
-
-### `get-contract`
-
-Get the smart contract definition (ABI, bytecode, etc.) by its address.
-
-| | |
-|---|---|
-| **Alias** | `getcontract` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Contract address |
-
-```bash
-wallet-cli --network nile get-contract --address TContractAddr...
-```
-
----
-
-### `get-contract-info`
-
-Get smart contract metadata including energy settings.
-
-| | |
-|---|---|
-| **Alias** | `getcontractinfo` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--address` | Yes | address | Contract address |
-
-```bash
-wallet-cli --network nile get-contract-info --address TContractAddr...
-```
-
----
-
-### `clear-contract-abi`
-
-Remove the ABI from a smart contract you own.
-
-| | |
-|---|---|
-| **Alias** | `clearcontractabi` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile clear-contract-abi --contract TContractAddr...
-```
-
----
-
-### `update-setting`
-
-Update the `consume_user_resource_percent` setting of a smart contract you own.
-
-| | |
-|---|---|
-| **Alias** | `updatesetting` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--consume-user-resource-percent` | Yes | number | New percentage (0-100) |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-setting --contract TContractAddr... --consume-user-resource-percent 50
-```
-
----
-
-### `update-energy-limit`
-
-Update the `origin_energy_limit` setting of a smart contract you own.
-
-| | |
-|---|---|
-| **Alias** | `updateenergylimit` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--contract` | Yes | address | Contract address |
-| `--origin-energy-limit` | Yes | number | New energy limit |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-energy-limit --contract TContractAddr... --origin-energy-limit 10000000
-```
-
----
-
-## 19. Witnesses & Voting
-
-Commands for Super Representative (witness) operations and voting.
-
----
-
-### `create-witness`
-
-Apply to become a Super Representative (witness). Requires 9,999 TRX to be burned.
-
-| | |
-|---|---|
-| **Alias** | `createwitness` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--url` | Yes | string | Your witness website URL |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile create-witness --url "https://mywitness.example.com"
-```
-
----
-
-### `update-witness`
-
-Update the URL of an existing witness.
-
-| | |
-|---|---|
-| **Alias** | `updatewitness` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--url` | Yes | string | New witness URL |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-witness --url "https://new-url.example.com"
-```
-
----
-
-### `vote-witness`
-
-Vote for one or more Super Representatives using your frozen TRX as voting power.
-
-| | |
-|---|---|
-| **Alias** | `votewitness` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--votes` | Yes | string | Space-separated pairs: `address1 count1 address2 count2 ...` |
-| `--owner` | No | address | Voter address |
-| `--permission-id` | No | number | Permission ID for multi-sig signing (default: 0) |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-# Vote for two witnesses
-wallet-cli --network nile vote-witness \
- --votes "TWitness1... 1000 TWitness2... 500"
-```
-
-> **Note:** Each vote replaces your previous votes entirely. Your total vote count cannot exceed your frozen TRX amount.
-
----
-
-### `update-brokerage`
-
-Update the brokerage (commission) ratio as a witness. This determines what percentage of voter rewards you keep.
-
-| | |
-|---|---|
-| **Alias** | `updatebrokerage` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--brokerage` | Yes | number | Brokerage ratio (0-100). E.g., 20 means keep 20%, distribute 80%. |
-| `--owner` | No | address | Witness address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile update-brokerage --brokerage 20
-```
-
----
-
-## 20. Proposals
-
-Commands for TRON governance proposals. Only Super Representatives can create proposals.
-
----
-
-### `create-proposal`
-
-Create a new governance proposal to change chain parameters.
-
-| | |
-|---|---|
-| **Alias** | `createproposal` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--parameters` | Yes | string | Space-separated pairs: `paramId1 value1 paramId2 value2 ...` |
-| `--owner` | No | address | Proposer address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-# Create a proposal to change parameter #0 to value 100000
-wallet-cli --network nile create-proposal --parameters "0 100000"
-```
-
----
-
-### `approve-proposal`
-
-Vote to approve or disapprove an existing proposal.
-
-| | |
-|---|---|
-| **Alias** | `approveproposal` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | number | Proposal ID |
-| `--approve` | Yes | boolean | `true` to approve, `false` to disapprove |
-| `--owner` | No | address | Voter address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile approve-proposal --id 1 --approve true
-```
-
----
-
-### `delete-proposal`
-
-Delete a proposal you created (only before it is approved).
-
-| | |
-|---|---|
-| **Alias** | `deleteproposal` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--id` | Yes | number | Proposal ID |
-| `--owner` | No | address | Proposer address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile delete-proposal --id 1
-```
-
----
-
-## 21. DEX & Exchanges
-
-Commands for the on-chain Bancor exchange and decentralized market.
-
----
-
-### `exchange-create`
-
-Create a new Bancor exchange pair between two tokens.
-
-| | |
-|---|---|
-| **Alias** | `exchangecreate` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--first-token` | Yes | string | First token ID (use `_` for TRX) |
-| `--first-balance` | Yes | number | Initial balance of the first token |
-| `--second-token` | Yes | string | Second token ID |
-| `--second-balance` | Yes | number | Initial balance of the second token |
-| `--owner` | No | address | Creator address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile exchange-create \
- --first-token _ \
- --first-balance 10000000000 \
- --second-token "1000001" \
- --second-balance 10000000
-```
-
----
-
-### `exchange-inject`
-
-Add liquidity to an existing exchange.
-
-| | |
-|---|---|
-| **Alias** | `exchangeinject` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--exchange-id` | Yes | number | Exchange ID |
-| `--token-id` | Yes | string | Token to inject |
-| `--quant` | Yes | number | Amount to inject |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile exchange-inject --exchange-id 1 --token-id _ --quant 1000000000
-```
-
----
-
-### `exchange-withdraw`
-
-Withdraw liquidity from an exchange.
-
-| | |
-|---|---|
-| **Alias** | `exchangewithdraw` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--exchange-id` | Yes | number | Exchange ID |
-| `--token-id` | Yes | string | Token to withdraw |
-| `--quant` | Yes | number | Amount to withdraw |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile exchange-withdraw --exchange-id 1 --token-id _ --quant 500000000
-```
-
----
-
-### `market-sell-asset`
-
-Place a limit sell order on the decentralized market.
-
-| | |
-|---|---|
-| **Alias** | `marketsellasset` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--sell-token` | Yes | string | Token to sell (use `_` for TRX) |
-| `--sell-quantity` | Yes | number | Amount to sell |
-| `--buy-token` | Yes | string | Token to buy (use `_` for TRX) |
-| `--buy-quantity` | Yes | number | Expected amount to buy (sets the price) |
-| `--owner` | No | address | Seller address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile market-sell-asset \
- --sell-token _ \
- --sell-quantity 1000000 \
- --buy-token "1000001" \
- --buy-quantity 500
-```
-
----
-
-### `market-cancel-order`
-
-Cancel a previously placed market order.
-
-| | |
-|---|---|
-| **Alias** | `marketcancelorder` |
-| **Auth** | Required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--order-id` | Yes | string | Order ID (hex) |
-| `--owner` | No | address | Owner address |
-| `--multi` | No | boolean | Multi-signature mode |
-
-```bash
-wallet-cli --network nile market-cancel-order --order-id abc123def...
-```
-
----
-
-## 22. Help
-
-### `help`
-
-Display help information.
-
-| | |
-|---|---|
-| **Alias** | `help` |
-| **Auth** | Not required |
-
-| Option | Required | Type | Description |
-|--------|----------|------|-------------|
-| `--command` | No | string | Specific command to show help for |
-
-```bash
-wallet-cli help
-wallet-cli --help
-wallet-cli send-coin --help
-```
-
----
-
-## 23. Common Scenarios
-
-### Scenario 1: Create a Wallet and Fund It
-
-```bash
-# Set your wallet password
-export MASTER_PASSWORD="SecurePass123!"
-
-# Create a new wallet on Nile testnet
-wallet-cli register-wallet --name "test-wallet"
-# Save the mnemonic phrase displayed! It's your backup.
-
-# Check your address
-wallet-cli get-address
-
-# Fund it from the Nile testnet faucet (external step)
-# Then verify your balance
-wallet-cli --network nile get-balance
-```
-
-### Scenario 2: Send TRX to Someone
-
-```bash
-export MASTER_PASSWORD="SecurePass123!"
-
-# Send 5 TRX (= 5,000,000 SUN)
-wallet-cli --network nile send-coin \
- --to TRecipientAddress... \
- --amount 5000000
-
-# Verify the transaction
-wallet-cli --network nile get-transaction-info-by-id --id
-```
-
-### Scenario 3: Transfer USDT
-
-```bash
-export MASTER_PASSWORD="SecurePass123!"
-
-# Transfer 10 USDT (= 10,000,000 in smallest unit)
-wallet-cli --network nile transfer-usdt \
- --to TRecipientAddress... \
- --amount 10000000
-```
-
-### Scenario 4: Stake TRX for Energy
-
-```bash
-export MASTER_PASSWORD="SecurePass123!"
-
-# Freeze 100 TRX for energy (Stake 2.0)
-wallet-cli --network nile freeze-balance-v2 --amount 100000000 --resource 1
-
-# Check your resources
-wallet-cli --network nile get-account-resource --address TYourAddress...
-```
-
-### Scenario 5: Delegate Energy to Another Address
-
-```bash
-export MASTER_PASSWORD="SecurePass123!"
-
-# Delegate 50 TRX worth of energy to a friend
-wallet-cli --network nile delegate-resource \
- --amount 50000000 \
- --resource 1 \
- --receiver TFriendAddress...
-
-# Later, reclaim it
-wallet-cli --network nile undelegate-resource \
- --amount 50000000 \
- --resource 1 \
- --receiver TFriendAddress...
-```
-
-### Scenario 6: Vote for a Super Representative
-
-```bash
-export MASTER_PASSWORD="SecurePass123!"
-
-# First, check available witnesses
-wallet-cli --network nile list-witnesses
-
-# Vote (you need frozen TRX for voting power)
-wallet-cli --network nile vote-witness \
- --votes "TWitnessAddr1... 500 TWitnessAddr2... 300"
-
-# Check unclaimed rewards later
-wallet-cli --network nile get-reward --address TYourAddress...
-```
-
-### Scenario 7: Call a Read-Only Smart Contract (No Fee)
-
-```bash
-# Check USDT balance -- no wallet auth needed (read-only, no fee)
-wallet-cli --network nile trigger-constant-contract \
- --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf \
- --method "balanceOf(address)" \
- --params '"TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"' \
- --owner TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
-```
-
-### Scenario 8: JSON Output for Scripting
-
-```bash
-# Get balance as JSON and extract with jq
-wallet-cli --output json --network nile get-balance --address TNPee... \
- | jq '.data.balance_trx'
-
-# Check if command succeeded
-wallet-cli --output json --network nile get-account --address TNPee... \
- | jq '.success'
-```
-
----
-
-## 24. Exit Codes & Error Handling
-
-### Exit Codes
-
-| Code | Meaning | Description |
-|------|---------|-------------|
-| `0` | Success | Command completed successfully |
-| `1` | Execution Error | Runtime failure (network error, authentication failure, transaction rejected) |
-| `2` | Usage Error | Invalid arguments, unknown command, missing required options |
-
-### JSON Output Envelope
-
-In `--output json` mode, all responses follow this structure:
-
-**Success:**
-```json
-{
- "success": true,
- "data": {
- "key": "value"
- }
-}
-```
-
-**Error:**
-```json
-{
- "success": false,
- "error": "error_code",
- "message": "Human-readable error description"
-}
-```
-
-Common error codes:
-- `usage_error` -- invalid arguments or syntax
-- `execution_error` -- runtime failure
-- `query_failed` -- a query returned no data
-- `missing_env` -- required environment variable is not set
-- `not_found` -- requested resource not found
-- `not_logged_in` -- authentication required but not provided
-
-### Troubleshooting Tips
-
-| Problem | Solution |
-|---------|----------|
-| "MASTER_PASSWORD is required..." | Set the `MASTER_PASSWORD` environment variable |
-| "No active wallet selected..." | Run `set-active-wallet` or use `--wallet` flag |
-| "Unknown global option..." | Global options must come before the command name |
-| "Missing value for --network" | Provide one of: `main`, `nile`, `shasta`, `custom` |
-| "Invalid value for --output" | Must be `text` or `json` |
-| Command not found | Check spelling. Try the no-dash alias (e.g., `sendcoin` instead of `send-coin`) |
-
----
-
-## 25. Appendix
-
-### A. SUN / TRX Conversion Table
-
-| TRX | SUN |
-|-----|-----|
-| 0.000001 | 1 |
-| 0.001 | 1,000 |
-| 0.01 | 10,000 |
-| 0.1 | 100,000 |
-| 1 | 1,000,000 |
-| 10 | 10,000,000 |
-| 100 | 100,000,000 |
-| 1,000 | 1,000,000,000 |
-
-**Formula:** SUN = TRX x 1,000,000
-
-### B. Resource Type Codes
-
-| Code | Resource | Used By |
-|------|----------|---------|
-| `0` | Bandwidth | All transactions (data transfer) |
-| `1` | Energy | Smart contract calls |
-| `2` | TRON_POWER | freeze/unfreeze only, when `getAllowNewResourceModel` is enabled (not delegatable) |
-
-### C. Network Endpoints
-
-| Network | Description |
-|---------|-------------|
-| `main` | TRON Mainnet (production) |
-| `nile` | Nile Testnet (recommended for development) |
-| `shasta` | Shasta Testnet (legacy) |
-| `custom` | Custom node (use with `--grpc-endpoint`) |
-
-### D. Multi-Signature Usage
-
-Many transaction commands support multi-signature mode via the `--multi` (or `-m`) flag. When enabled:
-
-1. The command creates the transaction but does **not** broadcast it immediately.
-2. Instead, it outputs the transaction for additional signatures.
-3. After all required parties have signed, use `broadcast-transaction` to submit it.
-
-To set up multi-sig, use `update-account-permission` to configure the account's permission structure first.
-
-### E. Complete Command Index
-
-| # | Command | Category | Auth |
-|---|---------|----------|------|
-| 1 | `register-wallet` | Wallet | No* |
-| 2 | `list-wallet` | Wallet | No |
-| 3 | `set-active-wallet` | Wallet | No |
-| 4 | `get-active-wallet` | Wallet | No |
-| 5 | `modify-wallet-name` | Wallet | Yes |
-| 6 | `generate-sub-account` | Wallet | Yes |
-| 7 | `clear-wallet-keystore` | Wallet | Yes |
-| 8 | `reset-wallet` | Wallet | No |
-| 9 | `send-coin` | Transaction | Yes |
-| 10 | `transfer-usdt` | Transaction | Yes |
-| 11 | `transfer-asset` | Transaction | Yes |
-| 12 | `create-account` | Transaction | Yes |
-| 13 | `update-account` | Transaction | Yes |
-| 14 | `set-account-id` | Transaction | Yes |
-| 15 | `asset-issue` | Transaction | Yes |
-| 16 | `update-asset` | Transaction | Yes |
-| 17 | `participate-asset-issue` | Transaction | Yes |
-| 18 | `update-account-permission` | Transaction | Yes |
-| 19 | `broadcast-transaction` | Transaction | No |
-| 20 | `gas-free-transfer` | Transaction | Yes |
-| 21 | `freeze-balance-v2` | Staking | Yes |
-| 22 | `unfreeze-balance-v2` | Staking | Yes |
-| 23 | `withdraw-expire-unfreeze` | Staking | Yes |
-| 24 | `cancel-all-unfreeze-v2` | Staking | Yes |
-| 25 | `delegate-resource` | Staking | Yes |
-| 26 | `undelegate-resource` | Staking | Yes |
-| 27 | `withdraw-balance` | Staking | Yes |
-| 28 | `freeze-balance` | Staking | Yes |
-| 29 | `unfreeze-balance` | Staking | Yes |
-| 30 | `unfreeze-asset` | Staking | Yes |
-| 31 | `get-address` | Query | Yes |
-| 32 | `get-balance` | Query | Conditional |
-| 33 | `get-usdt-balance` | Query | Conditional |
-| 34 | `get-account` | Query | No |
-| 35 | `get-account-by-id` | Query | No |
-| 36 | `get-account-net` | Query | No |
-| 37 | `get-account-resource` | Query | No |
-| 38 | `current-network` | Query | No |
-| 39 | `get-block` | Query | No |
-| 40 | `get-block-by-id` | Query | No |
-| 41 | `get-block-by-id-or-num` | Query | No |
-| 42 | `get-block-by-latest-num` | Query | No |
-| 43 | `get-block-by-limit-next` | Query | No |
-| 44 | `get-transaction-by-id` | Query | No |
-| 45 | `get-transaction-info-by-id` | Query | No |
-| 46 | `get-transaction-count-by-block-num` | Query | No |
-| 47 | `get-asset-issue-by-account` | Query | No |
-| 48 | `get-asset-issue-by-id` | Query | No |
-| 49 | `get-asset-issue-by-name` | Query | No |
-| 50 | `get-asset-issue-list-by-name` | Query | No |
-| 51 | `list-asset-issue` | Query | No |
-| 52 | `list-asset-issue-paginated` | Query | No |
-| 53 | `get-chain-parameters` | Query | No |
-| 54 | `get-bandwidth-prices` | Query | No |
-| 55 | `get-energy-prices` | Query | No |
-| 56 | `get-memo-fee` | Query | No |
-| 57 | `get-next-maintenance-time` | Query | No |
-| 58 | `get-contract` | Contract | No |
-| 59 | `get-contract-info` | Contract | No |
-| 60 | `get-delegated-resource` | Query | No |
-| 61 | `get-delegated-resource-v2` | Query | No |
-| 62 | `get-delegated-resource-account-index` | Query | No |
-| 63 | `get-delegated-resource-account-index-v2` | Query | No |
-| 64 | `get-can-delegated-max-size` | Query | No |
-| 65 | `get-available-unfreeze-count` | Query | No |
-| 66 | `get-can-withdraw-unfreeze-amount` | Query | No |
-| 67 | `get-brokerage` | Query | No |
-| 68 | `get-reward` | Query | No |
-| 69 | `list-nodes` | Query | No |
-| 70 | `list-witnesses` | Query | No |
-| 71 | `list-proposals` | Query | No |
-| 72 | `list-proposals-paginated` | Query | No |
-| 73 | `get-proposal` | Query | No |
-| 74 | `list-exchanges` | Query | No |
-| 75 | `list-exchanges-paginated` | Query | No |
-| 76 | `get-exchange` | Query | No |
-| 77 | `get-market-order-by-account` | Query | No |
-| 78 | `get-market-order-by-id` | Query | No |
-| 79 | `get-market-order-list-by-pair` | Query | No |
-| 80 | `get-market-pair-list` | Query | No |
-| 81 | `get-market-price-by-pair` | Query | No |
-| 82 | `gas-free-info` | Query | Conditional |
-| 83 | `gas-free-trace` | Query | No |
-| 84 | `deploy-contract` | Contract | Yes |
-| 85 | `trigger-contract` | Contract | Yes |
-| 86 | `trigger-constant-contract` | Contract | No |
-| 87 | `estimate-energy` | Contract | No |
-| 88 | `clear-contract-abi` | Contract | Yes |
-| 89 | `update-setting` | Contract | Yes |
-| 90 | `update-energy-limit` | Contract | Yes |
-| 91 | `create-witness` | Witness | Yes |
-| 92 | `update-witness` | Witness | Yes |
-| 93 | `vote-witness` | Witness | Yes |
-| 94 | `update-brokerage` | Witness | Yes |
-| 95 | `create-proposal` | Proposal | Yes |
-| 96 | `approve-proposal` | Proposal | Yes |
-| 97 | `delete-proposal` | Proposal | Yes |
-| 98 | `exchange-create` | Exchange | Yes |
-| 99 | `exchange-inject` | Exchange | Yes |
-| 100 | `exchange-withdraw` | Exchange | Yes |
-| 101 | `market-sell-asset` | Exchange | Yes |
-| 102 | `market-cancel-order` | Exchange | Yes |
-| 103 | `help` | Misc | No |
-
-\* `register-wallet` requires `MASTER_PASSWORD` to be set (for keystore encryption) but does not authenticate against an existing wallet.
-
-**Auth legend:** Yes = always required | No = never required | Conditional = depends on options provided
-
-## Using a Ledger hardware wallet
-
-Standard CLI signs transactions through a connected Ledger device when the
-selected wallet is a Ledger keystore. Authentication still uses
-`MASTER_PASSWORD` / `--password-stdin` to unlock the keystore; the device
-itself is the funds-protecting boundary.
-
-### One-time pairing (REPL)
-
-Path selection requires a human in the loop, so import is not exposed to
-standard CLI. Pair once via the REPL:
-
-```
-./gradlew run
-> importwalletbyledger
-```
-
-Choose a derivation path, set a local password, and note the resulting
-wallet name (it will be prefixed with `Ledger-`).
-
-### Signing from standard CLI
-
-```
-echo "$LEDGER_KEYSTORE_PASSWORD" | java -jar build/libs/wallet-cli.jar \
- --password-stdin --output json \
- --wallet ledger-alpha \
- send-coin --to TXxx... --amount 1000000
-```
-
-Requirements:
-
-- The Ledger must be connected, unlocked, and have the Tron app open.
-- "Sign By Hash" must be set to **Allowed** in the Tron app's settings.
-
-Behavior:
-
-- One stderr notice appears: `Please confirm transaction on Ledger device for TXxx...`.
-- Press the confirm button on the device.
-- On success, stdout contains a JSON envelope with the transaction id.
-
-The same flow applies to every Ledger-supported signing command in standard CLI
-(`send-coin`, `vote-witness`, `freeze-balance`, `trigger-contract`,
-`gas-free-transfer`, etc.) — there is no Ledger-specific command.
-
-### About the keystore password
-
-The keystore password protects the BIP44 path metadata, not your funds.
-Your private key never leaves the device. A Ledger keystore without the
-device connected cannot sign even with the correct password.
-
-### Error codes
-
-All errors are returned as execution errors (exit code `1`) with one of
-the following codes in the JSON envelope's `error` field:
-
-| Error code | Meaning |
-|------------|---------|
-| `ledger_not_connected` | No matching device found, or HID transport failure |
-| `ledger_app_not_open` | The Tron app is not open on the device |
-| `ledger_sign_by_hash_disabled` | "Sign By Hash" is not enabled in the Tron app's settings |
-| `ledger_unsupported_contract` | The transaction type is not supported by Ledger signing |
-| `ledger_already_signing` | A previous sign operation is still in progress on the device |
-| `ledger_user_rejected` | The user pressed reject on the device |
-| `ledger_timeout` | 60 seconds elapsed without confirmation or rejection |
-| `ledger_sign_failed` | Other failure (unknown APDU, transport exception) |
-
-All Ledger-specific codes share the `ledger_` prefix for programmatic
-matching by agent code.
-
-### Multi-device caveat
-
-The connected Ledger must derive the keystore address at the stored path.
-If no connected device matches, the command returns `ledger_not_connected`.
-This case is rare; a future flag may make multi-device selection explicit.
diff --git a/java/src/main/java/org/tron/common/utils/Utils.java b/java/src/main/java/org/tron/common/utils/Utils.java
index a8f4374f5..812959868 100644
--- a/java/src/main/java/org/tron/common/utils/Utils.java
+++ b/java/src/main/java/org/tron/common/utils/Utils.java
@@ -138,7 +138,7 @@ public class Utils {
public static final int MIN_LENGTH = 2;
public static final int MAX_LENGTH = 14;
- public static final String VERSION = " v4.10.1";
+ public static final String VERSION = " v4.11.0";
public static final String TRANSFER_METHOD_ID = "a9059cbb";
private static SecureRandom random = new SecureRandom();
diff --git a/ts/.dependency-cruiser.cjs b/ts/.dependency-cruiser.cjs
index 1a1bcea08..3af44982d 100644
--- a/ts/.dependency-cruiser.cjs
+++ b/ts/.dependency-cruiser.cjs
@@ -45,5 +45,10 @@ module.exports = {
doNotFollow: { path: "node_modules" },
tsConfig: { fileName: "tsconfig.json" },
enhancedResolveOptions: { extensions: [".ts", ".js"] },
+ // `import type` is erased at build time, so without this the rules above only see the graph
+ // that survives compilation — and a boundary violation carrying only a type is still one: it
+ // names a concrete implementation where a port belongs, and it is what a later refactor turns
+ // into a runtime edge.
+ tsPreCompilationDeps: true,
},
};
diff --git a/ts/README.md b/ts/README.md
index b3300a480..e9a3dbc6a 100644
--- a/ts/README.md
+++ b/ts/README.md
@@ -7,7 +7,22 @@ The agent-first implementation of wallet-cli, built for automation: every comman
- **Agent-first** — stable JSON output, deterministic exit codes, and discoverable schemas, built for scripts, CI, and AI agents (details in [The contract, in one paragraph](#the-contract-in-one-paragraph)).
- **Encrypted local storage** — software keystores are encrypted on disk; secrets are never passed via argv or environment variables.
- **Software and Ledger signing** — sign in software, or on a Ledger device (the private key never leaves the device).
-- **Covers the main TRON capabilities** — HD wallets, TRX and TRC20/TRC10 transfers, staking / resource delegation, voting / rewards, smart-contract calls and deployment, message and EIP-712/TIP-712 signing, and on-chain queries.
+- **Covers the main TRON capabilities** — HD wallets, TRX and TRC20/TRC10 transfers, staking / resource delegation, voting / rewards, smart-contract calls and deployment, multi-sig, GasFree transfers, message signing, and on-chain queries.
+
+## Table of contents
+
+- [Supported chains](#supported-chains)
+- [Install](#install)
+- [Quickstart](#quickstart)
+- [Commands](#commands)
+ - [Wallets and accounts](#wallets-and-accounts)
+ - [Transactions](#transactions)
+ - [On-chain queries](#on-chain-queries)
+ - [Tokens, contracts, staking, signing](#tokens-contracts-staking-signing)
+ - [Local tools and configuration](#local-tools-and-configuration)
+- [The contract, in one paragraph](#the-contract-in-one-paragraph)
+- [Understanding TRON mechanics](#understanding-tron-mechanics)
+- [Troubleshooting](#troubleshooting)
## Supported chains
@@ -52,6 +67,8 @@ npm ci && npm run build
npm link # puts `wallet-cli` on your PATH (or run: node dist/index.js)
```
+## Quickstart
+
**Create your first wallet.** `create` prompts for a master password, then shows the new account:
```bash
@@ -74,89 +91,90 @@ HD wlt_2dbv24de
└─ [0] main TTVdGTBXY5mmY3nJFGUp7Vo898kUJ6gtFQ (active)
```
-Next: fund it on a testnet, check the balance, and send TRX → [Getting started](docs/guide/getting-started.md).
-
-## Start here
-
-- 🚀 **First time?** → [Getting started: create a wallet and send your first transaction](docs/guide/getting-started.md)
-- 📖 **Looking up a command?** → [Command index](#commands) below, or `wallet-cli --help`
-- 🤖 **Calling from a script, CI, or an AI agent?** → [Machine interface: JSON envelope, exit codes, script safety](docs/machine-interface.md) · [Agent skill](skills/wallet-cli/SKILL.md)
-- 🔐 **Using a Ledger hardware wallet?** → [Ledger guide](docs/guide/ledger.md)
-- 🧭 **Something failed?** → [Troubleshooting](docs/troubleshooting.md)
-
-## The contract, in one paragraph
-
-Every command supports `-o json` and then prints **exactly one** terminal JSON frame on stdout, schema [`wallet-cli.result.v1`](docs/machine-interface.md#the-result-envelope). Exit codes are fixed: `0` success, `1` execution failure, `2` usage error. Secrets (passwords, mnemonics, private keys) are never accepted via argv or environment variables — only via stdin flags or interactive TTY prompts; mnemonic/private-key import and `change-password` are interactive-only (no stdin path at all). Details: [machine-interface.md](docs/machine-interface.md).
+The full flow — fund it on a testnet, check the balance, send your first TRX — is in the [getting-started guide](docs/guide/getting-started.md). From there, go deeper by topic: [sending tokens](docs/guide/send-tokens.md) · [staking & resources](docs/guide/stake-and-resources.md) · [using a Ledger hardware wallet](docs/guide/ledger.md) · [scripting](docs/guide/scripting.md).
## Commands
-Every command — including every subcommand — has a reference page; run `wallet-cli --help` for the built-in equivalent.
+Every command — including every subcommand — has its own reference page; the full per-command list is in the **[command index](docs/commands/index.md)**, and `wallet-cli --help` is the built-in equivalent.
### Wallets and accounts
+Create, import, and manage local wallets and accounts.
+
| Command | Description |
|---|---|
| [`create`](docs/commands/create.md) | Create a new HD wallet (BIP39 seed) |
-| [`import mnemonic`](docs/commands/import/mnemonic.md) | Import a BIP39 mnemonic phrase (interactive-only) |
-| [`import private-key`](docs/commands/import/private-key.md) | Import a raw private key (interactive-only) |
-| [`import ledger`](docs/commands/import/ledger.md) | Register a Ledger account (watch-only; signs on device) |
-| [`import watch`](docs/commands/import/watch.md) | Register a watch-only address (no secret) |
-| [`list`](docs/commands/list.md) | List wallets / accounts |
-| [`use`](docs/commands/use.md) / [`current`](docs/commands/current.md) | Set / show the active account |
+| `import` | Import a wallet — [mnemonic](docs/commands/import/mnemonic.md) · [private-key](docs/commands/import/private-key.md) · [ledger](docs/commands/import/ledger.md) · [watch](docs/commands/import/watch.md)-only |
+| [`list`](docs/commands/list.md) | List wallets and accounts |
+| [`use`](docs/commands/use.md) · [`current`](docs/commands/current.md) | Set / show the active account (`current --qr` for a receive QR) |
| [`derive`](docs/commands/derive.md) | Derive the next HD account from a seed wallet |
-| [`rename`](docs/commands/rename.md) / [`backup`](docs/commands/backup.md) / [`delete`](docs/commands/delete.md) | Manage accounts (backup writes secret + metadata, mode 0600) |
+| [`rename`](docs/commands/rename.md) · [`backup`](docs/commands/backup.md) · [`delete`](docs/commands/delete.md) | Rename, back up, or delete an account (backup writes secret + metadata, mode 0600) |
| [`change-password`](docs/commands/change-password.md) | Change the master password (re-encrypt all software keystores) |
### Transactions
+Send, broadcast, inspect, and co-sign transactions.
+
| Command | Description |
|---|---|
| [`tx send`](docs/commands/tx/send.md) | Send native TRX or TRC20/TRC10 tokens |
-| [`tx sign`](docs/commands/tx/sign.md) | Sign a transaction built elsewhere, without broadcasting |
| [`tx broadcast`](docs/commands/tx/broadcast.md) | Broadcast a presigned transaction |
-| [`tx status`](docs/commands/tx/status.md) | Show confirmation status (confirmed / failed / pending / not_found) |
-| [`tx info`](docs/commands/tx/info.md) | Show full transaction detail + receipt |
+| [`tx status`](docs/commands/tx/status.md) · [`tx info`](docs/commands/tx/info.md) | Confirmation status, or full detail + receipt |
+| [`tx sign`](docs/commands/tx/sign.md) · [`tx approvals`](docs/commands/tx/approvals.md) · [`tx multisig`](docs/commands/tx/multisig.md) | Co-sign multi-sig transactions and inspect approvals |
### On-chain queries
+Read account, block, and chain state.
+
| Command | Description |
|---|---|
-| [`account balance`](docs/commands/account/balance.md) | Show the native TRX balance |
-| [`account info`](docs/commands/account/info.md) | Show raw account data incl. resources |
-| [`account history`](docs/commands/account/history.md) | Show transaction history (requires TronGrid) |
-| [`account portfolio`](docs/commands/account/portfolio.md) | Native + token balances with best-effort USD value |
+| [`account balance`](docs/commands/account/balance.md) · [`info`](docs/commands/account/info.md) · [`portfolio`](docs/commands/account/portfolio.md) | Balance, raw account data, or balances with USD estimate |
+| [`account history`](docs/commands/account/history.md) | Transaction history (requires TronGrid) |
+| [`account activate`](docs/commands/account/activate.md) · [`set`](docs/commands/account/set.md) | Activate an account, or set its on-chain name / ID |
| [`block`](docs/commands/block.md) | Get a block (latest if omitted) |
-| [`chain params`](docs/commands/chain/params.md) | On-chain governance parameters |
-| [`chain prices`](docs/commands/chain/prices.md) | Energy/bandwidth unit price and memo fee |
-| [`chain node`](docs/commands/chain/node.md) | Connected node status (version / sync / peers) |
+| [`chain params`](docs/commands/chain/params.md) · [`prices`](docs/commands/chain/prices.md) · [`node`](docs/commands/chain/node.md) | Governance params, resource prices, or node status |
### Tokens, contracts, staking, signing
+Token and contract operations, resource staking, voting rewards, message signing, and permissions.
+
| Command | Description |
|---|---|
-| [`token`](docs/commands/token/index.md) | Manage the token address book and query tokens ([balance](docs/commands/token/balance.md) · [info](docs/commands/token/info.md) · [add](docs/commands/token/add.md) · [list](docs/commands/token/list.md) · [remove](docs/commands/token/remove.md)) |
-| [`contract`](docs/commands/contract/index.md) | Call, send, deploy, and inspect smart contracts ([call](docs/commands/contract/call.md) · [send](docs/commands/contract/send.md) · [deploy](docs/commands/contract/deploy.md) · [info](docs/commands/contract/info.md)) |
-| [`stake`](docs/commands/stake/index.md) | Stake / delegate resources & query state ([freeze](docs/commands/stake/freeze.md) · [unfreeze](docs/commands/stake/unfreeze.md) · [withdraw](docs/commands/stake/withdraw.md) · [cancel-unfreeze](docs/commands/stake/cancel-unfreeze.md) · [delegate](docs/commands/stake/delegate.md) · [undelegate](docs/commands/stake/undelegate.md) · [info](docs/commands/stake/info.md) · [delegated](docs/commands/stake/delegated.md)) |
-| [`vote`](docs/commands/vote/index.md) | Vote for super representatives ([cast](docs/commands/vote/cast.md) · [list](docs/commands/vote/list.md) · [status](docs/commands/vote/status.md)) |
-| [`reward`](docs/commands/reward/index.md) | Query / withdraw voting rewards ([balance](docs/commands/reward/balance.md) · [withdraw](docs/commands/reward/withdraw.md)) |
-| [`message`](docs/commands/message/index.md) | Sign arbitrary messages ([sign](docs/commands/message/sign.md)) |
-| [`typed-data`](docs/commands/typed-data/index.md) | Sign EIP-712 / TIP-712 structured data ([sign](docs/commands/typed-data/sign.md)) |
+| [`token`](docs/commands/token/index.md) | Token address book and queries ([balance](docs/commands/token/balance.md) · [info](docs/commands/token/info.md) · [add](docs/commands/token/add.md) · [list](docs/commands/token/list.md) · [remove](docs/commands/token/remove.md)) |
+| [`contact`](docs/commands/contact/index.md) | Recipient contact book ([add](docs/commands/contact/add.md) · [list](docs/commands/contact/list.md) · [remove](docs/commands/contact/remove.md)) |
+| [`contract`](docs/commands/contract/index.md) | Call, send, deploy, inspect contracts ([call](docs/commands/contract/call.md) · [send](docs/commands/contract/send.md) · [deploy](docs/commands/contract/deploy.md) · [info](docs/commands/contract/info.md)) |
+| [`stake`](docs/commands/stake/index.md) | Stake / delegate resources ([freeze](docs/commands/stake/freeze.md) · [unfreeze](docs/commands/stake/unfreeze.md) · [delegate](docs/commands/stake/delegate.md) · [info](docs/commands/stake/info.md), …) |
+| [`vote`](docs/commands/vote/index.md) · [`reward`](docs/commands/reward/index.md) | Vote for super representatives and claim voting rewards |
+| [`message`](docs/commands/message/index.md) · [`typed-data`](docs/commands/typed-data/index.md) | Sign arbitrary messages, or EIP-712/TIP-712 structured data |
+| [`permission`](docs/commands/permission/index.md) | View / update account permissions for multi-sig |
+| [`gasfree`](docs/commands/gasfree/index.md) | Gas-free token transfers via the GasFree service |
+
+### Local tools and configuration
-### Local configuration
+Offline local commands and configuration.
| Command | Description |
|---|---|
+| [`encoding convert`](docs/commands/encoding/convert.md) | Convert / validate addresses and encodings |
+| [`address generate`](docs/commands/address/generate.md) | Generate a random keypair (local, not stored) |
| [`config`](docs/commands/config.md) | Show / get / set configuration values |
-| [`networks`](docs/commands/networks.md) | List known networks (`tron:mainnet`, `tron:nile`, `tron:shasta`) |
+| [`networks`](docs/commands/networks.md) | List known networks |
-## Documentation map
+## The contract, in one paragraph
-| You want to… | Read |
-|---|---|
-| Learn by doing | [guide/](docs/guide/index.md) — [getting started](docs/guide/getting-started.md) · [sending tokens](docs/guide/send-tokens.md) · [staking](docs/guide/stake-and-resources.md) · [Ledger](docs/guide/ledger.md) · [scripting](docs/guide/scripting.md) |
-| Look up a command | [commands/](docs/commands/index.md) |
-| Integrate programmatically | [machine-interface.md](docs/machine-interface.md) |
-| Understand TRON mechanics | [concepts/](docs/concepts/index.md) — [networks](docs/concepts/networks.md) · [accounts & HD](docs/concepts/accounts-and-hd.md) · [energy & bandwidth](docs/concepts/energy-bandwidth.md) · [security](docs/concepts/security.md) |
-| Fix an error | [troubleshooting.md](docs/troubleshooting.md) |
+Every command supports `-o json` and then prints **exactly one** terminal JSON frame on stdout, schema [`wallet-cli.result.v1`](docs/machine-interface.md#the-result-envelope). Exit codes are fixed: `0` success, `1` execution failure, `2` usage error. Secrets (passwords, mnemonics, private keys) are never accepted via argv or environment variables — only via stdin flags or interactive TTY prompts; mnemonic/private-key import and `change-password` are interactive-only (no stdin path at all). Full spec: [machine-interface.md](docs/machine-interface.md); for calling from an AI agent, see the [Agent skill](skills/wallet-cli/SKILL.md).
+
+## Understanding TRON mechanics
+
+TRON differs a lot from EVM chains in fees, accounts, and key permissions — these are worth understanding up front to avoid surprises:
+
+- [Networks](docs/concepts/networks.md) — the three networks and the `family:chain` id
+- [Accounts & HD](docs/concepts/accounts-and-hd.md) — mnemonics, derivation paths, account activation
+- [Energy & bandwidth](docs/concepts/energy-bandwidth.md) — TRON's resource-based fee model (in place of EVM gas)
+- [Security](docs/concepts/security.md) — keystore encryption, secret handling, multi-sig permissions
+
+## Troubleshooting
+
+A command errored or behaved unexpectedly? Common issues and how to diagnose them are in [troubleshooting.md](docs/troubleshooting.md).
> All copy-pasteable examples in this documentation run against the **Nile testnet** (`--network tron:nile`). Mainnet commands move real funds; they appear only as annotated, non-copyable descriptions.
diff --git a/ts/docs/commands/account/activate.md b/ts/docs/commands/account/activate.md
new file mode 100644
index 000000000..311e8fe3d
--- /dev/null
+++ b/ts/docs/commands/account/activate.md
@@ -0,0 +1,97 @@
+# wallet-cli account activate
+
+Activate a not-yet-existing account on-chain.
+
+## Synopsis
+
+```
+wallet-cli account activate --address
+ [--dry-run | (--sign-only | --build-only) [--expiration ] | --wait [--wait-timeout ]]
+ [--permission-id ] [options]
+```
+
+## Description
+
+A TRON address doesn't exist on-chain until it receives its first asset or is explicitly created — until then queries return `not_found` and it cannot initiate a transaction. This command creates (activates) such an account **without transferring any asset**; the payer account covers the on-chain account-creation fee.
+
+Use it only when an address needs to *exist* on its own — to be queryable, or able to initiate its own transactions. If you're sending it funds anyway, [`tx send`](../tx/send.md) activates the recipient automatically in one step; and adding an address to a multi-sig permission does **not** require activation.
+
+Requires the payer account and the master password via `--password-stdin`; watch-only accounts fail with `watch_only_no_signer`.
+
+## Options
+
+| Option | Description |
+|---|---|
+| `--address ` | **Required.** The address to activate (a valid, not-yet-activated TRON address) |
+| `--dry-run` | Build and estimate only; no signature/broadcast, no password. Excludes `--sign-only` / `--build-only` |
+| `--sign-only` | Build and sign, output the signed hex (feed [`tx broadcast`](../tx/broadcast.md)). Excludes `--dry-run` / `--build-only`; pairs with `--expiration` |
+| `--build-only` | Build only, output the **unsigned** hex (feed [`tx multisig --create`](../tx/multisig.md)). Excludes `--dry-run` / `--sign-only`; pairs with `--expiration` |
+| `--expiration ` | Transaction expiration in ms, up to `86400000` (24h); only with `--sign-only` or `--build-only` |
+| `--permission-id ` | Permission group to sign with (default `0`) |
+| `--wait` / `--wait-timeout ` | Poll after broadcast until confirmed/failed (cap default: config `waitTimeoutMs`, built-in 60000) |
+| `--password-stdin` | Master password from stdin |
+
+Plus the [global options](../index.md#global-options-every-command). `--account` selects the payer.
+
+## Examples
+
+In the examples, `$PW` is your master password, fed on stdin via `--password-stdin`.
+
+Default — broadcast and return the **submitted** receipt:
+
+```bash
+echo "$PW" | wallet-cli account activate --address TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz --network tron:nile --password-stdin
+```
+
+```console
+⏳ Submitted — activate account
+ TxID a1b...
+ Address TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz
+ Payer TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw (main)
+ Status pending
+! Track it: wallet-cli tx info --network tron:nile --txid a1b...
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"account.activate","data":{"kind":"account-activate","stage":"submitted","txId":"a1b...","address":"TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz","payer":"TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw"},"meta":{"durationMs":17,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+Add `--wait` to block until confirmed, with the actual block and fee:
+
+```bash
+echo "$PW" | wallet-cli account activate --address TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz --network tron:nile --wait --password-stdin
+```
+
+```console
+✅ Account activated
+ TxID e7a...
+ Address TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz
+ Payer TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw (main)
+ Block #84,340,277
+ Fee 1.1 TRX
+ Status success
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"account.activate","data":{"kind":"account-activate","stage":"confirmed","txId":"e7a...","confirmed":true,"blockNumber":84340277,"feeSun":1100000,"failed":false,"address":"TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz","payer":"TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw"},"meta":{"durationMs":6540,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+## Output
+
+`data` varies by stage:
+
+| Stage | Fields |
+|---|---|
+| default (submit) | `kind: "account-activate"`, `stage: "submitted"`, `txId`, `address`, `payer` |
+| `--wait` (confirmed) | the above, but `stage: "confirmed"`, plus `confirmed`, `blockNumber`, `feeSun`, `failed` |
+| `--dry-run` | `kind`, `mode: "dry-run"`, fee estimate, `address`, `payer`; no `txId` |
+
+## Exit status
+
+`0` submitted (or built/signed/dry-run in early-exit modes) · `1` execution failure (`account_already_active`, `watch_only_no_signer`, `wrong_password`, `auth_failed`, `insufficient_balance`, `rpc_error`, `timeout`) · `2` usage error (`invalid_value` — malformed address).
+
+After a **confirmed** transaction the command reads the account back to verify the change took effect. That follow-up never turns an already-paid transaction into a command failure: a mismatch or an unreadable read is reported as a `meta.warnings` entry (`account_activate_postcheck_mismatch` / `account_activate_postcheck_unavailable`) with `success` still `true` and exit `0`.
+
+## See also
+
+[`account set`](set.md) · [`tx send`](../tx/send.md) · [`account info`](info.md) · [`chain params`](../chain/params.md)
diff --git a/ts/docs/commands/account/index.md b/ts/docs/commands/account/index.md
index fc12c1e69..f593e633a 100644
--- a/ts/docs/commands/account/index.md
+++ b/ts/docs/commands/account/index.md
@@ -1,6 +1,6 @@
# wallet-cli account
-Query on-chain account state.
+Query on-chain account state, and activate & name accounts.
## Synopsis
@@ -8,7 +8,7 @@ Query on-chain account state.
wallet-cli account COMMAND
```
-All subcommands read the chain for the **active account** by default; override with `--account ` or change the default with `wallet-cli use `.
+Subcommands act on the **active account** by default; override with `--account ` or change the default with `wallet-cli use `. The first four are read-only queries; `activate` and `set` change on-chain state and need the master password.
## Subcommands
@@ -18,6 +18,8 @@ All subcommands read the chain for the **active account** by default; override w
| [`account info`](info.md) | Raw account data incl. bandwidth/energy | node RPC |
| [`account history`](history.md) | Transaction history | **TronGrid required** |
| [`account portfolio`](portfolio.md) | Native + token balances, best-effort USD | node RPC + price source |
+| [`account activate`](activate.md) | Activate a not-yet-existing account (no transfer) | broadcast |
+| [`account set`](set.md) | Set the on-chain name / account id (one-time) | broadcast |
## See also
diff --git a/ts/docs/commands/account/set.md b/ts/docs/commands/account/set.md
new file mode 100644
index 000000000..5f9f6789c
--- /dev/null
+++ b/ts/docs/commands/account/set.md
@@ -0,0 +1,99 @@
+# wallet-cli account set
+
+Set the account's on-chain name or account id.
+
+## Synopsis
+
+```
+wallet-cli account set (--name | --id )
+ [--dry-run | (--sign-only | --build-only) [--expiration ] | --wait [--wait-timeout ]]
+ [--permission-id ] [options]
+```
+
+## Description
+
+Sets the account's on-chain **name** (a display alias, up to 32 bytes) or its **account id** (a globally unique identifier, 8–32 bytes). One at a time — `--name` and `--id` are mutually exclusive; to set both, run it twice.
+
+⚠️ **On mainnet each can be set only once and can never be changed** — the value is permanent, and there is no confirmation prompt. This is different from [`rename`](../rename.md), which changes the local label and can be redone anytime.
+
+Requires the account and the master password via `--password-stdin`; watch-only accounts fail with `watch_only_no_signer`. The account id's uniqueness is enforced on-chain — a taken id fails with `id_taken`.
+
+## Options
+
+| Option | Description |
+|---|---|
+| `--name ` | **Required** (one of). On-chain account name, up to 32 bytes; mainnet allows setting it once |
+| `--id ` | **Required** (one of). Account id, 8–32 bytes, globally unique; can be set once |
+| `--dry-run` | Build and estimate only; no signature/broadcast, no password. Excludes `--sign-only` / `--build-only` |
+| `--sign-only` | Build and sign, output the signed hex (feed [`tx broadcast`](../tx/broadcast.md)). Excludes `--dry-run` / `--build-only`; pairs with `--expiration` |
+| `--build-only` | Build only, output the **unsigned** hex (feed [`tx multisig --create`](../tx/multisig.md)). Excludes `--dry-run` / `--sign-only`; pairs with `--expiration` |
+| `--expiration ` | Transaction expiration in ms, up to `86400000` (24h); only with `--sign-only` or `--build-only` |
+| `--permission-id ` | Permission group to sign with (default `0`) |
+| `--wait` / `--wait-timeout ` | Poll after broadcast until confirmed/failed (cap default: config `waitTimeoutMs`, built-in 60000) |
+| `--password-stdin` | Master password from stdin |
+
+Plus the [global options](../index.md#global-options-every-command).
+
+## Examples
+
+In the examples, `$PW` is your master password, fed on stdin via `--password-stdin`.
+
+Set the on-chain name and wait for confirmation:
+
+```bash
+echo "$PW" | wallet-cli account set --name "Acme Treasury" --network tron:nile --wait --password-stdin
+```
+
+```console
+✅ On-chain name set
+ Account TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw (main)
+ Name Acme Treasury
+ TxID f2b...
+ Block #84,341,590
+ Fee 0.3 TRX
+ Status success
+```
+
+```bash
+echo "$PW" | wallet-cli account set --name "Acme Treasury" --network tron:nile --wait --password-stdin -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"account.set","data":{"kind":"account-set","stage":"confirmed","txId":"f2b...","confirmed":true,"blockNumber":84341590,"feeSun":300000,"failed":false,"field":"name","value":"Acme Treasury","address":"TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw"},"meta":{"durationMs":6420,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+Set the account id instead (`--id`); the id's uniqueness is enforced on-chain:
+
+```bash
+echo "$PW" | wallet-cli account set --id acme-treasury-01 --network tron:nile --wait --password-stdin
+```
+
+```console
+✅ Account id set
+ Account TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw (main)
+ Id acme-treasury-01
+ TxID 3d9...
+ Block #84,341,730
+ Fee 0.3 TRX
+ Status success
+```
+
+## Output
+
+`data` varies by stage:
+
+| Stage | Fields |
+|---|---|
+| default (submit) | `kind: "account-set"`, `stage: "submitted"`, `txId`, `field` (`name`/`id`), `value`, `address` |
+| `--wait` (confirmed) | the above, but `stage: "confirmed"`, plus `confirmed`, `blockNumber`, `feeSun`, `failed` |
+| `--dry-run` | `kind`, `mode: "dry-run"`, fee estimate, `field`, `value`, `address`; no `txId` |
+
+## Exit status
+
+`0` submitted (or built/signed/dry-run in early-exit modes) · `1` execution failure (`name_already_set`, `id_already_set`, `id_taken`, `watch_only_no_signer`, `wrong_password`, `auth_failed`, `rpc_error`, `timeout`) · `2` usage error (`invalid_value`, `invalid_option` — malformed or missing name/id).
+
+After a **confirmed** transaction the command reads the account back to verify the change took effect. That follow-up never turns an already-paid transaction into a command failure: a mismatch or an unreadable read is reported as a `meta.warnings` entry (`account_set_postcheck_mismatch` / `account_set_postcheck_unavailable`) with `success` still `true` and exit `0`.
+
+## See also
+
+[`account activate`](activate.md) · [`rename`](../rename.md) · [`account info`](info.md)
diff --git a/ts/docs/commands/address/generate.md b/ts/docs/commands/address/generate.md
new file mode 100644
index 000000000..1c447b25b
--- /dev/null
+++ b/ts/docs/commands/address/generate.md
@@ -0,0 +1,67 @@
+# wallet-cli address generate
+
+Generate a random keypair locally (not stored in the wallet).
+
+## Synopsis
+
+```
+wallet-cli address generate [--out ] [--print-secret]
+```
+
+## Description
+
+Generates a random keypair locally (works offline) and prints its TRON and EVM addresses. The private key is **not** stored in the wallet and does not enter the keystore.
+
+By default the private key is written to a `0600` file — the terminal shows only the addresses and the file path, keeping the secret off the screen, out of pipes, and out of an AI session (the same discipline as [`backup`](../backup.md)). Pass `--print-secret` to print the key to stdout instead (for offline transcription); the text output then carries a `!` warning.
+
+This produces a bare key for a one-off address, testing, or import into another system. For a normal account — an HD wallet in the keystore, with derivation — use [`create`](../create.md). To sign with a generated key, import it with [`import private-key`](../import/private-key.md).
+
+## Options
+
+| Option | Description |
+|---|---|
+| `--out ` | File to write the keypair to (mode `0600`); refuses to overwrite an existing file. Default: `/generated/keypair-` |
+| `--print-secret` | ⚠️ Print the private key to stdout instead of writing a file (use offline) |
+
+Plus the [global options](../index.md#global-options-every-command).
+
+## Examples
+
+```bash
+wallet-cli address generate
+```
+
+```console
+✅ Keypair generated (NOT stored in the wallet)
+ TRON address TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz
+ EVM address 0x8a41C3b9E2d07f6A5B14c8D9e0F27a3B6c5D48E1
+ Private key written to /generated/keypair-TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz
+
+! To sign with this key, import it: wallet-cli import private-key
+```
+
+The private key never appears in JSON output (unless `--print-secret`):
+
+```bash
+wallet-cli address generate -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"address.generate","data":{"tron":"TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz","evm":"0x8a41C3b9E2d07f6A5B14c8D9e0F27a3B6c5D48E1","secretFile":"/generated/keypair-TNewAddr9k2fP7cW4bXm1sV8dRj6eL3aQz"},"meta":{"durationMs":8,"warnings":[]}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `tron` | string | TRON base58 address |
+| `evm` | string | EVM `0x` address (EIP-55) |
+| `secretFile` | string | Path the private key was written to (absent with `--print-secret`) |
+
+## Exit status
+
+`0` success · `1` execution failure (`io_error`, `output_exists` — the `--out` target already exists and is never overwritten, `entropy_failure` — the system CSPRNG was unavailable) · `2` usage error (`invalid_value`).
+
+## See also
+
+[`create`](../create.md) · [`import private-key`](../import/private-key.md) · [`encoding convert`](../encoding/convert.md)
diff --git a/ts/docs/commands/address/index.md b/ts/docs/commands/address/index.md
new file mode 100644
index 000000000..9268a9767
--- /dev/null
+++ b/ts/docs/commands/address/index.md
@@ -0,0 +1,21 @@
+# wallet-cli address
+
+Generate a random keypair (local, not stored).
+
+A purely local tool group — it never touches the node. The generated key is **not** stored in the wallet; to sign with it, import it with [`import private-key`](../import/private-key.md).
+
+## Synopsis
+
+```
+wallet-cli address COMMAND
+```
+
+## Subcommands
+
+| Command | Page | Description |
+|---|---|---|
+| `address generate` | [generate.md](generate.md) | Generate a random keypair, printing the TRON and EVM addresses |
+
+## See also
+
+[`encoding convert`](../encoding/convert.md) · [`create`](../create.md) · [`import private-key`](../import/private-key.md)
diff --git a/ts/docs/commands/config.md b/ts/docs/commands/config.md
index 48c3469d3..0610ec956 100644
--- a/ts/docs/commands/config.md
+++ b/ts/docs/commands/config.md
@@ -27,10 +27,17 @@ Known keys:
| `defaultOutput` | `text` \| `json` | `text` | Output format when `-o` is omitted |
| `timeoutMs` | integer ms | `60000` | Default per RPC/device call timeout (`--timeout` overrides) |
| `waitTimeoutMs` | integer ms ≥ 0 | `60000` | Default `--wait` polling cap for broadcast commands |
+| `gasfreeApiKey` | string | (unset) | GasFree API key ([`gasfree`](gasfree/index.md)) |
+| `gasfreeApiSecret` | string | (unset) | GasFree API secret |
+| `tronlinkSecretId` | string | (unset) | TronLink multi-sig service secretId ([`tx multisig`](tx/multisig.md)) |
+| `tronlinkSecretKey` | string | (unset) | TronLink multi-sig service secretKey |
+| `tronlinkChannel` | string | (unset) | TronLink multi-sig service channel |
| `networks` | — | — | Known networks (read-only list) |
Precedence for a value that has both a flag and a config key (highest first): command-line flag > config value > built-in default — e.g. `--timeout` > config `timeoutMs` > built-in 60000.
+The external-service credentials are **per-environment**: the GasFree (`gasfreeApiKey` / `gasfreeApiSecret`) and TronLink (`tronlinkSecretId` / `tronlinkSecretKey` / `tronlinkChannel`) credentials must match the service environment of the current `--network` (mainnet vs testnet); a mismatch fails with `provider_error`, so swap them when you switch environments. When a key is unset, the commands that need it fail with a clear error — `gasfree_credentials_missing` for [`gasfree`](gasfree/index.md), `tronlink_credentials_missing` for [`tx multisig`](tx/multisig.md).
+
An invalid value returns `invalid_value` (exit 2).
## Examples
@@ -42,11 +49,16 @@ wallet-cli config
```
```console
-defaultNetwork tron:mainnet
-defaultOutput text
-timeoutMs 60000
-waitTimeoutMs 60000
-networks tron:mainnet, tron:nile, tron:shasta
+defaultNetwork tron:mainnet
+defaultOutput text
+timeoutMs 60000
+waitTimeoutMs 60000
+gasfreeApiKey ak_9f2c71d0e8b64a53
+gasfreeApiSecret sk_e37a90c412f85b6d
+tronlinkSecretId TEST
+tronlinkSecretKey TESTTESTTEST
+tronlinkChannel test
+networks tron:mainnet, tron:nile, tron:shasta
```
Read one key, then set it:
@@ -83,13 +95,13 @@ wallet-cli config timeoutMs 120000 -o json
| Mode | `data` fields |
|---|---|
-| show all (no args) | one field per key: `defaultNetwork`, `defaultOutput`, `timeoutMs`, `waitTimeoutMs`, `networks` (array of network ids) |
+| show all (no args) | one field per key: `defaultNetwork`, `defaultOutput`, `timeoutMs`, `waitTimeoutMs`, `gasfreeApiKey`, `gasfreeApiSecret`, `tronlinkSecretId`, `tronlinkSecretKey`, `tronlinkChannel`, `networks` (array of network ids) |
| read (``) | `key`, `value` |
| set (``) | `key`, `value`, `input` (the raw string as typed) |
## Exit status
-`0` success · `1` execution failure · `2` usage error. See [machine-interface](../machine-interface.md).
+`0` success · `1` execution failure (`invalid_config` — `config.yaml` is unreadable or not valid YAML; `insecure_config` — it holds service credentials but is a symlink or group/world-readable, so `chmod 600` it) · `2` usage error (`invalid_value` — unknown key). See [machine-interface](../machine-interface.md).
## See also
diff --git a/ts/docs/commands/contact/add.md b/ts/docs/commands/contact/add.md
new file mode 100644
index 000000000..7fb6f9c14
--- /dev/null
+++ b/ts/docs/commands/contact/add.md
@@ -0,0 +1,61 @@
+# wallet-cli contact add
+
+Add a recipient to the contact book.
+
+## Synopsis
+
+```
+wallet-cli contact add [--note ]
+```
+
+## Description
+
+Saves a recipient (name → address) to the local address book. The name can then be used wherever a recipient is expected — [`tx send --to`](../tx/send.md) and [`gasfree transfer --to`](../gasfree/transfer.md). The address checksum is validated locally; no node access.
+
+The name must be 1–64 characters and must not look like an address (so it can't be confused with a literal `--to` address).
+
+## Options
+
+| Option | Description |
+|---|---|
+| `--note ` | Free-form note (e.g. "exchange deposit address"), up to 128 characters |
+
+Plus the [global options](../index.md#global-options-every-command). `name` and `address` are positional arguments.
+
+## Examples
+
+```bash
+wallet-cli contact add alice TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub --note "Alice mainnet"
+```
+
+```console
+✅ Contact added
+ Name alice
+ Address TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub
+ Note Alice mainnet
+```
+
+```bash
+wallet-cli contact add alice TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub --note "Alice mainnet" -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"contact.add","data":{"name":"alice","address":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","note":"Alice mainnet","family":"tron"},"meta":{"durationMs":4,"warnings":[]}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `name` | string | Contact name |
+| `address` | string | Recipient address |
+| `note` | string \| null | The note, or `null` |
+| `family` | string | Chain family (`tron`) |
+
+## Exit status
+
+`0` success · `1` execution failure (`already_exists` — the name is taken, `limit_exceeded` — the address book is full). The address book is a local file: `encoding_error` if it cannot be decoded, `insecure_permissions` if it is a symlink or group/world-readable (`chmod 600` it). · `2` usage error (`invalid_value` — bad address checksum, or an invalid name).
+
+## See also
+
+[`contact list`](list.md) · [`contact remove`](remove.md) · [`tx send`](../tx/send.md)
diff --git a/ts/docs/commands/contact/index.md b/ts/docs/commands/contact/index.md
new file mode 100644
index 000000000..8fa83d458
--- /dev/null
+++ b/ts/docs/commands/contact/index.md
@@ -0,0 +1,23 @@
+# wallet-cli contact
+
+Manage the recipient contact book.
+
+A purely local address book of recipients (name → address), stored in the config directory in plaintext with file mode **0600** (readable/writable only by your user). Entries are grouped by chain family (all `tron` today). Once a contact exists, its name can be used directly wherever a recipient is expected — [`tx send --to`](../tx/send.md) and [`gasfree transfer --to`](../gasfree/transfer.md).
+
+## Synopsis
+
+```
+wallet-cli contact COMMAND
+```
+
+## Subcommands
+
+| Command | Page | Description |
+|---|---|---|
+| `contact add` | [add.md](add.md) | Add a recipient |
+| `contact list` | [list.md](list.md) | List recipients |
+| `contact remove` | [remove.md](remove.md) | Remove a recipient |
+
+## See also
+
+[`token`](../token/index.md) — the token address book (same shape) · [`tx send`](../tx/send.md) · [Security](../../concepts/security.md)
diff --git a/ts/docs/commands/contact/list.md b/ts/docs/commands/contact/list.md
new file mode 100644
index 000000000..769b4a26b
--- /dev/null
+++ b/ts/docs/commands/contact/list.md
@@ -0,0 +1,51 @@
+# wallet-cli contact list
+
+List all recipients in the contact book.
+
+## Synopsis
+
+```
+wallet-cli contact list
+```
+
+## Description
+
+Lists every recipient in the local address book — name, full address, and note. An empty address book returns an empty list (not an error). Purely local; no node access.
+
+## Options
+
+No command-specific options; the [global options](../index.md#global-options-every-command) only.
+
+## Examples
+
+```bash
+wallet-cli contact list
+```
+
+```console
+Name Address Note
+alice TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub Alice mainnet
+bob TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz —
+```
+
+```bash
+wallet-cli contact list -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"contact.list","data":{"contacts":[{"name":"alice","address":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","note":"Alice mainnet","family":"tron"},{"name":"bob","address":"TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz","note":null,"family":"tron"}]},"meta":{"durationMs":3,"warnings":[]}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `contacts[]` | array | Recipients, each `{name, address, note, family}` — `note` is `null` when unset |
+
+## Exit status
+
+`0` success (including an empty list) · `1` execution failure (`encoding_error`, `insecure_permissions` — the address book is a symlink or group/world-readable; `chmod 600` it) · `2` usage error.
+
+## See also
+
+[`contact add`](add.md) · [`contact remove`](remove.md) · [`tx send`](../tx/send.md)
diff --git a/ts/docs/commands/contact/remove.md b/ts/docs/commands/contact/remove.md
new file mode 100644
index 000000000..b6562239f
--- /dev/null
+++ b/ts/docs/commands/contact/remove.md
@@ -0,0 +1,52 @@
+# wallet-cli contact remove
+
+Remove a recipient from the contact book.
+
+## Synopsis
+
+```
+wallet-cli contact remove
+```
+
+## Description
+
+Deletes a recipient from the local address book. Local record only — nothing on-chain is affected. Purely local; no node access.
+
+## Options
+
+No command-specific options; `name` is a positional argument, plus the [global options](../index.md#global-options-every-command).
+
+## Examples
+
+```bash
+wallet-cli contact remove bob
+```
+
+```console
+✅ Contact removed
+ Name bob
+ Address TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz
+```
+
+```bash
+wallet-cli contact remove bob -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"contact.remove","data":{"name":"bob","address":"TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz"},"meta":{"durationMs":3,"warnings":[]}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `name` | string | The removed contact's name |
+| `address` | string | Its address |
+
+## Exit status
+
+`0` success · `1` execution failure (`not_found` — no such contact, `encoding_error`, `insecure_permissions`) · `2` usage error.
+
+## See also
+
+[`contact add`](add.md) · [`contact list`](list.md)
diff --git a/ts/docs/commands/contract/deploy.md b/ts/docs/commands/contract/deploy.md
index af1beaf26..751d95e4d 100644
--- a/ts/docs/commands/contract/deploy.md
+++ b/ts/docs/commands/contract/deploy.md
@@ -6,17 +6,17 @@ Deploy a smart contract.
```
wallet-cli contract deploy --abi --bytecode --fee-limit
- [--constructor-sig --params ]
- [--dry-run | --sign-only] [--wait [--wait-timeout ]] [options]
+ [--params ]
+ [--dry-run | (--sign-only | --build-only) [--expiration ] | --wait [--wait-timeout ]] [--permission-id ] [options]
```
## Description
-Deploys compiled contract bytecode from the active account (or `--account`) and reports the new contract address. `--fee-limit` is **required** here (deployments are energy-heavy; there is no safe default). Constructor arguments go via `--constructor-sig` + `--params`.
+Deploys compiled contract bytecode from the active account (or `--account`) and reports the new contract address. `--fee-limit` is **required** here (deployments are energy-heavy; there is no safe default). Constructor arguments go via `--params` alone — the parameter types are taken from the constructor entry in the `--abi` you pass.
Same execution model as other broadcast commands: `--dry-run` previews, `--sign-only` outputs a signed transaction for [`tx broadcast`](../tx/broadcast.md), default returns at submission, `--wait` blocks until confirmed/failed.
-Requires an account and the master password via `--password-stdin`; watch-only accounts fail with `watch_only_no_signer`.
+Requires an account. The master password (via `--password-stdin`) is needed only by the modes that sign — `--dry-run` and `--build-only` do not unlock the wallet and run without it. Watch-only accounts fail with `watch_only_no_signer` in a signing mode.
## Options
@@ -25,10 +25,12 @@ Requires an account and the master password via `--password-stdin`; watch-only a
| `--abi ` | **Required.** Contract ABI as a JSON array string |
| `--bytecode ` | **Required.** Compiled bytecode as hex (0x-prefixed or bare) |
| `--fee-limit ` | **Required.** Max energy fee to burn, in SUN |
-| `--constructor-sig ` | Constructor signature, e.g. `constructor(uint256)`; omit when no constructor args |
-| `--params ` | Constructor args as a JSON array of `{type,value}` |
-| `--dry-run` | Estimate only; excludes `--sign-only` |
-| `--sign-only` | Sign without broadcasting; excludes `--dry-run` |
+| `--params ` | Constructor args as a JSON array of raw positional values, e.g. `[100, "T..."]`; types are taken from the ABI constructor. Omit to pass no constructor args |
+| `--dry-run` | Estimate only; excludes `--sign-only` / `--build-only` |
+| `--sign-only` | Sign without broadcasting, output the signed hex; excludes `--dry-run` / `--build-only`; pairs with `--expiration` |
+| `--build-only` | Build only, output the **unsigned** hex; excludes `--dry-run` / `--sign-only`; pairs with `--expiration` |
+| `--expiration ` | Transaction expiration in ms, up to `86400000` (24h); only with `--sign-only` or `--build-only`; omitted = node default (~60s) |
+| `--permission-id ` | Permission group to sign with (0=owner, 1=witness, 2–9=active); default `0` |
| `--wait` / `--wait-timeout ` | Poll after broadcast until confirmed/failed (cap default: config `waitTimeoutMs`, built-in 60000) |
| `--password-stdin` | Master password from stdin |
diff --git a/ts/docs/commands/contract/send.md b/ts/docs/commands/contract/send.md
index 42cea5c76..e410d639a 100644
--- a/ts/docs/commands/contract/send.md
+++ b/ts/docs/commands/contract/send.md
@@ -7,7 +7,7 @@ State-changing contract call (triggerSmartContract).
```
wallet-cli contract send --contract --method [--params ]
[--call-value-sun ] [--fee-limit ]
- [--dry-run | --sign-only] [--wait [--wait-timeout ]] [options]
+ [--dry-run | (--sign-only | --build-only) [--expiration ] | --wait [--wait-timeout ]] [--permission-id ] [options]
```
## Description
@@ -18,7 +18,7 @@ Two early exits: `--dry-run` previews the energy cost (estimateEnergy) without s
**By default the command returns at submission** (`stage: "submitted"`) — add `--wait` to block until confirmed/failed. With `--wait`, an on-chain execution failure (revert / `OUT_OF_ENERGY`) comes back as `stage: "failed"` with the `result` reason.
-Requires an account and the master password via `--password-stdin`; watch-only accounts fail with `watch_only_no_signer`.
+Requires an account. The master password (via `--password-stdin`) is needed only by the modes that sign — `--dry-run` and `--build-only` do not unlock the wallet and run without it. Watch-only accounts fail with `watch_only_no_signer` in a signing mode.
## Options
@@ -29,8 +29,11 @@ Requires an account and the master password via `--password-stdin`; watch-only a
| `--params ` | JSON array of ABI parameters as `{type,value}` |
| `--call-value-sun ` | Native TRX attached to the call, in SUN (default 0) |
| `--fee-limit ` | Max energy fee to burn, in SUN (default 100000000) |
-| `--dry-run` | Estimate energy only, no signature/broadcast; excludes `--sign-only` |
-| `--sign-only` | Sign without broadcasting; excludes `--dry-run` |
+| `--dry-run` | Estimate energy only, no signature/broadcast; excludes `--sign-only` / `--build-only` |
+| `--sign-only` | Sign without broadcasting, output the signed hex; excludes `--dry-run` / `--build-only`; pairs with `--expiration` |
+| `--build-only` | Build only, output the **unsigned** hex; excludes `--dry-run` / `--sign-only`; pairs with `--expiration` |
+| `--expiration ` | Transaction expiration in ms, up to `86400000` (24h); only with `--sign-only` or `--build-only`; omitted = node default (~60s) |
+| `--permission-id ` | Permission group to sign with (0=owner, 1=witness, 2–9=active); default `0` |
| `--wait` / `--wait-timeout ` | Poll after broadcast until confirmed/failed (cap default: config `waitTimeoutMs`, built-in 60000) |
| `--password-stdin` | Master password from stdin |
@@ -101,7 +104,8 @@ echo "$PW" | wallet-cli contract send --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkA
| default (submit) | `kind: "contract-send"`, `stage: "submitted"`, `txId`, `method`, `contract` |
| `--wait` (confirmed/failed) | above, but `stage: "confirmed"` or `"failed"`, plus `confirmed`, `blockNumber`, `feeSun`, `energyUsed`, `result` (`SUCCESS` / `OUT_OF_ENERGY`, etc.), `failed` |
| `--dry-run` | `kind`, `mode: "dry-run"`, `fee` (`feeModel`, estimated `energy`, `availableEnergy`), unsigned `tx` |
-| `--sign-only` | `kind`, `mode: "sign-only"`, `signed` (feed to `tx broadcast`), `address` (signer), `txId`, `fee`, `method`, `contract` |
+| `--sign-only` | `kind`, `mode: "sign-only"`, `hex` (signed transaction hex), `signed` (the same transaction as a TRON tx object incl. `signature[]`), `address` (signer), `txId`, `fee`, `method`, `contract` |
+| `--build-only` | `kind`, `mode: "build-only"`, `hex` (**unsigned** transaction hex), unsigned `tx` (TRON tx object), `fee`, `method`, `contract` |
## Exit status
diff --git a/ts/docs/commands/current.md b/ts/docs/commands/current.md
index f2dbddb0c..71d4c9933 100644
--- a/ts/docs/commands/current.md
+++ b/ts/docs/commands/current.md
@@ -10,7 +10,11 @@ wallet-cli current [options]
## Options
-[Global options](index.md) only.
+| Option | Description |
+|---|---|
+| `--qr` | Also render the active account's address as a scannable QR code in the terminal, with the full address printed below it for manual verification; text output only |
+
+Plus the [global options](index.md) (`--account` overrides which account is shown).
## Examples
@@ -23,6 +27,21 @@ Active account: main-1
TRON address TRs9HgTuY3dT3yDasdFdP9WQHqL37891Ax
```
+Add `--qr` to also render the active account's address as a scannable receive QR code, drawn with block characters below the address. Purely local — the address comes from local keystore metadata, no node access:
+
+```bash
+wallet-cli current --qr
+```
+
+```console
+Active account: main-1
+ TRON address TRs9HgTuY3dT3yDasdFdP9WQHqL37891Ax
+
+ [ scannable QR code of the address, drawn in the terminal ]
+```
+
+The QR is a terminal rendering only and scans from a real terminal (where the block characters line up); `-o json` is unchanged by `--qr` (machine consumers take the address and generate their own code). If the terminal is too narrow to fit it, it degrades to printing just the address with a `!` hint.
+
```bash
wallet-cli current -o json
```
diff --git a/ts/docs/commands/encoding/convert.md b/ts/docs/commands/encoding/convert.md
new file mode 100644
index 000000000..891ed5f71
--- /dev/null
+++ b/ts/docs/commands/encoding/convert.md
@@ -0,0 +1,105 @@
+# wallet-cli encoding convert
+
+Auto-detect an input and print every equivalent representation.
+
+## Synopsis
+
+```
+wallet-cli encoding convert
+```
+
+## Description
+
+Auto-detects the input's encoding, prints every equivalent representation, and validates checksums. It routes automatically by whether the input is address-shaped, into one of two families:
+
+- **Address family** — a TRON base58 address, a TRON 41-hex address, an EVM `0x` address, or a public key hex, printed as all its address forms. A TRON address and an EVM address are two encodings of the **same 20-byte public-key hash**: `TRON` is base58check (with the `0x41` prefix), `TRON hex` is `41` + those 20 bytes (21 raw bytes), and `EVM` is `0x` + the same 20 bytes in EIP-55 mixed case. So the `TRON hex` and `EVM` forms share the same middle 20 bytes — the difference is only the `41` prefix and the encoding. A public key (65-byte uncompressed or 33-byte compressed) is first keccak-hashed to its last 20 bytes, then encoded.
+- **Encoding family** — any non-address-shaped byte string (arbitrary hex / Base64 / Base58Check) is printed as its `Hex`, `Base64`, and `Base58Check` forms (the Base58Check output carries a 4-byte checksum).
+
+Purely local — no node access. Private keys and mnemonics are **not** accepted: a secret passed on the command line would leak into shell history and the process list. To get an address from a private key, import it with [`import private-key`](../import/private-key.md).
+
+## Options
+
+No command-specific options; `input` is a positional argument. Purely local, so no `--network`. Plus the [global options](../index.md#global-options-every-command).
+
+## Examples
+
+A TRON address prints all its address forms:
+
+```bash
+wallet-cli encoding convert TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp
+```
+
+```console
+TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp
+TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29
+EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29
+```
+
+```bash
+wallet-cli encoding convert TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"encoding.convert","data":{"input":"TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp","inputType":"tron-base58","valid":true,"tron":"TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp","tronHex":"4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29","evm":"0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29"},"meta":{"durationMs":2,"warnings":[]}}
+```
+
+A public key hex resolves to the same address:
+
+```bash
+wallet-cli encoding convert 04a1b2c3d4e5...f6a7b8c9d0
+```
+
+```console
+TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp
+TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29
+EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29
+```
+
+A non-address-shaped input converts across encodings, in both directions:
+
+```bash
+wallet-cli encoding convert deadbeef0102
+```
+
+```console
+Hex deadbeef0102
+Base64 3q2+7wEC
+Base58Check DWcJPafcQr2coF
+```
+
+```bash
+wallet-cli encoding convert 3q2+7wEC # Base64 back to hex
+```
+
+```console
+Hex deadbeef0102
+Base64 3q2+7wEC
+Base58Check DWcJPafcQr2coF
+```
+
+A checksum failure reports the reason:
+
+```bash
+wallet-cli encoding convert TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUX
+```
+
+```console
+Error: invalid_value — base58 checksum mismatch (typo in the address?)
+```
+
+## Output
+
+`data` shape depends on the input family:
+
+| Family | Fields |
+|---|---|
+| address | `input`, `inputType` (`tron-base58` / `tron-hex` / `evm` / `public-key`), `valid`, `tron`, `tronHex`, `evm` |
+| encoding | `input`, `inputType` (`hex` / `base64` / `base58check`), `valid`, `hex`, `base64`, `base58check` |
+
+## Exit status
+
+`0` success · `2` usage error (`invalid_value` — unrecognized input or checksum mismatch; the text gives the specific reason).
+
+## See also
+
+[`address generate`](../address/generate.md) · [`import private-key`](../import/private-key.md)
diff --git a/ts/docs/commands/encoding/index.md b/ts/docs/commands/encoding/index.md
new file mode 100644
index 000000000..f8b599e25
--- /dev/null
+++ b/ts/docs/commands/encoding/index.md
@@ -0,0 +1,21 @@
+# wallet-cli encoding
+
+Convert and validate addresses & encodings across formats.
+
+A purely local tool group — it never touches the node or your keystore.
+
+## Synopsis
+
+```
+wallet-cli encoding COMMAND
+```
+
+## Subcommands
+
+| Command | Page | Description |
+|---|---|---|
+| `encoding convert` | [convert.md](convert.md) | Auto-detect an input and print every equivalent representation |
+
+## See also
+
+[`address generate`](../address/generate.md) · [`tx approvals`](../tx/approvals.md) · [Accounts & HD](../../concepts/accounts-and-hd.md)
diff --git a/ts/docs/commands/gasfree/index.md b/ts/docs/commands/gasfree/index.md
new file mode 100644
index 000000000..d8e73912d
--- /dev/null
+++ b/ts/docs/commands/gasfree/index.md
@@ -0,0 +1,32 @@
+# wallet-cli gasfree
+
+Gas-free token transfers via the GasFree service.
+
+`gasfree` moves tokens without holding any TRX: you sign a transfer with EIP-712 structured-data signing and the GasFree service ([open.gasfree.io](https://open.gasfree.io)) puts it on-chain for you. The fee is charged in the transferred token itself — a per-transfer service fee, plus a one-time activation fee on your first transfer — so **no TRX is needed**.
+
+## Synopsis
+
+```
+wallet-cli gasfree COMMAND
+```
+
+## Subcommands
+
+| Command | Page | Description |
+|---|---|---|
+| `gasfree info` | [info.md](info.md) | Your GasFree address, activation status, nonce, and fee schedule |
+| `gasfree transfer` | [transfer.md](transfer.md) | Sign a gas-free transfer and submit it to the provider |
+| `gasfree trace` | [trace.md](trace.md) | Track a submitted transfer by its trace id |
+
+## How it works
+
+- Each account has a **deterministically-derived GasFree address**. Assets are received and paid from that address — to receive USDT gas-free, give the sender your GasFree address (`gasfree info`).
+- On your **first** transfer, the provider activates the GasFree address on-chain and charges a one-time activation fee, on top of the per-transfer service fee. Both are deducted in the token.
+- Signatures are ordered by a per-address **nonce** to prevent replay.
+- Requires provider **API credentials** — set `gasfreeApiKey` / `gasfreeApiSecret` with [`config`](../config.md). `--network` selects the service environment (mainnet / testnet).
+
+Compared with [`tx send`](../tx/send.md): `tx send` broadcasts on-chain, spending bandwidth/energy or burning TRX; `gasfree transfer` goes through the provider's API — zero TRX, but a token-denominated fee per transfer. When you have TRX or energy, `tx send` is usually cheaper; `gasfree` is for the "no TRX at all" case.
+
+## See also
+
+[`gasfree info`](info.md) · [`gasfree transfer`](transfer.md) · [`gasfree trace`](trace.md) · [`config`](../config.md) · [`tx send`](../tx/send.md)
diff --git a/ts/docs/commands/gasfree/info.md b/ts/docs/commands/gasfree/info.md
new file mode 100644
index 000000000..64de9c8cf
--- /dev/null
+++ b/ts/docs/commands/gasfree/info.md
@@ -0,0 +1,64 @@
+# wallet-cli gasfree info
+
+Show your GasFree address, activation status, nonce, and fee schedule.
+
+## Synopsis
+
+```
+wallet-cli gasfree info [options]
+```
+
+## Description
+
+A read-only view, from the provider's API, of the account's GasFree address (deterministically derived), its activation status and current nonce, and the provider's supported tokens with their activation and per-transfer fees (charged in the token itself).
+
+The **GasFree address** is where assets are received and paid — to receive USDT gas-free, give this address to the sender. On the first outgoing transfer the provider activates it on-chain and charges the activation fee. The fee schedule and supported tokens are the provider's live configuration, so the output is whatever the API returns.
+
+Requires the provider API credentials (`gasfreeApiKey` / `gasfreeApiSecret`, set with [`config`](../config.md)).
+
+## Options
+
+No command-specific options; the [global options](../index.md#global-options-every-command) only (`--network`, which selects the service environment, and `--account`).
+
+## Examples
+
+```bash
+wallet-cli gasfree info --account main --network tron:nile
+```
+
+```console
+Account main (TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw)
+GasFree address TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw
+Status active
+Nonce 4
+
+Supported tokens (1)
+ Token Activation fee Transfer fee
+ USDT 1 USDT 0.5 USDT
+```
+
+```bash
+wallet-cli gasfree info --account main --network tron:nile -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.info","data":{"ownerAddress":"TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw","gasFreeAddress":"TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw","active":true,"nonce":4,"tokens":[{"symbol":"USDT","address":"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t","decimals":6,"activateFee":"1000000","transferFee":"500000"}]},"meta":{"durationMs":380,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `ownerAddress` | string | The account's own TRON address |
+| `gasFreeAddress` | string | Derived GasFree address (receive/pay here) |
+| `active` | boolean | Whether the GasFree address is activated on-chain |
+| `nonce` | number | Current per-address nonce |
+| `tokens[]` | array | Supported tokens: `{symbol, address, decimals, activateFee, transferFee}` — fees in the token's base units |
+
+## Exit status
+
+`0` success · `1` execution failure (`gasfree_credentials_missing`, `gasfree_integrity` — the provider's fee metadata disagreed between the token list and the address response, `provider_error` — service error / rate limit, `unsupported_network`) · `2` usage error (`invalid_value`).
+
+## See also
+
+[`gasfree transfer`](transfer.md) · [`gasfree trace`](trace.md) · [`config`](../config.md)
diff --git a/ts/docs/commands/gasfree/trace.md b/ts/docs/commands/gasfree/trace.md
new file mode 100644
index 000000000..571028ad4
--- /dev/null
+++ b/ts/docs/commands/gasfree/trace.md
@@ -0,0 +1,67 @@
+# wallet-cli gasfree trace
+
+Track a submitted gas-free transfer by its trace id.
+
+## Synopsis
+
+```
+wallet-cli gasfree trace [options]
+```
+
+## Description
+
+Looks up a GasFree transfer by the `traceId` returned from [`gasfree transfer`](transfer.md) and reports its current state. Once the transfer is on-chain, the response includes the transaction id and the actual fees charged.
+
+The provider's states are: `WAITING` (accepted, queued) → `INPROGRESS` (submitted on-chain) → `CONFIRMING` (awaiting solidification) → `SUCCEED` / `FAILED`. The text `Status` line shows the state in lowercase (consistent with the other commands); the raw uppercase enum is kept in the JSON `state`. On `FAILED`, the provider's failure reason is included as returned by the API.
+
+Requires the provider API credentials (`gasfreeApiKey` / `gasfreeApiSecret`, set with [`config`](../config.md)).
+
+## Options
+
+No command-specific options; `traceId` is a positional argument, plus the [global options](../index.md#global-options-every-command) (`--network`).
+
+## Examples
+
+```bash
+wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 --network tron:nile
+```
+
+```console
+Trace ID 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527
+Status succeed
+TxID d2e...
+Token USDT
+Amount 25 USDT
+Fee 0.5 USDT
+To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub
+```
+
+```bash
+wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 --network tron:nile -o json
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.trace","data":{"traceId":"7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527","state":"SUCCEED","txId":"d2e...","token":"USDT","amount":"25000000","serviceFee":"500000","activateFee":"0","to":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub"},"meta":{"durationMs":290,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+## Output
+
+| Field | Type | Meaning |
+|---|---|---|
+| `traceId` | string | The provider's acceptance id |
+| `state` | string | Raw state enum: `WAITING` / `INPROGRESS` / `CONFIRMING` / `SUCCEED` / `FAILED` |
+| `txId` | string | On-chain transaction id (once submitted) |
+| `token` | string | Token symbol |
+| `amount` | string | Amount, in token base units |
+| `serviceFee` / `activateFee` | string | Fees charged, in token base units |
+| `to` | string | Recipient address |
+
+## Exit status
+
+`0` success · `1` execution failure (`gasfree_credentials_missing`, `not_found` — no such trace id, `gasfree_integrity`, `provider_error`, `unsupported_network`) · `2` usage error (`invalid_value`).
+
+A `FAILED` transfer is a successful query: the envelope stays `success: true` at exit `0`, and `data.failureReason` carries the provider's explanation.
+
+## See also
+
+[`gasfree transfer`](transfer.md) · [`gasfree info`](info.md) · [`config`](../config.md)
diff --git a/ts/docs/commands/gasfree/transfer.md b/ts/docs/commands/gasfree/transfer.md
new file mode 100644
index 000000000..27cf9ba10
--- /dev/null
+++ b/ts/docs/commands/gasfree/transfer.md
@@ -0,0 +1,112 @@
+# wallet-cli gasfree transfer
+
+Sign a gas-free transfer and submit it to the GasFree provider.
+
+## Synopsis
+
+```
+wallet-cli gasfree transfer --to --amount [--token ]
+ [--dry-run | --wait [--wait-timeout ]] [options]
+```
+
+## Description
+
+Signs a transfer with EIP-712 structured-data signing and submits it to the GasFree provider, which puts it on-chain for you. No TRX is needed — the per-transfer service fee (plus a one-time activation fee on the first transfer) is deducted from the GasFree address's token balance, on top of the amount sent.
+
+Submission returns a **`traceId`** (the provider's acceptance id); at that point the transfer is accepted but **not yet on-chain**. Add `--wait` to poll the provider to a terminal state (`SUCCEED` / `FAILED`), or follow it later with [`gasfree trace`](trace.md). On the first transfer, when the GasFree address isn't activated yet, this transfer carries the activation automatically and the total deducted is amount + service fee + activation fee (itemised in the receipt and in `--dry-run`).
+
+There is no `--sign-only` / `--build-only`: the signed payload is bound to the provider's submission protocol, so offline distribution has no meaning. Requires an account, the master password via `--password-stdin`, and the provider credentials (`gasfreeApiKey` / `gasfreeApiSecret`, set with [`config`](../config.md)); watch-only accounts fail with `watch_only_no_signer`.
+
+## Options
+
+| Option | Description |
+|---|---|
+| `--to ` | **Required.** Recipient address, or a name from the [contact book](../contact/index.md) |
+| `--amount ` | **Required.** Amount in token units (e.g. `25` = 25 USDT); fees are charged on top |
+| `--token ` | Token to transfer; must be supported by the provider (see `gasfree info`) — default `USDT` |
+| `--dry-run` | Fee breakdown and balance check only; no signature, no submission, no password |
+| `--wait` / `--wait-timeout ` | Poll the provider until the transfer succeeds/fails (cap default: config `waitTimeoutMs`, built-in 60000) |
+| `--password-stdin` | Master password from stdin |
+
+Plus the [global options](../index.md#global-options-every-command).
+
+## Examples
+
+In the examples, `$PW` is your master password, fed on stdin via `--password-stdin`.
+
+Default — submit and return the acceptance receipt (a `traceId`, not yet on-chain):
+
+```bash
+echo "$PW" | wallet-cli gasfree transfer --to TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub --amount 25 --network tron:nile --password-stdin
+```
+
+```console
+⏳ Submitted to GasFree — send 25 USDT
+ Trace ID 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527
+ From TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw (GasFree address)
+ To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub
+ Fee 0.5 USDT
+ Total 25.5 USDT
+ Status accepted
+! Track it: wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.transfer","data":{"kind":"gasfree-transfer","stage":"submitted","traceId":"7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527","token":"USDT","amount":"25000000","serviceFee":"500000","activateFee":"0","totalDeducted":"25500000","from":"TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw","to":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","nonce":4},"meta":{"durationMs":650,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+Add `--wait` to poll to a terminal state, with the on-chain txid and actual deduction:
+
+```bash
+echo "$PW" | wallet-cli gasfree transfer --to TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub --amount 25 --network tron:nile --wait --password-stdin
+```
+
+```console
+✅ Sent 25 USDT via GasFree
+ Trace ID a41b6c88-0d2f-4e73-9a05-3c7d81f2b964
+ TxID d2e...
+ From TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw (GasFree address)
+ To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub
+ Fee 0.5 USDT
+ Total 25.5 USDT
+ Status succeed
+```
+
+On a first transfer the GasFree address isn't activated yet, so the fee itemises the service fee and the one-time activation fee, and `Total` includes activation:
+
+```bash
+wallet-cli gasfree transfer --to TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub --amount 25 --network tron:nile --dry-run
+```
+
+```console
+📋 Dry run — GasFree transfer 25 USDT (not submitted)
+ From TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw (GasFree address, not activated)
+ To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub
+ Fee 1.5 USDT (0.5 service + 1.0 activation)
+ Total 26.5 USDT
+```
+
+```json
+{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.transfer","data":{"kind":"gasfree-transfer","mode":"dry-run","token":"USDT","amount":"25000000","serviceFee":"500000","activateFee":"1000000","totalDeducted":"26500000","from":"TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw","to":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","nonce":0},"meta":{"durationMs":210,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}
+```
+
+## Output
+
+`data` varies by mode. Amounts and fees are token base units (strings):
+
+| Mode | Fields |
+|---|---|
+| default (submit) | `kind: "gasfree-transfer"`, `stage: "submitted"`, `traceId`, `token`, `tokenAddress`, `amount`, `serviceFee`, `activateFee`, `authorizedMaxFee`, `totalDeducted`, `from`, `to`, `nonce`, `deadline`, `serviceProvider`, plus `toContact` when `--to` was a contact name |
+| `--wait` (confirmed) | the above, but `stage: "confirmed"`, plus `confirmed`, `state` (`SUCCEED` / `FAILED`), `failed`, and `txId` |
+| `--wait` (failed) | the same fields, but `stage: "failed"`, `failed: true`, `state: "FAILED"`, and `failureReason` carrying the provider's explanation |
+| `--dry-run` | `kind`, `mode: "dry-run"`, `token`, `amount`, `serviceFee`, `activateFee`, `totalDeducted`, `from`, `to`; no `traceId` |
+
+A provider-side failure still leaves the envelope at `success: true` and exit `0` — the command completed; the transfer did not. Branch on `data.stage` / `data.state`, not on the exit code. See [script safety](../../machine-interface.md#script-safety-never-mistake-submitted-for-confirmed).
+
+## Exit status
+
+`0` submitted (or dry-run) · `1` execution failure (`gasfree_credentials_missing`, `insufficient_token_balance` — token balance < amount + service fee [+ activation fee], `unsupported_token`, `gasfree_rejected` — the provider declined the authorization, `gasfree_integrity` — the provider's fee metadata disagreed with itself, `watch_only_no_signer`, `wrong_password`, `auth_failed`, `signing_rejected`, `provider_error`) · `2` usage error (`invalid_value`, `invalid_amount`).
+
+## See also
+
+[`gasfree info`](info.md) · [`gasfree trace`](trace.md) · [`tx send`](../tx/send.md) · [`config`](../config.md)
diff --git a/ts/docs/commands/index.md b/ts/docs/commands/index.md
index 130df9032..06df98967 100644
--- a/ts/docs/commands/index.md
+++ b/ts/docs/commands/index.md
@@ -26,10 +26,12 @@ Every command — including every subcommand — has its own page, following a f
|---|---|
| `tx` (group) | [tx/index.md](tx/index.md) |
| `tx send` | [tx/send.md](tx/send.md) |
-| `tx sign` | [tx/sign.md](tx/sign.md) |
| `tx broadcast` | [tx/broadcast.md](tx/broadcast.md) |
| `tx status` | [tx/status.md](tx/status.md) |
| `tx info` | [tx/info.md](tx/info.md) |
+| `tx sign` | [tx/sign.md](tx/sign.md) |
+| `tx approvals` | [tx/approvals.md](tx/approvals.md) |
+| `tx multisig` | [tx/multisig.md](tx/multisig.md) |
## On-chain queries
@@ -40,12 +42,22 @@ Every command — including every subcommand — has its own page, following a f
| `account info` | [account/info.md](account/info.md) |
| `account history` | [account/history.md](account/history.md) |
| `account portfolio` | [account/portfolio.md](account/portfolio.md) |
+| `account activate` | [account/activate.md](account/activate.md) |
+| `account set` | [account/set.md](account/set.md) |
| `block` | [block.md](block.md) |
| `chain` (group) | [chain/index.md](chain/index.md) |
| `chain params` | [chain/params.md](chain/params.md) |
| `chain prices` | [chain/prices.md](chain/prices.md) |
| `chain node` | [chain/node.md](chain/node.md) |
+## Account permissions
+
+| Command | Page |
+|---|---|
+| `permission` (group) | [permission/index.md](permission/index.md) |
+| `permission show` | [permission/show.md](permission/show.md) |
+| `permission update` | [permission/update.md](permission/update.md) |
+
## Tokens and contracts
| Command | Page |
@@ -56,11 +68,19 @@ Every command — including every subcommand — has its own page, following a f
| `token add` | [token/add.md](token/add.md) |
| `token list` | [token/list.md](token/list.md) |
| `token remove` | [token/remove.md](token/remove.md) |
+| `contact` (group) | [contact/index.md](contact/index.md) |
+| `contact add` | [contact/add.md](contact/add.md) |
+| `contact list` | [contact/list.md](contact/list.md) |
+| `contact remove` | [contact/remove.md](contact/remove.md) |
| `contract` (group) | [contract/index.md](contract/index.md) |
| `contract call` | [contract/call.md](contract/call.md) |
| `contract send` | [contract/send.md](contract/send.md) |
| `contract deploy` | [contract/deploy.md](contract/deploy.md) |
| `contract info` | [contract/info.md](contract/info.md) |
+| `gasfree` (group) | [gasfree/index.md](gasfree/index.md) |
+| `gasfree info` | [gasfree/info.md](gasfree/info.md) |
+| `gasfree transfer` | [gasfree/transfer.md](gasfree/transfer.md) |
+| `gasfree trace` | [gasfree/trace.md](gasfree/trace.md) |
## Staking, voting, rewards
@@ -96,6 +116,8 @@ Every command — including every subcommand — has its own page, following a f
| Command | Page |
|---|---|
+| `encoding convert` | [encoding/convert.md](encoding/convert.md) |
+| `address generate` | [address/generate.md](address/generate.md) |
| `config` | [config.md](config.md) |
| `networks` | [networks.md](networks.md) |
@@ -110,4 +132,4 @@ Every command — including every subcommand — has its own page, following a f
-h, --help / -V, --version
```
-Broadcast (✍️) commands additionally take `--wait` / `--wait-timeout ` (cap default: config `waitTimeoutMs`, built-in 60000) and `--dry-run` / `--sign-only`.
+Broadcast (✍️) commands additionally take `--wait` / `--wait-timeout ` (cap default: config `waitTimeoutMs`, built-in 60000), the early-exit modes `--dry-run` / `--sign-only` / `--build-only`, and the multi-sig options `--permission-id ` / `--expiration `.
diff --git a/ts/docs/commands/permission/index.md b/ts/docs/commands/permission/index.md
new file mode 100644
index 000000000..9eebce4d1
--- /dev/null
+++ b/ts/docs/commands/permission/index.md
@@ -0,0 +1,34 @@
+# wallet-cli permission
+
+View and update account permissions — the basis of TRON multi-sig.
+
+`show` is the read-only query to run before you touch anything; `update` replaces the whole permission structure in one on-chain transaction (and burns 100 TRX).
+
+## Synopsis
+
+```
+wallet-cli permission COMMAND
+```
+
+## Subcommands
+
+| Command | Page | Description |
+|---|---|---|
+| `permission show` | [show.md](show.md) | Show the account's permission structure |
+| `permission update` | [update.md](update.md) | Replace the account's permission structure (burns 100 TRX) |
+
+## The permission model
+
+Every TRON account has:
+
+- **one owner permission** (id `0`) — full control, including the power to change the permissions themselves;
+- **up to 8 active permissions** (ids `2`–`9`) — each scoped to a set of operation types it may perform;
+- **one witness permission** (id `1`) — SRs only, for block-production signing.
+
+Each permission group holds **up to 5 keys** (address + weight) and a **threshold**. A transaction is valid for a group when the combined weight of its signatures is **≥ the threshold** — that is what makes an account "multi-sig". A typical setup keeps the owner group behind a multi-key threshold and runs day-to-day activity through a scoped active group.
+
+> ⚠️ **Misconfiguring the owner permission permanently locks the account.** If the new owner keys don't include an address you can sign with — or the threshold can't be met by keys you hold — the transaction still succeeds and there is no on-chain recovery. `permission update` surfaces the lockout risk as a warning but does **not** stop the submission. The warning codes are `owner_lockout` (local keys hold no owner weight), `owner_lockout_partial` (they hold less than the threshold, so co-signers become mandatory), `active_can_update_permission` (an active group can rewrite the permissions themselves) and `active_unknown_operations` (a group sets operation bits this build does not recognise).
+
+## See also
+
+[`permission show`](show.md) · [`permission update`](update.md) · [`tx sign`](../tx/sign.md) · [Security](../../concepts/security.md)
diff --git a/ts/docs/commands/permission/show.md b/ts/docs/commands/permission/show.md
new file mode 100644
index 000000000..2fb185c75
--- /dev/null
+++ b/ts/docs/commands/permission/show.md
@@ -0,0 +1,109 @@
+# wallet-cli permission show
+
+Show the account's permission structure.
+
+## Synopsis
+
+```
+wallet-cli permission show [options]
+```
+
+## Description
+
+A read-only view of the account's permission groups — owner, witness (SRs only), and up to 8 active groups — each with its threshold, keys (address + weight), and, for active groups, the decoded list of operations it may perform. Run it before `permission update`, and use it to check a co-signer's structure before signing.
+
+By default it reads the active account; `--account` overrides it and also accepts a bare address, so you can inspect any account on chain.
+
+Reading the output — the text layout mirrors the TronScan permission page, one "label / value" card per group:
+
+- **Permission Name** — the on-chain `permission_name` plus its id (active groups are marked `active`). The name is chosen when the group is created by [`permission update`](update.md); it is a mnemonic only, with no on-chain meaning. A never-modified account shows the chain default: an `owner` and an `active` group, each with the account's own address as the sole key and threshold `1`.
+- **Operation(s)** — active groups only. On chain this is a 32-byte bitmap (one bit per contract type); the text decodes it to human operation labels (`Transfer TRX`, `Vote`, …) and gives the total count. The label set matches what the TronScan permission page shows. JSON keeps the machine-readable contract-type names in `operations` plus the raw `operationsHex`.
+- **Threshold** — the combined signature weight a transaction needs to be valid for this group.
+- **Authorized To** — the group's keys as `Address / Weight`. Keys held by a local wallet (software or Ledger) are annotated `(this wallet: