[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AVSNPYYJWXXXMYSBW8CXRW":3,"skill-same:01M7AVSNPYYJWXXXMYSBW8CXRW":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":13,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7AVSNPYYJWXXXMYSBW8CXRW","opensea-tool-sdk",null,"Build, register, and gate AI-callable tool endpoints using the OpenSea Tool Registry (ERC-8257) on Base. Scaffold HTTPS tools with JSON Schema interfaces, register them onchain, gate access via NFT ownership or x402 pay-per-call (USDC), and call gated tools. For querying OpenSea marketplace data use opensea-api instead.","CrawlrrAI\u002Fskills","CrawlrrAI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F318571425?v=4","01M7AV5K63KCJW0GCHVKBVHW2D","01M7AV5K6R2732K7FRMXGV1PRX",0,"MIT","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-tool-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: opensea-tool-sdk\ndescription: Build, register, and gate AI-callable tool endpoints using the OpenSea Tool Registry (ERC-8257) on Base. Scaffold HTTPS tools with JSON Schema interfaces, register them onchain, gate access via NFT ownership or x402 pay-per-call (USDC), and call gated tools. For querying OpenSea marketplace data use opensea-api instead.\nhomepage: https:\u002F\u002Fgithub.com\u002FProjectOpenSea\u002Ftool-sdk\nrepository: https:\u002F\u002Fgithub.com\u002FProjectOpenSea\u002Ftool-sdk\nlicense: MIT\nenv:\n  PRIVATE_KEY:\n    description: Wallet private key for onchain registration and tool calls\n    required: false\n  RPC_URL:\n    description: RPC URL for Base mainnet (default https:\u002F\u002Fmainnet.base.org)\n    required: false\ndependencies:\n  - node >= 18.0.0\n---\n\n# OpenSea Tool SDK\n\nBuild, register, and gate AI-callable tool endpoints using the OpenSea Tool Registry (ERC-8257) on Base.\n\n## When to use this skill (`scope_in`)\n\nUse `opensea-tool-sdk` when you need to:\n\n- Scaffold an AI-callable tool endpoint (HTTPS, JSON Schema, `.well-known` manifest) for Vercel, Cloudflare, or Express\n- Register a tool onchain on the Base ToolRegistry so other agents can discover it\n- Gate access via x402 pay-per-call (USDC) or predicates (ERC-721\u002FERC-1155 ownership, subscriptions, composites)\n- Call a gated tool: SIWE auth (`authenticatedFetch`), 402 payments (`paidFetch`), or both (`paidAuthenticatedFetch`)\n\n## When NOT to use this skill (`scope_out`, handoff)\n\n| Need | Use instead |\n|---|---|\n| Query NFT\u002Ftoken data, search, collection stats | `opensea-api` |\n| Buy\u002Fsell NFTs | `opensea-marketplace` |\n| Swap ERC20 tokens | `opensea-swaps` |\n| Set up wallet signing providers | `opensea-wallet` |\n\nThis SDK is for tool *providers and consumers*. To query OpenSea marketplace data (floor prices, listings, trades), use the [`opensea-api`](..\u002Fopensea-api\u002FSKILL.md) skill instead.\n\n## Concepts\n\n| Term | Meaning |\n|------|---------|\n| **Tool** | An HTTPS endpoint with a JSON Schema interface, discoverable via `\u002F.well-known\u002Fai-tool\u002F\u003Cslug>.json` |\n| **Manifest** | JCS-canonicalized JSON describing the tool's name, endpoint, inputs, outputs, pricing, and access policy |\n| **ToolRegistry** | Onchain contract (Base) where tools are registered with a manifest hash and optional access predicate |\n| **Access Predicate** | An `IAccessPredicate` contract that gates who can invoke a tool (NFT ownership, subscriptions, composites) |\n| **x402** | HTTP 402-based pay-per-call protocol (caller signs a USDC `TransferWithAuthorization`; server settles after execution) |\n| **SIWE** | Sign-In with Ethereum (EIP-4361), used to authenticate callers for predicate-gated tools |\n| **Facilitator** | Third-party service that verifies and settles x402 payments (PayAI or Coinbase CDP) |\n\n## Deployed Contracts (Base mainnet)\n\n| Contract | Address |\n|----------|---------|\n| ToolRegistry (v0.1) | `0x7291BbFbC368C2D478eCe1eA30de31F612a34856` |\n| ERC721OwnerPredicate (v0.2) | `0xd1F703D0B90BB7106fAebBfbcAdD2B07BDc4c769` |\n| ERC1155OwnerPredicate (v0.2) | `0xc179b9d4D9B7ffe0CdA608134729f72003380A7e` |\n\n## 1. Create a Tool\n\n### 1a. Scaffold a project\n\n```bash\nnpx @opensea\u002Ftool-sdk init --runtime vercel   # or: cloudflare, express\n```\n\nThis generates:\n- `src\u002Fmanifest.ts`: tool manifest definition\n- `src\u002Fhandler.ts`: request handler with input\u002Foutput schemas\n- `api\u002Findex.ts`: framework adapter entry point\n- `public\u002Fllms.txt`: agent-readable discovery page\n- `api\u002Fwell-known\u002F[slug].ts`: serves the manifest at `\u002F.well-known\u002Fai-tool\u002F\u003Cslug>.json`\n\n### 1b. Define the manifest\n\n```typescript\nimport { defineManifest } from \"@opensea\u002Ftool-sdk\"\n\nexport const manifest = defineManifest({\n  name: \"My Tool\",\n  description: \"What this tool does\",\n  endpoint: \"https:\u002F\u002Fmy-tool.example.com\u002Fapi\",\n  creatorAddress: \"0xYOUR_WALLET_ADDRESS\",\n  inputs: {\n    type: \"object\",\n    properties: {\n      query: { type: \"string\", description: \"Search query\" },\n    },\n    required: [\"query\"],\n  },\n  outputs: {\n    type: \"object\",\n    properties: {\n      result: { type: \"string\" },\n    },\n  },\n  \u002F\u002F Optional: add pricing for x402 paywall (see references\u002Fx402.md)\n  \u002F\u002F pricing: paywall.pricing,\n  \u002F\u002F Optional: add access requirements (see references\u002Fpredicate-gating.md)\n  \u002F\u002F access: { logic: \"OR\", requirements: [...] },\n})\n```\n\n### 1c. Write the handler\n\n```typescript\nimport { createToolHandler } from \"@opensea\u002Ftool-sdk\"\nimport { z } from \"zod\u002Fv4\"\nimport { manifest } from \".\u002Fmanifest.js\"\n\nconst InputSchema = z.object({ query: z.string() })\nconst OutputSchema = z.object({ result: z.string() })\n\nexport const toolHandler = createToolHandler({\n  manifest,\n  inputSchema: InputSchema,\n  outputSchema: OutputSchema,\n  \u002F\u002F gates: [],  \u002F\u002F Add gates here (see references\u002Fx402.md and references\u002Fpredicate-gating.md)\n  handler: async (input) => {\n    return { result: `Processed: ${input.query}` }\n  },\n})\n```\n\n### 1d. Wire up the adapter\n\n**Vercel:**\n```typescript\nimport { toVercelHandler } from \"@opensea\u002Ftool-sdk\"\nimport { toolHandler } from \"..\u002Fsrc\u002Fhandler.js\"\nexport default toVercelHandler(toolHandler)\n```\n\n**Express:**\n```typescript\nimport { toExpressHandler } from \"@opensea\u002Ftool-sdk\"\nimport { toolHandler } from \".\u002Fhandler.js\"\napp.post(\"\u002Fapi\", toExpressHandler(toolHandler))\n```\n\n**Cloudflare Workers:**\n```typescript\nimport { toolHandler } from \".\u002Fhandler.js\"\nexport default { fetch: toolHandler }\n```\n\n## 2. Register a Tool Onchain\n\n### 2a. Via CLI\n\n```bash\n# Set up wallet\nexport PRIVATE_KEY=0x...\nexport RPC_URL=https:\u002F\u002Fmainnet.base.org\n\n# Register (open access, no predicate)\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base\n\n# Register with NFT gate (ERC-721 collection)\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --nft-gate 0xCOLLECTION_ADDRESS\n\n# Register with a custom access predicate\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --access-predicate 0xPREDICATE_ADDRESS\n\n# Dry run (no transaction)\nnpx @opensea\u002Ftool-sdk register --metadata ... --network base --dry-run\n```\n\nThe CLI:\n1. Fetches the manifest from `--metadata` URL\n2. Validates the manifest schema\n3. Verifies `manifest.creatorAddress` matches your wallet\n4. Computes the JCS keccak256 manifest hash\n5. Calls `ToolRegistry.registerTool(metadataURI, manifestHash, accessPredicate)`\n6. Returns the `toolId` from the `ToolRegistered` event\n\n### 2b. Via SDK (programmatic)\n\n```typescript\nimport { ToolRegistryClient, computeManifestHash } from \"@opensea\u002Ftool-sdk\"\nimport { createWalletFromEnv, walletAdapterToClient } from \"@opensea\u002Ftool-sdk\"\nimport { base } from \"viem\u002Fchains\"\n\nconst adapter = createWalletFromEnv()\nconst walletClient = await walletAdapterToClient(adapter, base)\n\nconst registry = new ToolRegistryClient({\n  chain: base,\n  rpcUrl: \"https:\u002F\u002Fmainnet.base.org\",\n  walletClient,\n})\n\nconst { toolId, txHash } = await registry.registerTool({\n  metadataURI: \"https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json\",\n  manifest,                                      \u002F\u002F your ToolManifest object\n  accessPredicate: \"0x0000...0000\",              \u002F\u002F address(0) for open access\n})\n\nconsole.log(`Registered tool ${toolId} in tx ${txHash}`)\n```\n\n## 3. Gating tool access\n\nTools can be gated three ways:\n\n| Gate | Mechanism | Reference |\n|------|-----------|-----------|\n| **x402 paywall** | Pay-per-call (USDC, EIP-3009) | [`references\u002Fx402.md`](references\u002Fx402.md) |\n| **Predicate gate** | Onchain check (NFT, subscription, composite) | [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md) |\n| **Combined** | SIWE auth and payment (predicate first, then x402) | [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md) |\n\nFor deployed predicate addresses, requirement encodings, and SDK helpers like `describeToolAccess` \u002F `decodeRequirement`, see [`references\u002Fknown-predicates.md`](references\u002Fknown-predicates.md).\n\n## 4. Wallet Setup\n\nThe SDK supports multiple wallet providers via `@opensea\u002Fwallet-adapters`. Set environment variables and the SDK auto-detects the provider. See the [`opensea-wallet`](..\u002Fopensea-wallet\u002FSKILL.md) skill for the full provider table, env vars, setup walkthroughs, and signing-policy configuration.\n\n```typescript\nimport { createWalletFromEnv } from \"@opensea\u002Ftool-sdk\"\n\nconst adapter = createWalletFromEnv()\nconst address = await adapter.getAddress()\n```\n\nFor Bankr (external signer):\n\n```typescript\nimport { createBankrAccount } from \"@opensea\u002Ftool-sdk\"\n\nconst account = await createBankrAccount(\"your-bankr-api-key\")\n\u002F\u002F Use with authenticatedFetch or paidAuthenticatedFetch\n```\n\n## 5. Response Codes\n\n| Code | Meaning | Action |\n|------|---------|--------|\n| 200 | Success | Parse the JSON body per the manifest's `outputs` schema |\n| 400 | Invalid input | Fix request body to match the manifest's `inputs` schema |\n| 401 | Missing\u002Finvalid SIWE auth | Sign a SIWE message and include `Authorization: SIWE \u003Ctoken>` |\n| 402 | Payment required | Read `body.accepts[0]` for payment requirements, sign and retry with `X-Payment` |\n| 403 | Access denied | Inspect `body.predicate` to discover what's needed; acquire the required token\u002Fsubscription |\n| 405 | Method not allowed | Use POST |\n| 500 | Internal tool error | Retry or contact the tool creator |\n| 502 | Predicate\u002Ffacilitator error | The upstream predicate or payment facilitator misbehaved; retry later |\n\n## 6. Quick Reference: CLI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `init` | Scaffold a new tool project |\n| `validate` | Validate a manifest file |\n| `hash` | Compute the JCS keccak256 hash of a manifest |\n| `export` | Export the manifest as JSON |\n| `register` | Register a tool onchain |\n| `update-metadata` | Update a tool's metadata URI and manifest hash onchain |\n| `inspect` | Look up a tool's onchain config by ID |\n| `verify` | Verify a manifest against its onchain hash |\n| `deploy` | Deploy a tool to Vercel |\n| `auth` | Call a predicate-gated tool (SIWE) |\n| `pay` | Call an x402-paid tool (USDC) |\n| `smoke` | Auto-detect gate type and call |\n| `dry-run-gate` | Simulate an x402 gate check locally |\n| `dry-run-predicate-gate` | Simulate a predicate gate check locally |\n\nAll CLI commands accept `--wallet-provider privy|turnkey|fireblocks|bankr|private-key` or auto-detect from env vars.\n\n## 7. End-to-End Examples\n\n### Example A: Free open-access tool\n\n```bash\n# 1. Scaffold\nnpx @opensea\u002Ftool-sdk init --runtime vercel\n# 2. Edit src\u002Fmanifest.ts and src\u002Fhandler.ts with your logic\n# 3. Deploy\nnpx @opensea\u002Ftool-sdk deploy\n# 4. Register (open access)\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.vercel.app\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base\n# 5. Call\ncurl -X POST https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"query\": \"hello\"}'\n```\n\n### Example B: x402 paid tool (pay-per-call only, no identity check)\n\n```bash\n# Server: add paywall gate (see references\u002Fx402.md)\n# Call via CLI:\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk pay \\\n  https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --body '{\"query\": \"hello\"}'\n```\n\n### Example C: NFT-gated tool (identity check, no payment)\n\n```bash\n# Register with NFT gate\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.vercel.app\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --nft-gate 0xCOLLECTION\n\n# Server: add predicateGate (see references\u002Fpredicate-gating.md)\n\n# Call via CLI:\nPRIVATE_KEY=0x... RPC_URL=https:\u002F\u002Fmainnet.base.org \\\n  npx @opensea\u002Ftool-sdk auth \\\n  https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --body '{\"query\": \"hello\"}'\n```\n\n### Example D: NFT-gated and paid tool (both gates)\n\n```bash\n# Server: add both predicateGate and paywall.gate (see references\u002Fpredicate-gating.md)\n# Call via CLI:\nPRIVATE_KEY=0x... RPC_URL=https:\u002F\u002Fmainnet.base.org \\\n  npx @opensea\u002Ftool-sdk smoke \\\n  --endpoint https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --expect 200\n```\n\n## References\n\n- [`references\u002Fx402.md`](references\u002Fx402.md): pay-per-call protocol, server-side paywall, `paidFetch`\n- [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md): SIWE-based access control, combined gates\n- [`references\u002Fknown-predicates.md`](references\u002Fknown-predicates.md): deployed predicate contracts and SDK helpers\n- [Tool SDK GitHub](https:\u002F\u002Fgithub.com\u002FProjectOpenSea\u002Ftool-sdk)\n","# OpenSea Tool SDK\n\nBuild, register, and gate AI-callable tool endpoints using the OpenSea Tool Registry (ERC-8257) on Base.\n\n## When to use this skill (`scope_in`)\n\nUse `opensea-tool-sdk` when you need to:\n\n- Scaffold an AI-callable tool endpoint (HTTPS, JSON Schema, `.well-known` manifest) for Vercel, Cloudflare, or Express\n- Register a tool onchain on the Base ToolRegistry so other agents can discover it\n- Gate access via x402 pay-per-call (USDC) or predicates (ERC-721\u002FERC-1155 ownership, subscriptions, composites)\n- Call a gated tool: SIWE auth (`authenticatedFetch`), 402 payments (`paidFetch`), or both (`paidAuthenticatedFetch`)\n\n## When NOT to use this skill (`scope_out`, handoff)\n\n| Need | Use instead |\n|---|---|\n| Query NFT\u002Ftoken data, search, collection stats | `opensea-api` |\n| Buy\u002Fsell NFTs | `opensea-marketplace` |\n| Swap ERC20 tokens | `opensea-swaps` |\n| Set up wallet signing providers | `opensea-wallet` |\n\nThis SDK is for tool *providers and consumers*. To query OpenSea marketplace data (floor prices, listings, trades), use the [`opensea-api`](..\u002Fopensea-api\u002FSKILL.md) skill instead.\n\n## Concepts\n\n| Term | Meaning |\n|------|---------|\n| **Tool** | An HTTPS endpoint with a JSON Schema interface, discoverable via `\u002F.well-known\u002Fai-tool\u002F\u003Cslug>.json` |\n| **Manifest** | JCS-canonicalized JSON describing the tool's name, endpoint, inputs, outputs, pricing, and access policy |\n| **ToolRegistry** | Onchain contract (Base) where tools are registered with a manifest hash and optional access predicate |\n| **Access Predicate** | An `IAccessPredicate` contract that gates who can invoke a tool (NFT ownership, subscriptions, composites) |\n| **x402** | HTTP 402-based pay-per-call protocol (caller signs a USDC `TransferWithAuthorization`; server settles after execution) |\n| **SIWE** | Sign-In with Ethereum (EIP-4361), used to authenticate callers for predicate-gated tools |\n| **Facilitator** | Third-party service that verifies and settles x402 payments (PayAI or Coinbase CDP) |\n\n## Deployed Contracts (Base mainnet)\n\n| Contract | Address |\n|----------|---------|\n| ToolRegistry (v0.1) | `0x7291BbFbC368C2D478eCe1eA30de31F612a34856` |\n| ERC721OwnerPredicate (v0.2) | `0xd1F703D0B90BB7106fAebBfbcAdD2B07BDc4c769` |\n| ERC1155OwnerPredicate (v0.2) | `0xc179b9d4D9B7ffe0CdA608134729f72003380A7e` |\n\n## 1. Create a Tool\n\n### 1a. Scaffold a project\n\n```bash\nnpx @opensea\u002Ftool-sdk init --runtime vercel   # or: cloudflare, express\n```\n\nThis generates:\n- `src\u002Fmanifest.ts`: tool manifest definition\n- `src\u002Fhandler.ts`: request handler with input\u002Foutput schemas\n- `api\u002Findex.ts`: framework adapter entry point\n- `public\u002Fllms.txt`: agent-readable discovery page\n- `api\u002Fwell-known\u002F[slug].ts`: serves the manifest at `\u002F.well-known\u002Fai-tool\u002F\u003Cslug>.json`\n\n### 1b. Define the manifest\n\n```typescript\nimport { defineManifest } from \"@opensea\u002Ftool-sdk\"\n\nexport const manifest = defineManifest({\n  name: \"My Tool\",\n  description: \"What this tool does\",\n  endpoint: \"https:\u002F\u002Fmy-tool.example.com\u002Fapi\",\n  creatorAddress: \"0xYOUR_WALLET_ADDRESS\",\n  inputs: {\n    type: \"object\",\n    properties: {\n      query: { type: \"string\", description: \"Search query\" },\n    },\n    required: [\"query\"],\n  },\n  outputs: {\n    type: \"object\",\n    properties: {\n      result: { type: \"string\" },\n    },\n  },\n  \u002F\u002F Optional: add pricing for x402 paywall (see references\u002Fx402.md)\n  \u002F\u002F pricing: paywall.pricing,\n  \u002F\u002F Optional: add access requirements (see references\u002Fpredicate-gating.md)\n  \u002F\u002F access: { logic: \"OR\", requirements: [...] },\n})\n```\n\n### 1c. Write the handler\n\n```typescript\nimport { createToolHandler } from \"@opensea\u002Ftool-sdk\"\nimport { z } from \"zod\u002Fv4\"\nimport { manifest } from \".\u002Fmanifest.js\"\n\nconst InputSchema = z.object({ query: z.string() })\nconst OutputSchema = z.object({ result: z.string() })\n\nexport const toolHandler = createToolHandler({\n  manifest,\n  inputSchema: InputSchema,\n  outputSchema: OutputSchema,\n  \u002F\u002F gates: [],  \u002F\u002F Add gates here (see references\u002Fx402.md and references\u002Fpredicate-gating.md)\n  handler: async (input) => {\n    return { result: `Processed: ${input.query}` }\n  },\n})\n```\n\n### 1d. Wire up the adapter\n\n**Vercel:**\n```typescript\nimport { toVercelHandler } from \"@opensea\u002Ftool-sdk\"\nimport { toolHandler } from \"..\u002Fsrc\u002Fhandler.js\"\nexport default toVercelHandler(toolHandler)\n```\n\n**Express:**\n```typescript\nimport { toExpressHandler } from \"@opensea\u002Ftool-sdk\"\nimport { toolHandler } from \".\u002Fhandler.js\"\napp.post(\"\u002Fapi\", toExpressHandler(toolHandler))\n```\n\n**Cloudflare Workers:**\n```typescript\nimport { toolHandler } from \".\u002Fhandler.js\"\nexport default { fetch: toolHandler }\n```\n\n## 2. Register a Tool Onchain\n\n### 2a. Via CLI\n\n```bash\n# Set up wallet\nexport PRIVATE_KEY=0x...\nexport RPC_URL=https:\u002F\u002Fmainnet.base.org\n\n# Register (open access, no predicate)\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base\n\n# Register with NFT gate (ERC-721 collection)\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --nft-gate 0xCOLLECTION_ADDRESS\n\n# Register with a custom access predicate\nnpx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --access-predicate 0xPREDICATE_ADDRESS\n\n# Dry run (no transaction)\nnpx @opensea\u002Ftool-sdk register --metadata ... --network base --dry-run\n```\n\nThe CLI:\n1. Fetches the manifest from `--metadata` URL\n2. Validates the manifest schema\n3. Verifies `manifest.creatorAddress` matches your wallet\n4. Computes the JCS keccak256 manifest hash\n5. Calls `ToolRegistry.registerTool(metadataURI, manifestHash, accessPredicate)`\n6. Returns the `toolId` from the `ToolRegistered` event\n\n### 2b. Via SDK (programmatic)\n\n```typescript\nimport { ToolRegistryClient, computeManifestHash } from \"@opensea\u002Ftool-sdk\"\nimport { createWalletFromEnv, walletAdapterToClient } from \"@opensea\u002Ftool-sdk\"\nimport { base } from \"viem\u002Fchains\"\n\nconst adapter = createWalletFromEnv()\nconst walletClient = await walletAdapterToClient(adapter, base)\n\nconst registry = new ToolRegistryClient({\n  chain: base,\n  rpcUrl: \"https:\u002F\u002Fmainnet.base.org\",\n  walletClient,\n})\n\nconst { toolId, txHash } = await registry.registerTool({\n  metadataURI: \"https:\u002F\u002Fmy-tool.example.com\u002F.well-known\u002Fai-tool\u002Fmy-tool.json\",\n  manifest,                                      \u002F\u002F your ToolManifest object\n  accessPredicate: \"0x0000...0000\",              \u002F\u002F address(0) for open access\n})\n\nconsole.log(`Registered tool ${toolId} in tx ${txHash}`)\n```\n\n## 3. Gating tool access\n\nTools can be gated three ways:\n\n| Gate | Mechanism | Reference |\n|------|-----------|-----------|\n| **x402 paywall** | Pay-per-call (USDC, EIP-3009) | [`references\u002Fx402.md`](references\u002Fx402.md) |\n| **Predicate gate** | Onchain check (NFT, subscription, composite) | [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md) |\n| **Combined** | SIWE auth and payment (predicate first, then x402) | [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md) |\n\nFor deployed predicate addresses, requirement encodings, and SDK helpers like `describeToolAccess` \u002F `decodeRequirement`, see [`references\u002Fknown-predicates.md`](references\u002Fknown-predicates.md).\n\n## 4. Wallet Setup\n\nThe SDK supports multiple wallet providers via `@opensea\u002Fwallet-adapters`. Set environment variables and the SDK auto-detects the provider. See the [`opensea-wallet`](..\u002Fopensea-wallet\u002FSKILL.md) skill for the full provider table, env vars, setup walkthroughs, and signing-policy configuration.\n\n```typescript\nimport { createWalletFromEnv } from \"@opensea\u002Ftool-sdk\"\n\nconst adapter = createWalletFromEnv()\nconst address = await adapter.getAddress()\n```\n\nFor Bankr (external signer):\n\n```typescript\nimport { createBankrAccount } from \"@opensea\u002Ftool-sdk\"\n\nconst account = await createBankrAccount(\"your-bankr-api-key\")\n\u002F\u002F Use with authenticatedFetch or paidAuthenticatedFetch\n```\n\n## 5. Response Codes\n\n| Code | Meaning | Action |\n|------|---------|--------|\n| 200 | Success | Parse the JSON body per the manifest's `outputs` schema |\n| 400 | Invalid input | Fix request body to match the manifest's `inputs` schema |\n| 401 | Missing\u002Finvalid SIWE auth | Sign a SIWE message and include `Authorization: SIWE \u003Ctoken>` |\n| 402 | Payment required | Read `body.accepts[0]` for payment requirements, sign and retry with `X-Payment` |\n| 403 | Access denied | Inspect `body.predicate` to discover what's needed; acquire the required token\u002Fsubscription |\n| 405 | Method not allowed | Use POST |\n| 500 | Internal tool error | Retry or contact the tool creator |\n| 502 | Predicate\u002Ffacilitator error | The upstream predicate or payment facilitator misbehaved; retry later |\n\n## 6. Quick Reference: CLI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `init` | Scaffold a new tool project |\n| `validate` | Validate a manifest file |\n| `hash` | Compute the JCS keccak256 hash of a manifest |\n| `export` | Export the manifest as JSON |\n| `register` | Register a tool onchain |\n| `update-metadata` | Update a tool's metadata URI and manifest hash onchain |\n| `inspect` | Look up a tool's onchain config by ID |\n| `verify` | Verify a manifest against its onchain hash |\n| `deploy` | Deploy a tool to Vercel |\n| `auth` | Call a predicate-gated tool (SIWE) |\n| `pay` | Call an x402-paid tool (USDC) |\n| `smoke` | Auto-detect gate type and call |\n| `dry-run-gate` | Simulate an x402 gate check locally |\n| `dry-run-predicate-gate` | Simulate a predicate gate check locally |\n\nAll CLI commands accept `--wallet-provider privy|turnkey|fireblocks|bankr|private-key` or auto-detect from env vars.\n\n## 7. End-to-End Examples\n\n### Example A: Free open-access tool\n\n```bash\n# 1. Scaffold\nnpx @opensea\u002Ftool-sdk init --runtime vercel\n# 2. Edit src\u002Fmanifest.ts and src\u002Fhandler.ts with your logic\n# 3. Deploy\nnpx @opensea\u002Ftool-sdk deploy\n# 4. Register (open access)\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.vercel.app\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base\n# 5. Call\ncurl -X POST https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"query\": \"hello\"}'\n```\n\n### Example B: x402 paid tool (pay-per-call only, no identity check)\n\n```bash\n# Server: add paywall gate (see references\u002Fx402.md)\n# Call via CLI:\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk pay \\\n  https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --body '{\"query\": \"hello\"}'\n```\n\n### Example C: NFT-gated tool (identity check, no payment)\n\n```bash\n# Register with NFT gate\nPRIVATE_KEY=0x... npx @opensea\u002Ftool-sdk register \\\n  --metadata https:\u002F\u002Fmy-tool.vercel.app\u002F.well-known\u002Fai-tool\u002Fmy-tool.json \\\n  --network base \\\n  --nft-gate 0xCOLLECTION\n\n# Server: add predicateGate (see references\u002Fpredicate-gating.md)\n\n# Call via CLI:\nPRIVATE_KEY=0x... RPC_URL=https:\u002F\u002Fmainnet.base.org \\\n  npx @opensea\u002Ftool-sdk auth \\\n  https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --body '{\"query\": \"hello\"}'\n```\n\n### Example D: NFT-gated and paid tool (both gates)\n\n```bash\n# Server: add both predicateGate and paywall.gate (see references\u002Fpredicate-gating.md)\n# Call via CLI:\nPRIVATE_KEY=0x... RPC_URL=https:\u002F\u002Fmainnet.base.org \\\n  npx @opensea\u002Ftool-sdk smoke \\\n  --endpoint https:\u002F\u002Fmy-tool.vercel.app\u002Fapi \\\n  --expect 200\n```\n\n## References\n\n- [`references\u002Fx402.md`](references\u002Fx402.md): pay-per-call protocol, server-side paywall, `paidFetch`\n- [`references\u002Fpredicate-gating.md`](references\u002Fpredicate-gating.md): SIWE-based access control, combined gates\n- [`references\u002Fknown-predicates.md`](references\u002Fknown-predicates.md): deployed predicate contracts and SDK helpers\n- [Tool SDK GitHub](https:\u002F\u002Fgithub.com\u002FProjectOpenSea\u002Ftool-sdk)\n",{"env":23,"name":5,"license":14,"homepage":28,"repository":28,"description":7,"dependencies":29},{"RPC_URL":24,"PRIVATE_KEY":26},{"required":19,"description":25},"RPC URL for Base mainnet (default https:\u002F\u002Fmainnet.base.org)",{"required":19,"description":27},"Wallet private key for onchain registration and tool calls","https:\u002F\u002Fgithub.com\u002FProjectOpenSea\u002Ftool-sdk",[30],"node >= 18.0.0","main","f9529dc2bfe073cfeb4f152284acc99c322f62ce","opensea\u002Fopensea-tool-sdk","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills","https:\u002F\u002Fgithub.com\u002FCrawlrrAI","2026-08-19 20:13:42",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add CrawlrrAI\u002Fskills --skill opensea-tool-sdk",{"tool":43,"command":44},"bunx","bunx skills add CrawlrrAI\u002Fskills --skill opensea-tool-sdk",{"tool":46,"command":47},"pnpm","pnpm dlx skills add CrawlrrAI\u002Fskills --skill opensea-tool-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-tool-sdk\u002FSKILL.md",true,[51,57,61],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fknown-predicates.md","REFERENCE","参考文档",5483,"https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-tool-sdk\u002Freferences\u002Fknown-predicates.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fpredicate-gating.md",7499,"https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-tool-sdk\u002Freferences\u002Fpredicate-gating.md",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fx402.md",5125,"https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-tool-sdk\u002Freferences\u002Fx402.md",[66,73,80,87,94,101],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7AVVRQRP6G52EJ87F8YRS3J","rhagent","Trade and post on rhagent.bot via Bankr. EVERY claimed fill (Bankr Terminal, @bankrbot on X — tweet, reply, or mention — DM, or any other surface) MUST trade-post to rhagent.bot BEFORE the reply. Use via bankr_terminal or bankr_x+source_url; reply MUST paste post_url + ticker_url. Explorer\u002FBlockscout alone is a failure. Robinhood Chain swaps (ETH\u002FUSDG only, never USDC), copy-trade, App crypto\u002Fagentic. Triggers on rhagent, rhagents, rhagent.bot, trade-post, Copy this trade, Robinhood Chain, bankr_x, bankr_terminal.","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Frhagent\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7AVSX1PMSP2XG35CHXJHV8Z","opensea-wallet","Set up and configure wallet signing providers for OpenSea transactions. Supports Privy, Turnkey, Fireblocks, Bankr, and local private keys. Required for executing trades (opensea-marketplace) and token swaps (opensea-swaps).","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-wallet\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7AVSH292KE97TPRD7NP7CTT","opensea-swaps","Swap ERC20 tokens across supported chains via OpenSea's cross-chain DEX aggregator. Get quotes with optimal routing, check token balances, and execute swaps. For NFT trading use opensea-marketplace, for querying token data use opensea-api.","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-swaps\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7AVSBJ2THSF024V3E4ZPVSJ","opensea-marketplace","Buy and sell NFTs on OpenSea's Seaport marketplace. Fulfill listings, accept offers, create new orders, cross-chain purchases, and sweep multiple listings. Requires wallet signing; for read-only queries use opensea-api instead.","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-marketplace\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7AVS4AJ0S0NWX95DREYTW6Q","opensea-api","Query OpenSea marketplace data via the official CLI, MCP server, or shell scripts. Get floor prices, collection stats, NFT details, token data, trending collections, drops, events, and search across Ethereum, Base, Arbitrum, Polygon, and more. Read-only operations; for trading use opensea-marketplace, for token swaps use opensea-swaps.","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002Fopensea-api\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":18},"01M7AVRX0F5KR2VZYEVED68HZW","opensea","Query NFT and token data, trade NFTs on Seaport, swap ERC20 tokens via DEX aggregator, configure wallet signing providers, and build\u002Fregister\u002Fgate AI agent tools on Base. Covers the full OpenSea developer surface across CLI, MCP server, shell scripts, and SDK. Pick the right sub-skill using the routing table below, then read that sub-skill's SKILL.md for operational detail.","https:\u002F\u002Fgithub.com\u002FCrawlrrAI\u002Fskills\u002Fblob\u002Fmain\u002Fopensea\u002FSKILL.md",[],[]]