diff --git a/README.md b/README.md index 541204100..ceebd7ce2 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Both manage TRON wallets, but they are independent implementations rather than i | **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` + `cd wallet-cli/java && ./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. | +| **How you drive it** | An **interactive prompt only** — start it, then type commands at `>`. | **One-shot subcommands** — `wallet-cli ` from your shell. Prompts appear only on a short allowlist (`create`, `import *`, `backup`, `change-password`, `delete`); every other command errors instead of asking. | | **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` endpoints, or `SwitchNetwork` at runtime. Mainnet · Nile · Shasta · custom. | `--network` flag / `config` command. Three TRON networks plus Ethereum, Sepolia, BNB Smart Chain, and its testnet. | diff --git a/java/README.md b/java/README.md index 64c954e48..254c05d8b 100644 --- a/java/README.md +++ b/java/README.md @@ -76,7 +76,7 @@ The full first-run walkthrough is in the [getting-started guide](docs/guide/gett ## Commands -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. +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, `help ` shows a command's built-in usage tips (`help` alone prints the full table). ### Wallets & accounts diff --git a/java/docs/commands/account.md b/java/docs/commands/account.md index f81ea3fc4..8aa3e982a 100644 --- a/java/docs/commands/account.md +++ b/java/docs/commands/account.md @@ -43,12 +43,14 @@ Before sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d4040e0cff9 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 + +No. Address Name +1 TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB.json +2 TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew.json +3 TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7 TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7.json +4 TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json +5 TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada.json +Please choose No. between 1 and 5, or enter search to search wallets 1 After sign transaction hex string is 0a84010a0291a422082bfcd3bb597f3d404083bd9cfae5325a6612640a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e7472616374122e0a15419d9c2bb5ee381a4396dd49ce42292e756b2e5e4b12154124764e4674179d4578cfc4c833c1ac1a09f6ce56708e8df6efe5321241ce53add4f75fe1838aa7e0a4e2411b3bbfce1d2164d68dac18507ed87e22ae503f65592a1161640834b3c0cef43c28f20b2d335120cc78b6f745a82ea95e451100 TxId is 26d6fcdfdc0018097ec4166eb140e19ebd597bea2212579d2f6d921b0ad6e56f diff --git a/java/docs/commands/chain-data.md b/java/docs/commands/chain-data.md index 0c118029d..0ed3b52da 100644 --- a/java/docs/commands/chain-data.md +++ b/java/docs/commands/chain-data.md @@ -57,10 +57,10 @@ Get the latest `n` blocks, where 0 < n < 100. ### GetBlockByLimitNext ```console -> GetBlockByLimitNext startBlockId endBlockId +> GetBlockByLimitNext start_block_number end_block_number ``` -Get the block in the range [startBlockId, endBlockId). +Get the blocks in the block-height range [start_block_number, end_block_number). Both arguments are block **numbers**, not block ids. ## Chain parameters & nodes diff --git a/java/docs/commands/contract.md b/java/docs/commands/contract.md index 6b47145fb..0b37b16b0 100644 --- a/java/docs/commands/contract.md +++ b/java/docs/commands/contract.md @@ -5,7 +5,7 @@ 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,...> +> 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) ``` - `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account. @@ -23,8 +23,7 @@ Deploy, trigger, and inspect smart contracts. 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 # +> 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: @@ -84,8 +83,7 @@ Takes 5 parameters, or 8 when the trailing `value token_value token_id` group is Example: ```console -> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest(uint256) 0 false -1000000000 0 0 # +> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest(uint256) 0 false 1000000000 0 0 # # Get the result of the contract execution with the getTransactionInfoById command > getTransactionInfoById 7d9c4e765ea53cf6749d8a89ac07d577141b93f83adc4015f0b266d8f5c2dec4 { @@ -128,7 +126,7 @@ The command accepts exactly five parameters without value/token fields, or eight Example: ```console -> TriggerConstantContract TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true +> TriggerConstantContract TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs balanceOf(address) 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true ``` ## ClearContractABI @@ -242,7 +240,7 @@ Estimate the energy required for the successful execution of a smart contract tr Example: ```console -> EstimateEnergy TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs "balanceOf(address)" 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true +> EstimateEnergy TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs balanceOf(address) 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c true ``` ## See also diff --git a/java/docs/commands/gasfree.md b/java/docs/commands/gasfree.md index 4b0b74ff5..669b5d406 100644 --- a/java/docs/commands/gasfree.md +++ b/java/docs/commands/gasfree.md @@ -14,7 +14,6 @@ For the current wallet address: ```console wallet> gasfreeinfo -balanceOf(address):70a08231 { "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF", "active":true, @@ -30,7 +29,6 @@ For a specified address: ```console wallet> gasfreeinfo TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe -balanceOf(address):70a08231 { "gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF", "active":true, @@ -49,7 +47,8 @@ Submit a gas-free token transfer request. ```console wallet> gasfreetransfer TEkj3ndMVEmFLYaFrATMwMjBRZ1EAZkucT 100000 -GasFreeTransfer result: { +GasFreeTransfer result: +{ "code":200, "data":{ "amount":100000, @@ -81,7 +80,8 @@ Track transfer status — check the progress of a GasFree transfer using the `id ```console wallet> gasfreetrace 6c3ff67e-0bf4-4c09-91ca-0c7c254b01a0 -GasFreeTrace result: { +GasFreeTrace result: +{ "code":200, "data":{ "amount":100000, diff --git a/java/docs/commands/index.md b/java/docs/commands/index.md index 66aef7619..377975bce 100644 --- a/java/docs/commands/index.md +++ b/java/docs/commands/index.md @@ -2,7 +2,7 @@ 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. +Run `help ` in the interactive wallet to see a command's built-in usage tips; `help` on its own prints the full table. Typing a command bare does not reliably show usage — most commands that need no argument simply run. ## By family @@ -15,7 +15,7 @@ Type any command in the interactive wallet to see its built-in usage tips. | 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) | +| Resource prices & memo fee | [resources.md](resources.md) | | Voting, rewards & witnesses | [vote-reward.md](vote-reward.md) | | Smart contracts | [contract.md](contract.md) | | Proposals | [proposals.md](proposals.md) | diff --git a/java/docs/commands/multisig.md b/java/docs/commands/multisig.md index 69e9ade41..5fb9cbe42 100644 --- a/java/docs/commands/multisig.md +++ b/java/docs/commands/multisig.md @@ -24,7 +24,7 @@ or wallet> updateAccountPermission === UpdateAccountPermission Interactive Mode === -Select permission to modify: +Please enter the index(1-7) to operate: 1. owner_permission 2. witness_permission 3. active_permissions @@ -45,7 +45,7 @@ If the account is not a witness, it's not necessary to set `witness_permission`, > 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." +Will show "Please confirm and input your permission id, if input y/Y means default 0, other non-numeric characters will cancel transaction." This will require the transfer authorization of active access. Enter: 2 @@ -53,7 +53,7 @@ Then select accounts and put in the local password, i.e. TNhXo1GbRNCuorvYu5JFWN3 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 !!". +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. @@ -190,7 +190,7 @@ wallet> tronlinkmultisign 1. Multi-sign transaction list 2. Create multi-sign transaction 0. Exit -Please enter the number to operate: +Please enter to operate: ``` ## See also diff --git a/java/docs/commands/network.md b/java/docs/commands/network.md index 1d084c1a0..e280501a2 100644 --- a/java/docs/commands/network.md +++ b/java/docs/commands/network.md @@ -41,7 +41,7 @@ View the current network. ```console wallet> currentnetwork -currentNetwork: NILE +current network: NILE ``` For a custom network, the node endpoints are shown: diff --git a/java/docs/commands/proposals.md b/java/docs/commands/proposals.md index 64c58ec8c..a109f1fcf 100644 --- a/java/docs/commands/proposals.md +++ b/java/docs/commands/proposals.md @@ -14,7 +14,7 @@ Initiate a proposal. - `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: +Values are passed to the chain verbatim — the CLI does no unit conversion, so a SUN-denominated parameter must be given in SUN. In the example, proposal No.4 (the token issuance fee) is set to the raw value `1000`, which is 1000 SUN: ```console > createProposal 4 1000 diff --git a/java/docs/commands/resources.md b/java/docs/commands/resources.md index 769dfc481..2a70e656e 100644 --- a/java/docs/commands/resources.md +++ b/java/docs/commands/resources.md @@ -8,9 +8,7 @@ Get the historical unit price of bandwidth. ```console wallet> getBandwidthPrices -{ - "prices": "0:10,1606537680000:40,1614238080000:140,1626581880000:1000,1626925680000:140,1627731480000:1000" -} +The BandwidthPrices is 0:10,1606537680000:40,1614238080000:140,1626581880000:1000,1626925680000:140,1627731480000:1000 ``` ## GetEnergyPrices @@ -19,9 +17,7 @@ Get the historical unit price of energy. ```console wallet> getEnergyPrices -{ - "prices": "0:100,1575871200000:10,1606537680000:40,1614238080000:140,1635739080000:280,1681895880000:420" -} +The EnergyPrices is 0:100,1575871200000:10,1606537680000:40,1614238080000:140,1635739080000:280,1681895880000:420 ``` ## GetMemoFee @@ -30,9 +26,7 @@ Get the memo fee. ```console wallet> getMemoFee -{ - "prices": "0:0,1675492680000:1000000" -} +The MemoFee is 0:0,1675492680000:1000000 ``` ## See also diff --git a/java/docs/commands/stake-v1-legacy.md b/java/docs/commands/stake-v1-legacy.md index c2ab6e215..af12aa9a2 100644 --- a/java/docs/commands/stake-v1-legacy.md +++ b/java/docs/commands/stake-v1-legacy.md @@ -22,7 +22,7 @@ After the funds are frozen, the corresponding number of shares and bandwidth wil For example: ```console -> freezeBalance 100000000 3 1 address +> freezeBalance 100000000 3 1 TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW ``` 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. diff --git a/java/docs/commands/stake-v2.md b/java/docs/commands/stake-v2.md index 40e46b545..891b403dc 100644 --- a/java/docs/commands/stake-v2.md +++ b/java/docs/commands/stake-v2.md @@ -2,6 +2,8 @@ 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). +The transaction examples below are abridged: every signing command also prints the permission-id prompt, the key selector, the before/after signing hex strings, and a trailing ` successful !!!` line. Only the `TxId is …` line is kept here, because it is the part you carry to `GetTransactionById`. + ## FreezeBalanceV2 / UnfreezeBalanceV2 ### FreezeBalanceV2 @@ -18,7 +20,7 @@ Example: ```console wallet> FreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000000000000 0 -txid is 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d +TxId is 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d wallet> GetTransactionById 82244829971b4235d98a9f09ba67ddb09690ac2f879ad93e09ba3ec1ab29177d { "ret":[ @@ -66,7 +68,7 @@ Example: ```console wallet> UnFreezeBalanceV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 9000000 0 -txid is dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634 +TxId is dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634 wallet> GetTransactionById dcfea1d92fc928d24c88f7f71a03ae8105d0b5b112d6d48be93d3b9c73bea634 { "ret":[ @@ -118,7 +120,7 @@ Example: ```console wallet> DelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 10000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3 true -txid is 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed +TxId is 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed wallet> GetTransactionById 363ac0b82b6ad3e0d3cad90f7d72b3eceafe36585432a3e013389db36152b6ed { "ret":[ @@ -170,7 +172,7 @@ Example: ```console wallet> UnDelegateResource TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1000000 0 TQ4gjjpAjLNnE67UFbmK5wVt5fzLfyEVs3 -txid is feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c +TxId is feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c wallet> GetTransactionById feb334794cf361fd351728026ccf7319e6ae90eba622b9eb53c626cdcae4965c { "ret":[ @@ -217,7 +219,7 @@ Example: ```console wallet> withdrawexpireunfreeze TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh -txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 +TxId is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 { "ret":[ @@ -262,7 +264,7 @@ Example: ```console wallet> cancelAllUnfreezeV2 TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh -txid is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 +TxId is e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 wallet> GetTransactionById e5763ab8dfb1e7ed076770d55cf3c1ddaf36d75e23ec8330f99df7e98f54a147 { "ret":[ @@ -360,9 +362,8 @@ Example: ```console wallet> getCanDelegatedMaxSize TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 0 -{ - "max_size": 999999978708334 -} +GetCanDelegatedMaxSize=999999978708334 +GetCanDelegatedMaxSize successful !!! ``` ### GetAvailableUnfreezeCount @@ -379,9 +380,8 @@ Example: ```console wallet> getAvailableUnfreezeCount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh -{ - "count": 31 -} +GetAvailableUnfreezeCount=31 +GetAvailableUnfreezeCount successful!!! ``` ### GetCanWithdrawUnfreezeAmount @@ -399,9 +399,7 @@ Example: ```console wallet> getCanWithdrawUnfreezeAmount TJAVcszse667FmSNCwU2fm6DmfM5D4AyDh 1671100335000 -{ - "amount": 9000000 -} +GetCanWithdrawUnfreezeAmount successful amount:9000000 !!! ``` ## See also diff --git a/java/docs/commands/transfer-trc10.md b/java/docs/commands/transfer-trc10.md index 078476850..07e5711bf 100644 --- a/java/docs/commands/transfer-trc10.md +++ b/java/docs/commands/transfer-trc10.md @@ -125,14 +125,22 @@ Example: ```console > TransferAsset TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz 1000001 1000 > getaccount TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz # View target account information after the transfer -address: TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz - assetV2 +{ + "address": "TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz", + "balance": 9999900000, + "assetV2": [ + { + "key": "1000001", + "value": 1000 + } + ], + "free_asset_net_usageV2": [ { - id: 1000001 - balance: 1000 - latest_asset_operation_timeV2: null - free_asset_net_usageV2: 0 + "key": "1000001", + "value": 0 } + ] +} ``` ### ParticipateAssetIssue @@ -155,14 +163,16 @@ Example: ```console > ParticipateAssetIssue TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ 1000001 1000 > getaccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW # View remaining balance -address: TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW -assetV2 +{ + "address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW", + "balance": 9999900000, + "assetV2": [ { - id: 1000001 - balance: 1000 - latest_asset_operation_timeV2: null - free_asset_net_usageV2: 0 + "key": "1000001", + "value": 1000 } + ] +} ``` ### ListAssetIssuePaginated diff --git a/java/docs/commands/usdt.md b/java/docs/commands/usdt.md index b78968fcf..d8252138e 100644 --- a/java/docs/commands/usdt.md +++ b/java/docs/commands/usdt.md @@ -14,17 +14,6 @@ Get the USDT balance of the login account, or of `Address` when one is given. ```console wallet> getusdtbalance -balanceOf(address):70a08231 -Execution result = { - "constant_result": [ - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "result": { - "result": true - }, - "energy_used": 4062, - "energy_penalty": 3127 -} USDT balance = 0 ``` @@ -38,39 +27,8 @@ Make a USDT transfer. ```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":[ @@ -98,13 +56,9 @@ Before sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e140b8c896 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 +The keystore file TUUSMd58eC3fKx3fn7whxJyr1FR56tgaP8.json is loaded. Please input your password. -******** +password: After sign transaction hex string is 0ad4010a0208c72208c02252c2ae3b92e1409fb0b9d9a2335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541caf9798d70a3c609b600f163e53cfe8f586e1b9f121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f2244a9059cbb000000000000000000000041a5418b8da12e73075abb46375e7a15c758ea21fc000000000000000000000000000000000000000000000000000000000000000170938293cfa23390018094ebdc031241a776830e5cd054c6a94631b6d62704e249e7587ab3f036e5e4fac15cbf49e671262532e094e1a32ad858272da3e101958102df61b0f72f26756a94b608883a6f01 TxId is 9c8d4b84e9a71ccaad86b0a96f790067d3fc7ea85c26b425e5d748b81d31a8b8 Transfer 1 to TR311sD6KasRnofj5RnFiFBA2rH8RH2kYk broadcast successful. @@ -133,7 +87,7 @@ wallet> GetUsdtTransferById b0044dcb188568d11e77da926d96630f3e878583c5d5f4b3a72d ## AddressBook -Add, delete, modify, and search the address book. +Add, edit, and delete address-book entries. The interactive menu has no search action. ```console wallet> AddressBook @@ -141,8 +95,8 @@ wallet> AddressBook MAIN MENU: 1. addAddress 2. editAddress -3. delAddress -4. getAddressBook +3. deleteAddress +4. exit Select option: 1 ``` diff --git a/java/docs/commands/vote-reward.md b/java/docs/commands/vote-reward.md index beec5ec9a..9b2b610a1 100644 --- a/java/docs/commands/vote-reward.md +++ b/java/docs/commands/vote-reward.md @@ -14,14 +14,14 @@ Voting requires share. Share can be obtained by freezing funds. For example: ```console -> freezeBalance 10000000 3 1 address # Freeze 10 TRX and acquire 10 units of shares +> freezeBalance 10000000 3 1 # Freeze 10 TRX 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 TJmka325yjJKeFpQDwKSQAoNwEyNGhsaEV 4 TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG 6 # Cast 4 votes for the first SR and 6 for the second at the same time -> votewitness 123455 witness1 10 # Voted 10 votes for witness1 +> votewitness TJmka325yjJKeFpQDwKSQAoNwEyNGhsaEV 10 # Vote 10 for the first SR only ``` -The final result of the above command was 10 votes for witness1 and 0 vote for witness2. +Each SR must be given as a Base58Check address; a placeholder name is not accepted. The final result of the above commands was 10 votes for `TJmka325…` and 0 for `TFFLWM7t…`. ## Brokerage diff --git a/java/docs/commands/wallet.md b/java/docs/commands/wallet.md index f24ab3bfc..5855cefe5 100644 --- a/java/docs/commands/wallet.md +++ b/java/docs/commands/wallet.md @@ -26,7 +26,7 @@ Please input password. password: Please input password again. password: -Please enter 12 words (separated by spaces) [Attempt 1/3]: +Please enter 12 or 24 words (separated by spaces) [Attempt 1/3]: ``` ## ExportWalletMnemonic @@ -37,8 +37,8 @@ Export the mnemonic of the address in the wallet. 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 +exportWalletMnemonic successful !! +alert twist correct matter pass gather pit position stop empty coconut abandon ``` ## ExportWalletKeystore @@ -50,7 +50,7 @@ wallet> ExportWalletKeystore tronlink /tmp Please input your password. password: exported keystore file : /tmp/TYdhEg8b7tXm92UDbRDXPtJNU6T9xVGbbo.json -exportWalletKeystore successful !! +exportWalletKeystore successful !! ``` ## ImportWalletByKeystore @@ -59,12 +59,14 @@ Import a TronLink-format keystore file into wallet-cli. ```console wallet> ImportWalletByKeystore tronlink /tmp/tronlink.json +Please enter the password for the keystore file, enter it once. +password: Please input password. password: Please input password again. password: fileName = TYQq6zp51unQDNELmT4xKMWh5WLcwpCDZJ.json -importWalletByKeystore successful !! +importWalletByKeystore successful !! ``` ## ImportWalletByLedger @@ -74,7 +76,6 @@ Import a derived account from a Ledger device into wallet-cli. ```console wallet> ImportWalletByLedger (Note:This will pair Ledger to user your hardware 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: @@ -87,8 +88,8 @@ 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 +Please select an option, other inputs will exit this operation: 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. ``` @@ -113,11 +114,11 @@ wallet> GenerateSubAccount Please input your password. password: -=== Sub Account Generator === ------------------------------ +=== GenerateSubAccount Generator === +------------------------------- Default Address: TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo Default Path: m/44'/195'/0'/0/1 ------------------------------ +------------------------------- 1. Generate Default Path 2. Change Account @@ -125,8 +126,8 @@ Default Path: m/44'/195'/0'/0/1 Enter your choice (1-3): 1 mnemonic file : ./Mnemonic/TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json -Generate a sub account successful, keystore file name is TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json -generateSubAccount successful. +GenerateSubAccount successful, keystore file name is TYEhEg7b7tXm92UDbRDXPtJNU6T9xVGbbo.json +generateSubAccount successful. ``` ## ClearWalletKeystore @@ -139,16 +140,17 @@ 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 +Continue? (y/Y to proceed, c/C to cancel): +y Final confirmation: Please enter: 'DELETE' to confirm the delete operation: Confirm: (DELETE): DELETE -File deleted successfully: +Delete File successful: - /wallet-cli/Wallet/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json - /wallet-cli/Mnemonic/TABWx8yFhWrvZHbwKcCmFLyPLWjd2dZ2Rq.json -ClearWalletKeystore successful !!! +ClearWalletKeystore successful !!! ``` ## ResetWallet @@ -157,7 +159,6 @@ Delete all local wallet keystore files and mnemonic files, and follow the prompt ```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 @@ -180,14 +181,15 @@ Log in to multiple keystore accounts with a unified password. 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 + +No. Address Name +1 TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB main +2 TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew cold +3 TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7 test +4 TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json +5 TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada backup +Please choose No. between 1 and 5, or enter search to search wallets 5 LoginAll successful !!! ``` @@ -227,12 +229,14 @@ 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 + +No. Address Name +1 TJEEKTmaVTYSpJAxahtyuofnDSpe2seajB main +2 TX1L9xonuUo1AHsjUZ3QzH8wCRmKm56Xew cold +3 TVuVqnJFuuDxN36bhEbgDQS7rNGA5dSJB7 test +4 TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe Ledger-TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe.json +5 TYXFDtn86VPFKg4mkwMs45DKDcpAyqsada backup +Please choose No. between 1 and 5, or enter search to search wallets 5 SwitchWallet successful !!! ``` diff --git a/java/docs/guide/command-flow.md b/java/docs/guide/command-flow.md index 63defc19c..cbd528811 100644 --- a/java/docs/guide/command-flow.md +++ b/java/docs/guide/command-flow.md @@ -9,11 +9,13 @@ $ ./gradlew run > RegisterWallet (prompts twice for the password, then for mnemonic length) > login (prompts for the password) > getAddress -address = TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm' # backup it! +GetAddress successful !! +address = TRfwwLDpr4excH4V4QzghLEsdYwkapTxnm # backup it! > BackupWallet (prompts for the password) -priKey = 1234567890123456789012345678901234567890123456789012345678901234 # backup it!!! (BackupWallet2Base64 option) +BackupWallet successful !! +1234567890123456789012345678901234567890123456789012345678901234 # backup it!!! (BackupWallet2Base64 prints the same key base64-encoded) > getbalance -Balance = 0 +Balance = 0 SUN = 0.000000 TRX > 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 diff --git a/ts/README.md b/ts/README.md index 51aa90792..4556438a2 100644 --- a/ts/README.md +++ b/ts/README.md @@ -1,6 +1,6 @@ # wallet-cli — TypeScript implementation -The agent-first implementation of wallet-cli, built for automation: every command has a stable JSON envelope, deterministic exit codes, and discoverable schemas; interactive prompts are kept only for secret input (import / backup / delete). For what wallet-cli is and how the two implementations compare, see the [repository overview](../README.md); for the original, see the [Java implementation](../java/README.md). +The agent-first implementation of wallet-cli, built for automation: every command has a stable JSON envelope, deterministic exit codes, and discoverable schemas; interactive prompts are kept to a short allowlist — `create`, the `import` variants, `backup`, `change-password` and `delete` — and everywhere else a missing credential is an error, never a prompt. For what wallet-cli is and how the two implementations compare, see the [repository overview](../README.md); for the original, see the [Java implementation](../java/README.md). ## Key features @@ -27,7 +27,7 @@ The agent-first implementation of wallet-cli, built for automation: every comman ## Supported chains -Seven built-in networks are supported. Networks use a canonical `family:chain` id: +Seven built-in networks are supported. Networks use a canonical [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) `namespace:reference` id. The namespace is not the family: `eip155` is CAIP-2's namespace for EVM chains, while the family this CLI branches on is `evm`. | Network id | Family | Native coin | Environment | |---|---|---|---| @@ -83,8 +83,13 @@ wallet-cli create --label main ```console ✅ Created wallet "main" Account ID wlt_2dbv24de.0 + Type HD TRON address TTVdGTBXY5mmY3nJFGUp7Vo898kUJ6gtFQ + EVM address 0x5c8e1b04A7f39d62C0B3e85A1d47F9028b6ce713 Active yes + +⚠️ Recovery phrase is encrypted locally and was not printed. +⚠️ Run `backup` soon and store the file offline. ``` ```bash @@ -184,7 +189,7 @@ Every command supports `-o json` and then prints **exactly one** terminal JSON f 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) — built-in TRON/EVM networks and the `family:chain` id +- [Networks](docs/concepts/networks.md) — built-in TRON/EVM networks and the CAIP-2 `namespace:reference` 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 @@ -193,4 +198,4 @@ TRON differs a lot from EVM chains in fees, accounts, and key permissions — th 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:3448148188`). Mainnet commands move real funds; they appear only as annotated, non-copyable descriptions. +> Copy-pasteable examples that spend anything target a testnet — **Nile** (`--network tron:3448148188`) on TRON, **Sepolia** (`--network eip155:11155111`) on EVM. Mainnet ids (`tron:728126428`, `eip155:1`) also appear: in read-only examples such as token-book listings and config paths, and in a few illustrations of mainnet token contracts. Those last ones carry placeholder recipients (`T...` / `0x...`) and are not runnable as written. diff --git a/ts/docs/commands/account/activate.md b/ts/docs/commands/account/activate.md index ee5b4b645..7186fa376 100644 --- a/ts/docs/commands/account/activate.md +++ b/ts/docs/commands/account/activate.md @@ -12,7 +12,7 @@ wallet-cli account activate --address ## 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. +A TRON address doesn't exist on-chain until it receives its first asset or is explicitly created — until then `account set` refuses it with `not_found` (a plain `account info` still succeeds, returning an empty `account` object) 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. diff --git a/ts/docs/commands/account/info.md b/ts/docs/commands/account/info.md index 773ddf208..6746554c7 100644 --- a/ts/docs/commands/account/info.md +++ b/ts/docs/commands/account/info.md @@ -40,7 +40,7 @@ wallet-cli account info --network tron:3448148188 -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"account.info","data":{"address":"TNmoJ3Be59WFEq5dsW6eCkZjveiL3G8HVB","account":{"account_name":"71612d74657374","balance":"9915803110","create_time":1753860222000,"owner_permission":{},"active_permission":[{}],"frozenV2":[{},{"type":"ENERGY"},{"type":"TRON_POWER"}]},"resources":{"bandwidth":{"used":325,"limit":600},"energy":{"used":0,"limit":0}}},"meta":{"durationMs":746,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"account.info","data":{"address":"TNmoJ3Be59WFEq5dsW6eCkZjveiL3G8HVB","account":{"account_name":"71612d74657374","balance":"9915803110","create_time":1753860222000,"owner_permission":{"threshold":1,"keys":[{},{}]},"active_permission":[{}],"frozenV2":[{},{"type":"ENERGY"},{"type":"TRON_POWER"}]},"resources":{"bandwidth":{"used":325,"limit":600},"energy":{"used":0,"limit":0}}},"meta":{"durationMs":746,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` On an EVM network the same command reports the EVM account state: diff --git a/ts/docs/commands/account/portfolio.md b/ts/docs/commands/account/portfolio.md index b779b219a..b4c4c2e41 100644 --- a/ts/docs/commands/account/portfolio.md +++ b/ts/docs/commands/account/portfolio.md @@ -45,7 +45,7 @@ wallet-cli account portfolio --network tron:3448148188 -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"account.portfolio","data":{"network":"tron:3448148188","account":"wlt_gd2x8vyk","address":"TNmoJ3Be59WFEq5dsW6eCkZjveiL3G8HVB","priceSource":"coingecko","holdings":[{"kind":"native","symbol":"TRX","decimals":6,"rawBalance":"9915803110","balance":"9915.80311","priceUsd":0,"valueUsd":0},{"kind":"trc20","symbol":"USDT","decimals":6,"rawBalance":"17061463423","balance":"17061.463423","priceUsd":0,"valueUsd":0,"id":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf","name":"Tether USD","source":"official"}],"totalValueUsd":0},"meta":{"durationMs":724,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"account.portfolio","data":{"network":"tron:3448148188","account":"wlt_gd2x8vyk","address":"TNmoJ3Be59WFEq5dsW6eCkZjveiL3G8HVB","priceSource":"coingecko","holdings":[{"kind":"native","symbol":"TRX","decimals":6,"rawBalance":"9915803110","balance":"9915.80311","priceUsd":0,"valueUsd":0},{"kind":"trc20","symbol":"USDT","decimals":6,"rawBalance":"17061463423","balance":"17061.463423","priceUsd":0,"valueUsd":0,"id":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf","name":"Tether USD","source":"official"},{"kind":"trc20","symbol":"USDD","decimals":18,"rawBalance":"0","balance":"0","priceUsd":0,"valueUsd":0,"id":"TYQF9cAeJ3Faq8QXpHxTcFco72DRCQbgFt","name":"Usdd Stablecoin","source":"official"}],"totalValueUsd":0},"meta":{"durationMs":724,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` The same command on an EVM network, with `kind` reporting `erc20` instead of `trc20`: diff --git a/ts/docs/commands/account/set.md b/ts/docs/commands/account/set.md index 4bc9840a1..1209bb3cb 100644 --- a/ts/docs/commands/account/set.md +++ b/ts/docs/commands/account/set.md @@ -14,7 +14,7 @@ wallet-cli account set (--name | --id ) 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. +⚠️ **Each can be set only once and can never be changed** — the value is permanent, and there is no confirmation prompt. This is not a mainnet-only rule: the CLI refuses a second write with `name_already_set` / `id_already_set` on every network, Nile and Shasta included, so a testnet run is not a rehearsal you can repeat. This is different from [`rename`](../rename.md), which changes the local label and can be redone anytime. Requires the account. The master password via `--password-stdin` is needed only when the selected mode signs — `--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. The account id's uniqueness is enforced on-chain — a taken id fails with `id_taken`. @@ -24,8 +24,8 @@ Ledger support differs by field: the TRON app can sign `--name`, but cannot sign | 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 | +| `--name ` | **Required** (one of). On-chain account name, up to 32 bytes; can be set once, on any network | +| `--id ` | **Required** (one of). Account id, 8–32 bytes, globally unique; can be set once, on any network | | `--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 and estimate, output the **unsigned** hex (feed [`tx multisig --create`](../tx/multisig.md)). Excludes `--dry-run` / `--sign-only`; pairs with `--expiration` | @@ -71,7 +71,7 @@ echo "$PW" | wallet-cli account set --id acme-treasury-01 --network tron:3448148 ``` ```console -✅ Account id set +✅ On-chain id set Address TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw ID acme-treasury-01 TxID 3d9... diff --git a/ts/docs/commands/asset/index.md b/ts/docs/commands/asset/index.md index 6034f805e..aafe87065 100644 --- a/ts/docs/commands/asset/index.md +++ b/ts/docs/commands/asset/index.md @@ -30,7 +30,7 @@ wallet-cli asset COMMAND | `asset participate` | [participate.md](participate.md) | Buy into a token's ICO with TRX | | `asset unfreeze` | [unfreeze.md](unfreeze.md) | Release matured frozen supply | | `asset info` | [info.md](info.md) | Full detail of one TRC10 | -| `asset list` | [list.md](list.md) | List every TRC10 on chain | +| `asset list` | [list.md](list.md) | List TRC10 tokens, one page at a time | ## See also diff --git a/ts/docs/commands/asset/info.md b/ts/docs/commands/asset/info.md index 103320046..c5ffc06b1 100644 --- a/ts/docs/commands/asset/info.md +++ b/ts/docs/commands/asset/info.md @@ -101,7 +101,7 @@ wallet-cli asset info 1000123 --network tron:3448148188 -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"asset.info","data":{"kind":"asset-info","assetId":"1000123","name":"MyToken","abbr":"MTK","issuerAddress":"TQkXm4vN...","totalSupply":"1000000000000000","precision":6,"price":"1:100","trxNum":1000000,"num":100000000,"startTime":1785542400000,"endTime":1788134400000,"url":"https://mytoken.io","description":"Demo TRC10","freeAssetNetLimit":0,"publicFreeAssetNetLimit":0,"frozenSupply":[{"amount":"100000000000000","days":30,"expireTime":1788134400000},{"amount":"50000000000000","days":90,"expireTime":1793318400000}]},"meta":{"durationMs":26,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"asset.info","data":{"kind":"asset-info","assetId":"1000123","name":"MyToken","abbr":"MTK","issuerAddress":"TQkXm4vN...","totalSupply":"1000000000000000","precision":6,"price":"1:100","trxNum":1,"num":100,"startTime":1785542400000,"endTime":1788134400000,"url":"https://mytoken.io","description":"Demo TRC10","freeAssetNetLimit":0,"publicFreeAssetNetLimit":0,"frozenSupply":[{"amount":"100000000000000","days":30,"expireTime":1788134400000},{"amount":"50000000000000","days":90,"expireTime":1793318400000}]},"meta":{"durationMs":26,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` The ambiguous-name failure, in json: @@ -126,7 +126,7 @@ wallet-cli asset info MyToken --network tron:3448148188 -o json | `totalSupply` | string | Total supply, raw (whole tokens × 10^`precision`). A **string**: supplies reach int64 and would lose precision as a JSON number | | `precision` | number | Decimal places, 0–6 | | `price` | string | The issued rate as `trx:tokens`, in whole units — what text renders as `1 TRX = 100 MyToken` | -| `trxNum` / `num` | number | The same rate exactly as stored on chain, in sun and minimal units. For a `precision` of 6, `1:100` is stored as `1000000` / `100000000` | +| `trxNum` / `num` | number | The rate exactly as the chain stores it, in sun and minimal units, reduced to lowest terms when the token was issued. At a `precision` of 6, `1:100` is stored as `trxNum=1` / `num=100` | | `startTime` / `endTime` | number | ICO window, ms since epoch | | `url` / `description` | string | Project page and description | | `freeAssetNetLimit` / `publicFreeAssetNetLimit` | number | Free bandwidth per holder, and the shared pool | diff --git a/ts/docs/commands/asset/issue.md b/ts/docs/commands/asset/issue.md index 6033c3c43..0d3b5d341 100644 --- a/ts/docs/commands/asset/issue.md +++ b/ts/docs/commands/asset/issue.md @@ -24,9 +24,9 @@ Creates a TRC10 token and, in the same transaction, fixes the terms of its ICO: Amounts (`--supply`, `--freeze`) are in **whole tokens** — `--supply 1000000000 --precision 6` becomes an on-chain `total_supply` of `1000000000000000`. -Dates are read as **UTC**, as `YYYY-MM-DD` or `YYYY-MM-DD HH:mm:ss`; a bare date means `00:00:00`. `--start` must be later than the chain's current time, so a bare date is at the earliest tomorrow — to start a sale the same day, give the time as well. +Dates are read as **UTC**, as `YYYY-MM-DD` or `YYYY-MM-DD HH:mm:ss`; a bare date means `00:00:00`. `--start` must be later than **this machine's** clock at build time (the check is local, not a node read), so a bare date is at the earliest tomorrow — to start a sale the same day, give the time as well. The chain applies its own window check on top. -Constraints are checked locally before broadcast: `--name` and `--abbr` are 1–32 visible ASCII characters (`0x21`–`0x7E`, so no spaces and no non-ASCII); `--url` is required and at most 256 bytes; `--description` at most 200 bytes; `--precision` 0–6; `--end` after `--start`; each `--freeze` tranche's days within `getMinFrozenSupplyTime`…`getMaxFrozenSupplyTime`, the number of tranches within `getMaxFrozenSupplyNumber`, and their sum within the total supply; both free-bandwidth limits below `getOneDayNetLimit`. +Constraints are checked locally before broadcast: `--name` and `--abbr` are 1–32 visible ASCII characters (`0x21`–`0x7E`, so no spaces and no non-ASCII); `--url` is required and at most 256 bytes; `--description` at most 200 bytes; `--precision` 0–6; `--start` in the future and `--end` after `--start`; each `--freeze` tranche's amount and days greater than zero. One extra pre-flight read refuses an account that has already issued a TRC10, because the fee is burned either way. Every other bound belongs to the node — the chain's limits on frozen tranches (`getMinFrozenSupplyTime`, `getMaxFrozenSupplyTime`, `getMaxFrozenSupplyNumber`, and the tranche sum against the total supply) and on the free-bandwidth limits (`getOneDayNetLimit`) are enforced at broadcast, and violating one comes back as `transaction_rejected` in the node's own words. **By default the command returns at submission** (`stage: "submitted"`), not confirmation — add `--wait` to block until confirmed/failed. 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. @@ -71,28 +71,28 @@ echo "$PW" | wallet-cli asset issue --name MyToken --abbr MTK --supply 100000000 ```console ✅ Asset issued Asset MyToken (id 1000123) - Issuer TQkXm4vN...5Zt7Uw (main) + Issuer TQkXm4vN...5Zt7Uw Total supply 1,000,000,000 Precision 6 Price 1 TRX = 100 MyToken - ICO start time 2026-08-01 00:00 UTC - ICO end time 2026-08-31 00:00 UTC + ICO start time 2026-08-01 00:00:00 UTC + ICO end time 2026-08-31 00:00:00 UTC Url https://mytoken.io Description Demo TRC10 Free net/account 0 Public free net 0 - Frozen (2) - 100,000,000 for 30 days - 50,000,000 for 90 days + 100,000,000 for 30 days + 50,000,000 for 90 days TxID 7d1... - Block 57,883,010 - Fee 1,024 TRX (312 bandwidth) + Block #57,883,010 + Fee 1,024 TRX Status success ``` ```bash echo "$PW" | wallet-cli asset issue --name MyToken --abbr MTK --supply 1000000000 --price 1:100 --precision 6 \ - --start 2026-08-01 --end 2026-08-31 --url https://mytoken.io --network tron:3448148188 --wait --password-stdin -o json + --start 2026-08-01 --end 2026-08-31 --url https://mytoken.io --description "Demo TRC10" \ + --freeze 100000000:30 --freeze 50000000:90 --network tron:3448148188 --wait --password-stdin -o json ``` ```json @@ -108,11 +108,11 @@ echo "$PW" | wallet-cli asset issue --name MyToken --abbr MTK --supply 100000000 | default (submit) | `kind: "asset-issue"`, `stage: "submitted"`, `txId`, and the token definition below except `assetId` | | `--wait` (confirmed) | above, plus `stage: "confirmed"`, `confirmed` (boolean), `blockNumber`, flat settlement fields when returned (`feeSun`, `energyUsed`, `netUsed`, `energyFeeSun`, `netFeeSun`), `failed`, and `assetId` — assigned by the chain, so known only once confirmed | -Definition fields: `issuerAddress`, `name`, `abbr`, `totalSupply` (raw decimal string), `precision`, `price` (the `trx:tokens` string as given) with the stored `trxNum` / `num` pair, `startTime` / `endTime` (ms since epoch), `url`, `description`, `freeAssetNetLimit`, `publicFreeAssetNetLimit`, and `frozenSupply[]` (`amount` raw decimal string, `days`). Confirmation resource fields are flat; there is no `resource` object and the bandwidth field is `netUsed`, not `netUsage`. +Definition fields: `issuerAddress`, `name`, `abbr`, `totalSupply` (raw decimal string), `precision`, `price` (a `trx:tokens` string derived back from the stored pair, so it is the **reduced** rate, not necessarily what you typed — `--price 2:200 --precision 6` reports `"1:100"`) with the stored `trxNum` / `num` pair, `startTime` / `endTime` (ms since epoch), `url`, `description`, `freeAssetNetLimit`, `publicFreeAssetNetLimit`, and `frozenSupply[]` (`amount` raw decimal string, `days`). Confirmation resource fields are flat; there is no `resource` object and the bandwidth field is `netUsed`, not `netUsage`. ## Exit status -`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`already_issued_asset` — this account already issued one, `insufficient_balance` — below the issuance fee, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`missing_option` — a required flag is absent; `invalid_asset_name` — name or abbreviation outside 1–32 visible ASCII; `invalid_value` — rate, precision, dates, bandwidth limits, or frozen tranches out of range, or the rate exceeding int32 after conversion). +`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`already_issued_asset` — this account already issued one, `transaction_rejected` — the node refused it, e.g. the balance cannot cover the issuance fee or a chain-side bound was exceeded, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`missing_option` — a required flag is absent; `invalid_asset_name` — name or abbreviation outside 1–32 visible ASCII; `invalid_value` — a malformed or non-positive rate, precision, supply or frozen tranche, a malformed date, `--start` not in the future, `--end` not after `--start`, or the rate exceeding int32 after reduction). ## See also diff --git a/ts/docs/commands/asset/list.md b/ts/docs/commands/asset/list.md index c42de534d..d69d576ae 100644 --- a/ts/docs/commands/asset/list.md +++ b/ts/docs/commands/asset/list.md @@ -1,6 +1,6 @@ # wallet-cli asset list -List every TRC10 on chain. +List TRC10 tokens on chain, one page at a time. ## Synopsis diff --git a/ts/docs/commands/asset/participate.md b/ts/docs/commands/asset/participate.md index e7d43f676..b2beac98e 100644 --- a/ts/docs/commands/asset/participate.md +++ b/ts/docs/commands/asset/participate.md @@ -14,7 +14,7 @@ wallet-cli asset participate --pay Buys from a token's issuance inside its funding window, at the fixed rate set when it was issued. This is participation in the ICO, not a market trade — the tokens come out of the issuer's remaining supply, and the price is not negotiable. The issuer's address is resolved from the token, so there is nothing to pass for it. -**`--pay` is the TRX you spend, not the tokens you receive.** You get `floor(pay × tokens ÷ trx)` where `trx:tokens` is the token's issued rate — the amount paid times the unit price, rounded down, since the chain multiplies before dividing on integers. The TRX is transferred in full, so any truncated remainder is not refunded; the loss is under 1 sun and cannot occur at all when the rate's `trxNum` is 1. If `--pay` is too small to buy even one unit, the command fails locally rather than broadcasting. +**`--pay` is the TRX you spend, not the tokens you receive.** You get `floor(pay × tokens ÷ trx)` where `trx:tokens` is the token's issued rate — the amount paid times the unit price, rounded down, since the chain multiplies before dividing on integers. The TRX is transferred in full, so any truncated remainder is not refunded. What is lost is under one **token minimal unit**, and the chain stores that unit's price as the pair `trxNum:num` — `trxNum` sun buys `num` minimal units — so the discarded amount is under `trxNum ÷ num` sun. At `--price 1:100 --precision 6` that is 0.01 sun, i.e. nothing; at `--price 1:100 --precision 0` the pair reduces to `10000:1` and the worst case is 9,999 sun. If `--pay` is too small to buy even one unit, the command fails locally rather than broadcasting. The acting account cannot be the token's own issuer. @@ -52,12 +52,12 @@ echo "$PW" | wallet-cli asset participate 1000124 --pay 100 --network tron:34481 ✅ Participated in ICO Asset BetaToken (id 1000124) Issuer TBeta9mR...8pLx - Participant TQkXm4vN...5Zt7Uw (main) + Participant TQkXm4vN...5Zt7Uw Paid 100 TRX Received 10,000 BetaToken TxID 4c8... - Block 57,883,402 - Fee 0 TRX (301 bandwidth) + Block #57,883,402 + Fee 0 TRX Status success ``` @@ -82,7 +82,7 @@ echo "$PW" | wallet-cli asset participate 1000124 --pay 100 --network tron:34481 ## Exit status -`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`asset_not_found` — no such token, `not_in_ico_window` — outside the funding window, `self_participation` — you issued this token, `insufficient_balance`, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`missing_option` — no `--pay`; `invalid_amount` — `--pay` is not a decimal number, or has more than 6 decimal places; `invalid_value` — `--pay` ≤ 0, or too small to buy one unit). +`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`asset_not_found` — no such token, `not_in_ico_window` — outside the funding window, `self_participation` — you issued this token, `transaction_rejected` — the node refused it, e.g. the balance cannot cover `--pay`, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`missing_option` — no `--pay`; `invalid_amount` — `--pay` is not a decimal number, or has more than 6 decimal places; `invalid_value` — `--pay` ≤ 0, or too small to buy one unit). ## See also diff --git a/ts/docs/commands/asset/unfreeze.md b/ts/docs/commands/asset/unfreeze.md index 4dc186f01..8e9c15640 100644 --- a/ts/docs/commands/asset/unfreeze.md +++ b/ts/docs/commands/asset/unfreeze.md @@ -51,12 +51,12 @@ echo "$PW" | wallet-cli asset unfreeze --network tron:3448148188 --wait --passwo ```console ✅ Frozen supply released Asset MyToken (id 1000123) - Issuer TQkXm4vN...5Zt7Uw (main) + Issuer TQkXm4vN...5Zt7Uw Released 100,000,000 MyToken Still frozen 50,000,000 MyToken TxID 6a5... - Block 57,883,560 - Fee 0 TRX (288 bandwidth) + Block #57,883,560 + Fee 0 TRX Status success ``` @@ -74,10 +74,10 @@ echo "$PW" | wallet-cli asset unfreeze --network tron:3448148188 --wait --passwo | Stage | Fields | |---|---| -| default (submit) | `kind: "asset-unfreeze"`, `stage: "submitted"`, `txId`, `assetId`, `name`, `issuerAddress` | -| `--wait` (confirmed) | above, plus `stage: "confirmed"`, `confirmed` (boolean), `blockNumber`, flat settlement fields when returned (`feeSun`, `energyUsed`, `netUsed`, `energyFeeSun`, `netFeeSun`), `failed`, `releasedAmount`, `stillFrozenAmount` | +| default (submit) | `kind: "asset-unfreeze"`, `stage: "submitted"`, `txId`, `assetId`, `name`, `issuerAddress`, `precision`, and `releasedAmount` / `stillFrozenAmount` — present here too, but as the amounts this command *intends* to release | +| `--wait` (confirmed) | above, plus `stage: "confirmed"`, `confirmed` (boolean), `blockNumber`, flat settlement fields when returned (`feeSun`, `energyUsed`, `netUsed`, `energyFeeSun`, `netFeeSun`), and `failed`; `releasedAmount` is then taken from the receipt | -`releasedAmount` and `stillFrozenAmount` are raw decimal strings (smallest unit); `precision` is included for scaling. The confirmed `releasedAmount` reflects what the receipt reports. +`releasedAmount` and `stillFrozenAmount` are raw decimal strings (smallest unit); `precision` is included for scaling. Both are always present — before confirmation they are this command's own computation from the asset's frozen tranches, and only the confirmed `releasedAmount` is the receipt's number. ## Exit status diff --git a/ts/docs/commands/asset/update.md b/ts/docs/commands/asset/update.md index 7cd60e6fa..94d39a4a3 100644 --- a/ts/docs/commands/asset/update.md +++ b/ts/docs/commands/asset/update.md @@ -52,14 +52,14 @@ echo "$PW" | wallet-cli asset update --url https://mytoken.io/v2 --network tron: ```console ✅ Asset updated Asset MyToken (id 1000123) - Issuer TQkXm4vN...5Zt7Uw (main) + Issuer TQkXm4vN...5Zt7Uw Url https://mytoken.io/v2 Description Demo TRC10 Free net/account 0 Public free net 0 TxID 9e3... - Block 57,883,190 - Fee 0 TRX (295 bandwidth) + Block #57,883,190 + Fee 0 TRX Status success ``` @@ -84,7 +84,7 @@ The four fields are `url`, `description`, `freeAssetNetLimit`, and `publicFreeAs ## Exit status -`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`not_an_issuer` — this account has not issued a TRC10, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`missing_option` — no field given; `invalid_value` — URL or description too long, bandwidth limits out of range). +`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`not_an_issuer` — this account has not issued a TRC10, `watch_only_no_signer`, `ledger_unsupported`, `auth_failed`) · `2` usage error (`invalid_value` — no field given at all, or a URL / description that is too long; the command has no required flag, so a bare call is `invalid_value`, not `missing_option`). ## See also diff --git a/ts/docs/commands/backup.md b/ts/docs/commands/backup.md index 572279c2c..93c667915 100644 --- a/ts/docs/commands/backup.md +++ b/ts/docs/commands/backup.md @@ -69,7 +69,7 @@ printf '%s' "$PW" | wallet-cli backup main --password-stdin ``` ```console -⚠️ Backup written ./wlt_d1qbj2fb.0-1783751611076.json +⚠️ Backup written /home/you/wlt_d1qbj2fb.0-1783751611076.json Account ID wlt_d1qbj2fb.0 Secret recovery phrase File mode 0600 @@ -85,7 +85,7 @@ printf '%s' "$PW" | wallet-cli backup main --keystore --password-stdin ``` ```console -⚠️ Keystore written ./wlt_d1qbj2fb.0-1785930000.keystore.json +⚠️ Keystore written /home/you/wlt_d1qbj2fb.0-1785930000.keystore.json Account ID wlt_d1qbj2fb.0 Family tron Secret private key @@ -100,7 +100,7 @@ printf '%s' "$PW" | wallet-cli backup main --keystore --out ./main.keystore.json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"backup","data":{"accountId":"wlt_d1qbj2fb.0","label":"main","type":"seed","index":0,"active":true,"addresses":{"tron":"TQkXm4vN...5Zt7Uw","evm":"0x7B28FE10...46C9C"},"seedId":"wlt_d1qbj2fb","derivationPath":{"tron":"m/44'/195'/0'/0/0","evm":"m/44'/60'/0'/0/0"},"family":"tron","secretType":"privateKey","format":"keystore","out":"./main.keystore.json","fileMode":"0600","bytes":491},"meta":{"durationMs":1420,"warnings":[]},"chain":{"family":"tron","network":"tron:728126428","chainId":"728126428"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"backup","data":{"accountId":"wlt_d1qbj2fb.0","label":"main","type":"seed","index":0,"active":true,"addresses":{"tron":"TQkXm4vN...5Zt7Uw","evm":"0x86B3D0f2...f4106"},"seedId":"wlt_d1qbj2fb","derivationPath":{"tron":"m/44'/195'/0'/0/0","evm":"m/44'/60'/0'/0/0"},"family":"tron","secretType":"privateKey","format":"keystore","out":"/home/you/main.keystore.json","fileMode":"0600","bytes":491},"meta":{"durationMs":1420,"warnings":[]},"chain":{"family":"tron","network":"tron:728126428","chainId":"728126428"}} ``` The audit log: @@ -111,11 +111,11 @@ wallet-cli backup --records --limit 3 ```console Backup records (showing 3 of 12) -| Time (UTC) | Exported account | Operation | File | -| ---------------- | ------------------------ | ----------------- | ----------------------------------------- | -| 2026-08-05 11:40 | TQkXm4vN...5Zt7Uw (main) | backup --keystore | ./wlt_d1qbj2fb.0-1785930000.keystore.json | -| 2026-08-04 09:12 | TQkXm4vN...5Zt7Uw (main) | backup | ./wlt_d1qbj2fb.0-1785834720.json | -| 2026-07-30 22:03 | TBeta9mR...8pLx | backup | ./tbeta-seed.json | +| Time (UTC) | Exported account | Operation | File | +| ---------------- | ------------------------ | ----------------- | ------------------------------------------------- | +| 2026-08-05 11:40 | TQkXm4vN...5Zt7Uw (main) | backup --keystore | /home/you/wlt_d1qbj2fb.0-1785930000.keystore.json | +| 2026-08-04 09:12 | TQkXm4vN...5Zt7Uw (main) | backup | /home/you/wlt_d1qbj2fb.0-1785834720.json | +| 2026-07-30 22:03 | TBeta9mR...8pLx | backup | /home/you/tbeta-seed.json | ``` ```bash @@ -123,7 +123,7 @@ wallet-cli backup --records --limit 3 -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"backup.records","data":{"records":[{"operation":"backup --keystore","accountId":"wlt_d1qbj2fb.0","account":"TQkXm4vN...5Zt7Uw","label":"main","out":"./wlt_d1qbj2fb.0-1785930000.keystore.json","timestamp":"2026-08-05T11:40:00Z"},{"operation":"backup","accountId":"wlt_d1qbj2fb.0","account":"TQkXm4vN...5Zt7Uw","label":"main","out":"./wlt_d1qbj2fb.0-1785834720.json","timestamp":"2026-08-04T09:12:00Z"},{"operation":"backup","accountId":"wlt_9x3k2m7p.0","account":"TBeta9mR...8pLx","label":null,"out":"./tbeta-seed.json","timestamp":"2026-07-30T22:03:00Z"}]},"meta":{"durationMs":8,"warnings":[],"pagination":{"offset":0,"limit":3,"total":12}},"chain":{"family":"tron","network":"tron:728126428","chainId":"728126428"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"backup.records","data":{"records":[{"operation":"backup --keystore","accountId":"wlt_d1qbj2fb.0","account":"TQkXm4vN...5Zt7Uw","family":"tron","label":"main","out":"/home/you/wlt_d1qbj2fb.0-1785930000.keystore.json","timestamp":"2026-08-05T11:40:00Z"},{"operation":"backup","accountId":"wlt_d1qbj2fb.0","account":"TQkXm4vN...5Zt7Uw","label":"main","out":"/home/you/wlt_d1qbj2fb.0-1785834720.json","timestamp":"2026-08-04T09:12:00Z"},{"operation":"backup","accountId":"wlt_9x3k2m7p.0","account":"TBeta9mR...8pLx","label":null,"out":"/home/you/tbeta-seed.json","timestamp":"2026-07-30T22:03:00Z"}]},"meta":{"durationMs":8,"warnings":[],"pagination":{"offset":0,"limit":3,"total":12}},"chain":{"family":"tron","network":"tron:728126428","chainId":"728126428"}} ``` ## Output @@ -145,7 +145,7 @@ Both forms are local and contact no node, but `backup` has an optional network d | `seedId` | string | Owning seed wallet id (`seed` accounts only) | | `secretType` | string | Kind of exported secret — `mnemonic`, or `privateKey` with `--keystore` | | `format` | string | `keystore` when `--keystore` was used | -| `out` | string | Path written | +| `out` | string | **Absolute** path written — a relative `--out` is resolved against the working directory before it is reported | | `fileMode` | string | File permissions, always `0600` | | `bytes` | number | File size in bytes | @@ -155,7 +155,7 @@ Both forms are local and contact no node, but `backup` has an optional network d |---|---|---| | `operation` | string | `backup` or `backup --keystore` | | `accountId` / `account` / `label` | string \| null | The account whose secret was exported; `label` is `null` when unset | -| `out` | string | File the secret went to | +| `out` | string | File the secret went to, as an **absolute** path | | `timestamp` | string | Export time, UTC | `meta.pagination` carries `offset`, `limit` (`null` = unlimited), and `total`. diff --git a/ts/docs/commands/block.md b/ts/docs/commands/block.md index b89366f42..edb9296bb 100644 --- a/ts/docs/commands/block.md +++ b/ts/docs/commands/block.md @@ -37,7 +37,7 @@ wallet-cli block 70433745 --network tron:3448148188 -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"block","data":{"block":{"blockID":"0000000041e6a3c3…","block_header":{"raw_data":{"number":69093315,"txTrieRoot":"…","witness_address":"41…","parentHash":"…","version":31,"timestamp":1783783761000},"witness_signature":"…"},"transactions":[{}]}},"meta":{"durationMs":126,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"block","data":{"block":{"blockID":"0000000041e6a3c3…","block_header":{"raw_data":{"number":70433745,"txTrieRoot":"…","witness_address":"41…","parentHash":"…","version":31,"timestamp":1787818674000},"witness_signature":"…"},"transactions":[{}]}},"meta":{"durationMs":126,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` On an EVM network the text summary carries the gas and fee figures a block actually has: diff --git a/ts/docs/commands/chain/node.md b/ts/docs/commands/chain/node.md index 6524bb903..913a13dc1 100644 --- a/ts/docs/commands/chain/node.md +++ b/ts/docs/commands/chain/node.md @@ -12,7 +12,7 @@ wallet-cli chain node [options] Shows the connected node's version, head/solid block heights, sync state, and peer counts, on TRON and EVM networks alike. Its job in troubleshooting: separate "the node is out of sync" from "something is wrong with my transaction" before you start debugging the latter. -How the numbers are made: on TRON, version, block heights and peers come from the node's `getnodeinfo`, and the sync verdict is a freshness check — the head block header's timestamp against the local clock, within 3 block intervals (TRON produces a block every 3 s, so 9 s). On EVM the fields come from `web3_clientVersion`, `eth_chainId`, `eth_syncing`, `net_peerCount` and the latest block, and the verdict is the node's own `eth_syncing` answer rather than a guess from timestamps — the text `Syncing` row is that same verdict read the other way round. Public gateways (TronGrid, public RPC providers) may hide some fields (peers, machine info); those rows show `—` (json `null`). +How the numbers are made: on TRON, version, the solid block height and peers come from the node's `getnodeinfo`, while the **head** block number and timestamp come from a separate `getBlock()` read; the sync verdict is a freshness check — the head block header's timestamp against the local clock, within 3 block intervals (TRON produces a block every 3 s, so 9 s). On EVM the fields come from `web3_clientVersion`, `eth_chainId`, `eth_syncing`, `net_peerCount` and the latest block, and the verdict is the node's own `eth_syncing` answer rather than a guess from timestamps — the text `Syncing` row is that same verdict read the other way round. Public gateways (TronGrid, public RPC providers) may hide some fields (peers, machine info); those rows show `—` (json `null`). The `endpoint` is reported as a **host only**, never the full URL — a commercial RPC endpoint often carries its API key in the path, and this is output people paste into issues and CI logs. Read the full value with `config networks..httpEndpoint`. diff --git a/ts/docs/commands/chain/params.md b/ts/docs/commands/chain/params.md index 0fb05b32f..a9fabc104 100644 --- a/ts/docs/commands/chain/params.md +++ b/ts/docs/commands/chain/params.md @@ -76,7 +76,7 @@ wallet-cli chain params --network tron:3448148188 -o json | Field | Type | Meaning | |---|---|---| | `key` | string | Parameter name, verbatim from the chain | -| `value` | number | Raw chain value, no unit suffix (text adds SUN / ms) | +| `value` | number | Raw chain value, no unit suffix (text adds SUN / ms). Absent altogether for a parameter the node reports without one. The port that carries it is typed `number \| string`, but the TronWeb gateway behind it only ever yields numbers | ## Exit status diff --git a/ts/docs/commands/chain/prices.md b/ts/docs/commands/chain/prices.md index a37c43286..7da7de8c7 100644 --- a/ts/docs/commands/chain/prices.md +++ b/ts/docs/commands/chain/prices.md @@ -80,8 +80,8 @@ EVM: | Field | Type | Meaning | |---|---|---| | `feeModel` | string | `eip1559` or `legacy` | -| `baseFeeWei` | string | The latest block's base fee per gas; EIP-1559 chains only | -| `priorityFeeWei` | string | The node's suggested tip per gas | +| `baseFeeWei` | string | The latest block's base fee per gas; EIP-1559 chains only. A zero base fee is reported as `"0"`, not omitted | +| `priorityFeeWei` | string \| null | The node's suggested tip per gas; `null` when the node suggests none. Present on EIP-1559 chains only, alongside `baseFeeWei` | | `gasPriceWei` | string | Price per gas at those numbers | | `transferGas` | number | `21000` — the gas a plain native transfer costs | | `transferCostWei` | string | `transferGas × gasPriceWei`, i.e. what that transfer would cost now | diff --git a/ts/docs/commands/change-password.md b/ts/docs/commands/change-password.md index dd63cc452..e7ac2c2f0 100644 --- a/ts/docs/commands/change-password.md +++ b/ts/docs/commands/change-password.md @@ -36,14 +36,13 @@ wallet-cli change-password ``` ```console -? Current master password (hidden): +? Master password (hidden): ? New master password (hidden): -? Confirm new password (hidden): +? Confirm new password: ? Re-encrypt 3 software wallet(s) with the new password? [y/N]: y ✅ Master password changed — re-encrypted 3 software wallet(s) Wallets wallet1, wallet2, imported-1 - -⚠️ Ledger / watch-only accounts have no secrets and are unaffected. + Note Ledger / watch-only accounts are unaffected ``` ## Output diff --git a/ts/docs/commands/config.md b/ts/docs/commands/config.md index b6615b2d3..d30edfba5 100644 --- a/ts/docs/commands/config.md +++ b/ts/docs/commands/config.md @@ -25,7 +25,7 @@ Known keys: |---|---|---|---| | `defaultNetwork` | network id | `tron:728126428` | Network used when `--network` is omitted | | `defaultOutput` | `text` \| `json` | `text` | Output format when `-o` is omitted | -| `timeoutMs` | integer ms | `60000` | Default per RPC/device call timeout (`--timeout` overrides) | +| `timeoutMs` | ms, any finite number > 0 | `60000` | Default per node, service, or device call timeout (`--timeout` overrides). Unlike `waitTimeoutMs` it is not required to be an integer | | `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 | @@ -71,12 +71,27 @@ networks httpEndpoint api.trongrid.io tron:3448148188 httpEndpoint nile.trongrid.io + tron:2494104990 + httpEndpoint api.shasta.trongrid.io + eip155:1 + httpEndpoint ethereum-rpc.publicnode.com eip155:11155111 httpEndpoint ethereum-sepolia-rpc.publicnode.com + eip155:56 + httpEndpoint bsc-dataseed.bnbchain.org + eip155:97 + httpEndpoint bsc-testnet-dataseed.bnbchain.org aliases - tron tron:728126428 - nile tron:3448148188 - sepolia eip155:11155111 + tron tron:728126428 + tron:mainnet tron:728126428 + nile tron:3448148188 + tron:nile tron:3448148188 + shasta tron:2494104990 + tron:shasta tron:2494104990 + ethereum eip155:1 + sepolia eip155:11155111 + bsc eip155:56 + bsc-testnet eip155:97 tronlinkSecretId TEST tronlinkSecretKey ******** tronlinkChannel test diff --git a/ts/docs/commands/contact/list.md b/ts/docs/commands/contact/list.md index 8b1f643e6..e6f04ae84 100644 --- a/ts/docs/commands/contact/list.md +++ b/ts/docs/commands/contact/list.md @@ -23,9 +23,10 @@ wallet-cli contact list ``` ```console -Name Address Note -alice TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub Alice mainnet -bob TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz — +| Name | Address | Note | +| ----- | ---------------------------------- | ------------- | +| alice | TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub | Alice mainnet | +| bob | TXe4Kd8nP2rF9gH5jL3mV6cW1bN7yS0aQz | — | ``` ```bash diff --git a/ts/docs/commands/contract/call.md b/ts/docs/commands/contract/call.md index e2fecbb59..c3a6e3b99 100644 --- a/ts/docs/commands/contract/call.md +++ b/ts/docs/commands/contract/call.md @@ -43,7 +43,7 @@ wallet-cli contract call --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf --method {"schema":"wallet-cli.result.v1","success":true,"command":"contract.call","data":{"contract":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf","method":"balanceOf(address)","result":["0000000000000000000000000000000000000000000000000000000000000000"]},"meta":{"durationMs":15,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` -The same call on an EVM network. Note the shape of `result`: the TRON node returns the return data split into words, the EVM node returns it as one `0x` blob: +The same call on an EVM network. Note the shape of `result`: TRON passes the node's `constant_result` array through untouched, while the EVM node returns one `0x` blob: ```bash wallet-cli contract call --contract 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 --method "balanceOf(address)" --params '[{"type":"address","value":"0x541B10b92b45C08513e67bb8209f035D810212B6"}]' --network eip155:11155111 @@ -64,7 +64,7 @@ Result 0x0000000000000000000000000000000000000000000000000000000000000000 (raw) |---|---|---| | `contract` | string | Contract address called | | `method` | string | Method signature invoked | -| `result` | string[] \| string | Raw ABI-encoded return data; an array of 32-byte words on TRON, a single `0x` string on EVM. Decode per the method's return type | +| `result` | string[] \| string | Raw ABI-encoded return data. On TRON it is the node's `constant_result` array verbatim — the CLI does no splitting or re-chunking; on EVM, a single `0x` string. Decode per the method's return type | ## Exit status diff --git a/ts/docs/commands/contract/create2.md b/ts/docs/commands/contract/create2.md index 6318b0461..207eb53a6 100644 --- a/ts/docs/commands/contract/create2.md +++ b/ts/docs/commands/contract/create2.md @@ -58,7 +58,7 @@ wallet-cli contract create2 --deployer TQkXm4vN...5Zt7Uw --code 6080604052... -- ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"contract.create2","data":{"deployerAddress":"TQkXm4vN...","salt":255,"saltHex":"0x00000000000000000000000000000000000000000000000000000000000000ff","codeHash":"c8f4a1...b91b","address":"TWq8dK3n...2mHb"},"meta":{"durationMs":3,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"contract.create2","data":{"deployerAddress":"TQkXm4vN...","salt":255,"saltHex":"0x00000000000000000000000000000000000000000000000000000000000000ff","codeHash":"c8f4a1...b91b","address":"TWq8dK3n...2mHb"},"meta":{"durationMs":3,"warnings":[]},"chain":{"family":"tron","network":"tron:728126428","chainId":"728126428"}} ``` ## Output @@ -66,12 +66,12 @@ wallet-cli contract create2 --deployer TQkXm4vN...5Zt7Uw --code 6080604052... -- | Field | Type | Meaning | |---|---|---| | `deployerAddress` | string | The deployer as given, base58 | -| `salt` | number | The salt as given, decimal | +| `salt` | number \| string | The salt as given, decimal. A **string** when it falls outside the safe-integer range, so a full int64 salt survives JSON | | `saltHex` | string | The zero-padded 32 bytes that actually enter the hash | | `codeHash` | string | `keccak256` of the creation bytecode | | `address` | string | The resulting contract address, base58 | -This is a local command, so the envelope carries no `chain` block. +The command never contacts a node, but it is still a TRON chain command: the envelope carries the usual `chain` block for the selected network. `--network` is optional here and only picks which network the block names. ## Exit status diff --git a/ts/docs/commands/contract/deploy.md b/ts/docs/commands/contract/deploy.md index 8a1dae8b6..80dd8add3 100644 --- a/ts/docs/commands/contract/deploy.md +++ b/ts/docs/commands/contract/deploy.md @@ -137,7 +137,7 @@ echo "$PW" | wallet-cli contract deploy --artifact ./build/contracts/Token.json | `--dry-run` | `kind`, `mode: "dry-run"`, `contractAddress`, `fee`, the unsigned `tx` (plus `nonce` on EVM) | | `--sign-only` / `--build-only` | `kind`, `mode`, `hex`, `fee`, the transaction object | -`contractAddress` is computed locally from the deployer and nonce, so it is known before the transaction confirms. +`contractAddress` is known before the transaction confirms, but each family derives it differently. On EVM it is computed locally from the deployer and the nonce. On TRON the address is derived from the final txID, so it is read back from the prepared transaction — after `--permission-id` / `--expiration` have been bound and the txID is settled — rather than computed from the builder's output. ## Exit status diff --git a/ts/docs/commands/contract/send.md b/ts/docs/commands/contract/send.md index 0c3aff0ee..eb34b777a 100644 --- a/ts/docs/commands/contract/send.md +++ b/ts/docs/commands/contract/send.md @@ -72,8 +72,9 @@ echo "$PW" | wallet-cli contract send --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkA ```console ⏳ Called transfer - TxID c8d... - Status pending — not yet on-chain + Contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf + TxID c8d... + Status pending — not yet on-chain ! Track it: wallet-cli tx info --network tron:3448148188 --txid c8d... ``` @@ -109,11 +110,12 @@ echo "$PW" | wallet-cli contract send --contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkA ```console ❌ Called transfer - TxID c8d... - Block #66,000,123 - Energy 31,200 - Status failed - Reason OUT_OF_ENERGY + Contract TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf + TxID c8d... + Block #66,000,123 + Energy 31,200 + Status failed + Reason OUT_OF_ENERGY ``` ## Output diff --git a/ts/docs/commands/create.md b/ts/docs/commands/create.md index e76d7691c..9a69a4b77 100644 --- a/ts/docs/commands/create.md +++ b/ts/docs/commands/create.md @@ -40,7 +40,7 @@ wallet-cli create --label main Account ID wlt_2dbv24de.0 Type HD TRON address TTVdGTBXY5mmY3nJFGUp7Vo898kUJ6gtFQ - EVM address 0x7B28FE10FBccE88c3967ff0Fd64f1ffB46b46C9C + EVM address 0x5c8e1b04A7f39d62C0B3e85A1d47F9028b6ce713 Active yes ⚠️ Recovery phrase is encrypted locally and was not printed. @@ -54,7 +54,7 @@ printf '%s' "$PW" | wallet-cli create --label main --password-stdin -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"create","data":{"status":"created","accountId":"wlt_2dbv24de.0","label":"main","type":"seed","index":0,"active":true,"addresses":{"tron":"TTVdGTBXY5mmY3nJFGUp7Vo898kUJ6gtFQ","evm":"0x7B28FE10FBccE88c3967ff0Fd64f1ffB46b46C9C"},"seedId":"wlt_2dbv24de","derivationPath":{"tron":"m/44'/195'/0'/0/0","evm":"m/44'/60'/0'/0/0"}},"meta":{"durationMs":38,"warnings":[]}} +{"schema":"wallet-cli.result.v1","success":true,"command":"create","data":{"status":"created","accountId":"wlt_2dbv24de.0","label":"main","type":"seed","index":0,"active":true,"addresses":{"tron":"TTVdGTBXY5mmY3nJFGUp7Vo898kUJ6gtFQ","evm":"0x5c8e1b04A7f39d62C0B3e85A1d47F9028b6ce713"},"seedId":"wlt_2dbv24de","derivationPath":{"tron":"m/44'/195'/0'/0/0","evm":"m/44'/60'/0'/0/0"}},"meta":{"durationMs":38,"warnings":[]}} ``` ## Output diff --git a/ts/docs/commands/current.md b/ts/docs/commands/current.md index c3fbe4a6f..9826c0d38 100644 --- a/ts/docs/commands/current.md +++ b/ts/docs/commands/current.md @@ -12,7 +12,7 @@ wallet-cli current [options] | Option | Description | |---|---| -| `--qr` | Also render the receive address for the selected network as a scannable QR code in the terminal, with the full address printed above it for manual verification; text output only | +| `--qr` | Also render the receive address for the selected network 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). @@ -30,9 +30,9 @@ Active account: main EVM address 0x7B28FE10FBccE88c3967ff0Fd64f1ffB46b46C9C ``` -With `--account`, the header reads `Selected account:` instead of `Active account:`. +The header follows `data.active`, not the flag: it reads `Selected account:` when `--account` names an account other than the active one, and stays `Active account:` otherwise — including when `--account` happens to name the active account. -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: +Add `--qr` to also render the active account's address as a scannable receive QR code, drawn with block characters after the address list and followed by a `Receive address` line carrying the full value. Purely local — the address comes from local keystore metadata, no node access: ```bash wallet-cli current --qr @@ -43,7 +43,8 @@ Active account: main TRON address TE9kPMtaMjfZN95CuPRsCHUQGWwx9EcJW8 EVM address 0x7B28FE10FBccE88c3967ff0Fd64f1ffB46b46C9C - [ scannable QR code of the TRON address, drawn in the terminal ] +[ scannable QR code of the TRON address, drawn in the terminal ] +Receive address TE9kPMtaMjfZN95CuPRsCHUQGWwx9EcJW8 ``` The QR encodes **one** address — the receive address for the selected network. Pass `--network` to choose which: @@ -88,7 +89,7 @@ error [missing_wallet_address]: no active account; import one first | `index` | number \| null | HD derivation index; `null` for non-HD accounts | | `active` | boolean | `true` for the active account; `false` when `--account` selected a different one | | `addresses` | object | One entry per family the account can produce: `tron` (base58) and/or `evm` (`0x`, EIP-55 checksummed) | -| `derivationPath` | object \| null | Per-family BIP32 path for `seed` accounts; `null` otherwise | +| `derivationPath` | object \| null | The BIP32 path behind each address: every family for a `seed` account, the single chosen path for a `ledger` account; `null` for `privateKey` and `watch`, which were never derived | | `seedId` | string | Owning seed wallet id (`seed` accounts only) | | `family` | string | Chain family this account is bound to — single-family accounts (`watch`, `ledger`) only | | `receiveAddress` | string | Present in JSON only when `--qr` was requested; address selected by `--network` | diff --git a/ts/docs/commands/delete.md b/ts/docs/commands/delete.md index db92b1ad1..901d6c862 100644 --- a/ts/docs/commands/delete.md +++ b/ts/docs/commands/delete.md @@ -67,7 +67,7 @@ wallet-cli delete main-1 --yes -o json |---|---|---| | `accountId` | string | Id of the deleted account/wallet (`wlt_….N` for a sub-account, the wallet id `wlt_…` for a wallet) | | `scope` | string | `account` (only that account) or `wallet` (cascaded whole wallet) | -| `secretRemoved` | boolean | Whether the key was removed (deleting an HD sub-account keeps the seed = `false`; deleting a wallet = `true`) | +| `secretRemoved` | boolean | Whether encrypted secret material was removed. Deleting an HD sub-account keeps the seed, so `false`. Deleting a wallet reports whether that wallet held a secret at all: `true` for seed and private-key wallets, `false` for Ledger and watch-only ones, which never stored one | | `newActive` | string \| null | New active account id after deletion; `null` if none remain | ## Exit status diff --git a/ts/docs/commands/derive.md b/ts/docs/commands/derive.md index 5e6224452..980c6256a 100644 --- a/ts/docs/commands/derive.md +++ b/ts/docs/commands/derive.md @@ -13,7 +13,7 @@ wallet-cli derive --seed-id [--index ] [--label ] [options] | Option | Description | |---|---| | `--seed-id ` | seed id of the HD wallet to derive from — the HD group header in `list` [required] | -| `--index ` | explicit HD account index; omit to use the next free index | +| `--index ` | explicit HD account index; omit to use the next free index. An index that already exists is not re-derived — the existing account is made active and `status` comes back `"existing"` | | `--label ` | label for the new account, 1-64 chars; omit to auto-generate | | `--password-stdin` | read the master password from stdin (fd 0) | @@ -55,7 +55,7 @@ printf '%s' "$PW" | wallet-cli derive --seed-id wlt_y8cz6xda --password-stdin -o | Field | Type | Meaning | |---|---|---| -| `status` | string | `"created"` | +| `status` | string | `"created"` for a newly derived index, `"existing"` when `--index` names an index this wallet already holds — that account is simply made active again, and no new key is derived | | `accountId` | string | Stable id `.` | | `label` | string | Account label (default `-`, e.g. `main-1`) | | `type` | string | Always `"seed"` | diff --git a/ts/docs/commands/encoding/convert.md b/ts/docs/commands/encoding/convert.md index 891ed5f71..76c9ca626 100644 --- a/ts/docs/commands/encoding/convert.md +++ b/ts/docs/commands/encoding/convert.md @@ -30,9 +30,9 @@ wallet-cli encoding convert TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp ``` ```console -TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp -TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29 -EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29 +TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp +TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29 +EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29 ``` ```bash @@ -50,9 +50,9 @@ wallet-cli encoding convert 04a1b2c3d4e5...f6a7b8c9d0 ``` ```console -TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp -TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29 -EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29 +TRON TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUp +TRON hex 4112e94f5a3c88b17d2f6e0b9a45cd310f8e7a6d29 +EVM 0x12E94f5a3c88b17d2F6E0b9a45Cd310f8E7a6D29 ``` A non-address-shaped input converts across encodings, in both directions: @@ -84,7 +84,7 @@ wallet-cli encoding convert TBhCfAytTEh52WFL6HYr64i2nmc3u3TCUX ``` ```console -Error: invalid_value — base58 checksum mismatch (typo in the address?) +error [invalid_value]: base58 checksum mismatch (typo in the address?) ``` ## Output diff --git a/ts/docs/commands/exchange/index.md b/ts/docs/commands/exchange/index.md index 902eb2f5e..bf79aa2bb 100644 --- a/ts/docs/commands/exchange/index.md +++ b/ts/docs/commands/exchange/index.md @@ -2,7 +2,7 @@ TRON's protocol-level Bancor exchange. -Pairs trade **TRX against TRC10** — never TRC20 — and settle instantly against a bonding curve: no order book, no counterparty, no matching. Four properties differ from the AMMs most people are used to, and all four matter before you touch this group: +Pairs trade **TRX and TRC10 assets** — never TRC20 — and settle instantly against a bonding curve. Either side may be TRX or a TRC10 id, so a TRC10-against-TRC10 pair is legal too; the only rule is that the two sides differ: no order book, no counterparty, no matching. Four properties differ from the AMMs most people are used to, and all four matter before you touch this group: - **A pair is private to its creator.** Only the account that created a pair can inject or withdraw its liquidity, and that binding cannot be transferred. There are no LP tokens and no outside liquidity providers. - **Anyone can trade**, though — trading is open even though liquidity is not. @@ -35,7 +35,7 @@ wallet-cli exchange COMMAND | `exchange withdraw` | [withdraw.md](withdraw.md) | Take liquidity out in proportion to reserves | | `exchange trade` | [trade.md](trade.md) | Swap one side for the other | | `exchange show` | [show.md](show.md) | One pair's creator, creation time, and reserves | -| `exchange list` | [list.md](list.md) | List every pair on chain | +| `exchange list` | [list.md](list.md) | List exchange pairs, one page at a time | ## See also diff --git a/ts/docs/commands/exchange/list.md b/ts/docs/commands/exchange/list.md index e2997d5d1..23118e19b 100644 --- a/ts/docs/commands/exchange/list.md +++ b/ts/docs/commands/exchange/list.md @@ -1,6 +1,6 @@ # wallet-cli exchange list -List every exchange pair on chain. +List exchange pairs on chain, one page at a time. ## Synopsis @@ -16,13 +16,13 @@ Lists pairs with their id, both tokens, reserves, and creator. Read-only, no acc **Reserves here are in minimal units, not whole tokens.** This command makes a single RPC and so has no token precisions to divide by; `exchange show` fetches them and prints whole tokens instead. The same pair therefore reads `6,672` here and `66.72` there. -Paging happens on the node, and **there is no total**: the chain exposes no count of exchange pairs. The title reports the window it asked for — `Exchanges (limit 3, offset 0)` — not `showing 3 of N`, and `meta.pagination.total` is always `null`. To get everything, pass a `--limit` large enough to cover it. +Paging happens on the node, and **there is no total**: the chain exposes no count of exchange pairs. The title reports the window it asked for — `Exchanges (limit 3, offset 0)` — not `showing 3 of N`, and `meta.pagination.total` is always `null`. To get everything, page with `--offset` until a short page comes back: `--limit` caps at `1000`, and a larger value is rejected with `invalid_value`. ## Options | Option | Description | |---|---| -| `--limit ` | Max pairs to return (default `10`) | +| `--limit ` | Max pairs to return, 1–1000 (default `10`) | | `--offset ` | Pagination offset (default `0`) | Plus the [global options](../index.md#global-options-every-command). diff --git a/ts/docs/commands/exchange/trade.md b/ts/docs/commands/exchange/trade.md index fe1f123ca..4b644cd92 100644 --- a/ts/docs/commands/exchange/trade.md +++ b/ts/docs/commands/exchange/trade.md @@ -76,14 +76,14 @@ echo "$PW" | wallet-cli exchange trade 12 --sell TRX --amount 100 --min-received Status success ``` -The same trade via `--slippage 1`: the CLI computes 4,950 from the current reserves, takes 1 % off, and sends 4,900 as the floor. +The same trade via `--slippage 1`: the CLI computes 4,950 from the current reserves, takes 1 % off, and sends 4,900.5 as the floor. The percentage is first converted to basis points, **rounded to the nearest** one — so `--slippage 1.006` tolerates 1.01 % — and the floor itself is then integer-divided, i.e. rounded down. ```bash echo "$PW" | wallet-cli exchange trade 12 --sell TRX --amount 100 --slippage 1 --network tron:3448148188 --wait --password-stdin -o json ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"exchange.trade","data":{"kind":"exchange-trade","stage":"confirmed","txId":"d9a...","confirmed":true,"blockNumber":57884455,"failed":false,"exchangeId":12,"pair":"TRX:1000123","traderAddress":"TQkXm4vN...","soldTokenId":"_","soldQuant":"100000000","soldLabel":"TRX","soldDecimals":6,"receivedTokenId":"1000123","receivedLabel":"MyToken","receivedDecimals":6,"receivedQuant":"4950000000","estimatedReceivedQuant":"4950000000","minReceivedQuant":"4900000000","feeSun":0},"meta":{"durationMs":6490,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"exchange.trade","data":{"kind":"exchange-trade","stage":"confirmed","txId":"d9a...","confirmed":true,"blockNumber":57884455,"failed":false,"exchangeId":12,"pair":"TRX:1000123","traderAddress":"TQkXm4vN...","soldTokenId":"_","soldQuant":"100000000","soldLabel":"TRX","soldDecimals":6,"receivedTokenId":"1000123","receivedLabel":"MyToken","receivedDecimals":6,"receivedQuant":"4950000000","estimatedReceivedQuant":"4950000000","minReceivedQuant":"4900500000","feeSun":0},"meta":{"durationMs":6490,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` ## Output @@ -102,7 +102,7 @@ TRX is identified as `"_"`; every quantity is a **string** in minimal units. Bef ## Exit status -`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`exchange_not_found` — no such pair, `token_not_in_exchange`, `exchange_closed` — a side holds zero, `exchange_trading_disabled` — the network is not accepting Bancor trades, `slippage_exceeded` — the return fell below the floor, `transaction_rejected` — the node refused it, for example for lack of balance, `watch_only_no_signer`, `auth_failed`) · `2` usage error (`missing_option` — no `--sell`; `invalid_option` — both or neither of `--amount` / `--raw-amount`, or more than one floor flag; `invalid_amount` — the amount or `--min-received` is not a decimal number, or has more decimal places than that token allows; `invalid_value` — amount ≤ 0, or a `--slippage` outside 0–100). +`0` submitted (or built/signed in early-exit modes) · `1` execution failure (`exchange_not_found` — no such pair, `token_not_in_exchange`, `exchange_closed` — a side holds zero, `exchange_trading_disabled` — the network is not accepting Bancor trades, `slippage_exceeded` — the return fell below the floor, `transaction_rejected` — the node refused it, for example for lack of balance, `watch_only_no_signer`, `auth_failed`) · `2` usage error (`missing_option` — no `--sell`; `invalid_option` — both or neither of `--amount` / `--raw-amount`, or more than one floor flag; `invalid_amount` — the amount or `--min-received` is not a decimal number, or has more decimal places than that token allows; `invalid_value` — amount ≤ 0, or a `--slippage` that is not both greater than 0 and less than 100; `0` and `100` are themselves rejected). ## See also diff --git a/ts/docs/commands/gasfree/index.md b/ts/docs/commands/gasfree/index.md index 5f298e1f5..dc683adfc 100644 --- a/ts/docs/commands/gasfree/index.md +++ b/ts/docs/commands/gasfree/index.md @@ -2,7 +2,7 @@ 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**. +`gasfree` moves tokens without holding any TRX: you sign a transfer with TIP-712 structured-data signing (TRON's EIP-712 analogue) 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**. **TRON only.** GasFree is a TRON service; every subcommand here fails with `family_mismatch` on an EVM network. diff --git a/ts/docs/commands/gasfree/info.md b/ts/docs/commands/gasfree/info.md index e67822d5a..5c030384b 100644 --- a/ts/docs/commands/gasfree/info.md +++ b/ts/docs/commands/gasfree/info.md @@ -32,9 +32,9 @@ GasFree address TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw Status active Nonce 4 -| Token | Balance | Activation fee | Transfer fee | -| ----- | ------- | -------------- | ------------ | -| USDT | 125 USDT | 1 USDT | 0.5 USDT | +| Token | Balance | Activation fee | Transfer fee | +| ----- | -------- | -------------- | ------------ | +| USDT | 125 USDT | 1 USDT | 0.5 USDT | ``` ```bash @@ -42,7 +42,7 @@ wallet-cli gasfree info --account main --network tron:3448148188 -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","balance":"125000000"}]},"meta":{"durationMs":380,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.info","data":{"ownerAddress":"TQkXm4vN8pR2sD6fWbYc3LhJa9Ee5Zt7Uw","gasFreeAddress":"TVjsyZ7fYF3qCcNaMxN5PMWmSgYcCyqZfw","active":true,"nonce":"4","tokens":[{"symbol":"USDT","address":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf","decimals":6,"activateFee":"1000000","transferFee":"500000","balance":"125000000"}]},"meta":{"durationMs":380,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` ## Output @@ -57,7 +57,7 @@ wallet-cli gasfree info --account main --network tron:3448148188 -o json ## Exit status -`0` success · `1` execution failure (`gasfree_integrity` — the provider's fee metadata disagreed between the token list and the address response, `provider_error` — service error / rate limit) · `2` usage error (`gasfree_credentials_missing`, `unsupported_network`, `invalid_value`). +`0` success · `1` execution failure (`gasfree_integrity` — the provider's fee metadata disagreed between the token list and the address response, `provider_error` — the service failed, answered with malformed or oversized JSON, returned a field this CLI will not act on, or returned any non-429 error status; `provider_rate_limited` — the service returned 429, with `details.retryAfter` when it sent one) · `2` usage error (`gasfree_credentials_missing`, `unsupported_network`, `invalid_value`). ## See also diff --git a/ts/docs/commands/gasfree/trace.md b/ts/docs/commands/gasfree/trace.md index 30ca201cf..0a423d3ae 100644 --- a/ts/docs/commands/gasfree/trace.md +++ b/ts/docs/commands/gasfree/trace.md @@ -27,15 +27,15 @@ wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 --network tron:344 ``` ```console -Trace ID 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 -Status succeed -TxID d2e... -Token USDT -Amount 25 USDT +Trace ID 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 +Status succeed +TxID d2e... +Token USDT +Amount 25 USDT Service fee 0.5 USDT Activation fee 0 USDT Total 25.5 USDT -To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub +To TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub ``` ```bash @@ -43,7 +43,7 @@ wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 --network tron:344 ``` ```json -{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.trace","data":{"traceId":"7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527","state":"SUCCEED","txId":"d2e...","token":"USDT","tokenAddress":"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t","decimals":6,"amount":"25000000","serviceFee":"500000","activateFee":"0","totalDeducted":"25500000","from":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER","owner":"TMVQGm1qAQYVdetCeGRRkTWYYrLXuHK2HC","to":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","nonce":"8"},"meta":{"durationMs":290,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} +{"schema":"wallet-cli.result.v1","success":true,"command":"gasfree.trace","data":{"traceId":"7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527","state":"SUCCEED","txId":"d2e...","token":"USDT","tokenAddress":"TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf","decimals":6,"amount":"25000000","serviceFee":"500000","activateFee":"0","totalDeducted":"25500000","from":"TNER12mMVWruqopsW9FQtKxCGfZcEtb3ER","owner":"TMVQGm1qAQYVdetCeGRRkTWYYrLXuHK2HC","to":"TBy6mQ7Y3nJ8sD2fWpXk4LhVc9Ra1Zt5Ub","nonce":"8"},"meta":{"durationMs":290,"warnings":[]},"chain":{"family":"tron","network":"tron:3448148188","chainId":"3448148188"}} ``` ## Output @@ -66,7 +66,7 @@ wallet-cli gasfree trace 7f3e9a02-58c1-4d2e-b6a4-91d0c3f8e527 --network tron:344 ## Exit status -`0` success · `1` execution failure (`not_found` — no such trace id, `gasfree_integrity`, `provider_error`) · `2` usage error (`gasfree_credentials_missing`, `unsupported_network`, `invalid_value`). +`0` success · `1` execution failure (`not_found` — no such trace id, `gasfree_integrity`, `provider_error` — the service failed, answered with malformed or oversized JSON, returned a field this CLI will not act on, or returned any non-429 error status; `provider_rate_limited` — the service returned 429) · `2` usage error (`gasfree_credentials_missing`, `unsupported_network`, `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. diff --git a/ts/docs/commands/gasfree/transfer.md b/ts/docs/commands/gasfree/transfer.md index 9253a8cf0..0038ed48c 100644 --- a/ts/docs/commands/gasfree/transfer.md +++ b/ts/docs/commands/gasfree/transfer.md @@ -11,7 +11,7 @@ wallet-cli gasfree transfer --to --amount [--token