# Send ZeroEx Swap to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "zeroex-swap",
    "name": "ZeroEx Swap",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/aviclaw/zeroex-swap",
    "canonicalUrl": "https://clawhub.ai/aviclaw/zeroex-swap",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/zeroex-swap",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=zeroex-swap",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "package.json",
      "quote.js",
      "swap.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "zeroex-swap",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-11T12:20:34.525Z",
      "expiresAt": "2026-05-18T12:20:34.525Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=zeroex-swap",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=zeroex-swap",
        "contentDisposition": "attachment; filename=\"zeroex-swap-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "zeroex-swap"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/zeroex-swap"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/zeroex-swap",
    "downloadUrl": "https://openagent3.xyz/downloads/zeroex-swap",
    "agentUrl": "https://openagent3.xyz/skills/zeroex-swap/agent",
    "manifestUrl": "https://openagent3.xyz/skills/zeroex-swap/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/zeroex-swap/agent.md"
  }
}
```
## Documentation

### ZeroEx Swap Skill

⚠️ SECURITY WARNING: This skill involves real funds. Review all parameters before executing swaps.

### Install

cd skills/zeroex-swap
npm install

### Required Environment Variables

VariableDescriptionRequiredZEROEX_API_KEYGet from https://dashboard.0x.org/YesPRIVATE_KEYWallet private key (hex, without 0x prefix)YesRPC_URLRPC endpoint for chain (optional, defaults provided)No

Declared required env vars: ZEROEX_API_KEY, PRIVATE_KEY

export ZEROEX_API_KEY="your-0x-api-key"
export PRIVATE_KEY="your-private-key-hex"
export RPC_URL="https://mainnet.base.org"  # optional

### Get Price Quote

node quote.js --sell USDC --buy WETH --amount 1 --chain base

### Execute Swap (sell → buy)

node swap.js --sell USDC --buy WETH --amount 1 --chain base

### Execute Swap (buy example)

node swap.js --sell WETH --buy USDC --amount 0.01 --chain base

### getSwapTrades

curl -s "https://api.0x.org/trade-analytics/swap?chainId=8453&taker=0xYOUR_WALLET" \\
  -H "0x-api-key: $ZEROEX_API_KEY" \\
  -H "0x-version: v2"

### getGaslessTrades

curl -s "https://api.0x.org/trade-analytics/gasless?chainId=8453&taker=0xYOUR_WALLET" \\
  -H "0x-api-key: $ZEROEX_API_KEY" \\
  -H "0x-version: v2"

### Gasless Swap (Meta-transaction)

Flow:

Get gasless quote
Sign EIP-712 payload
Submit meta-tx

### 1) Get gasless quote

curl -s "https://api.0x.org/gasless/quote?sellToken=USDC&buyToken=WETH&sellAmount=1000000&chainId=8453&taker=0xYOUR_WALLET" \\
  -H "0x-api-key: $ZEROEX_API_KEY" \\
  -H "0x-version: v2"

### 2) Sign EIP-712 (use viem)

// use viem to sign quote.trade.eip712
await client.signTypedData({
  domain: quote.trade.eip712.domain,
  types: quote.trade.eip712.types,
  message: quote.trade.eip712.message,
  primaryType: quote.trade.eip712.primaryType
});

### 3) Submit

curl -s -X POST "https://api.0x.org/gasless/submit" \\
  -H "0x-api-key: $ZEROEX_API_KEY" \\
  -H "0x-version: v2" \\
  -H "Content-Type: application/json" \\
  -d '{"trade": {"type":"settler_metatransaction","eip712": {"domain": {"name": "Settler", "chainId": 8453, "verifyingContract": "0x..."},"types": {...},"message": {...},"primaryType":"..."},"signature": {"v": 27, "r": "0x...", "s": "0x...", "signatureType": 2}}}'

### Security Best Practices

Use a dedicated hot wallet
Set slippage protection
Approve exact amounts only
Use your own RPC via RPC_URL
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: aviclaw
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-11T12:20:34.525Z
- Expires at: 2026-05-18T12:20:34.525Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/zeroex-swap)
- [Send to Agent page](https://openagent3.xyz/skills/zeroex-swap/agent)
- [JSON manifest](https://openagent3.xyz/skills/zeroex-swap/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/zeroex-swap/agent.md)
- [Download page](https://openagent3.xyz/downloads/zeroex-swap)