Skip to content

feat: ts v0.1.1#950

Open
gummy789j wants to merge 6 commits into
release_v4.9.8from
feat/ts-v0.1.1
Open

feat: ts v0.1.1#950
gummy789j wants to merge 6 commits into
release_v4.9.8from
feat/ts-v0.1.1

Conversation

@gummy789j

Copy link
Copy Markdown
Collaborator

feat(ts): TypeScript Wallet CLI v0.1.1

Stake/chain queries, governance (vote/reward), a configurable confirmation
timeout, TTY-only secret entry, and a family-keyed command contract — layered
on top of release_v4.9.8. User-facing command surface is additive; the one
breaking change is the command-id scheme (see below).

Highlights

New commands

  • vote cast | list | status — cast/replace your full SR vote allocation,
    list super representatives & candidates (with brokerage → reward-ratio), and
    show current votes + voting power + reward overview.
  • reward balance | withdraw — claimable voting/block reward and 24h
    withdraw-window status; withdraw accrued rewards.
  • chain params | prices | node — on-chain governance parameters,
    energy/bandwidth unit prices + memo fee, and connected-node sync status.
  • stake info | delegated — staked amounts, voting power, resource usage,
    unfreeze schedule; and V2 delegation records (both directions).
  • change-password — re-encrypt every software keystore under a new master
    password (TTY-only, confirmed).

Faster, fresher reads (--wait)

TRON reads and transaction confirmation now hit the full node's unconfirmed
view
instead of the solidified node. Confirmation resolves ~one block after
inclusion (~3s) rather than after solidification (~19 blocks / ~60s), and all
reads are fresh and mutually consistent.

Configurable confirmation cap

New config key waitTimeoutMs (built-in 60000 ms) supplies the default
--wait polling cap; --wait-timeout overrides per-invocation.

Secret policy: wallet secrets are TTY-only

import mnemonic / import private-key / change-password secrets are entered
interactively (hidden prompt) — the --mnemonic-stdin / --private-key-stdin
channels were removed. Only password, tx, and message remain stdin-backed.
No secret ever sits in argv, env, or the process table.

Refactors (no behavior change)

  • Family-keyed command contract — one ChainCommandDefinition per logical
    chain command: a service-free ChainSpec plus a family → FamilyBinding
    table. registerTronChainCommands replaces TronModule; commands/tron/*
    folded up into commands/*.
  • render/index.ts split by command domain (wallet / account / tx / vote /
    reward / chain / misc). Golden suite byte-identical.
  • First-class array flags — repeatable --for via yargs array: true
    (no preprocess/pipe patch).

⚠️ Breaking change

Stable command id dropped the tron. prefix: chain command ids are now
path.join(".") (e.g. tx.send, not tron.tx.send). The family travels in the
envelope's chain.family. The --json-schema catalog is otherwise identical
modulo this prefix removal.

Docs

ts/docs/typescript-wallet-cli-architecture-source-of-truth.md updated to match:
command surface, command contract, ports/use-cases, capability list, full-node
read model, secret policy, config keys, and arity.

Verification

typecheck · depcruise · test · build clean; golden suite passing.

gummy789j and others added 6 commits July 8, 2026 00:40
One ChainCommandDefinition per logical chain command: a neutral,
service-free ChainSpec (path, policy, baseFields, shared formatText)
plus a family->FamilyBinding table (run + delta fields/refine).
Registry assembles same-path bindings; shell dispatches by resolving
the network first, then the binding via net.family
(network_family_mismatch when absent), merging baseFields with the
binding's delta and composing base->family refines.

- command id = path.join(".") — drop the tron. prefix; the family
  travels in the envelope's chain.family
- help/catalog render one entry per chain command with families: [...]
  and a merged input schema
- registerTronChainCommands(registry, deps) replaces TronModule;
  commands/tron/* folded up into commands/*
- remove dead legacy paths: resolveCandidates/resolveForFamily/tree(),
  CommandDefinition.family, and the Networked/Networkless union —
  CommandDefinition is now neutral-and-networkless by type

User-facing surface is unchanged: --json-schema catalog is identical
modulo the tron. prefix removal; all describe()/summary strings are
byte-identical; golden suite 360 passed / 2 skipped; tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pure moves, no output change (golden suite byte-identical):
  family.ts  — FAMILY_RENDER hook table + renderFamily
  wallet.ts  — wallet receipts + list tree view
  account.ts — account/token queries + history/portfolio rows
  tx.ts      — signing receipts + tx status/info
  misc.ts    — config/networks/contract/message/block
index.ts stays the barrel: reassembles TextFormatters (spread) and
keeps renderGenericText, so no importer changes. methodName moves to
scalars.ts (shared by tx receipts and contract call).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(ts): add vote and reward commands
…s, vote/reward

Steven's v0.1.1 slice plus Leon's vote/reward (#949), rectified to repo conventions:
- config: waitTimeoutMs (configurable --wait-timeout default)
- gateway: TRON stake/chain read RPCs; reads + tx confirmation via the full node
  (fast --wait ~3s instead of ~60s solidity lag; fresh, consistent reads)
- stake: info / delegated queries + public votingPower()
- chain: params / prices / node
- change-password + import mnemonic/private-key: TTY-only secret entry (no --*-stdin)
- vote: cast / list / status ; reward: balance / withdraw
  (rectified: reuse stake.votingPower via injected TronStakeService, scope.warn instead
   of a __walletCliWarnings data side-channel, shared scalars.formatAtWithRelative,
   bounded/cached brokerage fan-out, pct & receipt-summary cleanups)
- arity: first-class array flags (--for) via yargs array:true — no preprocess/pipe patch
- render: preserve fractional TRX; chain untagged (generic, not TRON-exclusive)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gummy789j gummy789j changed the title Feat/ts v0.1.1 feat: ts v0.1.1 Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant