Moralis Web3 Data API Skill
Use this skill to run Moralis EVM data operations through uxc + OpenAPI.
Reuse the uxc skill for shared execution, auth, and error-handling guidance.
Prerequisites
- -
uxc is installed and available in PATH. - Network access to
https://deep-index.moralis.io/api/v2.2. - Access to the curated OpenAPI schema URL:
-
https://raw.githubusercontent.com/holon-run/uxc/main/skills/moralis-openapi-skill/references/moralis-evm.openapi.json
Scope
This skill covers a read-first wallet intelligence surface:
- - native balance lookup
- wallet token balances
- wallet history
- wallet swaps
- wallet net worth
- ERC-20 metadata lookup
- ERC-20 token price lookup
This skill does not cover:
- - write or transaction submission flows
- Solana, Streams, or NFT-specific surfaces
- the full Moralis API
Authentication
Moralis uses X-API-Key header auth.
Configure one API-key credential and bind it to deep-index.moralis.io/api/v2.2:
CODEBLOCK0
Validate the active mapping when auth looks wrong:
CODEBLOCK1
Core Workflow
- 1. Use the fixed link command by default:
-
command -v moralis-openapi-cli
- If missing, create it:
uxc link moralis-openapi-cli https://deep-index.moralis.io/api/v2.2 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/moralis-openapi-skill/references/moralis-evm.openapi.json
- INLINECODE10
- 2. Inspect operation schema first:
-
moralis-openapi-cli get:/{address}/balance -h
-
moralis-openapi-cli get:/wallets/{address}/tokens -h
- INLINECODE13
- 3. Prefer narrow reads before broader wallet scans:
-
moralis-openapi-cli get:/{address}/balance address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
-
moralis-openapi-cli get:/erc20/{address}/price address=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 chain=eth
- INLINECODE16
- 4. Execute with key/value parameters:
-
moralis-openapi-cli get:/wallets/{address}/tokens address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
- INLINECODE18
Operation Groups
Wallet Reads
- - INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
Token Reads
- - INLINECODE24
- INLINECODE25
Guardrails
- - Keep automation on the JSON output envelope; do not use
--text. - Parse stable fields first:
ok, kind, protocol, data, error. - Treat this v1 skill as read-only. Do not imply signing or transaction broadcast support.
- Moralis supports multiple chains. Always pass
chain explicitly instead of assuming Ethereum. - Wallet history and swaps can become expensive at large ranges. Start with small limits and narrow time windows.
- INLINECODE33 is equivalent to
uxc https://deep-index.moralis.io/api/v2.2 --schema-url <moralis_openapi_schema> <operation> ....
References
- - Usage patterns: INLINECODE35
- Curated OpenAPI schema: INLINECODE36
- Moralis wallet docs: https://docs.moralis.com/data-api/evm/wallet
- Moralis token docs: https://docs.moralis.com/data-api/evm/token
Moralis Web3 数据 API 技能
使用此技能通过 uxc + OpenAPI 运行 Moralis EVM 数据操作。
复用 uxc 技能以实现共享执行、认证和错误处理指导。
前置条件
- - uxc 已安装并可在 PATH 中使用。
- 可访问 https://deep-index.moralis.io/api/v2.2 网络。
- 可访问精选的 OpenAPI 模式 URL:
- https://raw.githubusercontent.com/holon-run/uxc/main/skills/moralis-openapi-skill/references/moralis-evm.openapi.json
范围
此技能涵盖以读取优先的钱包智能数据面:
- - 原生余额查询
- 钱包代币余额
- 钱包历史记录
- 钱包兑换记录
- 钱包净资产
- ERC-20 元数据查询
- ERC-20 代币价格查询
此技能不涵盖:
- - 写入或交易提交流程
- Solana、Streams 或 NFT 特定数据面
- 完整的 Moralis API
认证
Moralis 使用 X-API-Key 头部认证。
配置一个 API 密钥凭证并将其绑定到 deep-index.moralis.io/api/v2.2:
bash
uxc auth credential set moralis \
--auth-type api_key \
--api-key-header X-API-Key \
--secret-env MORALISAPIKEY
uxc auth binding add \
--id moralis \
--host deep-index.moralis.io \
--path-prefix /api/v2.2 \
--scheme https \
--credential moralis \
--priority 100
当认证出现问题时,验证当前映射:
bash
uxc auth binding match https://deep-index.moralis.io/api/v2.2
核心工作流程
- 1. 默认使用固定链接命令:
- command -v moralis-openapi-cli
- 如果缺失,创建它:
uxc link moralis-openapi-cli https://deep-index.moralis.io/api/v2.2 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/moralis-openapi-skill/references/moralis-evm.openapi.json
- moralis-openapi-cli -h
- 2. 首先检查操作模式:
- moralis-openapi-cli get:/{address}/balance -h
- moralis-openapi-cli get:/wallets/{address}/tokens -h
- moralis-openapi-cli get:/erc20/{address}/price -h
- 3. 优先进行窄范围读取,再进行宽泛的钱包扫描:
- moralis-openapi-cli get:/{address}/balance address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
- moralis-openapi-cli get:/erc20/{address}/price address=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 chain=eth
- moralis-openapi-cli get:/wallets/{address}/net-worth address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
- 4. 使用键/值参数执行:
- moralis-openapi-cli get:/wallets/{address}/tokens address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
- moralis-openapi-cli get:/wallets/{address}/history address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth limit=20
操作组
钱包读取
- - get:/{address}/balance
- get:/wallets/{address}/tokens
- get:/wallets/{address}/history
- get:/wallets/{address}/swaps
- get:/wallets/{address}/net-worth
代币读取
- - get:/erc20/metadata
- get:/erc20/{address}/price
安全边界
- - 保持自动化在 JSON 输出信封上;不要使用 --text。
- 首先解析稳定字段:ok、kind、protocol、data、error。
- 将此 v1 技能视为只读。不要暗示支持签名或交易广播。
- Moralis 支持多条链。始终显式传递 chain 参数,而不是假设为以太坊。
- 钱包历史记录和兑换记录在大范围查询时可能消耗较大。从小范围和窄时间窗口开始。
- moralis-openapi-cli ... 等同于 uxc https://deep-index.moralis.io/api/v2.2 --schema-url openapischema> ...。
参考资料
- - 使用模式:references/usage-patterns.md
- 精选的 OpenAPI 模式:references/moralis-evm.openapi.json
- Moralis 钱包文档:https://docs.moralis.com/data-api/evm/wallet
- Moralis 代币文档:https://docs.moralis.com/data-api/evm/token