{"id":"37df6839-f393-4fb7-8466-32ea96fcc6f1","entityType":"agent","slug":"clawhub-api3dao-api3-data-feed-purchase","name":"api3-data-feed-purchase","canonicalUrl":"https://www.xpersona.co/agent/clawhub-api3dao-api3-data-feed-purchase","canonicalPath":"/agent/clawhub-api3dao-api3-data-feed-purchase","generatedAt":"2026-10-11T03:53:19.305Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":null},"description":"Purchases Api3 data feed subscriptions from market.api3.org. Skill: api3-data-feed-purchase Owner: api3dao Summary: Purchases Api3 data feed subscriptions from market.api3.org. Tags: latest:0.7.0 Version history: v0.7.0 | 2026-08-03T13:36:22.955Z | auto - Removed obsolete documentation file skill-card.md. - Updated version to 0.7.0 in metadata and package files. - No changes to user-facing features, scripts, or process in SKILL.md. - Maintenance update: cleans up documentation","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17fpem9ms79vcs99cb3mps27x8bd7p6:api3-data-feed-purchase","sourceUrl":"https://clawhub.ai/api3dao/api3-data-feed-purchase","homepage":"https://clawhub.ai/api3dao/skills/api3-data-feed-purchase","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/api3dao/api3-data-feed-purchase","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/api3dao/skills/api3-data-feed-purchase","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Purchases Api3 data feed subscriptions from market.api3.org. Skill: api3-data-feed-purchase Owner: api3dao Summary: Purchases Api3 data feed subscriptions from "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":null},"stars":null,"forks":null,"downloads":1215,"packageName":null,"latestVersion":"0.7.0","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T00:47:49.235Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T00:47:49.338Z","lastCrawledAt":"2026-10-11T00:47:49.235Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T00:47:49.235Z","lastVerifiedAt":null,"highlights":[{"version":"0.7.0","createdAt":"2026-08-03T13:36:22.955Z","changelog":"- Removed obsolete documentation file skill-card.md. - Updated version to 0.7.0 in metadata and package files. - No changes to user-facing features, scripts, or process in SKILL.md. - Maintenance update: cleans up documentation, no functional impact.","fileCount":14,"zipByteSize":13755},{"version":"0.6.0","createdAt":"2026-07-29T14:34:24.504Z","changelog":"- Removed the file skill-card.md. - Updated package version from 0.5.0 to 0.6.0. - Made minor content or formatting changes to documentation (SKILL.md). - No major user-facing changes to skill functionality.","fileCount":14,"zipByteSize":13801},{"version":"0.5.0","createdAt":"2026-07-29T10:33:59.571Z","changelog":"api3-data-feed-purchase v0.5.0 - Removed obsolete file: skill-card.md. - SKILL.md updated; core flow, procedures, and logic remain unchanged. - No user-facing functionality changes; documentation now reflects current implementation and requirements.","fileCount":14,"zipByteSize":13843},{"version":"0.4.1","createdAt":"2026-07-28T15:05:07.246Z","changelog":"- Removed obsolete files: _meta.json and skill-card.md. - Updated SKILL.md version to 0.4.1 and maintained detailed step-by-step instructions. - No changes to functionality or user flow; documentation remains thorough and unchanged in behavior.","fileCount":14,"zipByteSize":13889},{"version":"0.3.1","createdAt":"2026-07-28T14:45:22.342Z","changelog":"api3-data-feed-purchase v0.3.1 - Removed the skill-card.md file. - Updated _meta.json and package.json (details not shown). - No changes to logic or user-facing flow in SKILL.md. - Changelog and instructional rules remain unchanged; maintenance release.","fileCount":14,"zipByteSize":13859},{"version":"0.3.0","createdAt":"2026-07-13T07:21:59.888Z","changelog":"- Added new metadata file (_meta.json). - Removed skill-card.md file. - Updated package information in package.json. - No user-facing behavior or workflow of the skill has changed. - Internal project structure cleanup.","fileCount":14,"zipByteSize":13769},{"version":"0.2.0","createdAt":"2026-07-02T18:21:28.490Z","changelog":"Updated script, polished SKILL.md","fileCount":14,"zipByteSize":13729},{"version":"0.1.0","createdAt":"2026-06-08T14:32:46.604Z","changelog":"Initial release of api3-data-feed-purchase skill. - Guides users step-by-step to purchase API3 data feed subscriptions from market.api3.org. - Collects, validates, and confirms all necessary user inputs before continuing. - Installs required packages and dependencies with user approval. - Supports optional live data feed value exploration prior to purchase. - Provides clear price quoting and summary confirmations before executing any on-chain transaction. - Uses only secure, approved methods; never reads secrets or .env files directly.","fileCount":12,"zipByteSize":10499}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17fpem9ms79vcs99cb3mps27x8bd7p6:api3-data-feed-purchase","setupComplexity":"low","setupSteps":["Node.js workspace detected. Install dependencies securely: run `npm ci --ignore-scripts` to prevent post-install lifecycle triggers from running arbitrary code, then selectively audit the dependency tree.","Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T03:53:19.300Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-api3dao-api3-data-feed-purchase/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":null},"readme":"Skill: api3-data-feed-purchase\n\nOwner: api3dao\n\nSummary: Purchases Api3 data feed subscriptions from market.api3.org.\n\nTags: latest:0.7.0\n\nVersion history:\n\nv0.7.0 | 2026-08-03T13:36:22.955Z | auto\n\n- Removed obsolete documentation file skill-card.md.\n- Updated version to 0.7.0 in metadata and package files.\n- No changes to user-facing features, scripts, or process in SKILL.md.\n- Maintenance update: cleans up documentation, no functional impact.\n\nv0.6.0 | 2026-07-29T14:34:24.504Z | auto\n\n- Removed the file skill-card.md.\n- Updated package version from 0.5.0 to 0.6.0.\n- Made minor content or formatting changes to documentation (SKILL.md).\n- No major user-facing changes to skill functionality.\n\nv0.5.0 | 2026-07-29T10:33:59.571Z | auto\n\napi3-data-feed-purchase v0.5.0\n\n- Removed obsolete file: skill-card.md.\n- SKILL.md updated; core flow, procedures, and logic remain unchanged.\n- No user-facing functionality changes; documentation now reflects current implementation and requirements.\n\nv0.4.1 | 2026-07-28T15:05:07.246Z | auto\n\n- Removed obsolete files: _meta.json and skill-card.md.\n- Updated SKILL.md version to 0.4.1 and maintained detailed step-by-step instructions.\n- No changes to functionality or user flow; documentation remains thorough and unchanged in behavior.\n\nv0.3.1 | 2026-07-28T14:45:22.342Z | auto\n\napi3-data-feed-purchase v0.3.1\n\n- Removed the skill-card.md file.\n- Updated _meta.json and package.json (details not shown).\n- No changes to logic or user-facing flow in SKILL.md.\n- Changelog and instructional rules remain unchanged; maintenance release.\n\nv0.3.0 | 2026-07-13T07:21:59.888Z | auto\n\n- Added new metadata file (_meta.json).\n- Removed skill-card.md file.\n- Updated package information in package.json.\n- No user-facing behavior or workflow of the skill has changed.\n- Internal project structure cleanup.\n\nv0.2.0 | 2026-07-02T18:21:28.490Z | user\n\nUpdated script, polished SKILL.md\n\nv0.1.0 | 2026-06-08T14:32:46.604Z | auto\n\nInitial release of api3-data-feed-purchase skill.\n\n- Guides users step-by-step to purchase API3 data feed subscriptions from market.api3.org.\n- Collects, validates, and confirms all necessary user inputs before continuing.\n- Installs required packages and dependencies with user approval.\n- Supports optional live data feed value exploration prior to purchase.\n- Provides clear price quoting and summary confirmations before executing any on-chain transaction.\n- Uses only secure, approved methods; never reads secrets or .env files directly.\n\nArchive index:\n\nArchive v0.7.0: 14 files, 13755 bytes\n\nFiles: example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2059b), SKILL.md (10387b), _meta.json (142b)\n\nFile v0.7.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.7.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means either Api3 Market (https://market.api3.org/) is closed due to ongoing integrations or skill is out of date and user should download the latest version of this skill.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.7.0:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.7.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.7.0\",\n  \"publishedAt\": 1785764182955\n}\n\nFile v0.7.0:skill-card.md\n\n## Description:\n\nPurchases Api3 data feed subscriptions from market.api3.org.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[api3dao](https://clawhub.ai/user/api3dao)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators use this skill to select an Api3 dAPI feed and chain, get a subscription quote, execute an on-chain purchase, and optionally read the deployed reader proxy.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill uses WALLET_MNEMONIC to sign a live blockchain transaction for a data feed subscription.\n\nMitigation: Use only a dedicated low-balance wallet and independently inspect the transaction details before approving the purchase step.\n\nRisk: A valuable recovery phrase could be exposed if stored casually in the skill directory or shared with the agent.\n\nMitigation: Keep production wallet secrets out of the skill directory and avoid sharing the mnemonic directly in chat.\n\nRisk: The read-data-feed step can target an unintended contract if the reader proxy address is malformed or untrusted.\n\nMitigation: Run that step only after validating the proxy address as a 42-character hexadecimal Ethereum address that starts with 0x.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase)\n- [Api3 Market](https://market.api3.org)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell command blocks and summarized command output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC for purchase execution.]\n\n## Skill Version(s):\n\n0.7.0 (source: release evidence and SKILL.md metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.7.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.32.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.7.0:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.6.0: 14 files, 13801 bytes\n\nFiles: example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2222b), SKILL.md (10387b), _meta.json (142b)\n\nFile v0.6.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.6.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means either Api3 Market (https://market.api3.org/) is closed due to ongoing integrations or skill is out of date and user should download the latest version of this skill.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.6.0:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.6.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.6.0\",\n  \"publishedAt\": 1785335664504\n}\n\nFile v0.6.0:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[api3dao](https://clawhub.ai/user/api3dao) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and blockchain operators use this skill to select an Api3 dAPI feed, choose a supported chain and deviation threshold, quote the subscription cost, execute the on-chain purchase, and optionally verify the deployed reader proxy. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The workflow can sign and submit real blockchain transactions that spend funds from WALLET_MNEMONIC. <br>\nMitigation: Use a dedicated low-balance wallet, avoid storing a main wallet mnemonic in the skill directory, and verify the chain, feed, deviation, amount, and sponsor wallet before approving the purchase. <br>\nRisk: A confirmed purchase transaction may be irreversible. <br>\nMitigation: Review the quoted subscription price and amount to send before execution, and use the optional provider value check to sanity-check the selected feed before paying. <br>\n\n\n## Reference(s): <br>\n- [Api3 Market](https://market.api3.org) <br>\n- [Api3 Signed API public endpoint pattern](https://signed-api.api3.org/public/${api.airnode}) <br>\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and summarized script output.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Guides package installation, feed and chain validation, price quote review, purchase execution, and optional feed readback.] <br>\n\n## Skill Version(s): <br>\n0.6.0 (source: SKILL.md metadata and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.6.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.31.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.6.0:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.5.0: 14 files, 13843 bytes\n\nFiles: example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2385b), SKILL.md (10387b), _meta.json (142b)\n\nFile v0.5.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.5.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means either Api3 Market (https://market.api3.org/) is closed due to ongoing integrations or skill is out of date and user should download the latest version of this skill.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.5.0:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.5.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.5.0\",\n  \"publishedAt\": 1785321239571\n}\n\nFile v0.5.0:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[api3dao](https://clawhub.ai/user/api3dao) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and blockchain operators use this skill to select an Api3 dAPI feed, validate the target chain and deviation threshold, get a live subscription quote, execute the purchase transaction, and optionally verify the reader proxy output. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill asks for a wallet seed phrase in a local environment variable and can use it to sign blockchain transactions. <br>\nMitigation: Use a dedicated low-balance wallet or safer signer, and do not use a primary wallet seed phrase. <br>\nRisk: The purchase flow can spend funds in an irreversible on-chain transaction. <br>\nMitigation: Verify the chain, feed, deviation threshold, subscription price, amount to send, sponsor wallet, and transaction details before approval; consider adding dry-run or max-spend controls before real use. <br>\nRisk: The skill installs dependencies and runs TypeScript scripts that fetch live market, pricing, and provider data. <br>\nMitigation: Review dependencies, commands, and returned values before execution, and run the scripts only from the trusted skill directory. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase) <br>\n- [Api3 Market](https://market.api3.org) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and summarized command output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC; may execute irreversible blockchain transactions after user approval.] <br>\n\n## Skill Version(s): <br>\n0.5.0 (source: evidence release and SKILL.md metadata; package.json reports 1.0.0) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.5.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.30.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.5.0:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.4.1: 14 files, 13889 bytes\n\nFiles: example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2554b), SKILL.md (10338b), _meta.json (142b)\n\nFile v0.4.1:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.4.1\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means the `@api3/dapi-management` package is out of date. Tell the user to get the latest version of this skill, then stop.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.4.1:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.4.1:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.4.1\",\n  \"publishedAt\": 1785251107246\n}\n\nFile v0.4.1:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[api3dao](https://clawhub.ai/user/api3dao) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and teams integrating Api3 data feeds use this skill to select a feed, chain, and deviation threshold; inspect provider-reported values; get a subscription quote; execute the on-chain purchase; and read the resulting proxy. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The purchase flow can spend funds from the configured wallet. <br>\nMitigation: Use a dedicated low-value wallet and verify the feed, chain, price, sponsor wallet, deviation threshold, and amount before approving buy.ts. <br>\nRisk: The workflow relies on WALLET_MNEMONIC in a local environment file. <br>\nMitigation: Avoid storing a valuable mnemonic in plaintext; keep the environment file local, protect it from disclosure, and remove the mnemonic when the purchase is complete. <br>\nRisk: The scripts install Node packages and contact Api3-related services and RPC endpoints. <br>\nMitigation: Review the package list and command output before proceeding, and run the skill only in an environment where those network calls are acceptable. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase) <br>\n- [Api3 Market](https://market.api3.org) <br>\n- [Api3 Market integration path example](https://market.api3.org/ethereum/eth-usd/integrate) <br>\n- [Api3 signed API endpoint pattern](https://signed-api.api3.org/public/${api.airnode}) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown responses with command invocations, validation summaries, quote details, transaction status, and feed-read results.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC; commands contact Api3 services and RPC endpoints and may execute a real blockchain purchase.] <br>\n\n## Skill Version(s): <br>\n0.4.1 (source: server release metadata and SKILL.md metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.4.1:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.30.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.4.1:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.3.1: 14 files, 13859 bytes\n\nFiles: _meta.json (142b), example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2547b), SKILL.md (10338b)\n\nFile v0.3.1:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.1.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means the `@api3/dapi-management` package is out of date. Tell the user to get the latest version of this skill, then stop.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.3.1:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.3.1:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.3.1\",\n  \"publishedAt\": 1785249922342\n}\n\nFile v0.3.1:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[api3dao](https://clawhub.ai/user/api3dao) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and teams use this skill to select an Api3 dAPI feed, choose a supported chain and deviation threshold, inspect provider-reported values, quote the subscription cost, execute the on-chain purchase, and optionally read the deployed reader proxy. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill requires a full wallet mnemonic in a local environment file. <br>\nMitigation: Use only a low-value or dedicated wallet, and avoid placing a main wallet mnemonic in the project directory. <br>\nRisk: The purchase step can submit an irreversible on-chain transaction. <br>\nMitigation: Verify the feed, chain, deviation threshold, sponsor wallet, price, amount to send, and gas before approving the purchase script. <br>\nRisk: The workflow depends on live Api3 market, pricing, RPC, and signed API data at execution time. <br>\nMitigation: Inspect the provider-reported values and quote output before purchase, and stop if the returned values or network details do not match expectations. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase) <br>\n- [Api3 Market](https://market.api3.org) <br>\n- [Api3 signed API endpoint base](https://signed-api.api3.org/public/) <br>\n- [Api3 dAPI pricing data base](https://api3dao.github.io/data-feeds/market/dapi-pricing/) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown guidance with shell commands and summarized script output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC. The workflow installs dependencies, queries Api3 feed and chain metadata, provides price quotes, can submit an on-chain purchase transaction after user confirmation, and can read the resulting data feed proxy.] <br>\n\n## Skill Version(s): <br>\n0.3.1 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.3.1:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.30.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.3.1:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.3.0: 14 files, 13769 bytes\n\nFiles: _meta.json (142b), example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2285b), SKILL.md (10338b)\n\nFile v0.3.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.1.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means the `@api3/dapi-management` package is out of date. Tell the user to get the latest version of this skill, then stop.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.3.0:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.3.0\",\n  \"publishedAt\": 1783927319888\n}\n\nFile v0.3.0:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[metobom](https://clawhub.ai/user/metobom) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and Web3 operators use this skill to choose an Api3 dAPI feed, chain, and deviation threshold, inspect live provider values, quote the subscription price, execute the on-chain purchase, and optionally verify the reader proxy. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill uses a local WALLET_MNEMONIC to sign real blockchain purchase transactions. <br>\nMitigation: Use only a limited-purpose wallet with minimal funds and avoid storing a primary seed phrase in the skill directory. <br>\nRisk: The purchase transaction is an on-chain action that can spend ETH and should be treated as irreversible. <br>\nMitigation: Confirm the exact chain, feed, deviation threshold, quoted price, and amount to send before approving the purchase script. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/metobom/skills/api3-data-feed-purchase) <br>\n- [API3 Market](https://market.api3.org) <br>\n- [API3 Signed API public endpoint pattern](https://signed-api.api3.org/public/${api.airnode}) <br>\n- [API3 pricing data path pattern](https://api3dao.github.io/data-feeds/market/dapi-pricing/${chainId}/${path}.json) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with shell commands, plain-text command output summaries, and tables.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires feed, chain, and deviation choices; purchase execution requires WALLET_MNEMONIC in the environment, and feed reading requires a reader proxy address.] <br>\n\n## Skill Version(s): <br>\n0.3.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.3.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.28.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.3.0:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.2.0: 14 files, 13729 bytes\n\nFiles: example.env (16b), package.json (259b), pnpm-workspace.yaml (35b), README.md (505b), scripts/buy.ts (2587b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1318b), scripts/read-data-feed.ts (1300b), scripts/utils.ts (10825b), skill-card.md (2177b), SKILL.md (10338b), _meta.json (142b)\n\nFile v0.2.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.1.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `@openzeppelin/merkle-tree`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\"\n```\n- If the script fails, let the user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Homepage, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `dAPI` | Feed |\n| `Chain` | Chain |\n| `Deviation` | Deviation Threshold |\n| `Duration` | Subscription Duration (seconds) |\n| `Price` | Subscription Price (ETH) |\n| `Amount to send` | Amount to Send (ETH) |\n| `Sponsor wallet` | Sponsor Wallet |\n\n- If the amount to send is lower than the subscription price, explain that the sponsor wallet already holds funds, so only the difference needs to be sent.\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain to the user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\"\n```\n- If the script fails with an `Invalid root` error, this means the `@api3/dapi-management` package is out of date. Tell the user to get the latest version of this skill, then stop.\n- If the script fails for any other reason, let the user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the transaction hash from the `Confirmed:` line of the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask the user if they want to read the data feed now. If yes, proceed. If no, inform the user that the subscription is active (though it's always better to verify the feed) and stop here.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.2.0:README.md\n\n# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1783016488490\n}\n\nFile v0.2.0:skill-card.md\n\n## Description: <br>\nPurchases Api3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[metobom](https://clawhub.ai/user/metobom) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and blockchain operators use this skill to choose an Api3 dAPI, validate the target chain and deviation threshold, inspect provider data, quote subscription cost, execute an on-chain purchase, and optionally read the deployed reader proxy. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The purchase flow can use a wallet mnemonic to sign and send a real on-chain transaction. <br>\nMitigation: Use a dedicated low-balance wallet, never a primary wallet mnemonic, and confirm the chain, contract, amount, and gas before approval. <br>\nRisk: The skill installs and runs TypeScript dependencies before interacting with blockchain services. <br>\nMitigation: Review the artifact before running, pin dependencies where practical, and consider using an external wallet signer. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/metobom/skills/api3-data-feed-purchase) <br>\n- [Api3 Market](https://market.api3.org) <br>\n- [Api3 signed API public endpoint](https://signed-api.api3.org/public/) <br>\n- [Api3 data feed pricing data](https://api3dao.github.io/data-feeds/market/dapi-pricing/) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, shell commands, configuration, text] <br>\n**Output Format:** [Markdown guidance with shell commands and transaction summaries] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC; can initiate an on-chain purchase transaction after user approval.] <br>\n\n## Skill Version(s): <br>\n0.2.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.2.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.22.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}\n\nFile v0.2.0:pnpm-workspace.yaml\n\nallowBuilds:\n  unrs-resolver: false\n\nArchive v0.1.0: 12 files, 10499 bytes\n\nFiles: example.env (16b), package.json (246b), README.md (505b), scripts/buy.ts (3576b), scripts/explore-data-feeds.ts (2148b), scripts/get-chains.ts (350b), scripts/get-dapis.ts (262b), scripts/quote.ts (1824b), scripts/read-data-feed.ts (1271b), skill-card.md (1993b), SKILL.md (9963b), _meta.json (142b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: api3-data-feed-purchase\ndescription: Purchases API3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.1.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts in skill's directory, which is referenced as `{baseDir}` variable and name is given in this file's name field at top. Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:\n  - `@api3/dapi-management`\n  - `dotenv`\n  - `ethers`\n- Ask for approval to run `pnpm install`. Wait for an affirmative response. Once approved, run the command regardless of whether packages may already be installed:\n```\nexec command=\"cd {baseDir} && pnpm install\"\n```\n- If the output contains `[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: unrs-resolver...`, this is expected and not a real failure — the ignored build script is not needed for this skill. Treat it as success and continue.\n- If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.\n\n---\n\n## Phase 2: Collect User Input\n\n### Part 2.1\n- Ask the user for all three inputs in one message:\n  - **Feed name** — which data feed they want (e.g. `ETH/USD`). Direct them to https://market.api3.org to browse available feeds.\n  - **Chain** — which network they want to use (name or alias, e.g. `ethereum`).\n  - **Deviation threshold** — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` (percent).\n- Wait for all three answers before continuing.\n\n### Part 2.2\n- Run `get-dapis.ts` and `get-chains.ts` to fetch the list of available feeds and supported chains:\n```\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/get-chains.ts\"\n```\n- If script fails, let user know about the problem and ask what to do. This data is necessary for validating their input, so skipping is not an option.\n\n### Part 2.3\n- Validate `DAPI_NAME`:\n  - Search the output of `get-dapis.ts` for an entry matching the user's feed name exactly (case-insensitive).\n  - Match found: set `DAPI_NAME` to the exact string from the list (preserve its casing) and confirm the matched value to the user.\n  - No match: inform the user, direct them to https://market.api3.org for the exact feed name, and wait for a new value. Repeat this step.\n\n- Validate `CHAIN_ALIAS`:\n  - Search the output of `get-chains.ts` — first by `alias` field (case-insensitive), then by `name` field.\n  - Match found: set `CHAIN_ALIAS`, `CHAIN_NAME`, `CHAIN_ID` from that entry. Confirm the match with the user and ask if it is correct. If not, ask them to re-enter and repeat this step.\n  - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.\n\n- Validate `DEVIATION`:\n  - Check that the value is exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5`.\n  - Valid: set `DEVIATION`.\n  - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.\n\n### Part 2.4\n\n- Show the user a summary of their selected options:\n  - Feed: `<DAPI_NAME>`\n  - Chain: `<CHAIN_NAME>`\n  - Deviation Threshold: `<DEVIATION>%`\n- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.\n- If yes, ask whether they'd also like to explore the data feed first — i.e. see the live value each data provider is currently reporting for this feed before getting a price quote. If yes, proceed to Phase 3. If no, skip ahead to Phase 4.\n\n---\n\n## Phase 3: Check Live Provider Values (Optional)\n\n### Part 3.1\n- Explain to the user that before continuing, you'll show them the live value each data provider is currently reporting for this feed, so they can sanity-check the data before paying for it.\n- Run `explore-data-feeds.ts`, which fetches each provider's Signed API data and decodes the live value for this feed directly:\n```\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/explore-data-feeds.ts <DAPI_NAME>\"\n```\n- If the script fails, let the user know about the problem and ask what to do.\n\n### Part 3.2\n- The script prints, for each provider: API Alias, Data Feed ID, Signed API URL, Value, and Timestamp (or an explanation if no value could be retrieved).\n- Show the user a summary table of these fields for each provider exactly as reported by the script — do not re-fetch or re-derive any of these values yourself.\n- Proceed to Phase 4.\n\n---\n\n## Phase 4: Get Price Quote\n\n### Part 4.1\n- Run `quote.ts` to fetch the live subscription price for the selected feed, chain, and deviation:\n```\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/quote.ts <DAPI_NAME> <CHAIN_ALIAS> <DEVIATION>\"\n```\n- If script fails, let user know about the problem and ask what to do.\n\n### Part 4.2\n- Extract and show these fields from the output:\n| Field | Label to show |\n|---|---|\n| `Feed Name` | Feed |\n| `Chain` | Chain |\n| `Heartbeat Interval` | Heartbeat Interval (seconds) |\n| `Deviation Threshold` | Deviation Threshold |\n| `Subscription Duration` | Subscription Duration (seconds) |\n| `Price (ETH)` | Price (ETH) |\n\n- Ask the user to confirm that they want to proceed with these options. If yes, proceed to Phase 5. If no, ask the user what they want to do.\n\n---\n\n## Phase 5: Execute Purchase\n\n### Part 5.1\n- Explain user that you are ready to complete the purchase. You will run `buy.ts`, which will execute a blockchain transaction to purchase the subscription.\n- Explain this script will use the `WALLET_MNEMONIC` environment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in `.env` file in the root of this skill.\n- Ask if the `.env` file is ready with the correct mnemonic and if they want you to run the purchase script. Wait for an affirmative response before proceeding. Then run the following command if answer is affirmative:\n\n(substitute actual variable values when running):\n```\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/buy.ts <DAPI_NAME> <CHAIN_ALIAS> <DEVIATION>\"\n```\n- If script fails, let user know about the problem and ask what to do.\n\n### Part 5.2\n- Extract the `hash` value from the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash.\n- Proceed to Phase 6.\n\n---\n\n## Phase 6: Read the Data Feed\n\n### Part 6.1\n- Ask user if they want to read the data feed now. If yes, proceed. If no, inform the user the subscription is active, but its always better to check and stop.\n- Ask the user to retrieve their Reader Proxy address by:\n  - Going to https://market.api3.org/<CHAIN_ALIAS>/<DAPI_NAME lowercased, with `/` replaced by `-`>/integrate\n  - Copying the proxy contract address and sharing it here.\n- Wait for the user to provide the proxy address.\n- Validate the proxy address:\n  - Must start with `0x`.\n  - Must be exactly 42 characters long.\n  - If either check fails: inform the user of the requirements and wait again.\n- Set `PROXY_ADDRESS` to the valid value.\n\n### Part 6.2\n- Run `read-data-feed.ts` to fetch the latest value and timestamp from the proxy contract:\n```\nexec command=\"cd {baseDir} && ts-node {baseDir}/scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\"\n```\n- If script fails, let user know about the problem and ask what to do.\n- Extract and show the value and timestamp from the output.\n- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!\n\nFile v0.1.0:README.md\n\n# API3 Data Feed Purchase\n\nHelper skill for buying API3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1780929166604\n}\n\nFile v0.1.0:skill-card.md\n\n## Description: <br>\nPurchases API3 data feed subscriptions from market.api3.org. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[metobom](https://clawhub.ai/user/metobom) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and blockchain operators use this skill to discover API3 dAPIs and supported chains, quote subscription pricing, purchase a selected data feed subscription on-chain, and optionally read the resulting feed. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill uses WALLET_MNEMONIC from a local .env file to sign blockchain transactions. <br>\nMitigation: Use only a dedicated low-balance wallet and never paste a main wallet seed phrase into chat or project files. <br>\nRisk: The purchase flow can spend funds and broadcast an irreversible on-chain transaction. <br>\nMitigation: Verify the feed, chain, deviation threshold, and quoted price carefully, and require explicit user approval before running the purchase command. <br>\n\n\n## Reference(s): <br>\n- [API3 Market](https://market.api3.org) <br>\n- [ClawHub Skill Page](https://clawhub.ai/metobom/api3-data-feed-purchase) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and summary tables] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Guides package installation, feed and chain validation, price quoting, transaction execution, and optional feed reading.] <br>\n\n## Skill Version(s): <br>\n0.1.0 (source: server release metadata and SKILL.md metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.1.0:package.json\n\n{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"file:api3-dapi-management-4.20.0.tgz\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}","readmeExcerpt":"Skill: api3-data-feed-purchase Owner: api3dao Summary: Purchases Api3 data feed subscriptions from market.api3.org. Tags: latest:0.7.0 Version history: v0.7.0 | 2026-08-03T13:36:22.955Z | auto - Removed obsolete documentation file skill-card.md. - Updated version to 0.7.0 in metadata and package files. - No changes to user-facing features, scripts, or process in SKILL.md. - Maintenance update: cleans up documentation","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"exec command=\"cd {baseDir} && pnpm install\""},{"language":"text","snippet":"exec command=\"cd {baseDir} && ts-node scripts/get-dapis.ts\"\nexec command=\"cd {baseDir} && ts-node scripts/get-chains.ts\""},{"language":"text","snippet":"exec command=\"cd {baseDir} && ts-node scripts/explore-data-feeds.ts <DAPI_NAME>\""},{"language":"text","snippet":"exec command=\"cd {baseDir} && ts-node scripts/quote.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\""},{"language":"text","snippet":"exec command=\"cd {baseDir} && ts-node scripts/buy.ts <CHAIN_ID> <DAPI_NAME> <DEVIATION>\""},{"language":"text","snippet":"exec command=\"cd {baseDir} && ts-node scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>\""}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: api3-data-feed-purchase\ndescription: Purchases Api3 data feed subscriptions from market.api3.org.\nmetadata:\n  version: 0.7.0\n  clawdis:\n    requires:\n      bins:\n        - ts-node\n        - pnpm\n      env:\n        - WALLET_MNEMONIC\n    primaryEnv: WALLET_MNEMONIC\n---\n\n# Api3 Data Feed Purchase\n\n\n## Variables\n\n| Variable | Description |\n|---|---|\n| `DAPI_NAME` | Exact feed name from the dAPI list (e.g. `ETH/USD`) |\n| `CHAIN_ALIAS` | Chain alias from the chain list (e.g. `ethereum`) |\n| `CHAIN_NAME` | Human-readable chain name (e.g. `Ethereum Mainnet`) |\n| `CHAIN_ID` | Numeric chain ID (e.g. `1`) |\n| `DEVIATION` | Deviation threshold — must be exactly one of: `0.25`, `0.5`, `1`, `2.5`, `5` |\n| `PROXY_ADDRESS` | Reader proxy contract address — starts with `0x`, exactly 42 characters |\n\n---\n\n# Rules\n- **NEVER** read .env files or ask for secrets such as WALLET_MNEMONIC.\n- **NEVER** read, list, or search inside `node_modules/`, `pnpm-lock.yaml`, or `pnpm-workspace.yaml`,they are not needed for this skill nor relevant to the user.\n- **ALWAYS** use the `exec` tool to run commands. Never use Bash or shell directly.\n- **ALWAYS** run scripts from the skill's directory, referenced as `{baseDir}` (the directory named by the `name` field at the top of this file). Prefix every command with `cd {baseDir} &&` to ensure it runs from the correct directory.\n- **ALWAYS** substitute actual variable values into every `exec` command before running it.\n- **ALWAYS** after asking any question, stop and wait for the user's response. Do not assume a response or continue until the user has replied.\n- **ALWAYS** complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.\n- Treat affirmative responses as approval (e.g. \"yes\", \"sure\", \"ok\", \"go ahead\", \"yep\"). Treat negative responses as rejection (e.g. \"no\", \"nope\", \"cancel\", \"stop\"). If intent is unclear, ask once more before acting.\n- **NEVER** wrap URLs in markdown formatting (backticks, asterisks, brackets, etc.) or add trailing punctuation when sharing them with the user — share the raw URL as plain text so it stays clickable and isn't corrupted with extra characters.\n- **ALWAYS** lowercase `<CHAIN_ALIAS>` and the feed/token symbol (e.g. the base of `<DAPI_NAME>`) when substituting them into market.api3.org URL paths (e.g. `https://market.api3.org/ethereum/eth-usd/integrate`), even if the confirmed values are stored/displayed with different casing.\n\n## Phase 0: Introduction\n\n- Introduce the skill: you will walk the user through purchasing an Api3 data feed subscription on-chain, step by step. You will ask for approval before installing packages and before executing the purchase transaction.\n- Ask if they are ready to begin and wait for an affirmative response before continuing.\n\n---\n\n## Phase 1: Package Installation\n\n### Part 1.1\n\n- **You must always run this step. Do not skip it, even if you think packages are already installed.**\n- Inform the user that before an"},{"path":"README.md","content":"# Api3 Data Feed Purchase\n\nHelper skill for buying Api3 data feed subscriptions from market.api3.org.\n\n## Requirements\n\n- `pnpm`\n- `ts-node`\n- `WALLET_MNEMONIC` in `.env` (see `example.env`)\n\n## Scripts\n\n- `get-dapis.ts` and `get-chains.ts` to discover supported feeds and networks\n- `explore-data-feeds.ts` to inspect provider-reported values for a feed\n- `quote.ts` to get a subscription price quote\n- `buy.ts` to execute the purchase transaction\n- `read-data-feed.ts` to read the deployed reader proxy"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7701b4mvc79x412gf9v4n6td889pe5\",\n  \"slug\": \"api3-data-feed-purchase\",\n  \"version\": \"0.7.0\",\n  \"publishedAt\": 1785764182955\n}"},{"path":"skill-card.md","content":"## Description:\n\nPurchases Api3 data feed subscriptions from market.api3.org.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[api3dao](https://clawhub.ai/user/api3dao)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators use this skill to select an Api3 dAPI feed and chain, get a subscription quote, execute an on-chain purchase, and optionally read the deployed reader proxy.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill uses WALLET_MNEMONIC to sign a live blockchain transaction for a data feed subscription.\n\nMitigation: Use only a dedicated low-balance wallet and independently inspect the transaction details before approving the purchase step.\n\nRisk: A valuable recovery phrase could be exposed if stored casually in the skill directory or shared with the agent.\n\nMitigation: Keep production wallet secrets out of the skill directory and avoid sharing the mnemonic directly in chat.\n\nRisk: The read-data-feed step can target an unintended contract if the reader proxy address is malformed or untrusted.\n\nMitigation: Run that step only after validating the proxy address as a 42-character hexadecimal Ethereum address that starts with 0x.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/api3dao/skills/api3-data-feed-purchase)\n- [Api3 Market](https://market.api3.org)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell command blocks and summarized command output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires pnpm, ts-node, and WALLET_MNEMONIC for purchase execution.]\n\n## Skill Version(s):\n\n0.7.0 (source: release evidence and SKILL.md metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."},{"path":"package.json","content":"{\n  \"name\": \"api3-data-feed-purchase\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"@api3/dapi-management\": \"4.32.0\",\n    \"@openzeppelin/merkle-tree\": \"^1.0.8\",\n    \"dotenv\": \"^17.4.2\",\n    \"ethers\": \"^6.16.0\"\n  }\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Purchases Api3 data feed subscriptions from market.api3.org. Skill: api3-data-feed-purchase Owner: api3dao Summary: Purchases Api3 data feed subscriptions from market.api3.org. Tags: latest:0.7.0 Version history: v0.7.0 | 2026-08-03T13:36:22.955Z | auto - Removed obsolete documentation file skill-card.md. - Updated version to 0.7.0 in metadata and package files. - No changes to user-facing features, scripts, or process in SKILL.md. - Maintenance update: cleans up documentation","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1511,"uniquenessScore":46,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T00:47:49.338Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T03:53:19.305Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}