Skip to content

fix: repair response model construction and type definitions#2

Merged
Hades-Ye merged 4 commits intomainfrom
fix/response-models
Mar 6, 2026
Merged

fix: repair response model construction and type definitions#2
Hades-Ye merged 4 commits intomainfrom
fix/response-models

Conversation

@Hades-Ye
Copy link
Copy Markdown
Contributor

@Hades-Ye Hades-Ye commented Mar 6, 2026

Summary

  • SupportedResponse missing fee field: X402Facilitator.supported() constructed SupportedResponse without the required fee field, causing 500 on /supported endpoint
  • TypeScript FeeQuoteResponse incomplete: Missing scheme and asset fields that Python facilitator returns
  • TypeScript SupportedResponse.fee optional: Should be required to match Python model
  • SettleResponse error paths missing network: Both X402Facilitator.settle() and X402Server.settle_payment() omitted network in error responses
  • Facilitator HTTP timeout too short: 30s timeout insufficient for GasFree settlement polling (typically 9-28s), increased to 120s

Test plan

  • Python tests: 174 passed
  • TypeScript build + tests: 16 passed
  • Ruff lint + format: passed
  • E2E: Python exact_permit on Nile - success
  • E2E: Python exact_gasfree on Nile - settlement success
  • E2E: TypeScript gasfree on Nile - success

Hades-Ye added 4 commits March 6, 2026 21:11
- Add missing fee field to SupportedResponse in X402Facilitator.supported()
- Add missing scheme and asset fields to TypeScript FeeQuoteResponse
- Make SupportedResponse.fee required in TypeScript (match Python)
- Add network field to SettleResponse error paths in facilitator and server
- Increase facilitator HTTP client timeout from 30s to 120s for GasFree settlement
The fee field on SupportedResponse was a single value for multiple kinds,
which is architecturally incorrect. Aligns with coinbase/x402 which has
no fee field on SupportedResponse. Fee info is provided per-request via
/fee/quote endpoint instead.
@Hades-Ye Hades-Ye merged commit 9a38228 into main Mar 6, 2026
7 checks passed
@Hades-Ye Hades-Ye deleted the fix/response-models branch March 7, 2026 05:59
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