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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/arunnadarasa/digitalhealthClawHub 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
-
Request resource
GET <Echo URL>(e.g.https://x402.payai.network/api/base-sepolia/paid-content). -
Parse 402
- Prefer
PAYMENT-REQUIREDresponse header (base64-encoded JSON). - Fallback: response body may be JSON with
acceptsarray. - Type:
{ x402Version?, error?, resource?, accepts: Array<{ scheme, network, amount, asset, payTo, maxTimeoutSeconds?, extra? }> }.
- Prefer
-
Pick USDC option
- From
accepts, choose entry whereassetmatches USDC on Base Sepolia orextra.name === "USDC". - Use
amount,asset,payTo,extra.name/extra.versionfor EIP-712.
- From
-
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 + 300s),nonce(32 random bytes as hex). - Sign with
signTypedData(EIP-712).
- Domain:
-
Send payment and retry
- Build payload:
{ x402Version: 2, scheme, network, accepted: { scheme, network, amount, asset, payTo, maxTimeoutSeconds, extra? }, payload: { signature, authorization: message }, extensions: {} }. PAYMENT-SIGNATURE= base64(JSON.stringify(payload)).- Same URL:
GETwith headerPAYMENT-SIGNATURE: <base64>.
- Build payload:
-
Read result
- On 200: body is content. Optional
PAYMENT-RESPONSEorX-PAYMENT-RESPONSEheader (base64 JSON) may containtransaction(tx hash) etc.
- On 200: body is content. Optional
Config
VITE_X402_USDC_ECHO_URL: PayAI Echo endpoint (default:https://x402.payai.network/api/base-sepolia/paid-content).- USDC on Base Sepolia:
0x036CbD53842c5426634e7929541eC2318f3dCF7e.
Flow 2: DHM x402 via EVVM native
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-arunnadarasa-digitalhealth": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
krumpkraft-play
Teaches how to play KrumpKraft with EVVM payments, USDC.k and $IP. Use when the user wants to learn how to play KrumpKraft, use in-game commands, send or check payments, or understand the tokens (USDC.k, $IP, JAB) on Story.
Krumpklaw
Skill by arunnadarasa
elevenlabs
Converts text to natural speech using ElevenLabs for clinical and healthcare use cases. Use when generating patient instructions, discharge summaries, medication reminders, multilingual health messages, or accessible voice content for the OpenClaw Clinical Hackathon.
Krump
A dance skill designed to teach OpenClaw agents the fundamentals of Krump, including its history, fam system, music, crews, events, and other related topics. The knowledge base extends up to 2017, so some information may be outdated or inaccurate
quantinuumclaw
Enables building and deploying quantum computing applications with Quantinuum, Guppy, Selene, and Fly.io. Use for the OpenClaw Clinical Hackathon, clinical or healthcare projects (drug discovery, treatment optimization, patient stratification, trial randomization), quantum-powered web apps, deploying quantum algorithms to the cloud, or integrating quantum results into user-facing interfaces.