Merged
Conversation
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
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>
7 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