恢复访问权限
Updated:
丢失了某笔订单的访问令牌?通过签署一条一次性消息来证明您是该付费钱包的所有者,即可获取该钱包的所有订单(包含新的访问令牌)、仍在处理中的支付以及余额信息。
除非您将其撤销,否则旧代币仍可继续使用。
流程
迎接挑战
POST /wallet/challenge向您的钱包返回一条文本消息(EIP-4361)。
请在消息末尾签名
personal_sign(EIP-191) 中的message完全按收到的内容呈现。签名不会导致资金转移。恢复
POST /wallet/recover返回包含新访问令牌的钱包订单。
迎接挑战
请求正文
名称 | 类型 | 描述 |
|---|---|---|
地址 | 字符串 | 必填。钱包地址, |
目的 | 字符串 |
|
向任意地址发出挑战时:响应不会告知该地址是否有指令。
示例
POST https://proxy-seller.com/api/x402/v1/wallet/challenge
{
"address": "0x1111111111111111111111111111111111111111",
"purpose": "recover"
}回复
200:OK
{
"challenge_id": "chl_01JZ9E5F7G9H1J3K5M7N9P1Q3R",
"address": "0x1111111111111111111111111111111111111111",
"purpose": "recover",
"message": "proxy-seller.com wants you to sign in with your Ethereum account:\n0x1111111111111111111111111111111111111111\n\nRecover access to orders paid from this wallet at Proxy-Seller. Signing does not move funds.\n\nURI: https://proxy-seller.com/api/x402/v1/wallet/recover\nVersion: 1\nChain ID: 8453\nNonce: sDYRsY6sbhBxxPSC\nIssued At: 2026-11-02T12:00:00Z\nExpiration Time: 2026-11-02T12:05:00Z\nRequest ID: chl_01JZ9E5F7G9H1J3K5M7N9P1Q3R",
"expires_at": "2026-11-02T12:05:00Z",
"signature": {
"type": "eip191_personal_sign",
"contract_wallets": "eip1271"
}
}挑战持续 5 分钟,且仅可使用一次。通过 EIP-1271 支持智能合约钱包,当contract_wallets 是eip1271.
恢复
请求正文
名称 | 类型 | 描述 |
|---|---|---|
challenge_id | 字符串 | 必填。挑战的ID为 |
签名 | 字符串 | 必填。签名: |
限制 | 整数 | 每页条目数,1–200,默认50条 |
offset | 整数 | 页码偏移量,从 0 开始 |
revoke_existing | 布尔值 | 撤销该钱包在本次挑战创建之前发行的所有代币 |
每页都需要一个新挑战。发送revoke_existing: true 仅限首页:在后续页面中,这将撤销您在之前页面中刚刚获得的代币。
示例
POST https://proxy-seller.com/api/x402/v1/wallet/recover
{
"challenge_id": "chl_01JZ9E5F7G9H1J3K5M7N9P1Q3R",
"signature": "0x9a7c…1c",
"limit": 50,
"offset": 0
}回复
200:OK
{
"wallet": "0x1111111111111111111111111111111111111111",
"network": "eip155:8453",
"account": {
"type": "wallet",
"exists": true,
"status": "active",
"balance_usd": "6.40",
"email_attached": false,
"topup_url": "https://proxy-seller.com/api/x402/v1/topup",
"withdraw_url": "https://proxy-seller.com/api/x402/v1/wallet/withdraw"
},
"orders": [
{
"order_id": "ord_01JZ8Q7K5N2R4T6V8X0Z2B4D6F",
"status": "active",
"payment_state": "settled",
"summary": "2x IPv4 US, 30 days",
"amount_usd": "3.60",
"created_at": "2026-11-02T10:01:12Z",
"expires_at": "2026-12-02T23:59:59Z",
"url": "https://proxy-seller.com/api/x402/v1/orders/ord_01JZ8Q7K5N2R4T6V8X0Z2B4D6F",
"access_token": "x402_Nf5gT2hY8jU4kI1oL7pA3sD9fG6hJ0kL2zX5cV8bN4m",
"token_type": "Bearer"
}
],
"pending_payments": [],
"topups": [
{
"id": "tup_01JZ9D4E6F8G0H2J4K6M8N0P2Q",
"status": "credited",
"payment_state": "settled",
"amount_usd": "10.00",
"created_at": "2026-11-02T11:20:31Z",
"url": "https://proxy-seller.com/api/x402/v1/topup/tup_01JZ9D4E6F8G0H2J4K6M8N0P2Q",
"access_token": "x402_Rt6yU1iO7pA2sD8fG3hJ9kL4zX0cV5bN6mQ1wE7rT2y",
"token_type": "Bearer"
}
],
"withdrawals": [
{
"id": "wdr_01JZ9E8H0J2K4M6N8P0Q2R4S6T",
"status": "done",
"amount_usd": "6.40",
"address": "0x1111111111111111111111111111111111111111",
"network": "eip155:8453",
"created_at": "2026-12-03T09:14:22Z",
"tx_hash": "0x5c3e8a1f0b7d4e2c9a6f1b8d3e0c7a4f2b9e6d1c8a5f3e0b7d4c1a9f6e3b8d2c",
"sent_at": "2026-12-03T15:40:05Z",
"confirmed_at": "2026-12-03T15:43:10Z"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1
}
}名称 | 描述 |
|---|---|
账号 |
|
订单 | 钱包中的订单按最新优先排序,并附带新代币。当订单的访问期结束时(到期后90天),将不再发放代币。 |
待处理付款 | 结果尚未确定或正在审核中的付款: |
topups | 最多20项最新充值记录,附带新代币 |
提款 | 钱包中最近的20笔提现请求,按时间倒序排列: |
分页 |
|
注意 | 仅适用于被封禁的钱包:订单中不显示代币数量 |
401:未授权 — 该签名并非来自挑战的地址。
404:未找到
{
"error": "not_found",
"message": "Challenge not found",
"retryable": false,
"retry_action": "abandon",
"detail": "challenge is unknown, expired or already used"
}该挑战为未知、已过期、已被使用或已发放withdraw。换一个新的。