Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9731d11
feat: add TRON governance command domains
Aug 7, 2026
9053529
Merge branch 'feat/ts-v4.12.0' into feat/ts-v4.12.0
grayfoxd Aug 10, 2026
d12bd1c
Merge pull request #972 from grayfoxd/feat/ts-v4.12.0
gummy789j Aug 10, 2026
b579d29
feat(ts): trc-10 releated commands including asset & exchange and key…
gummy789j Aug 10, 2026
839c9df
fix(ts): repair the governance commands from PR #972
gummy789j Aug 10, 2026
b68d902
fix(ts): send origin_energy_limit as a json number, not a string
gummy789j Aug 10, 2026
a0ce486
fix(ts): make --build-only and --sign-only work for the governance wr…
gummy789j Aug 10, 2026
8584026
feat(ts): integrate
gummy789j Aug 10, 2026
0f20a6f
fix(ts): reject --offset without --records on backup
gummy789j Aug 11, 2026
e9561fd
fix(ts): stop passing the current chain value off as a proposal's old…
gummy789j Aug 12, 2026
de0bd6f
feat(ts) qa report review and fix
gummy789j Aug 13, 2026
f38e529
fix(ts): unify governance transaction preparation on the pipeline's p…
gummy789j Aug 13, 2026
48cdafd
fix(ts): read TRC10, exchange and transaction-info losslessly
gummy789j Aug 13, 2026
dbfbe14
fix(ts): bind TRC10 and exchange reads to the id asked for, and to pr…
gummy789j Aug 13, 2026
fd7bcc6
fix(ts): close four small paths where a wrong answer looked like a ri…
gummy789j Aug 14, 2026
6c298b8
fix(ts): trust our own transaction id, MAC bytes and a proposal snaps…
gummy789j Aug 17, 2026
85bb42c
chore(ts): adopt Prettier and ESLint, aligned to the existing style
gummy789j Aug 17, 2026
4917bca
Merge pull request #975 from tronprotocol/feat/ts-v4.12.0
gummy789j Aug 17, 2026
2c2acf0
feat(ts): standalone
gummy789j Aug 13, 2026
a8fb2d2
fix: use declared ledger HID transport
Aug 13, 2026
9c15048
test: stabilize cli golden timeouts
Aug 13, 2026
37b5686
ci: update typescript workflow triggers
Aug 13, 2026
11e3b71
ci: run typescript checks for all PRs
Aug 13, 2026
cd73cf4
test: drop the tty env flag for a detached spawn
gummy789j Aug 17, 2026
1e6aa46
ci: limit typescript push triggers to develop, master and release bra…
gummy789j Aug 17, 2026
f54e37d
chore: record the uri-js lockfile entry
gummy789j Aug 17, 2026
dbe71b7
docs: de-Chinese the help and layout comments
gummy789j Aug 17, 2026
a2c2f3e
Merge pull request #977 from tronprotocol/feat/standalone
gummy789j Aug 18, 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
  •  
  •  
  •  
67 changes: 67 additions & 0 deletions .github/workflows/ts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: TypeScript CI

on:
pull_request:
branches:
- "**"
# Topic branches are covered by the pull_request trigger above; pushing to one would otherwise
# start a second, identical run (a different concurrency key, so neither cancels the other).
push:
branches:
- develop
- master
- "release_*"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ts-ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
quality:
name: Quality / Node ${{ matrix.node }}
runs-on: ubuntu-24.04
timeout-minutes: 20

strategy:
fail-fast: false
matrix:
node:
- "22"
- "24"

defaults:
run:
working-directory: ts

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: ts/package-lock.json

- name: Install locked dependencies
run: npm ci

- name: Check architecture boundaries
run: npm run depcruise

- name: Type-check
run: npm run typecheck

- name: Run tests
run: npm test

- name: Build npm bundle
run: npm run build

- name: Validate npm package contents
run: npm pack --dry-run
228 changes: 228 additions & 0 deletions .github/workflows/ts-standalone-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: TypeScript Standalone Artifacts

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read

env:
NODE_VERSION: "20"

jobs:
quality:
name: TypeScript quality gates
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ts

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: ts/package-lock.json

- name: Install dependencies
run: npm ci

- name: Check architecture boundaries
run: npm run depcruise

- name: Type-check
run: npm run typecheck

- name: Test
run: npm test

- name: Build npm bundle
run: npm run build

binaries:
name: ${{ matrix.asset }}
needs: quality
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: bun-linux-x64-baseline
asset: linux-x64
executable: wallet-cli
archive: tar.gz
glibc_max: "2.35"
- os: ubuntu-22.04-arm
target: bun-linux-arm64
asset: linux-arm64
executable: wallet-cli
archive: tar.gz
glibc_max: "2.35"
- os: macos-15-intel
target: bun-darwin-x64
asset: macos-x64
executable: wallet-cli
archive: tar.gz
- os: macos-15
target: bun-darwin-arm64
asset: macos-arm64
executable: wallet-cli
archive: tar.gz
- os: windows-2022
target: bun-windows-x64-baseline
asset: windows-x64
executable: wallet-cli.exe
archive: zip
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ts

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: ts/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build standalone executable
run: >-
npm run build:standalone --
--target ${{ matrix.target }}
--outfile standalone/${{ matrix.executable }}

- name: Verify executable and embedded Ledger addon
run: node scripts/verify-standalone.mjs standalone/${{ matrix.executable }}

- name: Verify Linux ABI baseline
if: runner.os == 'Linux'
shell: bash
env:
MAX_GLIBC: ${{ matrix.glibc_max }}
run: |
set -euo pipefail
executable="standalone/${{ matrix.executable }}"
native_addon="$(
./node_modules/.bin/bun -e \
'import { resolveNodeHidAddon } from "./scripts/standalone/resolve-node-hid-addon.ts"; console.log(resolveNodeHidAddon().nativeAddon)'
)"
host_glibc="$(getconf GNU_LIBC_VERSION | awk '{print $2}')"

if [[ "${host_glibc}" != "${MAX_GLIBC}" ]]; then
echo "::error::runner glibc ${host_glibc} does not match the supported baseline ${MAX_GLIBC}"
exit 1
fi

required_versions="$(
{
readelf --version-info --wide "${executable}"
readelf --version-info --wide "${native_addon}"
} | grep -oE 'GLIBC_[0-9]+(\.[0-9]+)*' | sed 's/^GLIBC_//' | sort -Vu
)"
highest_required="$(printf '%s\n' "${required_versions}" | tail -n 1)"
highest_version="$(printf '%s\n%s\n' "${MAX_GLIBC}" "${highest_required}" | sort -V | tail -n 1)"

if [[ "${highest_version}" != "${MAX_GLIBC}" ]]; then
echo "::error::Linux artifact requires GLIBC_${highest_required}; maximum allowed is GLIBC_${MAX_GLIBC}"
exit 1
fi

dynamic_dependencies="$(readelf --dynamic --wide "${native_addon}")"
if ! grep -Fq 'Shared library: [libudev.so.1]' <<< "${dynamic_dependencies}"; then
echo "::error::Ledger native addon no longer declares its documented libudev.so.1 dependency"
exit 1
fi

echo "Verified GLIBC_${highest_required} <= GLIBC_${MAX_GLIBC} and libudev.so.1 dependency"

- name: Verify macOS code signature
if: runner.os == 'macOS'
run: codesign --verify --verbose standalone/${{ matrix.executable }}

- name: Package Unix archive
if: matrix.archive == 'tar.gz'
shell: bash
run: |
set -euo pipefail
version="$(node -p "require('./package.json').version")"
package="wallet-cli-${version}-${{ matrix.asset }}"
mkdir -p "standalone-assets/${package}"
cp "standalone/${{ matrix.executable }}" "standalone-assets/${package}/wallet-cli"
cp LICENSE "standalone-assets/${package}/LICENSE"
tar -C standalone-assets -czf "standalone-assets/${package}.tar.gz" "${package}"
rm -r "standalone-assets/${package}"

- name: Package Windows archive
if: matrix.archive == 'zip'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$version = node -p "require('./package.json').version"
$package = "wallet-cli-$version-${{ matrix.asset }}"
New-Item -ItemType Directory -Force "standalone-assets/$package" | Out-Null
Copy-Item "standalone/${{ matrix.executable }}" "standalone-assets/$package/wallet-cli.exe"
Copy-Item "LICENSE" "standalone-assets/$package/LICENSE"
Compress-Archive -Path "standalone-assets/$package" -DestinationPath "standalone-assets/$package.zip"
Remove-Item -Recurse "standalone-assets/$package"

- name: Upload platform artifact
uses: actions/upload-artifact@v4
with:
name: wallet-cli-${{ matrix.asset }}
path: ts/standalone-assets/*
if-no-files-found: error
retention-days: 1

artifacts:
name: Publish Actions artifact
needs: binaries
runs-on: ubuntu-24.04
permissions:
artifact-metadata: write
attestations: write
contents: read
id-token: write

steps:
- name: Download binaries
uses: actions/download-artifact@v4
with:
pattern: wallet-cli-*
path: standalone-assets
merge-multiple: true

- name: Create checksums and metadata
shell: bash
run: |
set -euo pipefail
cd standalone-assets
printf 'commit=%s\nref=%s\nrun_id=%s\n' \
"${GITHUB_SHA}" "${GITHUB_REF}" "${GITHUB_RUN_ID}" > BUILD_METADATA.txt
sha256sum BUILD_METADATA.txt wallet-cli-* > SHA256SUMS.txt

- name: Attest standalone archives
uses: actions/attest@v4
with:
subject-checksums: standalone-assets/SHA256SUMS.txt

- name: Upload standalone bundle
uses: actions/upload-artifact@v4
with:
name: wallet-cli-standalone-${{ github.sha }}
path: standalone-assets/*
if-no-files-found: error
retention-days: 30
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

This repository holds **two independent implementations** that share the same purpose but target different users:

- **[Java](java/README.md)** — the original, full-featured reference CLI. An interactive prompt (REPL) for people who want the complete TRON feature surface.
- **[Java](java/README.md)** — the original, full-featured reference CLI. An interactive prompt (REPL) you drive by hand.
- **[TypeScript](ts/README.md)** — an agent-first rewrite for automation. Standard subcommands with a stable JSON envelope, built for scripts, CI, and AI agents.

Both manage the same kind of wallet on the same networks — your address is identical regardless of which you use. They differ in how you install and drive them, and in how much of TRON they cover. Pick one and read its own README for depth; this page gives you the basics of each so you can choose.
Both manage the same kind of wallet on the same networks — your address is identical regardless of which you use. They cover the same TRON feature surface and differ in how you install and drive them. Pick one and read its own README for depth; this page gives you the basics of each so you can choose.

## At a glance

Expand All @@ -31,7 +31,7 @@ Both manage the same kind of wallet on the same networks — your address is ide
| **Output for scripts** | Human-readable text. | Stable JSON via `-o json` ([`wallet-cli.result.v1`](ts/docs/machine-interface.md)) + fixed exit codes (`0`/`1`/`2`). |
| **Config / networks** | `config.conf` (net type + full node), or `SwitchNetwork` at runtime. Mainnet · Nile · Shasta · custom. | `--network` flag / `config` command. `tron:mainnet` · `tron:nile` · `tron:shasta`. |
| **Signing** | Software keystore · Ledger. | Encrypted local keystore · Ledger. Secrets never via argv/env. |
| **Feature scope** | **The full surface** — everything in the TypeScript column, plus TRC10 token issuance and on-chain DEX & governance/proposals. | **Core wallet ops** — HD wallets, TRX/TRC20/TRC10 transfers, staking & delegation, voting & rewards, contract call/deploy, multi-sig, GasFree transfers, message signing, and on-chain queries. |
| **Feature scope** | **The full surface** — wallets and transfers, staking, voting and rewards, governance, contracts, TRC10, and the on-chain exchange. | **The full surface** — HD wallets, TRX/TRC20/TRC10 transfers, staking & delegation, voting & rewards, governance proposals & super-representative operation, contract call/deploy/governance, TRC10 issuance, the on-chain Bancor exchange, multi-sig, GasFree transfers, message signing, and on-chain queries. |
| **Best for** | People at a terminal who want every TRON capability. | Scripting, CI pipelines, and AI agents. |
| **Full docs** | [java/README.md](java/README.md) | [ts/README.md](ts/README.md) |

Expand All @@ -49,7 +49,7 @@ $ java -jar wallet-cli.jar # opens the interactive prompt
> GetBalance # TRX balance
```

Full setup (config.conf, connecting to a node), the complete A–Z command list, and features like GasFree and multi-sig live in **[java/README.md](java/README.md)** — jump to [Setup](java/README.md#setup), [Quickstart](java/README.md#quickstart), [Commands](java/README.md#commands), or [GasFree](java/README.md#gasfree).
Full setup (config.conf, connecting to a node), the complete A–Z command list, and features like GasFree and multi-sig live in **[java/README.md](java/README.md)** — jump to [Setup](java/README.md#setup), [Quickstart](java/README.md#quickstart), [Commands](java/README.md#commands), or [GasFree](java/README.md#contracts-gasfree--chain-data).

## TypeScript — get a taste

Expand All @@ -72,5 +72,5 @@ Every command has a reference page, and the JSON contract, exit codes, and agent
## Which should I use?

- **Scripting, CI, or building an AI agent?** → the [TypeScript version](ts/README.md) — the JSON envelope and deterministic exit codes exist for exactly this.
- **Working interactively and want the complete TRON toolkit** — TRC10 issuance, or on-chain DEX/governance/proposals? → the [Java version](java/README.md).
- **Working interactively** — one long-running session at a `>` prompt, with the wallet unlocked once for the whole session? → the [Java version](java/README.md).
- **Just sending TRX/tokens or staking from your own machine?** → either works; the TypeScript CLI is the lighter install (`npm install -g`, no build step).
12 changes: 6 additions & 6 deletions java/docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Type any command in the interactive wallet to see its built-in usage tips.
| CreateProposal | [proposals.md#createproposal](proposals.md#createproposal) |
| CreateWitness | [vote-reward.md#createwitness](vote-reward.md#createwitness) |
| CurrentNetwork | [network.md#currentnetwork](network.md#currentnetwork) |
| DelegateResource | [stake-v2.md#delegateresource-undelegateresource](stake-v2.md#delegateresource-undelegateresource) |
| DelegateResource | [stake-v2.md#delegateresource](stake-v2.md#delegateresource) |
| DeleteProposal | [proposals.md#deleteproposal](proposals.md#deleteproposal) |
| DeployConstantContract | [contract.md#deployconstantcontract](contract.md#deployconstantcontract) |
| DeployContract | [contract.md#deploycontract](contract.md#deploycontract) |
Expand All @@ -58,7 +58,7 @@ Type any command in the interactive wallet to see its built-in usage tips.
| ExportWalletKeystore | [wallet.md#exportwalletkeystore](wallet.md#exportwalletkeystore) |
| ExportWalletMnemonic | [wallet.md#exportwalletmnemonic](wallet.md#exportwalletmnemonic) |
| FreezeBalance | [stake-v1-legacy.md#how-to-freezeunfreeze-balance](stake-v1-legacy.md#how-to-freezeunfreeze-balance) |
| FreezeBalanceV2 | [stake-v2.md#freezebalancev2-unfreezebalancev2](stake-v2.md#freezebalancev2-unfreezebalancev2) |
| FreezeBalanceV2 | [stake-v2.md#freezebalancev2](stake-v2.md#freezebalancev2) |
| GasFreeInfo | [gasfree.md#gasfreeinfo](gasfree.md#gasfreeinfo) |
| GasFreeTrace | [gasfree.md#gasfreetrace](gasfree.md#gasfreetrace) |
| GasFreeTransfer | [gasfree.md#gasfreetransfer](gasfree.md#gasfreetransfer) |
Expand Down Expand Up @@ -145,17 +145,17 @@ Type any command in the interactive wallet to see its built-in usage tips.
| TriggerConstantContract | [contract.md#triggerconstantcontract](contract.md#triggerconstantcontract) |
| TriggerContract | [contract.md#triggercontract](contract.md#triggercontract) |
| TronlinkMultiSign | [multisig.md#tronlinkmultisign](multisig.md#tronlinkmultisign) |
| UnDelegateResource | [stake-v2.md#delegateresource-undelegateresource](stake-v2.md#delegateresource-undelegateresource) |
| UnDelegateResource | [stake-v2.md#undelegateresource](stake-v2.md#undelegateresource) |
| UnfreezeAsset | [transfer-trc10.md#unfreezeasset](transfer-trc10.md#unfreezeasset) |
| UnfreezeBalance | [stake-v1-legacy.md#unfreezebalance-undelegate](stake-v1-legacy.md#unfreezebalance-undelegate) |
| UnfreezeBalanceV2 | [stake-v2.md#freezebalancev2-unfreezebalancev2](stake-v2.md#freezebalancev2-unfreezebalancev2) |
| UnfreezeBalanceV2 | [stake-v2.md#unfreezebalancev2](stake-v2.md#unfreezebalancev2) |
| Unlock | [wallet.md#unlock](wallet.md#unlock) |
| UpdateAccount | [account.md#updateaccount](account.md#updateaccount) |
| UpdateAccountPermission | [multisig.md#updateaccountpermission](multisig.md#updateaccountpermission) |
| UpdateAsset | [transfer-trc10.md#updateasset](transfer-trc10.md#updateasset) |
| UpdateBrokerage | [vote-reward.md#updatebrokerage](vote-reward.md#updatebrokerage) |
| UpdateEnergyLimit | [contract.md#updateenergylimit-updatesetting](contract.md#updateenergylimit-updatesetting) |
| UpdateSetting | [contract.md#updateenergylimit-updatesetting](contract.md#updateenergylimit-updatesetting) |
| UpdateEnergyLimit | [contract.md#updateenergylimit--updatesetting](contract.md#updateenergylimit--updatesetting) |
| UpdateSetting | [contract.md#updateenergylimit--updatesetting](contract.md#updateenergylimit--updatesetting) |
| UpdateWitness | [vote-reward.md#updatewitness](vote-reward.md#updatewitness) |
| ViewBackupRecords | [account.md#viewbackuprecords](account.md#viewbackuprecords) |
| ViewTransactionHistory | [account.md#viewtransactionhistory](account.md#viewtransactionhistory) |
Expand Down
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.11.0";
public static final String VERSION = " v4.12.0";
public static final String TRANSFER_METHOD_ID = "a9059cbb";

private static SecureRandom random = new SecureRandom();
Expand Down
3 changes: 2 additions & 1 deletion ts/.dependency-cruiser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ module.exports = {
{
name: "inbound-does-not-know-outbound",
severity: "error",
comment: "CLI adapters call application ports/use-cases; bootstrap/composition supplies outbound implementations",
comment:
"CLI adapters call application ports/use-cases; bootstrap/composition supplies outbound implementations",
from: { path: "^src/adapters/inbound/", pathNot: "\\.test\\.ts$" },
to: { path: "^src/(adapters/outbound|bootstrap)/" },
},
Expand Down
Loading
Loading