moralis-openapi-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Moralis Web3 Data API Skill

Moralis Web3 Data API 技能

Use this skill to run Moralis EVM data operations through
uxc
+ OpenAPI.
Reuse the
uxc
skill for shared execution, auth, and error-handling guidance.
使用本技能通过
uxc
+ OpenAPI执行Moralis EVM数据操作。
复用
uxc
技能以获得共享的执行、认证和错误处理指引。

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
  • A Moralis API key.
  • uxc
    已安装并在
    PATH
    中可用。
  • 可访问
    https://deep-index.moralis.io/api/v2.2
    网络。
  • 可访问精心整理的OpenAPI schema URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/moralis-openapi-skill/references/moralis-evm.openapi.json
  • 拥有Moralis API密钥。

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
本技能覆盖以读取为主的钱包智能场景:
  • 原生余额查询
  • 钱包代币余额
  • 钱包历史记录
  • 钱包兑换记录
  • 钱包净资产
  • ERC-20元数据查询
  • ERC-20代币价格查询
本技能覆盖:
  • 写入或交易提交流程
  • Solana、Streams或NFT相关场景
  • 完整的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
:
bash
uxc auth credential set moralis \
  --auth-type api_key \
  --api-key-header X-API-Key \
  --secret-env MORALIS_API_KEY

uxc auth binding add \
  --id moralis \
  --host deep-index.moralis.io \
  --path-prefix /api/v2.2 \
  --scheme https \
  --credential moralis \
  --priority 100
Validate the active mapping when auth looks wrong:
bash
uxc auth binding match https://deep-index.moralis.io/api/v2.2
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 MORALIS_API_KEY

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

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
    • moralis-openapi-cli -h
  2. Inspect operation schema first:
    • moralis-openapi-cli get:/{address}/balance -h
    • moralis-openapi-cli get:/wallets/{address}/tokens -h
    • moralis-openapi-cli get:/erc20/{address}/price -h
  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
    • moralis-openapi-cli get:/wallets/{address}/net-worth address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
  4. Execute with key/value parameters:
    • moralis-openapi-cli get:/wallets/{address}/tokens address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth
    • moralis-openapi-cli get:/wallets/{address}/history address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045 chain=eth limit=20
  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. 先查看操作schema:
    • 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

Operation Groups

操作分组

Wallet Reads

钱包读取

  • get:/{address}/balance
  • get:/wallets/{address}/tokens
  • get:/wallets/{address}/history
  • get:/wallets/{address}/swaps
  • get:/wallets/{address}/net-worth
  • get:/{address}/balance
  • get:/wallets/{address}/tokens
  • get:/wallets/{address}/history
  • get:/wallets/{address}/swaps
  • get:/wallets/{address}/net-worth

Token Reads

代币读取

  • get:/erc20/metadata
  • get:/erc20/{address}/price
  • get:/erc20/metadata
  • get:/erc20/{address}/price

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.
  • moralis-openapi-cli <operation> ...
    is equivalent to
    uxc https://deep-index.moralis.io/api/v2.2 --schema-url <moralis_openapi_schema> <operation> ...
    .
  • 自动化操作仅使用JSON输出格式;请勿使用
    --text
    参数。
  • 优先解析稳定字段:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
  • 将本v1技能视为只读工具。请勿暗示其支持签名或交易广播功能。
  • Moralis支持多条链。请始终显式传入
    chain
    参数,而非默认假设为以太坊。
  • 钱包历史记录和兑换记录在大范围查询时可能产生较高成本。请从小范围限制和窄时间窗口开始查询。
  • moralis-openapi-cli <operation> ...
    等同于
    uxc https://deep-index.moralis.io/api/v2.2 --schema-url <moralis_openapi_schema> <operation> ...

References

参考资料