Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command>` 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 <command>` 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. |
Expand Down
2 changes: 1 addition & 1 deletion java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command>` shows a command's built-in usage tips (`help` alone prints the full table).

### Wallets & accounts

Expand Down
14 changes: 8 additions & 6 deletions java/docs/commands/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions java/docs/commands/chain-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 5 additions & 7 deletions java/docs/commands/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,library:address,...> <lib_compiler_version(e.g:v5)> 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) <library:address,...> <lib_compiler_version(e.g:v5)>
```

- `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account.
Expand All @@ -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:
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions java/docs/commands/gasfree.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ For the current wallet address:

```console
wallet> gasfreeinfo
balanceOf(address):70a08231
{
"gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
"active":true,
Expand All @@ -30,7 +29,6 @@ For a specified address:

```console
wallet> gasfreeinfo TRvVXgqddDGYRMx3FWf2tpVxXQQXDZxJQe
balanceOf(address):70a08231
{
"gasFreeAddress":"TCtSt8fCkZcVdrGpaVHUr6P8EmdjysswMF",
"active":true,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions java/docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command>` 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

Expand All @@ -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) |
Expand Down
8 changes: 4 additions & 4 deletions java/docs/commands/multisig.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,15 +45,15 @@ 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

Then select accounts and put in the local password, i.e. TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR needs a private key of TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR to sign a transaction.

Select another account and enter the local password, i.e. TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP will need a private key of TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP to sign a transaction.

The weight of each account is 1, threshold of access is 2. When the requirements are met, users will be notified with "Send 10000000000000000 Sun to TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW successful !!".
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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion java/docs/commands/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion java/docs/commands/proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions java/docs/commands/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion java/docs/commands/stake-v1-legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading