搜索

PythonReactSEOPDF
OpenClaw

clawhub-x402-payments

Implements USDC x402 payments via PayAI (EIP-3009) and DHM x402 payments via EVVM native (signed pay). Use when adding x402 payment flows, PayAI Echo integration, EVVM pay() for DHM, agent-to-agent payments with Privy, or when the user asks how to do USDC/DHM x402 in the ClawHub/NHS EVVM app.

arunnadarasa0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install arunnadarasa/digitalhealth

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

ClawHub x402 Payments (USDC via PayAI + DHM via EVVM)

This skill documents the two x402 payment flows in the NHS EVVM / ClawHub app: USDC via PayAI Echo and DHM via EVVM native. Reference implementation lives in this repo.

Reference paths

Flow Client UI Server / config
USDC (PayAI) frontend/src/components/sections/USDCX402TestSection.tsx Config: frontend/src/config/contracts.ts (X402_USDC_ECHO_URL, USDC_BASE_SEPOLIA)
DHM (EVVM) frontend/src/components/sections/X402TestSection.tsx server/src/index.ts (GET 402, POST /payments/evvm/dhm)
EVVM sign frontend/src/lib/evvmSign.ts —

Chain: Base Sepolia (chainId 84532).


Flow 1: USDC x402 via PayAI Echo

PayAI returns 402 with an accepts array (not options). Client picks a USDC option, builds EIP-3009 TransferWithAuthorization, signs EIP-712, sends signature in PAYMENT-SIGNATURE header, retries the same URL; server returns 200 and may set PAYMENT-RESPONSE header with result (e.g. transaction hash).

Client steps
  1. Request resource
    GET <Echo URL> (e.g. https://x402.payai.network/api/base-sepolia/paid-content).

  2. Parse 402

    • Prefer PAYMENT-REQUIRED response header (base64-encoded JSON).
    • Fallback: response body may be JSON with accepts array.
    • Type: { x402Version?, error?, resource?, accepts: Array<{ scheme, network, amount, asset, payTo, maxTimeoutSeconds?, extra? }> }.
  3. Pick USDC option

    • From accepts, choose entry where asset matches USDC on Base Sepolia or extra.name === "USDC".
    • Use amount, asset, payTo, extra.name / extra.version for EIP-712.
  4. Build EIP-3009 authorization

    • Domain: name = extra?.name ?? "USDC", version = extra?.version ?? "2", chainId = 84532, verifyingContract = asset.
    • Type: TransferWithAuthorization: from, to, value, validAfter (0), validBefore (e.g. now...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/arunnadarasa/digitalhealth
Version
—
Commit
e8255e215803d2772c593825128965602c16fecc
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# ClawHub x402 Payments (USDC via PayAI + DHM via EVVM)

This skill documents the two x402 payment flows in the NHS EVVM / ClawHub app: **USDC via PayAI Echo** and **DHM via EVVM native**. Reference implementation lives in this repo.

## Reference paths

| Flow | Client UI | Server / config |
|------|-----------|------------------|
| USDC (PayAI) | `frontend/src/components/sections/USDCX402TestSection.tsx` | Config: `frontend/src/config/contracts.ts` (X402_USDC_ECHO_URL, USDC_BASE_SEPOLIA) |
| DHM (EVVM) | `frontend/src/components/sections/X402TestSection.tsx` | `server/src/index.ts` (GET 402, POST /payments/evvm/dhm) |
| EVVM sign | `frontend/src/lib/evvmSign.ts` | — |

Chain: **Base Sepolia** (chainId 84532).

---

## Flow 1: USDC x402 via PayAI Echo

PayAI returns **402** with an `accepts` array (not `options`). Client picks a USDC option, builds EIP-3009 `TransferWithAuthorization`, signs EIP-712, sends signature in `PAYMENT-SIGNATURE` header, retries the same URL; server returns 200 and may set `PAYMENT-RESPONSE` header with result (e.g. `transaction` hash).

### Client steps

1. **Request resource**  
   `GET <Echo URL>` (e.g. `https://x402.payai.network/api/base-sepolia/paid-content`).

2. **Parse 402**  
   - Prefer `PAYMENT-REQUIRED` response header (base64-encoded JSON).  
   - Fallback: response body may be JSON with `accepts` array.  
   - Type: `{ x402Version?, error?, resource?, accepts: Array<{ scheme, network, amount, asset, payTo, maxTimeoutSeconds?, extra? }> }`.

3. **Pick USDC option**  
   - From `accepts`, choose entry where `asset` matches USDC on Base Sepolia or `extra.name === "USDC"`.  
   - Use `amount`, `asset`, `payTo`, `extra.name` / `extra.version` for EIP-712.

4. **Build EIP-3009 authorization**  
   - Domain: `name` = `extra?.name ?? "USDC"`, `version` = `extra?.version ?? "2"`, `chainId` = 84532, `verifyingContract` = `asset`.  
   - Type: `TransferWithAuthorization`: `from`, `to`, `value`, `validAfter` (0), `validBefore` (e.g. now...

相关技能

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

0protocol

0isone

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.