Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
797057f
feat(ts): add the SunSwap and SunPump command groups
gummy789j Sep 28, 2026
39a436e
ops: update version
gummy789j Sep 28, 2026
7e2b8b7
build(ts): resolve the SunSwap SDK from public npm
gummy789j Sep 28, 2026
65a82b8
fix(ts): name a V4 pool by its key, not by a pool id
gummy789j Sep 29, 2026
b07c3a8
fix(ts): report the position a V4 mint creates
gummy789j Sep 29, 2026
a7f95db
fix(ts): four V4 outputs that disagreed with what actually happens
gummy789j Sep 29, 2026
d57cea2
docs(ts): bring the command reference up to date with what ships
gummy789j Sep 29, 2026
fce38b8
fix(ts): report an unminted position id as position_not_found everywhere
gummy789j Sep 29, 2026
d8118e2
fix(ts): refuse --create-pool on a V4 pool that already exists
gummy789j Sep 29, 2026
7605294
fix(ts): refuse a zero swap amount before asking any market
gummy789j Sep 29, 2026
017f2cd
fix(ts): refuse --wait where there is nothing to wait for
gummy789j Sep 29, 2026
bd73aad
fix: reconcile liquidity receipts and optimize golden tests
gummy789j Sep 29, 2026
0444f8e
fix(ts): address verified Ledger and liquidity issues
gummy789j Sep 29, 2026
b5f4624
fix(ts): format V4 fixtures for CI
gummy789j Sep 29, 2026
623c9ec
fix(ts): address v4.15.0 test-case findings for sunswap and sunpump
gummy789j Oct 6, 2026
99726fe
fix(ts): document both Ledger TRON app settings for sunswap and sunpump
gummy789j Oct 8, 2026
6584bd1
refactor(ts): source SunSwap/SunPump contract addresses from the SDK …
gummy789j Oct 8, 2026
57b03f9
fix(ts): bind SunSwap routes to the requested swap
gummy789j Oct 8, 2026
34a7c30
chore(ts): drop internal process references from comments
gummy789j Oct 8, 2026
1837b51
test(ts): use zod v4 issue type and portable fixture paths
gummy789j Oct 8, 2026
067b5fb
fix: wait for prerequisite approvals before dependent transactions
gummy789j Oct 8, 2026
ccecb01
fix(ts): swap through a standing Permit2 grant instead of refusing
gummy789j Oct 8, 2026
45c36ee
fix(ts): separate V4 mint recipient from Permit2 owner
gummy789j Oct 8, 2026
8d6c238
fix(ts): validate --deadline on V4 add-liquidity
gummy789j Oct 8, 2026
0124d80
fix(sunswap): reject reversed V4 position token pairs
gummy789j Oct 8, 2026
cd18aa4
fix(ts): simulate V3 collect as the position owner
gummy789j Oct 8, 2026
17735e6
docs(sunswap): clarify slippage and approval semantics
gummy789j Oct 8, 2026
254a749
fix(sunswap): correct offline builds and validate remote data
gummy789j Oct 8, 2026
cd751fe
docs(ts): bring SunSwap/SunPump docs in line with the shipped code
gummy789j Oct 8, 2026
b6ff2f4
fix(ts): show the SunSwap quote fee in the input token
gummy789j Oct 8, 2026
a428ad6
build(ts): move the SunSwap SDK to the 0.1.0 release
gummy789j Oct 8, 2026
220b622
docs: reconcile PM documentation with CLI behavior
gummy789j Oct 8, 2026
54dffe4
fix(ts): merge config.yaml sunswap/sunpump blocks over the builtins
gummy789j Oct 8, 2026
ac559e8
fix(ts): report an unconfirmed sunpump launch as launch_outcome_unknown
gummy789j Oct 8, 2026
980b16e
fix(ts): check V4 deposit balances before any approval or Permit2 grant
gummy789j Oct 8, 2026
0da3f1b
Merge pull request #1025 from tronprotocol/feat/ts-v4.15.0
gummy789j Oct 9, 2026
7b0e47b
fix(cli): address confirmed R75 defects and add regression coverage
gummy789j Oct 9, 2026
4f39b0d
Merge pull request #1029 from tronprotocol/fix/regression-v4.15.0
gummy789j Oct 10, 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
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .github/workflows/ts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ jobs:
cache: npm
cache-dependency-path: ts/package-lock.json

# The SDK was resolved from a registry on a private network until 2026-09-28. A runner cannot
# reach one, and npm's own message for that reads as a proxy problem, which sent the last
# reader after the wrong thing entirely. This keeps the invariant checkable rather than
# rediscoverable.
- name: Check every dependency resolves from the public registry
run: |
offenders=$(node -e '
const lock = require("./package-lock.json");
const bad = Object.entries(lock.packages ?? {})
.filter(([, v]) => v.resolved && !v.resolved.startsWith("https://registry.npmjs.org/"))
.map(([k, v]) => `${k} -> ${v.resolved}`);
process.stdout.write(bad.join("\n"));
')
if [ -n "$offenders" ]; then
echo "::error::These packages do not resolve from the public npm registry:"
echo "$offenders"
echo "::error::A GitHub-hosted runner cannot reach a private registry, so 'npm ci' will time out."
echo "::error::This is not a network fault and not a proxy problem."
exit 1
fi

- name: Install locked dependencies
run: npm ci

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ graphify-out/
.claude/settings.local.json

.private/

# Scoped registry credentials for the private @sun-sdk packages; local-only until the SDK
# is published to public npm (see ts/docs/superpowers/specs, D6).
ts/.npmrc
7 changes: 4 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ Key points:
`adapters/outbound/chain/<family>/`, and the family plugin under `bootstrap/families/`. Both
`tron` and `evm` are registered unconditionally (`bootstrap/composition.ts`) and reachable: the
builtin networks and aliases cover ETH, Sepolia, BSC, BSC testnet, Base and Base Sepolia alongside the TRON three.
There is no family-level feature gate. EVM simply binds a narrower command set (29 bindings:
account, block, chain, tx, token, contract, message/typed-data signing and eight ERC-8004 identity commands) against TRON's 78, which adds
stake, permission, proposal, asset, GasFree and TronLink multisig.
There is no family-level feature gate. EVM simply binds a narrower command set (30 bindings:
account, block, chain, tx, token, contract, message/typed-data signing, `bai recharge` and eight ERC-8004 identity commands) against TRON's 96, which adds
stake, permission, proposal, asset, GasFree, TronLink multisig, and the SunSwap and SunPump groups (17 commands).
The counts are the `families` tags in `wallet-cli --json-schema`.
- **A single Zod schema per command** drives validation, yargs arity, help text, and JSON Schema.
- **Secrets** (private keys, mnemonics, BIP39 passphrases) are encrypted at rest and never accepted
from argv or env — only a dedicated stdin channel or hidden TTY prompt.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Both manage TRON wallets, but they are independent implementations rather than i
| **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, Base, and their testnets. |
| **Signing** | Software keystore · Ledger. | Encrypted local keystore · Ledger. Secrets enter via stdin/TTY, never argv or dedicated secret environment variables. |
| **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. |
| **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, SunSwap swaps & liquidity, SunPump trading & launches, 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 Down
2 changes: 1 addition & 1 deletion java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

group 'Tron'
version '4.14.0'
version '4.15.0'

apply plugin: 'java'
apply plugin: 'com.google.protobuf'
Expand Down
9 changes: 7 additions & 2 deletions java/docs/commands/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ Query and update on-chain accounts, manage account metadata, and view local reco

## How to create account

You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Either way the payer covers an on-chain account-creation fee, which is the sum of two chain parameters — `getCreateAccountFee` and `getCreateNewAccountFeeInSystemContract`. On mainnet today that is 100,000 SUN + 1,000,000 SUN = **1.1 TRX**, but both are proposal-adjustable, so read them with `getchainparameters` instead of assuming a fixed value.
You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Either way the payer covers the cost of creating the account, which has two parts:

- `getCreateNewAccountFeeInSystemContract` — always burned from the payer's TRX balance (1,000,000 SUN = **1 TRX** on mainnet today).
- The transaction's bandwidth — taken from the payer's **staked** bandwidth if there is enough of it (the free daily bandwidth does not count here). Only when staked bandwidth is insufficient does the chain burn `getCreateAccountFee` instead (100,000 SUN = **0.1 TRX** on mainnet today).

So creating an account costs 1 TRX when the payer has enough staked bandwidth, and 1.1 TRX when it does not. Both parameters are proposal-adjustable; read them with `getchainparameters` instead of assuming fixed values.

## CreateAccount

Create a new account with an inactive address. The payer covers the account-creation fee described above (about 1.1 TRX on mainnet today, `getCreateAccountFee` + `getCreateNewAccountFeeInSystemContract`).
Create a new account with an inactive address. The payer covers the account-creation cost described above: `getCreateNewAccountFeeInSystemContract` (1 TRX on mainnet today), plus `getCreateAccountFee` (0.1 TRX) only if the payer lacks enough staked bandwidth.

```console
> CreateAccount [OwnerAddress] Address
Expand Down
2 changes: 1 addition & 1 deletion java/docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $ java -jar wallet-cli.jar

## How to create account

You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Either way the payer covers an on-chain account-creation fee — the sum of the chain parameters `getCreateAccountFee` and `getCreateNewAccountFeeInSystemContract`, about **1.1 TRX** on mainnet today. See [Account commands](../commands/account.md#how-to-create-account).
You can create accounts by transferring funds to non-existing accounts, or by initiating a transaction to create an account using the **CreateAccount** command. Either way the payer burns `getCreateNewAccountFeeInSystemContract` (**1 TRX** on mainnet today); the transaction's bandwidth comes from the payer's staked bandwidth, and only if that is insufficient is `getCreateAccountFee` (**0.1 TRX**) burned as well — so 1 to 1.1 TRX in total. See [Account commands](../commands/account.md#how-to-create-account).

See [commands/account](../commands/account.md) for the full `CreateAccount` example.

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 @@ -136,7 +136,7 @@ public class Utils {

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

private static SecureRandom random = new SecureRandom();
Expand Down
34 changes: 34 additions & 0 deletions ts/.dependency-cruiser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ module.exports = {
from: { path: "^src/adapters/outbound/", pathNot: "\\.test\\.ts$" },
to: { path: "^src/(adapters/inbound|bootstrap)/" },
},
{
name: "sdk-adapters-only",
severity: "error",
comment:
"@sun-sdk is a vendor SDK, so it belongs behind the outbound adapter that owns it; anywhere else it would put a vendor's types in a port or a use case",
from: { path: "^src/", pathNot: "^src/adapters/outbound/(sunswap|sunpump)/" },
// Unanchored: an installed dependency resolves to `node_modules/@sun-protocol/sun-sdk-...`, an
// unresolvable one keeps its bare specifier, and both have to be caught.
// `import type` counts too — tsPreCompilationDeps is on, and a type-only edge still names
// the vendor where a port belongs and is what a later refactor turns into a runtime edge.
to: { path: "@sun-protocol/sun-sdk-" },
},
{
name: "sunswap-does-not-import-sunpump",
severity: "error",
comment: "the two SunSwap/SunPump adapters are separate integrations and share no code",
from: { path: "^src/adapters/outbound/sunswap/" },
to: { path: "^src/adapters/outbound/sunpump/" },
},
{
name: "sunpump-does-not-import-sunswap",
severity: "error",
comment: "the reverse of sunswap-does-not-import-sunpump",
from: { path: "^src/adapters/outbound/sunpump/" },
to: { path: "^src/adapters/outbound/sunswap/" },
},
{
name: "no-runtime-import",
severity: "error",
comment:
"@sun-protocol/sun-sdk-runtime can broadcast (sendAction) and build a wallet from a private key; exactly one file builds a read-only runtime over a TronClient that throws on both, and nothing else may reach for it",
from: { path: "^src/", pathNot: "^src/adapters/outbound/sunswap/sdk-runtime\\.ts$" },
to: { path: "@sun-protocol/sun-sdk-runtime" },
},
],
options: {
doNotFollow: { path: "node_modules" },
Expand Down
11 changes: 10 additions & 1 deletion ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The agent-first implementation of wallet-cli, built for automation: every comman
- **Agent-first** — stable JSON output, deterministic exit codes, and discoverable schemas, built for scripts, CI, and AI agents (details in [The contract, in one paragraph](#the-contract-in-one-paragraph)).
- **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 full TRON feature surface** — HD wallets, TRX and TRC20/TRC10 transfers, staking / resource delegation, voting / rewards, governance proposals and super-representative operation, smart-contract calls, deployment and governance, TRC10 issuance, the on-chain Bancor exchange, multi-sig, GasFree transfers, message signing, and on-chain queries.
- **Covers the full TRON feature surface** — HD wallets, TRX and TRC20/TRC10 transfers, staking / resource delegation, voting / rewards, governance proposals and super-representative operation, smart-contract calls, deployment and governance, TRC10 issuance, the on-chain Bancor exchange, SunSwap swaps and liquidity, SunPump trading and launches, multi-sig, GasFree transfers, message signing, and on-chain queries.
- **TRON and EVM chains** — one account holds an address on each; transfers, tokens, contracts, signing and chain queries work the same on both, and TRON-only protocol features are refused on EVM rather than half-working.

## Table of contents
Expand Down Expand Up @@ -175,6 +175,15 @@ Chain governance, super-representative operation, and TRON's protocol-level TRC1
| [`asset`](docs/commands/asset/index.md) | Issue and manage TRC10 tokens ([issue](docs/commands/asset/issue.md) · [update](docs/commands/asset/update.md) · [participate](docs/commands/asset/participate.md) · [unfreeze](docs/commands/asset/unfreeze.md) · [info](docs/commands/asset/info.md) · [list](docs/commands/asset/list.md)); TRC10 transfers go through [`tx send`](docs/commands/tx/send.md) |
| [`exchange`](docs/commands/exchange/index.md) | The protocol-level Bancor exchange between TRX and TRC10 ([create](docs/commands/exchange/create.md) · [inject](docs/commands/exchange/inject.md) · [withdraw](docs/commands/exchange/withdraw.md) · [trade](docs/commands/exchange/trade.md) · [show](docs/commands/exchange/show.md) · [list](docs/commands/exchange/list.md)) |

### SunSwap and SunPump

Trade and provide liquidity on SunSwap, and trade or launch tokens on the SunPump bonding curve (TRON mainnet; the SunSwap liquidity commands also run on Nile).

| Command | Description |
|---|---|
| [`sunswap`](docs/commands/sunswap/index.md) | Swap tokens and manage V2/V3/V4 liquidity ([swap](docs/commands/sunswap/swap.md) · [add-liquidity](docs/commands/sunswap/add-liquidity.md) · [remove-liquidity](docs/commands/sunswap/remove-liquidity.md) · [collect-fees](docs/commands/sunswap/collect-fees.md)), and look up pools, positions, tokens and prices ([pool-list](docs/commands/sunswap/pool-list.md) · [position-list](docs/commands/sunswap/position-list.md) · [price](docs/commands/sunswap/price.md), …) |
| [`sunpump`](docs/commands/sunpump/index.md) | Buy and sell tokens on their bonding curve, launch a token, and look tokens up ([buy](docs/commands/sunpump/buy.md) · [sell](docs/commands/sunpump/sell.md) · [launch](docs/commands/sunpump/launch.md) · [token-list](docs/commands/sunpump/token-list.md) · [token-info](docs/commands/sunpump/token-info.md) · [token-search](docs/commands/sunpump/token-search.md)) |

### Payments and Agent identity

| Command | Description |
Expand Down
2 changes: 2 additions & 0 deletions ts/docs/commands/bai/recharge.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Creates a recharge order with B.AI, pays it from the active account (or `--accou

The minimum is 1 for USDT and USDC; USDD has none.

On TRON, a first `exact` recharge may also broadcast a one-time `approve(Permit2, MaxUint256)` from the account, which burns its Energy or TRX and grants an unlimited allowance — see [`x402 pay`](../x402/pay.md#description).

**Who gets the credits.** Without `--to`, the account that owns the API key. With `--to`, the B.AI account behind that email or wallet address (EVM, TRON, or Solana); B.AI resolves it before the order is created.

**Checked before an order is created:**
Expand Down
2 changes: 1 addition & 1 deletion ts/docs/commands/chain/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Frequently used keys:
|---|---|
| `getEnergyFee` | Energy unit price (SUN/energy) — the burn rate when you lack energy; core input to fee estimation |
| `getTransactionFee` | Bandwidth unit price (SUN/byte) — the burn rate once free bandwidth is spent |
| `getCreateAccountFee` | System-side account creation fee (SUN) — part of the extra cost of sending to a fresh address |
| `getCreateAccountFee` | Burned (SUN) when creating an account and the payer lacks enough staked bandwidth for the transaction — otherwise staked bandwidth is used instead |
| `getWitnessPayPerBlock` | SR reward per block produced (SUN) — feeds the voting-reward pool |
| `getMaintenanceTimeInterval` | Maintenance cycle length (ms; 21,600,000 = 6 h) — the vote-tally / SR-ranking period |

Expand Down
Loading
Loading