Install
openclaw skills install api3-data-feed-purchasePurchases API3 data feed subscriptions from market.api3.org.
openclaw skills install api3-data-feed-purchase| 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 |
exec tool to run commands. Never use Bash or shell directly.{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.exec command before running it.<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.@api3/dapi-managementdotenvetherspnpm 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"
[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.ETH/USD). Direct them to https://market.api3.org to browse available feeds.ethereum).0.25, 0.5, 1, 2.5, 5 (percent).get-dapis.ts and get-chains.ts to 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"
Validate DAPI_NAME:
get-dapis.ts for an entry matching the user's feed name exactly (case-insensitive).DAPI_NAME to the exact string from the list (preserve its casing) and confirm the matched value to the user.Validate CHAIN_ALIAS:
get-chains.ts — first by alias field (case-insensitive), then by name field.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.Validate DEVIATION:
0.25, 0.5, 1, 2.5, 5.DEVIATION.<DAPI_NAME><CHAIN_NAME><DEVIATION>%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 <DAPI_NAME>"
quote.ts to fetch the live subscription price for the selected feed, chain, and deviation:exec command="cd {baseDir} && ts-node {baseDir}/scripts/quote.ts <DAPI_NAME> <CHAIN_ALIAS> <DEVIATION>"
Extract and show these fields from the output:
| Field | Label to show |
|---|---|
| Feed Name | Feed |
| Chain | Chain |
| Heartbeat Interval | Heartbeat Interval (seconds) |
| Deviation Threshold | Deviation Threshold |
| Subscription Duration | Subscription 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.
buy.ts, which will execute a blockchain transaction to purchase the subscription.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..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:(substitute actual variable values when running):
exec command="cd {baseDir} && ts-node {baseDir}/scripts/buy.ts <DAPI_NAME> <CHAIN_ALIAS> <DEVIATION>"
hash value from the output and show the purchase summary: feed, chain, deviation, subscription duration, and transaction hash./ replaced by ->/integrate0x.PROXY_ADDRESS to the valid value.read-data-feed.ts to fetch the latest value and timestamp from the proxy contract:exec command="cd {baseDir} && ts-node {baseDir}/scripts/read-data-feed.ts <PROXY_ADDRESS> <CHAIN_ALIAS>"