Skip to content

feat(e2e): add coinbase express server and facilitator with MoneyParser#12

Merged
Hades-Ye merged 2 commits intodev/v2from
feature/coinbase-e2e
Mar 12, 2026
Merged

feat(e2e): add coinbase express server and facilitator with MoneyParser#12
Hades-Ye merged 2 commits intodev/v2from
feature/coinbase-e2e

Conversation

@Hades-Ye
Copy link
Copy Markdown
Contributor

Summary

  • Added new E2E test components for the official Coinbase x402 v2 SDK in e2e/coinbase/.
  • Implemented MoneyParser mechanism for EVM DHLU token mapping ($0.001 -> 1000 DHLU).
  • Restricted Coinbase implementations to EVM protocol only.
  • Integrated with existing E2E discovery framework (always discovered by default).
  • Verified with full E2E flow using pnpm --filter @bankofai/x402-e2e test --servers=coinbase-express --facilitators=coinbase-typescript --clients=axios --families=evm.

Changes

  • Created e2e/coinbase/servers/express using @x402/express and @x402/core.
  • Created e2e/coinbase/facilitators/typescript using @x402/core and @x402/evm.
  • Updated e2e/src/discovery.ts to include coinbase directories in test discovery.
  • Updated e2e/setup.sh and e2e/package.json with --coinbase support.
  • Updated e2e/pnpm-workspace.yaml to include the new packages.

Implement e2e tests for coinbase v2 SDK using MoneyParser for DHLU token.
- Add coinbase components in e2e/coinbase
- Support MoneyParser for EVM DHLU mapping
- Integrate with existing e2e discovery and setup framework
- Restrict coinbase implementations to EVM only as requested
@Hades-Ye Hades-Ye merged commit 0135c98 into dev/v2 Mar 12, 2026
7 checks passed
@Hades-Ye Hades-Ye deleted the feature/coinbase-e2e branch March 12, 2026 15:15
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.

1 participant