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 java/src/main/java/org/tron/common/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public class Utils {

public static final int MIN_LENGTH = 2;
public static final int MAX_LENGTH = 14;
public static final String VERSION = " v4.10.0";
public static final String VERSION = " v4.11.0";
public static final String TRANSFER_METHOD_ID = "a9059cbb";

private static SecureRandom random = new SecureRandom();
Expand Down
32 changes: 29 additions & 3 deletions ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The agent-first implementation of wallet-cli, built for automation: every comman
- **Encrypted local storage** — software keystores are encrypted on disk; secrets are never passed via argv or environment variables.
- **Software and Ledger signing** — sign in software, or on a Ledger device (the private key never leaves the device).
- **Covers the main TRON capabilities** — HD wallets, TRX and TRC20/TRC10 transfers, staking / resource delegation, voting / rewards, smart-contract calls and deployment, message and EIP-712/TIP-712 signing, and on-chain queries.
- **Multi-signature end to end** — inspect and replace [account permissions](docs/commands/permission/index.md), then collect signatures either offline by passing a transaction artifact between signers or through the TronLink service, with approval weight and threshold visible at every step.
- **Gas-free transfers** — move USDT and other supported tokens with [no TRX at all](docs/commands/gasfree/index.md), paying the fee in the token itself via the GasFree Open Platform.

## Supported chains

Expand Down Expand Up @@ -106,17 +108,37 @@ Every command — including every subcommand — has a reference page; run `wall
| [`derive`](docs/commands/derive.md) | Derive the next HD account from a seed wallet |
| [`rename`](docs/commands/rename.md) / [`backup`](docs/commands/backup.md) / [`delete`](docs/commands/delete.md) | Manage accounts (backup writes secret + metadata, mode 0600) |
| [`change-password`](docs/commands/change-password.md) | Change the master password (re-encrypt all software keystores) |
| [`address generate`](docs/commands/address/generate.md) | Generate a keypair locally, without adding it to the wallet |

### Transactions

| Command | Description |
|---|---|
| [`tx send`](docs/commands/tx/send.md) | Send native TRX or TRC20/TRC10 tokens |
| [`tx sign`](docs/commands/tx/sign.md) | Sign a transaction built elsewhere, without broadcasting |
| [`tx broadcast`](docs/commands/tx/broadcast.md) | Broadcast a presigned transaction |
| [`tx sign`](docs/commands/tx/sign.md) | Sign transaction JSON, or append a signature to transaction hex, offline |
| [`tx broadcast`](docs/commands/tx/broadcast.md) | Validate and broadcast a presigned JSON or protobuf-hex transaction |
| [`tx approvals`](docs/commands/tx/approvals.md) | Show permission, approvals, accumulated weight, and expiration |
| [`tx multisig`](docs/commands/tx/multisig.md) | Coordinate signature collection through the TronLink service |
| [`tx status`](docs/commands/tx/status.md) | Show confirmation status (confirmed / failed / pending / not_found) |
| [`tx info`](docs/commands/tx/info.md) | Show full transaction detail + receipt |

### Multi-signature permissions

| Command | Description |
|---|---|
| [`permission show`](docs/commands/permission/show.md) | Show owner, witness, and active permission groups with decoded operations |
| [`permission update`](docs/commands/permission/update.md) | Replace the complete permission structure — **can permanently lock the account** |

### Gas-free transfers

Send tokens with no TRX: sign a TIP-712 authorization and let the GasFree provider broadcast, taking its fee in the transferred token. Needs credentials via [`config`](docs/commands/config.md); unavailable on `tron:shasta`.

| Command | Description |
|---|---|
| [`gasfree info`](docs/commands/gasfree/info.md) | GasFree address, activation status, nonce, balances, and fees |
| [`gasfree transfer`](docs/commands/gasfree/transfer.md) | Sign and submit a TIP-712 GasFree token transfer |
| [`gasfree trace`](docs/commands/gasfree/trace.md) | Track a submitted transfer to its terminal state |

### On-chain queries

| Command | Description |
Expand All @@ -125,6 +147,8 @@ Every command — including every subcommand — has a reference page; run `wall
| [`account info`](docs/commands/account/info.md) | Show raw account data incl. resources |
| [`account history`](docs/commands/account/history.md) | Show transaction history (requires TronGrid) |
| [`account portfolio`](docs/commands/account/portfolio.md) | Native + token balances with best-effort USD value |
| [`account activate`](docs/commands/account/activate.md) | Activate a new TRON account, paid for by the active account |
| [`account set`](docs/commands/account/set.md) | Set the one-time on-chain account name or ID |
| [`block`](docs/commands/block.md) | Get a block (latest if omitted) |
| [`chain params`](docs/commands/chain/params.md) | On-chain governance parameters |
| [`chain prices`](docs/commands/chain/prices.md) | Energy/bandwidth unit price and memo fee |
Expand All @@ -146,8 +170,10 @@ Every command — including every subcommand — has a reference page; run `wall

| Command | Description |
|---|---|
| [`config`](docs/commands/config.md) | Show / get / set configuration values |
| [`config`](docs/commands/config.md) | Show / get / set configuration values, including TronLink and GasFree credentials (secrets masked) |
| [`networks`](docs/commands/networks.md) | List known networks (`tron:mainnet`, `tron:nile`, `tron:shasta`) |
| [`contact`](docs/commands/contact/index.md) | Local recipient address book, usable as `--to <name>` ([add](docs/commands/contact/add.md) · [list](docs/commands/contact/list.md) · [remove](docs/commands/contact/remove.md)) |
| [`encoding convert`](docs/commands/encoding/convert.md) | Convert and validate address, hex, Base64, and Base58Check encodings |

## Documentation map

Expand Down
103 changes: 103 additions & 0 deletions ts/docs/commands/account/activate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# wallet-cli account activate

Activate a new TRON account. ✍️

## Synopsis

```
wallet-cli account activate --address <address>
[--dry-run | --sign-only | --build-only] [options]
```

## Description

A TRON address exists as soon as you generate a key, but it is not *activated* until it appears on
chain. An unactivated address cannot receive TRC10, hold resources, or be the owner of a
transaction. Activation is a funded operation: this command builds an `AccountCreateContract` paid
for by the **active account** (or `--account`) and broadcasts it.

Preconditions checked before anything is signed:

- `--address` must be a valid TRON base58 address (`invalid_value`, exit 2).
- The target must not already be active — otherwise `account_already_active` (exit 1).
- The payer's balance must cover the creation fee — otherwise `insufficient_balance` (exit 1),
with `balance` and `required` in the error details.

Because the fee comes from the chain's current parameters rather than a fixed constant, run
`--dry-run` first to see what it costs right now.

With `--wait`, the command additionally re-reads the target account after confirmation and fails
with `provider_error` if the node does not report it as active — a confirmed activation that is
invisible to the node is treated as a failure, not a success.

## Options

| Option | Description |
|---|---|
| `--address <string>` | **Required.** Unactivated TRON base58 address to activate |
| `--dry-run` | Build and estimate only — no signature, no broadcast |
| `--sign-only` | Sign and output the complete transaction hex without broadcasting |
| `--build-only` | Build and output the unsigned transaction hex without unlocking |
| `--permission-id <0-9>` | TRON permission group id used to authorize this transaction (default `0`) |
| `--expiration <ms>` | Expiration duration in ms (1–86400000); only with `--sign-only` / `--build-only` |
| `--wait` / `--wait-timeout <ms>` | Poll after broadcast until confirmed/failed |
| `--password-stdin` | Master password from stdin (software accounts) |

`--dry-run`, `--sign-only`, and `--build-only` are mutually exclusive.

Plus the [global options](../index.md#global-options-every-command).

## Examples

Check the current cost before spending anything:

```bash
wallet-cli account activate --address TB6dL8QunEyPUqX95PESxyZ2SHGeAQELW2 \
--network tron:nile --dry-run
```

Activate and wait for confirmation:

```bash
echo "$PW" | wallet-cli account activate --address TB6dL8QunEyPUqX95PESxyZ2SHGeAQELW2 \
--network tron:nile --wait --password-stdin
```

```console
✅ Account activated
TxID 4c0a1f4b1e0e0d8a5f0a2c6f9e1d3b7a8c5e2f4d6b8a0c2e4f6a8c0e2f4a6b8c
Block #66,012,345
Fee 1.1 TRX
Address TB6dL8QunEyPUqX95PESxyZ2SHGeAQELW2
Payer TMSgJxtPw29AFEHMXsjGo4kWV7UwbCToHJ
Status success
```

An address that is already on chain is refused rather than paid for twice:

```json
{"schema":"wallet-cli.result.v1","success":false,"command":"account.activate","error":{"code":"account_already_active","message":"TRON account is already active: TB6dL8QunEyPUqX95PESxyZ2SHGeAQELW2"}}
```

## Output

| Field | Type | Meaning |
|---|---|---|
| `kind` | string | `"account-activate"` |
| `stage` | string | `"submitted"` / `"confirmed"` / `"failed"` (absent for `--dry-run`) |
| `mode` | string | `"dry-run"` / `"sign-only"` / `"build-only"` when a mode flag was used |
| `txId` | string | Transaction id |
| `address` | string | The address that was activated |
| `payer` | string | Address that paid the creation fee |
| `blockNumber`, `feeSun` | number \| string | Present after `--wait` |

## Exit status

`0` · `1` execution failure (`account_already_active`, `insufficient_balance`, `provider_error`,
`auth_failed`) · `2` usage error (`invalid_value`, conflicting mode flags).

## See also

[`address generate`](../address/generate.md) — make a keypair to activate ·
[`account info`](info.md) · [`tx send`](../tx/send.md) — a transfer to a fresh address also
activates it
12 changes: 12 additions & 0 deletions ts/docs/commands/account/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,25 @@ All subcommands read the chain for the **active account** by default; override w

## Subcommands

Read-only:

| Command | Description | Data source |
|---|---|---|
| [`account balance`](balance.md) | Native balance (TRX/SUN) | node RPC |
| [`account info`](info.md) | Raw account data incl. bandwidth/energy | node RPC |
| [`account history`](history.md) | Transaction history | **TronGrid required** |
| [`account portfolio`](portfolio.md) | Native + token balances, best-effort USD | node RPC + price source |

Broadcasting (✍️) — these change on-chain state and cost fees:

| Command | Description |
|---|---|
| [`account activate`](activate.md) | Activate a new TRON account, paid for by the active account |
| [`account set`](set.md) | Set the one-time on-chain account name or ID |

Both write-side commands are effectively one-shot: an account can only be activated once, and the
on-chain name and ID can each be set once. Run them with `--dry-run` first.

## See also

[`list`](../list.md) — local accounts (no chain access) · [Networks & resources](../../concepts/networks.md)
94 changes: 94 additions & 0 deletions ts/docs/commands/account/set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# wallet-cli account set

Set the one-time on-chain account name or ID. ✍️

## Synopsis

```
wallet-cli account set (--name <name> | --id <id>)
[--dry-run | --sign-only | --build-only] [options]
```

## Description

TRON accounts carry two optional on-chain text fields:

| Field | Contract | Constraint |
|---|---|---|
| `--name` | `AccountUpdateContract` | 1–32 UTF-8 bytes |
| `--id` | `SetAccountIdContract` | 8–32 UTF-8 bytes, **unique across the chain** |

Both are effectively **immutable** — the chain accepts them once, and a second attempt is rejected.
Treat this as a one-way decision and confirm the value with `--dry-run` before broadcasting.

Exactly one of `--name` / `--id` per invocation (`invalid_option`, exit 2). The target account must
already be activated, otherwise the command fails before signing.

These fields are on-chain metadata and are unrelated to the local wallet label set by
[`rename`](../rename.md), which never touches the chain.

After a confirmed broadcast the command re-reads the account and fails with `provider_error` if the
stored value does not match what was submitted.

## Options

| Option | Description |
|---|---|
| `--name <string>` | One-time on-chain account name (1–32 UTF-8 bytes) |
| `--id <string>` | One-time unique account ID (8–32 UTF-8 bytes) |
| `--dry-run` | Build and estimate only — no signature, no broadcast |
| `--sign-only` | Sign and output the complete transaction hex without broadcasting |
| `--build-only` | Build and output the unsigned transaction hex without unlocking |
| `--permission-id <0-9>` | TRON permission group id used to authorize this transaction (default `0`) |
| `--expiration <ms>` | Expiration duration in ms (1–86400000); only with `--sign-only` / `--build-only` |
| `--wait` / `--wait-timeout <ms>` | Poll after broadcast until confirmed/failed |
| `--password-stdin` | Master password from stdin (software accounts) |

Plus the [global options](../index.md#global-options-every-command).

## Examples

```bash
wallet-cli account set --name alice --network tron:nile --dry-run
```

```bash
echo "$PW" | wallet-cli account set --id alice-001 --network tron:nile \
--wait --password-stdin
```

```console
✅ On-chain id set
TxID 9b2f...c1d4
Block #66,012,401
Address TMSgJxtPw29AFEHMXsjGo4kWV7UwbCToHJ
ID alice-001
Status success
```

Passing both selectors is a usage error:

```console
error [invalid_option]: provide exactly one of --name or --id
```

## Output

| Field | Type | Meaning |
|---|---|---|
| `kind` | string | `"account-set"` |
| `field` | string | `"name"` or `"id"` |
| `value` | string | The value written on chain |
| `address` | string | Account that was updated |
| `stage`, `txId`, `blockNumber`, `feeSun` | — | Standard broadcast receipt fields |

## Exit status

`0` · `1` execution failure (account not activated, chain rejected an already-set field,
`provider_error`, `auth_failed`) · `2` usage error (neither/both of `--name` / `--id`, conflicting
mode flags).

## See also

[`rename`](../rename.md) — local label only · [`account info`](info.md) ·
[`account activate`](activate.md)
Loading