Skip to content

Dev/v2merge#11

Merged
Hades-Ye merged 6 commits intodev/v2from
dev/v2merge
Mar 12, 2026
Merged

Dev/v2merge#11
Hades-Ye merged 6 commits intodev/v2from
dev/v2merge

Conversation

@boboliu-1010
Copy link
Copy Markdown
Collaborator

Description

Tests

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits

bobo added 6 commits March 12, 2026 17:08
# Conflicts:
#	typescript/packages/mechanisms/tron/package.json
#	typescript/packages/mechanisms/tron/src/exact/client/eip3009.ts
#	typescript/packages/mechanisms/tron/src/types.ts
#	typescript/packages/mechanisms/tron/src/utils.ts
@Hades-Ye Hades-Ye merged commit f8ae11c into dev/v2 Mar 12, 2026
7 checks passed
@Hades-Ye Hades-Ye deleted the dev/v2merge branch March 12, 2026 15:24
boboliu-1010 pushed a commit that referenced this pull request Apr 27, 2026
Followup to the 2026-04-27 Nile evaluation. Two GasFree quirks were
worth correcting in user-facing code rather than just documenting.

balance: query the chain directly, not GasFree API
- New src/onchain.ts: getTrc20Balance() hits the Tron full-node
  /wallet/triggerconstantcontract endpoint with hand-built calldata.
  No tronweb abi-encoder, no signature, no broadcast.
- balance command now surfaces both chainBalance + apiBalance per
  asset, plus an apiBalanceStale flag and a stderr warning when the
  two disagree. Verified live: chain=23.2948 USDT vs api=0 → stale
  warning fired correctly.
- New balance test covers the stale path (chain ≠ api → warning + flag).

transfer --dry-run: surface GasFree fee economics
- Computes feeAsPercentageOfAmount = (transferFee + activateFee) /
  amount. Also emits a stderr WARNING when fees ≥ 10% of payment.
  At our default 0.001 USDT test amount the warning is 10000.0% — loud
  on purpose; users should know GasFree has flat per-tx fees and is
  uneconomical for sub-dollar payments.

Documentation:
- docs/solutions.md #11: GasFree assets[].balance can lag the chain;
  always read from the contract.
- docs/solutions.md #12: GasFree fee structure is flat-per-tx; small
  payments have huge fee/amount ratios. Recommends switching to
  ERC-3009 exact for micropayments.
- typescript/packages/cli/README.md: new "GasFree economics" section
  before the configuration reference, with the break-even rule of
  thumb and a pointer to the new solutions entries.

Tests: 94 (was 93). All green. balance.test.ts gained one stale-flag
test; transfer/dry-run continues to assert the wrapped envelope shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants