blocknative-openapi-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blocknative Gas Platform Skill

Blocknative Gas平台Skill

Use this skill to run Blocknative gas intelligence operations through
uxc
+ OpenAPI.
Reuse the
uxc
skill for shared execution, auth, and error-handling guidance.
使用本Skill通过
uxc
+ OpenAPI执行Blocknative Gas情报操作。
复用
uxc
Skill以实现共享执行、认证和错误处理指引。

Prerequisites

前置条件

  • uxc
    is installed and available in
    PATH
    .
  • Network access to
    https://api.blocknative.com
    .
  • Access to the curated OpenAPI schema URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/blocknative-openapi-skill/references/blocknative-gas.openapi.json
  • A Blocknative API key for the full v1 surface.
  • 已安装
    uxc
    并可在
    PATH
    中访问。
  • 可访问
    https://api.blocknative.com
    网络。
  • 可访问精选OpenAPI Schema的URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/blocknative-openapi-skill/references/blocknative-gas.openapi.json
  • 用于完整v1功能的Blocknative API密钥。

Scope

适用范围

This skill covers a read-first Blocknative gas intelligence surface:
  • supported chain discovery
  • gas price confidence estimates
  • base fee and blob fee prediction
  • pending gas distribution analysis
This skill does not cover:
  • write operations
  • transaction submission
  • mempool event streaming
  • broader Blocknative product areas outside the selected gas platform endpoints
本Skill覆盖Blocknative Gas情报的只读优先功能范围:
  • 支持的链发现
  • Gas价格置信度估算
  • 基础费用和Blob费用预测
  • 待处理Gas分布分析
本Skill包含以下内容:
  • 写入操作
  • 交易提交
  • 内存池事件流
  • 所选Gas平台端点之外的其他Blocknative产品领域

Authentication

认证

Blocknative uses
Authorization
header auth. Some discovery and gas reads can work without a key, but this skill standardizes on authenticated requests because
basefee-estimates
and
distribution
require a valid API key.
Configure one API-key credential and bind it to
api.blocknative.com
:
bash
uxc auth credential set blocknative \
  --auth-type api_key \
  --api-key-header Authorization \
  --secret-env BLOCKNATIVE_API_KEY

uxc auth binding add \
  --id blocknative \
  --host api.blocknative.com \
  --scheme https \
  --credential blocknative \
  --priority 100
Validate the active mapping when auth looks wrong:
bash
uxc auth binding match https://api.blocknative.com
Blocknative采用
Authorization
头部认证。部分发现和Gas读取操作无需密钥即可运行,但由于
basefee-estimates
distribution
需要有效API密钥,本Skill统一使用认证请求。
配置一个API密钥凭证并绑定到
api.blocknative.com
bash
uxc auth credential set blocknative \
  --auth-type api_key \
  --api-key-header Authorization \
  --secret-env BLOCKNATIVE_API_KEY

uxc auth binding add \
  --id blocknative \
  --host api.blocknative.com \
  --scheme https \
  --credential blocknative \
  --priority 100
当认证出现问题时,验证当前映射:
bash
uxc auth binding match https://api.blocknative.com

Core Workflow

核心工作流

  1. Use the fixed link command by default:
    • command -v blocknative-openapi-cli
    • If missing, create it:
      uxc link blocknative-openapi-cli https://api.blocknative.com --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blocknative-openapi-skill/references/blocknative-gas.openapi.json
    • blocknative-openapi-cli -h
  2. Inspect operation schema first:
    • blocknative-openapi-cli get:/chains -h
    • blocknative-openapi-cli get:/gasprices/blockprices -h
    • blocknative-openapi-cli get:/gasprices/basefee-estimates -h
  3. Prefer narrow validation before broader polling:
    • blocknative-openapi-cli get:/chains
    • blocknative-openapi-cli get:/gasprices/blockprices chainid=1
    • blocknative-openapi-cli get:/gasprices/basefee-estimates
  4. Execute with key/value parameters:
    • blocknative-openapi-cli get:/gasprices/blockprices chainid=1 confidenceLevels=70,90,99
    • blocknative-openapi-cli get:/gasprices/blockprices system=story network=mainnet
    • blocknative-openapi-cli get:/gasprices/distribution chainid=1
  1. 默认使用固定链接命令:
    • command -v blocknative-openapi-cli
    • 若不存在,创建链接:
      uxc link blocknative-openapi-cli https://api.blocknative.com --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blocknative-openapi-skill/references/blocknative-gas.openapi.json
    • blocknative-openapi-cli -h
  2. 先检查操作Schema:
    • blocknative-openapi-cli get:/chains -h
    • blocknative-openapi-cli get:/gasprices/blockprices -h
    • blocknative-openapi-cli get:/gasprices/basefee-estimates -h
  3. 在进行大范围轮询前,优先进行小范围验证:
    • blocknative-openapi-cli get:/chains
    • blocknative-openapi-cli get:/gasprices/blockprices chainid=1
    • blocknative-openapi-cli get:/gasprices/basefee-estimates
  4. 使用键值对参数执行:
    • blocknative-openapi-cli get:/gasprices/blockprices chainid=1 confidenceLevels=70,90,99
    • blocknative-openapi-cli get:/gasprices/blockprices system=story network=mainnet
    • blocknative-openapi-cli get:/gasprices/distribution chainid=1

Operation Groups

操作分组

Discovery

发现

  • get:/chains
  • get:/chains

Gas Intelligence

Gas情报

  • get:/gasprices/blockprices
  • get:/gasprices/basefee-estimates
  • get:/gasprices/distribution
  • get:/gasprices/blockprices
  • get:/gasprices/basefee-estimates
  • get:/gasprices/distribution

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 transaction sending or execution support.
  • blockprices
    can be polled without auth on some plans, but
    basefee-estimates
    and
    distribution
    require a valid key. Standardize on auth so mixed workflows do not fail mid-run.
  • These endpoints update at most once per second on paid plans and more slowly on free plans. For automation, start around one poll every 5 to 10 seconds and only tighten that interval when you specifically need fresher paid-plan data.
  • distribution
    is Ethereum-mainnet focused in the current docs. Do not assume multi-chain coverage there just because
    blockprices
    supports many chains.
  • Keep
    confidenceLevels
    narrow and explicit when you do not need the full default ladder.
  • blocknative-openapi-cli <operation> ...
    is equivalent to
    uxc https://api.blocknative.com --schema-url <blocknative_openapi_schema> <operation> ...
    .
  • 自动化操作使用JSON输出格式;请勿使用
    --text
    参数。
  • 优先解析稳定字段:
    ok
    kind
    protocol
    data
    error
  • 将本v1 Skill视为只读工具。请勿假设其支持交易发送或执行。
  • 在部分套餐中,
    blockprices
    无需认证即可轮询,但
    basefee-estimates
    distribution
    需要有效密钥。统一使用认证可避免混合工作流中途失败。
  • 付费套餐中这些端点每秒最多更新一次,免费套餐更新更慢。自动化操作初始可设置每5-10秒轮询一次,仅当确实需要付费套餐的最新数据时,再缩短轮询间隔。
  • 当前文档中
    distribution
    仅针对以太坊主网。请勿因
    blockprices
    支持多链就假设
    distribution
    也支持多链。
  • 当不需要完整默认梯度时,保持
    confidenceLevels
    范围狭窄且明确。
  • blocknative-openapi-cli <operation> ...
    等同于
    uxc https://api.blocknative.com --schema-url <blocknative_openapi_schema> <operation> ...

References

参考资料