Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support x402 v1 402s (requirements in the body, X-PAYMENT header)

Đã đóng
#14 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

@franciscorodr26 đang làm issue này rồi.

Từ ngày 7/10/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
56/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
payments

Hướng nghiên cứu

Start by reading the x402 response parsing and payment-header handling, then inspect test/real-merchants.test.ts for the existing v2 fixtures and tests. Add tests for the captured v1 responses and verify opt-in parsing, strict rejection of unknown keys, v1 payment headers, and refusal of a wrong payee or higher price before signing; the issue does not name the implementation files.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement good first issue

Why

Some live merchants on Base still speak x402 v1: the requirements come only in the JSON body (x402Version: 1, network: "base", maxAmountRequired) and they expect an X-PAYMENT header back. Seen on 2026-10-07: Neynar, SLAMai (CryptoSlam) and Browserbase. Today the SDK refuses these 402s (no PAYMENT-REQUIRED header).

What

  • Opt-in v1 compatibility (policy.acceptV1: true): parse the v1 body into the same PaymentRequirements shape (map base → eip155:8453, maxAmountRequired → amount), then run exactly the same policy checks.
  • Send the payment as v1 X-PAYMENT for those merchants; read the receipt from X-PAYMENT-RESPONSE (already supported).
  • Strict schemas as for v2; unknown keys rejected.

Acceptance

  • Unit tests with the captured v1 402s (see test/real-merchants.test.ts for the v2 ones).
  • A v1 402 asking for a different payee or a higher price is refused before signing, same as v2.
Ngôn ngữ chính
TypeScript
Star
0
Fork
0
Merge trung bình
3 giờ 51 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DeepFirstHQ/deepfirstsearch

Tất cả issue của DeepFirstHQ/deepfirstsearch

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.