OneKeyHQ / OneKeyHQ/app-monorepo

[Feature] Support x402 payments

Open
#7,314 0 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
TypeScript
Stars
2.4k
Forks
535
Avg merge
21h 55m
Merged PRs (30d)
497

Description

**Is your feature request related to a problem? Please describe.**

Currently payments on websites are triggered by embedded JavaScript asking some web3 library to call the browser wallet extension or similar to accept and sign a payment.

x402 is a new open source protocol resurrecting the HTTP 402 Payment Required for online payments

**Describe the solution you'd like**

I would like to see OneKey detect if a HTTP request fails with error code 402 on any site, and then read the payload of that request and present the user with a dialog that has the payment details, for example

> Website example.com is requesting payment to allow access to URL example.com/x/y/z
> Do you approve the requested payment of 0.01 USDC to recipient A1B2C3?
> [Approve] [Decline]

If user approves, OneKey would resubmit the same HTTP request but add `X-Payment` headers with the signed transaction as specified in https://www.coinbase.com/en-ca/developer-platform/discover/launches/x402

![Image](https://github.com/user-attachments/assets/5c3aa1a6-48e2-47d8-a8a0-75f85b88fe38)

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by locating OneKey's HTTP request interception and wallet transaction-signing entry points, then study the linked x402 specification and determine how a 402 payload, approval dialog, and X-Payment resubmission should flow; done means the full interaction is designed and validated across supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.