← 返回 Skills 市场
inthaiguy

Buy a travel eSIM - via x402 USDC Base Wallet

作者 inthaiguy · GitHub ↗ · v1.0.2
cross-platform ✓ 安全检测通过
973
总下载
2
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install get-esim
功能描述
Purchase travel eSIM data plans using USDC on Base Mainnet or Sepolia testnet via x402, with eSIM delivery via a QR code installation page.
使用说明 (SKILL.md)

Get eSIM Skill

Purchase eSIM data packages using USDC on Base Mainnet (or testnet for testing) via the x402 protocol.

Description

This skill enables AI agents to purchase eSIM data packages for users. It uses the x402 payment protocol to pay with USDC on Base Mainnet (default) or Base Sepolia testnet (for testing), then delivers the eSIM installation page.

Default Network: Base Mainnet (production - real eSIMs) Test Network: Base Sepolia (testing - mock eSIMs)

Prerequisites

  • A wallet skill or USDC-capable wallet on Base (Mainnet or Sepolia)
  • USDC balance for purchases
  • ETH for gas (if using transfer scheme)

Suggested wallets: Coinbase Agentic Wallet, any x402-compatible wallet, or any wallet that supports Base USDC transfers.

Network Selection

By default, purchases happen on Base Mainnet (real eSIMs). For testing, explicitly specify the testnet network.

When to Use Each Network

Network Use Case eSIM Type
Base Mainnet (default) Production purchases Real eSIMs
Base Sepolia Development/testing Mock eSIMs

Specifying Network

The user can indicate their preference by:

  • Saying "testnet", "testing", "mock", or "demo" → Use Sepolia testnet
  • Not specifying, or saying "mainnet", "production", "real" → Use Base mainnet (default)

Invocation

Use this skill when a user:

  • Asks for an eSIM or mobile data
  • Needs cellular data for travel
  • Wants to buy a data plan for a specific country
  • Mentions needing connectivity abroad
  • Requests "test" or "mock" eSIM for development

Important: Transaction Timing

Crypto and eSIM transactions are NOT instant. Expect:

  • USDC transfer: 5-15 seconds for on-chain confirmation
  • Purchase completion: Additional 3-30 seconds for API to verify the transaction on-chain
  • Total purchase flow: Can take 30-60 seconds from payment initiation to eSIM delivery

Inform the user that the purchase is processing and to wait for confirmation.

Workflow

  1. Determine network: Ask or detect if user wants mainnet (real) or testnet (testing)
  2. Discover needs: Ask which country they need data for
  3. Search packages: Query esimqr.link for available packages
  4. Present options: Show available data plans with prices
  5. Get selection: User picks a package
  6. Confirm purchase: Show price, network (mainnet/testnet), and wallet balance, get confirmation
  7. Execute x402 flow:
    • POST to /api/agent/purchase (mainnet) or /api/agent-testnet/purchase (testnet) → receive 402 with payment details
    • Pay using your wallet
    • Retry POST with payment proof header
  8. Deliver eSIM: Return the esimPageUrl - a user-friendly page with QR code and install buttons

Example Conversation

Mainnet (Real eSIM)

User: I need an eSIM for my trip to USA

Agent: I can help you get an eSIM! This will be a real eSIM on Base Mainnet.

[Agent searches packages]

I found these options for USA:
- US_100MB_7: 100MB / 7 Days - $0.50
- US_1_7: 1GB / 7 Days - $1.18
- US_3_7: 3GB / 7 Days - $2.50
- US_5_30: 5GB / 30 Days - $4.42

Which package would you like?

User: 1GB 7 days

Agent: The US 1GB 7-Day plan costs $1.18 USDC on Base Mainnet.

My wallet balance: $30.00 USDC

Shall I purchase this eSIM now?

User: Yes

Agent: Initiating purchase on Base Mainnet...

✓ Payment sent: 1.18 USDC
✓ Transaction: 0xabc123...

Your eSIM is ready! Install it here:
https://esimqr.link/web3/esim/agent_1707184523_abc123

Testnet (Mock eSIM for Testing)

User: Get me a test eSIM for USA

Agent: I'll get you a test eSIM on Base Sepolia testnet (mock eSIM for testing).

[Agent searches packages on testnet]

I found test packages for USA:
- US_1_7: 1GB / 7 Days - $1.18 (testnet)
- US_5_30: 5GB / 30 Days - $4.42 (testnet)

Which would you like?

User: 1GB

Agent: The US 1GB 7-Day test plan costs $1.18 testnet USDC.

My wallet balance: 10.00 testnet USDC

Shall I purchase this test eSIM?

User: Yes

Agent: Initiating testnet purchase...

✓ Test payment sent: 1.18 USDC
✓ Transaction: 0xdef456...

Your mock eSIM is ready! (For testing only):
https://esimqr.link/web3/esim/mockagent_1707184523_abc123

API Endpoints

Base URL: https://esimqr.link

Mainnet Endpoints (Production)

Endpoint Method Description
/api/agent/quote GET Get price quote
/api/agent/purchase POST Initiate/complete purchase
/api/agent/esim/{id} GET Get eSIM status

Testnet Endpoints (Testing)

Endpoint Method Description
/api/agent-testnet/quote GET Get price quote
/api/agent-testnet/purchase POST Initiate/complete purchase
/api/agent-testnet/esim/{id} GET Get eSIM status

Shared Endpoints (Both Networks)

Endpoint Method Description
/api/web3/packages?q={country} GET Search packages (works for both)

Rate Limiting

  • Limit: 10 requests per minute per IP
  • Response: HTTP 429 with Retry-After header
  • Handle rate limits gracefully by respecting the Retry-After value

Network Configuration

Base Mainnet (Default)

Parameter Value
Network Base Mainnet
Chain ID 8453
CAIP-2 eip155:8453
USDC Token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
USDC Decimals 6

Base Sepolia (Testnet)

Parameter Value
Network Base Sepolia (testnet)
Chain ID 84532
CAIP-2 eip155:84532
USDC Token 0x036CbD53842c5426634e7929541eC2318f3dCF7e
USDC Decimals 6

Note: Payment wallet addresses are returned dynamically by the API in quote and 402 responses. Do not hardcode payment addresses.

Payment Schemes (x402)

The 402 response offers two payment options in the accepts array. Choose based on your wallet capabilities:

Scheme Header Wallet Requirements Gas
exact PAYMENT-SIGNATURE EIP-3009 signing (Circle, x402 SDK) Gasless
transfer X-PAYMENT Standard USDC transfer You pay gas

Which Scheme to Use

  • Use exact if: Your wallet supports EIP-3009 transferWithAuthorization signing (Circle wallets, x402-compatible SDKs). Benefits: gasless - the facilitator broadcasts for you.

  • Use transfer if: Your wallet can do standard USDC transfers but doesn't support EIP-3009. Works with any wallet that supports Base. You pay gas fees.

  • Not sure?: The transfer scheme works with any USDC-capable wallet.

Exact Scheme Flow (gasless):

  1. POST /api/agent/purchase (mainnet) or /api/agent-testnet/purchase (testnet) → receive 402 with EIP-3009 parameters
  2. Sign a transferWithAuthorization message (no on-chain tx needed)
  3. Retry POST with header: PAYMENT-SIGNATURE: \x3Cbase64-encoded-payload>
  4. Facilitator broadcasts the transaction for you

Transfer Scheme Flow:

  1. POST /api/agent/purchase (mainnet) or /api/agent-testnet/purchase (testnet) → receive 402 with payment details
  2. Transfer USDC on-chain to payTo address (on the correct network!)
  3. Retry POST with header: X-PAYMENT: txHash=0x...,nonce=...

API Response Examples

Search Packages

GET /api/web3/packages?q=US

{
  "packages": [
    {"packageCode": "US_1_7", "name": "United States 1GB 7Days", ...}
  ]
}

Quote (Mainnet)

GET /api/agent/quote?packageCode=US_1_7

{
  "packageCode": "PHAJHEAYP",
  "slug": "US_1_7",
  "planName": "United States 1GB 7Days",
  "usdcAmount": "1.18",
  "paymentDetails": {
    "recipient": "\x3Cpayment-address-from-api>",
    "chainId": 8453,
    "network": "eip155:8453"
  }
}

Quote (Testnet)

GET /api/agent-testnet/quote?packageCode=US_1_7

{
  "packageCode": "PHAJHEAYP",
  "slug": "US_1_7",
  "planName": "United States 1GB 7Days",
  "usdcAmount": "1.18",
  "paymentDetails": {
    "recipient": "\x3Cpayment-address-from-api>",
    "chainId": 84532,
    "network": "eip155:84532"
  },
  "isTestnet": true
}

402 Payment Required

POST /api/agent/purchase
Body: {"packageCode": "US_1_7"}

{
  "x402Version": 2,
  "accepts": [
    {"scheme": "exact", ...},
    {"scheme": "transfer", "amount": "1180000", "payTo": "\x3Cpayment-address-from-api>", "extra": {"nonce": "abc123"}}
  ]
}

Important: Always use the payTo address from the 402 response. Never hardcode payment addresses.

Purchase Success

POST /api/agent/purchase
Headers: X-PAYMENT: txHash=0x...,nonce=abc123
Body: {"packageCode": "US_1_7"}

{
  "success": true,
  "esimId": "agent_1707184523_abc123",
  "esimPageUrl": "https://esimqr.link/web3/esim/agent_1707184523_abc123",
  "esimDetails": {
    "iccid": "8901234...",
    "activationCode": "LPA:1$..."
  }
}

Status Values

  • pending - Order created, awaiting provisioning
  • processing - eSIM being provisioned
  • ready - eSIM ready for installation
  • activated - eSIM installed on device
  • failed - Order failed (contact support)
  • cancelled - Mock eSIM auto-cancelled (testnet only)

Documentation

Files

  • esim_api.py - API client for esimqr.link (supports both mainnet and testnet)

Dependencies

requests>=2.28.0

Hackathon Submission

  • Track: Agentic Commerce
  • Protocol: x402 (HTTP 402 Payment Required)
  • Networks: Base Mainnet (production), Base Sepolia (testing)
  • Payment: USDC

Submitted to: https://www.moltbook.com/m/usdc

安全使用建议
This skill looks coherent and matches its stated purpose, but before installing: - Be aware the default network is Base Mainnet (real eSIMs) — you will spend real USDC/ETH if you proceed on mainnet. Prefer testnet (Sepolia) when testing. - Confirm the agent always asks for explicit user approval before initiating a purchase. - Verify any wallet skill you pair with this does not auto-sign transactions. If your wallet can auto-sign, do not enable autonomous agent actions that could trigger purchases. - Do not provide private keys, API keys, or wallet secrets to this skill; it expects an external wallet to handle signing. - Review the returned payment address and tx details before broadcasting payments. - Note the service endpoint is https://esimqr.link; if you have policy constraints about third-party domains, review that domain separately. If you want extra assurance, test the flow on Sepolia first and observe the interaction between the agent and your wallet skill (confirm prompts and signing behavior).
功能分析
Type: OpenClaw Skill Name: get-esim Version: 1.0.2 The OpenClaw AgentSkills skill bundle for 'get-esim' is benign. The `SKILL.md` provides clear, non-malicious instructions for the AI agent to purchase eSIMs via the x402 protocol, with no evidence of prompt injection attempts. The `esim_api.py` code correctly implements the described API interactions with `https://esimqr.link`, uses standard libraries, and follows good security practices by dynamically obtaining payment addresses rather than hardcoding them. There are no indicators of data exfiltration, unauthorized execution, persistence, or obfuscation across any of the files.
能力评估
Purpose & Capability
Name, SKILL.md, README, and the included esim_api.py all describe the same purpose: searching esim packages and conducting x402 USDC purchases via esimqr.link on Base mainnet or Sepolia testnet. There are no unrelated credentials, binaries, or config paths requested.
Instruction Scope
Instructions are narrowly scoped to discovering packages, requesting quotes, initiating a 402 flow, and completing purchases with payment proof. They do not instruct reading arbitrary files or exfiltrating unrelated data. Notable: the default network is Base Mainnet (real-money purchases); the skill expects the agent to obtain wallet signatures externally. Ensure the agent explicitly confirms purchases before initiating payment.
Install Mechanism
This is instruction+code-only with no install spec. requirements.txt only lists requests. No downloads from arbitrary URLs or archive extraction are present. The absence of an install script reduces disk footprint risk.
Credentials
The skill does not request environment variables or secrets and relies on an external wallet skill for signing/transfers. This is proportional to its purpose. However, because payment happens on-chain, the real risk is indirect: if a wallet skill auto-signs or has stored keys, the skill could cause real USDC/ETH transfers. Do not provide private keys or credentials to this skill.
Persistence & Privilege
always is false and the skill does not request persistent system-wide configuration. Model invocation is enabled (normal). Caution: autonomous invocation combined with an auto-signing wallet increases the blast radius — the skill itself doesn't request elevated privileges but can trigger payments via the wallet skill.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install get-esim
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /get-esim 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
# get-esim v1.0.2 Changelog - Added new file: `.DS_Store`. - Updated documentation to clarify that payment wallet addresses are provided dynamically by the API (do not hardcode payment addresses). - Added details on API rate limiting (10 requests/min per IP, HTTP 429 with `Retry-After`). - Removed hardcoded payment wallet addresses from public documentation tables. - No core logic or functional changes; documentation and metadata update only.
v1.0.1
- Added .gitignore and README.md files for improved codebase management and documentation. - Updated SKILL.md to support both Base Mainnet (real eSIMs) and Base Sepolia (test/mock eSIMs), with guidance on how to specify the desired network. - Revised the workflow and invocation instructions to include explicit network selection and clarify when to use mainnet versus testnet. - Expanded API documentation to detail separate endpoints and payment information for mainnet and testnet environments. - Improved example conversations to illustrate flows for both production (mainnet) and development/testing (testnet) use cases.
v1.0.0
Initial release of Get eSIM Skill. - Purchase eSIM data packages for any country using USDC on Base Sepolia testnet, via the x402 protocol. - Supports two payment schemes: gasless (EIP-3009 "exact") and standard USDC transfer ("transfer"). - Returns a user-friendly installation page with QR code upon purchase completion. - Includes guided workflow for discovering user needs, presenting data plans, confirming purchases, and handling x402 payments. - Notifies users about transaction timing and progress.
元数据
Slug get-esim
版本 1.0.2
许可证
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Buy a travel eSIM - via x402 USDC Base Wallet 是什么?

Purchase travel eSIM data plans using USDC on Base Mainnet or Sepolia testnet via x402, with eSIM delivery via a QR code installation page. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 973 次。

如何安装 Buy a travel eSIM - via x402 USDC Base Wallet?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install get-esim」即可一键安装,无需额外配置。

Buy a travel eSIM - via x402 USDC Base Wallet 是免费的吗?

是的,Buy a travel eSIM - via x402 USDC Base Wallet 完全免费(开源免费),可自由下载、安装和使用。

Buy a travel eSIM - via x402 USDC Base Wallet 支持哪些平台?

Buy a travel eSIM - via x402 USDC Base Wallet 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Buy a travel eSIM - via x402 USDC Base Wallet?

由 inthaiguy(@inthaiguy)开发并维护,当前版本 v1.0.2。

💬 留言讨论