Dev/v2merge#14
Merged
boboliu-1010 merged 3 commits intodev/v2from Mar 12, 2026
Merged
Conversation
boboliu-1010
pushed a commit
that referenced
this pull request
Apr 28, 2026
…ANGELOG + docs
User requirement: "默认用 exact_permit 和 exact" — the CLI should pick
the cheapest user-fee scheme by default rather than always defaulting
to exact_gasfree's 0.1 USDT relayer cut.
Headline behavior change:
- Profile.scheme is now optional. When unset, transfer/pay auto-pick
per (network, token) via the new src/schemes.ts table:
eip155:97 DHLU → exact (ERC-3009)
eip155:97/56 USDT/USDC → exact_permit (EIP-2612)
tron:* USDT → exact_permit (TIP-712), with allowance-
failure auto-fallback to
exact_gasfree
- Default `nile` profile pinned to exact_permit (was exact_gasfree).
Both BSC and TRON exact_permit settle through the BankofAI root
facilitator with feeAmount=0 — verified live on BSC Testnet, tx
0xe6458fcbf1da1da9a0c638cf68b357982781ae932b6742a02331d2371bfeaf30.
Implementation:
- src/schemes.ts (+10 unit tests): recommendedSchemes / pickScheme /
isKnownScheme. Single source of truth for per-token scheme support.
- src/commands/transfer.ts: split into settleViaFacilitator (exact /
exact_permit via FacilitatorHttpClient /fee/quote /verify /settle)
and settleViaGasFree (in-process GasFreeAPIClient.submit). 9 unit
tests covering both paths, dry-run, fallback, and error envelopes.
- src/commands/pay.ts: registers exact + exact_permit on EVM and
exact_permit + exact_gasfree on TRON. Selector filters server
accepts[] by scheme/maxAmount.
- src/commands/request.ts (+5 unit tests): offline transfer-request URI
generator. Falls back to built-in defaults when ~/.x402/config.json
is absent.
- src/wallet.ts: createTronClientSignerFromEnv /
createEvmClientSignerFromEnv. Pure env-key path, no agent-wallet
dependency at signing time. EVM derivation supported (was post-MVP).
- src/facilitator.ts: getFacilitatorBaseUrl(eip155:*) now returns the
root URL (was a non-existent /bsc-testnet 404). Per solutions.md
#14 the BankofAI proxy serves EVM schemes from root, only TRON
GasFree uses network-scoped paths.
- src/commands/doctor.ts: readiness probe falls back to /supported
when /api/v1/config/provider/all 404s, so EVM doctors don't
misreport facilitator=fail.
Documentation:
- typescript/packages/cli/CHANGELOG.md: new file. 0.1.0 entry covering
every shipped command + known limitations (TRON USDT transferFrom
revert, single Nile GasFree provider, scheme registry coverage).
- typescript/packages/cli/README.md: rewritten "Schemes & fees"
section with the cost-comparison table; first-run flow now
recommends BSC testnet for fee-free demo; live tx hash linked.
- docs/solutions.md #13: TRON USDT (TRC-20) transferFrom returns no
data — breaks exact_permit settle. Workaround: pin --scheme
exact_gasfree on TRON USDT until SDK ships a TRC-20-aware adapter.
- docs/solutions.md #14: BankofAI facilitator URL semantics — root
for everything except the TRON GasFree balance proxy.
- specs/002-bankofai-cli/notes/decisions.md D4 updated: EVM facilitator
is root, not per-chain slug.
Tests: 15 files, 114 unit tests. Build clean. Real-chain BSC
exact_permit verified end-to-end with feeAmount=0; TRON exact_permit
dry-run works (live fee_quote returns 0); TRON exact_gasfree path
intact (prior session txs).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Tests
Checklist