Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
11c98aa
feat: evm extension
gummy789j Aug 24, 2026
58c3916
feat: help review and update & known issues fix
gummy789j Aug 24, 2026
559017c
feat: requirement alignment
gummy789j Aug 24, 2026
4bb4471
feat: drop useless
gummy789j Aug 24, 2026
ee28612
feat(lint): clear
gummy789j Aug 24, 2026
016e651
fix(ci): test timeout
gummy789j Aug 25, 2026
f5ee5a8
feat: requirement alignment review
gummy789j Aug 25, 2026
44a40ee
feat: run format
gummy789j Aug 25, 2026
c0bddb6
fix: scope chain json schemas by family
Aug 24, 2026
9f14026
chore: fix lint gate
Aug 24, 2026
902a562
style: apply prettier formatting
Aug 24, 2026
0de53d8
fix: neutralize shared chain command metadata
Aug 24, 2026
f67e4bf
refactor: share EVM unsigned tx building
Aug 24, 2026
e6e9ffc
refactor: require EVM service dependencies
Aug 24, 2026
8ee6b39
refactor: centralize EVM RPC requests
Aug 24, 2026
e8b0d35
refactor: reuse EVM ABI call encoder
Aug 24, 2026
e4bf7e6
fix: guard EVM safe integer conversions
Aug 24, 2026
b1bc761
docs: refresh EVM command metadata
Aug 24, 2026
c41b43a
chore: fix post-rebase quality gates
Aug 24, 2026
701c58c
Merge pull request #984 from grayfoxd/feat/architecture-evm-extension
gummy789j Aug 26, 2026
3913909
chore(ts): drop dead eslint block, redundant #send wrapper, and the g…
gummy789j Aug 26, 2026
7a33dcd
feat(ts): route every chain HTTP call through one transport, add per-…
gummy789j Aug 27, 2026
5389b00
docs: repoint the ts architecture reference at what still exists
gummy789j Aug 27, 2026
f723d8f
docs: drop the ADR reference — ts/docs/adr is gitignored
gummy789j Aug 27, 2026
fbf5362
Merge pull request #982 from tronprotocol/feat/architecture-evm-exten…
gummy789j Aug 27, 2026
e35e054
fix(ts): restore --permission-id/--expiration on the TRON-only writes
gummy789j Aug 27, 2026
61ee130
docs(ts): align the reference with the EVM-capable CLI
gummy789j Aug 27, 2026
2f7ba11
Merge branch 'feat/architecture-evm-extension' into feat/v4.13.0
gummy789j Aug 27, 2026
de12f5f
docs(java): add the standard CLI removal plan
gummy789j Aug 26, 2026
946d8f5
refactor(java): move CommandErrorException out of the standard CLI pa…
gummy789j Aug 26, 2026
7a2b9cc
feat(java)!: reduce the entry point to the interactive shell
gummy789j Aug 26, 2026
c5add15
refactor(java): move LedgerSigner/LedgerSignOutcome to org.tron.ledge…
gummy789j Aug 26, 2026
b4515a3
feat(java)!: delete the standard CLI package, its tests, and its reso…
gummy789j Aug 26, 2026
e4dcf38
refactor(java): remove the standard CLI's private surface from the core
gummy789j Aug 26, 2026
ea5663f
chore(java): delete the QA harness
gummy789j Aug 26, 2026
a0008d8
feat(java)!: close out the standard CLI removal and cut v4.13.0
gummy789j Aug 26, 2026
bc41b69
chore(java): drop the lombok Setter import orphaned by the CLI removal
gummy789j Aug 26, 2026
e66ecff
refactor(java): remove the permission-id override left over from the CLI
gummy789j Aug 26, 2026
d6d7e67
chore(java): drop three Ledger helpers orphaned by the adapter removal
gummy789j Aug 26, 2026
6281f95
chore: drop useless spec
gummy789j Aug 27, 2026
adb0b8a
Merge pull request #991 from tronprotocol/feat/java-remove-standard-cli
gummy789j Aug 27, 2026
e206c00
feat: update tag to capital
gummy789j Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 20 additions & 51 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ npm run depcruise # dependency-cruiser — enforces the architecture rules

### Architecture (hexagonal / ports & adapters)

Dependencies point inward. The source of truth is
`ts/docs/typescript-wallet-cli-architecture-source-of-truth.md` — read it before changing
boundaries, ports, command routing, or the JSON contract. `depcruise` enforces these rules in CI.
Dependencies point inward, and the table below is the rule — read it before changing boundaries,
ports, or command routing. `depcruise` enforces it in CI (`ts/.dependency-cruiser.cjs`).
`ts/docs/machine-interface.md` is the source of truth for the JSON contract (envelope, exit codes,
stdout/stderr discipline).

| Area (`ts/src/…`) | Role | May depend on | Must NOT depend on |
|---|---|---|---|
Expand Down Expand Up @@ -73,14 +74,10 @@ Key points:
# Build fat JAR (output: build/libs/wallet-cli.jar)
./gradlew shadowJar

# Run in REPL 交互模式 (human-friendly, interactive prompts)
# Run the interactive shell (the only way to run it)
./gradlew run
# Or after building: java -jar build/libs/wallet-cli.jar

# Run in standard CLI mode (non-interactive, scriptable)
java -jar build/libs/wallet-cli.jar --network nile get-account --address TXyz...
java -jar build/libs/wallet-cli.jar --output json --network nile get-account --address TXyz...

# Run tests
./gradlew test

Expand All @@ -93,74 +90,46 @@ java -jar build/libs/wallet-cli.jar --output json --network nile get-account --a

Java 8 source/target compatibility. Protobuf sources are in `src/main/protos/` and generate into `src/main/gen/` — this directory is git-tracked but rebuilt on `clean`.

## QA Verification

The `qa/` directory contains shell-based parity tests that compare interactive REPL output vs standard CLI (text and JSON modes). Requires a funded Nile testnet account.

```bash
# Run QA verification (needs TRON_TEST_PRIVATE_KEY env var for private key)
TRON_TEST_PRIVATE_KEY=<nile-private-key> bash qa/run.sh verify
## End-to-end coverage

# QA config is in qa/config.sh; test commands are in qa/commands/*.sh
# MASTER_PASSWORD env var is used for keystore auto-login (default: testpassword123A)
```
There is none, and there never was: the `qa/` harness that used to live here
only ever drove the standard CLI, which was removed in v4.13.0. `./gradlew build`
passing does **not** mean the interactive shell still works — changes that touch
shared helpers must be walked through by hand against a funded Nile account.

## Architecture

This is a **TRON blockchain CLI wallet** built on the [Trident SDK](https://github.com/tronprotocol/trident). It communicates with TRON nodes via gRPC.

### Two CLI Modes

1. **REPL 交互模式** (human-friendly) — `Client` class with JCommander `@Parameters` inner classes. Entry point: `org.tron.walletcli.Client`. Features tab completion, interactive prompts, and conversational output. This is the largest file (~4900 lines). Best for manual exploration and day-to-day wallet management by humans.
2. **Standard CLI 模式** (AI-agent-friendly) — `StandardCliRunner` with `CommandRegistry`/`CommandDefinition` pattern in `org.tron.walletcli.cli.*`. Supports `--output json`, `--network`, `--quiet` flags. Commands are registered in `cli/commands/` classes (e.g., `WalletCommands`, `TransactionCommands`, `QueryCommands`). Designed for automation: deterministic exit codes, structured JSON output, no interactive prompts, and env-var-based authentication — ideal for AI agents, scripts, and CI/CD pipelines.
### One CLI Mode

The standard CLI suppresses all stray stdout/stderr in JSON mode to ensure machine-parseable output. Authentication is automatic via `MASTER_PASSWORD` env var + keystore files in `Wallet/`.
**REPL 交互模式** — `Client` class with JCommander `@Parameters` inner classes. Entry point:
`org.tron.walletcli.Client`. Features tab completion, interactive prompts, and conversational
output. This is the largest file (~4800 lines).

### Standard CLI Contract

Before changing parser behavior, auth flow, JSON output, command success/failure semantics, or `qa/` expectations for
the standard CLI, read:

- `java/docs/standard-cli-contract-spec.md`

Treat that file as the source of truth for the standard CLI contract unless the repository owner explicitly decides to
revise it.
The shell is started one way only: a bare `java -jar wallet-cli.jar`. The entry point recognises
`--version` and `--help` and nothing else; any other argument prints a one-line pointer to the
TypeScript CLI on stderr and exits 2. Non-interactive, scriptable and CI use belongs to `ts/`
(npm `@tron-walletcli/wallet-cli`).

### Request Flow

```
# Standard CLI mode:
User Input → GlobalOptions → StandardCliRunner → CommandRegistry → CommandHandler → WalletApiWrapper → WalletApi → Trident SDK → gRPC → TRON Node

# Interactive REPL mode:
User Input → Client (JCommander) → WalletApiWrapper → WalletApi → Trident SDK → gRPC → TRON Node
```

### Key Classes

- **`org.tron.walletcli.Client`** — Legacy REPL entry point and CLI command dispatcher. Each command is a JCommander `@Parameters` inner class.
- **`org.tron.walletcli.cli.StandardCliRunner`** — New standard CLI executor. Handles network init, auto-authentication, JSON stream suppression, and command dispatch.
- **`org.tron.walletcli.cli.CommandRegistry`** — Maps command names/aliases to `CommandDefinition` instances. Supports fuzzy suggestion on typos.
- **`org.tron.walletcli.cli.CommandDefinition`** — Immutable command metadata (name, aliases, options, handler). Built via fluent `Builder` API.
- **`org.tron.walletcli.cli.OutputFormatter`** — Formats output as text or JSON. In JSON mode, wraps results in `{"success":true,"data":...}` envelope.
- **`org.tron.walletcli.Client`** — REPL entry point and command dispatcher. Each command is a JCommander `@Parameters` inner class.
- **`org.tron.walletcli.WalletApiWrapper`** — Orchestration layer between CLI and core wallet logic. Handles transaction construction, signing, and broadcasting.
- **`org.tron.walletserver.WalletApi`** — Core wallet operations: account management, transaction creation, proposals, asset operations. Delegates gRPC calls to Trident.
- **`org.tron.walletcli.ApiClientFactory`** — Creates gRPC client instances for different networks (mainnet, Nile testnet, Shasta testnet, custom).

### Adding a New Standard CLI Command

1. Create or extend a class in `cli/commands/` (e.g., `TransactionCommands.java`)
2. Build a `CommandDefinition` via `CommandDefinition.builder()` with name, aliases, options, and handler
3. Register it in the appropriate `register(CommandRegistry)` method
4. The handler receives `(ParsedOptions, WalletApiWrapper, OutputFormatter)` — use `formatter.success()/error()` for output

### Package Organization

| Package | Purpose |
|---------|---------|
| `walletcli` | CLI entry points, API wrapper |
| `walletcli.cli` | Standard CLI framework: registry, definitions, options, formatter |
| `walletcli.cli.commands` | Standard CLI command implementations by domain |
| `walletcli` | REPL entry point, API wrapper |
| `walletserver` | Core wallet API and gRPC communication |
| `common` | Crypto utilities, encoding, enums, shared helpers |
| `core` | Configuration, data converters, DAOs, exceptions, managers |
Expand Down
6 changes: 0 additions & 6 deletions java/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,4 @@ Wallet/
Mnemonic/
wallet_data/

# QA runtime output
qa/results/
qa/runtime/
qa/report.txt
qa/.verify.lock/

docs/superpowers
16 changes: 0 additions & 16 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,3 @@ shadowJar {
version = null
mergeServiceFiles() // https://github.com/grpc/grpc-java/issues/10853
}

task qaJar(type: Jar, dependsOn: [shadowJar, testClasses]) {
from zipTree(shadowJar.archiveFile)
from sourceSets.test.output
archiveBaseName.set('wallet-cli-qa')
archiveClassifier.set('')
archiveVersion.set('')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

task qaRun(type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = 'org.tron.qa.QARunner'
args = project.hasProperty('qaArgs') ? project.property('qaArgs').split(' ') : ['list']
standardInput = System.in
}
Loading