app-monorepo icon indicating copy to clipboard operation
app-monorepo copied to clipboard

[Feature] Support x402 payments

Open ottok opened this issue 11 months ago • 0 comments

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

ottok avatar May 12 '25 17:05 ottok