← 返回 Skills 市场
38
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install api3-data-feed-purchase
功能描述
Purchases API3 data feed subscriptions from market.api3.org.
使用说明 (SKILL.md)
Api3 Data Feed Purchase
Variables
| Variable | Description |
|---|---|
DAPI_NAME |
Exact feed name from the dAPI list (e.g. ETH/USD) |
CHAIN_ALIAS |
Chain alias from the chain list (e.g. ethereum) |
CHAIN_NAME |
Human-readable chain name (e.g. Ethereum Mainnet) |
CHAIN_ID |
Numeric chain ID (e.g. 1) |
DEVIATION |
Deviation threshold — must be exactly one of: 0.25, 0.5, 1, 2.5, 5 |
PROXY_ADDRESS |
Reader proxy contract address — starts with 0x, exactly 42 characters |
Rules
- NEVER read .env files or ask for secrets such as WALLET_MNEMONIC.
- ALWAYS use the
exectool to run commands. Never use Bash or shell directly. - 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 withcd {baseDir} &&to ensure it runs from the correct directory. - ALWAYS substitute actual variable values into every
execcommand before running it. - 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.
- ALWAYS complete the current phase fully before moving to the next. Never skip a phase or assume it is already done.
- 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.
- 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.
- ALWAYS lowercase
\x3CCHAIN_ALIAS>and the feed/token symbol (e.g. the base of\x3CDAPI_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.
Phase 0: Introduction
- 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.
- Ask if they are ready to begin and wait for an affirmative response before continuing.
Phase 1: Package Installation
Part 1.1
- You must always run this step. Do not skip it, even if you think packages are already installed.
- Inform the user that before any scripts can run, the required packages must be installed. Show them the list:
@api3/dapi-managementdotenvethers
- 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:
exec command="cd {baseDir} && pnpm install"
- 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. - If the command fails for any other reason, inform the user and ask what to do. This step cannot be skipped.
Phase 2: Collect User Input
Part 2.1
- Ask the user for all three inputs in one message:
- Feed name — which data feed they want (e.g.
ETH/USD). Direct them to https://market.api3.org to browse available feeds. - Chain — which network they want to use (name or alias, e.g.
ethereum). - Deviation threshold — must be exactly one of:
0.25,0.5,1,2.5,5(percent).
- Feed name — which data feed they want (e.g.
- Wait for all three answers before continuing.
Part 2.2
- Run
get-dapis.tsandget-chains.tsto fetch the list of available feeds and supported chains:
exec command="cd {baseDir} && ts-node {baseDir}/scripts/get-dapis.ts"
exec command="cd {baseDir} && ts-node {baseDir}/scripts/get-chains.ts"
- 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.
Part 2.3
-
Validate
DAPI_NAME:- Search the output of
get-dapis.tsfor an entry matching the user's feed name exactly (case-insensitive). - Match found: set
DAPI_NAMEto the exact string from the list (preserve its casing) and confirm the matched value to the user. - 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.
- Search the output of
-
Validate
CHAIN_ALIAS:- Search the output of
get-chains.ts— first byaliasfield (case-insensitive), then bynamefield. - Match found: set
CHAIN_ALIAS,CHAIN_NAME,CHAIN_IDfrom 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. - No match: inform the user, direct them to https://market.api3.org for supported chains, and wait for a new value. Repeat this step.
- Search the output of
-
Validate
DEVIATION:- Check that the value is exactly one of:
0.25,0.5,1,2.5,5. - Valid: set
DEVIATION. - Invalid: inform the user of the valid options and wait for a new answer. Repeat this step.
- Check that the value is exactly one of:
Part 2.4
- Show the user a summary of their selected options:
- Feed:
\x3CDAPI_NAME> - Chain:
\x3CCHAIN_NAME> - Deviation Threshold:
\x3CDEVIATION>%
- Feed:
- Ask the user to confirm that they want to proceed with these options. If no, ask the user what they want to do.
- 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.
Phase 3: Check Live Provider Values (Optional)
Part 3.1
- 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.
- Run
explore-data-feeds.ts, which fetches each provider's Signed API data and decodes the live value for this feed directly:
exec command="cd {baseDir} && ts-node {baseDir}/scripts/explore-data-feeds.ts \x3CDAPI_NAME>"
- If the script fails, let the user know about the problem and ask what to do.
Part 3.2
- 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).
- 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.
- Proceed to Phase 4.
Phase 4: Get Price Quote
Part 4.1
- Run
quote.tsto fetch the live subscription price for the selected feed, chain, and deviation:
exec command="cd {baseDir} && ts-node {baseDir}/scripts/quote.ts \x3CDAPI_NAME> \x3CCHAIN_ALIAS> \x3CDEVIATION>"
- If script fails, let user know about the problem and ask what to do.
Part 4.2
-
Extract and show these fields from the output:
Field Label to show Feed NameFeed ChainChain Heartbeat IntervalHeartbeat Interval (seconds) Deviation ThresholdDeviation Threshold Subscription DurationSubscription Duration (seconds) Price (ETH)Price (ETH) -
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.
Phase 5: Execute Purchase
Part 5.1
- 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. - Explain this script will use the
WALLET_MNEMONICenvironment variable to sign the transaction. Make sure the user has WALLET_MNEMONIC set in.envfile in the root of this skill. - Ask if the
.envfile 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:
(substitute actual variable values when running):
exec command="cd {baseDir} && ts-node {baseDir}/scripts/buy.ts \x3CDAPI_NAME> \x3CCHAIN_ALIAS> \x3CDEVIATION>"
- If script fails, let user know about the problem and ask what to do.
Part 5.2
- Extract the
hashvalue from the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash. - Proceed to Phase 6.
Phase 6: Read the Data Feed
Part 6.1
- 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.
- Ask the user to retrieve their Reader Proxy address by:
- Going to https://market.api3.org/\x3CCHAIN_ALIAS>/\x3CDAPI_NAME lowercased, with
/replaced by->/integrate - Copying the proxy contract address and sharing it here.
- Going to https://market.api3.org/\x3CCHAIN_ALIAS>/\x3CDAPI_NAME lowercased, with
- Wait for the user to provide the proxy address.
- Validate the proxy address:
- Must start with
0x. - Must be exactly 42 characters long.
- If either check fails: inform the user of the requirements and wait again.
- Must start with
- Set
PROXY_ADDRESSto the valid value.
Part 6.2
- Run
read-data-feed.tsto fetch the latest value and timestamp from the proxy contract:
exec command="cd {baseDir} && ts-node {baseDir}/scripts/read-data-feed.ts \x3CPROXY_ADDRESS> \x3CCHAIN_ALIAS>"
- If script fails, let user know about the problem and ask what to do.
- Extract and show the value and timestamp from the output.
- Inform the user the feed is active and readable and congratulate them on successfully purchasing an Api3 data feed subscription!
安全使用建议
Review before installing. Use only a dedicated low-balance wallet, do not paste a main wallet seed phrase into chat or project files, verify the chain/feed/price carefully, and assume the purchase transaction may spend funds and be irreversible once broadcast.
能力标签
能力评估
Purpose & Capability
The stated purpose, scripts, and metadata align around buying API3 data feed subscriptions, but this includes high-impact authority: signing and submitting on-chain purchase transactions that spend wallet funds.
Instruction Scope
The workflow asks for user confirmations and quote review before purchase, but it gives conflicting secret-handling instructions: it says never to read .env files while later requiring WALLET_MNEMONIC in a skill-local .env that buy.ts loads with dotenv.
Install Mechanism
Installation is disclosed and requires user approval for pnpm install. The dependency ranges for dotenv and ethers are unpinned, and package.json references a local @api3/dapi-management tarball that is not present in the inspected artifact files.
Credentials
Requiring a full wallet mnemonic is sensitive but related to the purpose. The artifact does not sufficiently explain that a mnemonic grants full wallet control or recommend safer containment such as a low-funds dedicated wallet or external signer.
Persistence & Privilege
There is no background persistence, but the recommended local .env storage of a wallet mnemonic creates durable sensitive material in the skill directory and increases exposure risk.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install api3-data-feed-purchase - 安装完成后,直接呼叫该 Skill 的名称或使用
/api3-data-feed-purchase触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
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.
元数据
常见问题
API3 Data Feed Purchase 是什么?
Purchases API3 data feed subscriptions from market.api3.org. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。
如何安装 API3 Data Feed Purchase?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install api3-data-feed-purchase」即可一键安装,无需额外配置。
API3 Data Feed Purchase 是免费的吗?
是的,API3 Data Feed Purchase 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
API3 Data Feed Purchase 支持哪些平台?
API3 Data Feed Purchase 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 API3 Data Feed Purchase?
由 metobom(@metobom)开发并维护,当前版本 v0.1.0。
推荐 Skills