返回顶部
m

mexc-openapi-skillMEXC开放API技能

Operate MEXC Spot REST APIs through UXC with a curated OpenAPI schema, HMAC query signing, and separate public/signed workflow guardrails.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
202
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

mexc-openapi-skill

MEXC 现货 API 技能

使用此技能通过 uxc + OpenAPI 运行 MEXC 现货 REST 操作。

复用 uxc 技能以获取共享执行、认证和错误处理指导。

前提条件

  • - uxc 已安装并位于 PATH 中。
  • 可访问 https://api.mexc.com 的网络连接。
  • 可访问精选的 OpenAPI 模式 URL:
- https://raw.githubusercontent.com/holon-run/uxc/main/skills/mexc-openapi-skill/references/mexc-spot.openapi.json

范围

此技能涵盖精选的 MEXC 现货 REST 接口,包括:

  • - 公开市场查询
  • 签名账户查询
  • 签名订单的创建、取消和查询流程

此技能涵盖:

  • - 期货 API
  • 更广泛的平台产品系列

认证

公开市场端点无需凭据。

签名现货端点需要:

  • - apikey 字段用于 X-MEXC-APIKEY
  • secretkey 字段用于 HMAC SHA256 查询签名

创建一个凭据:

bash
uxc auth credential set mexc-spot \
--auth-type api_key \
--field apikey=env:MEXCAPI_KEY \
--field secretkey=env:MEXCSECRET_KEY

添加一个签名者绑定:

bash
uxc auth binding add \
--id mexc-spot \
--host api.mexc.com \
--path-prefix /api/v3 \
--scheme https \
--credential mexc-spot \
--signer-json {kind:hmacqueryv1,algorithm:hmacsha256,signingfield:secretkey,keyfield:apikey,keyplacement:header,keyname:X-MEXC-APIKEY,signatureparam:signature,signatureencoding:hex,timestampparam:timestamp,timestampunit:milliseconds,canonicalization:{mode:preserveorder}} \
--priority 100

当认证看起来有问题时,验证活动映射:

bash
uxc auth binding match https://api.mexc.com/api/v3/account

核心工作流程

  1. 1. 默认使用固定链接命令:
- command -v mexc-openapi-cli - 如果缺失,则创建它: uxc link mexc-openapi-cli https://api.mexc.com --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/mexc-openapi-skill/references/mexc-spot.openapi.json - mexc-openapi-cli -h
  1. 2. 执行前检查操作帮助:
- mexc-openapi-cli get:/api/v3/ticker/price -h - mexc-openapi-cli get:/api/v3/account -h - mexc-openapi-cli post:/api/v3/order -h
  1. 3. 优先使用公开查询:
- mexc-openapi-cli get:/api/v3/ticker/price symbol=BTCUSDT - mexc-openapi-cli get:/api/v3/depth symbol=BTCUSDT limit=20
  1. 4. 在写入前使用签名查询:
- mexc-openapi-cli get:/api/v3/account recvWindow=5000 - mexc-openapi-cli get:/api/v3/openOrders symbol=BTCUSDT recvWindow=5000

操作组

公开市场

  • - get:/api/v3/ping
  • get:/api/v3/exchangeInfo
  • get:/api/v3/ticker/price
  • get:/api/v3/ticker/24hr
  • get:/api/v3/depth

签名查询

  • - get:/api/v3/account
  • get:/api/v3/openOrders
  • get:/api/v3/order

签名写入

  • - post:/api/v3/order
  • delete:/api/v3/order

防护措施

  • - 保持自动化在 JSON 输出信封上;不要使用 --text。
  • 首先解析稳定字段:ok、kind、protocol、data、error。
  • 将签名写入操作视为高风险,并在执行前要求明确确认。
  • timestamp 和 signature 由签名者绑定注入;用户通常提供业务参数以及可选的 recvWindow。
  • 在下单前查询 exchangeInfo,以便了解交易对过滤器和最小交易量。
  • mexc-openapi-cli ... 等同于 uxc https://api.mexc.com --schema-url spotopenapi_schema> ...。

参考资料

  • - 使用模式:references/usage-patterns.md
  • 精选的 OpenAPI 模式:references/mexc-spot.openapi.json
  • 官方 MEXC 现货 v3 文档:https://mexcdevelop.github.io/apidocs/spotv3en/

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mexc-openapi-skill-1776064637 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mexc-openapi-skill-1776064637 技能

通过命令行安装

skillhub install mexc-openapi-skill-1776064637

下载

⬇ 下载 mexc-openapi-skill v1.0.0(免费)

文件大小: 5.44 KB | 发布时间: 2026-4-15 13:25

v1.0.0 最新 2026-4-15 13:25
Initial release of MEXC Spot API skill for UXC:

- Enables use of MEXC Spot REST APIs via UXC with curated OpenAPI schema.
- Supports public market reads, signed account reads, and signed order operations.
- Implements HMAC SHA256 signing and authentication guardrails for signed endpoints.
- Includes setup instructions for credential and signer binding.
- Provides groupings for public, signed read, and signed write operation types.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部