mcpField
O
openocean

openocean

github.com/starchild-ai-agent其他3089 次安装1 周前更新
代码仓库

关于 openocean

OpenOcean Skill 是面向 Starchild 用户的纯脚本适配器,可用于获取兑换报价和执行交易。它通过 Starchild 钱包运行时进行以太坊主网兑换,并支持检查授权及通过余额变化验证结果。

主要功能

  1. 01查询 Gas 价格和兑换报价
  2. 02通过 Starchild 钱包执行兑换
  3. 03检查并发起 ERC20 授权
  4. 04根据余额变化验证结果

适用场景

  1. 01在代币兑换前查看报价
  2. 02在以太坊主网上兑换 ETH 与 ERC20 代币

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/starchild-ai-agent/official-skills --skill openocean

安装后在 Claude Code 中输入/openocean确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

__init__.py
_trade_report.py
exports.py

详细介绍

OpenOcean Skill(Starchild Adapter)

用户提出以下请求时使用此技能:

  • 获取 OpenOcean 报价
  • 通过 OpenOcean 路由执行兑换
  • 通过 Starchild 钱包执行 OpenOcean 交易

运行模式

仅限脚本。不注册工具。

导入: from skills.openocean.exports import openocean_gas_price, openocean_quote, openocean_swap

函数

  • openocean_gas_price(chain='ethereum')
  • openocean_quote(chain, in_token, out_token, amount_wei, slippage='1')
  • openocean_swap(chain, in_token, out_token, amount_wei, slippage='1', verify_timeout_seconds=90, poll_interval_seconds=5)

当前范围

  • 已测试 Ethereum 主网执行路径(ETH -> ERC20 和 ERC20 -> ETH)
  • 使用 Starchild 钱包运行时(/agent/transfer)广播交易
  • 内置 ERC20 授权流程(检查额度,并在需要时发送授权交易)
  • 通过余额变化验证结果(交易哈希延迟时也可正常工作)

安全检查清单

  1. 首先调用 openocean_quote 并展示输出。
  2. 与用户确认金额和滑点。
  3. 先用小额执行。
  4. 在确认结果为 verified_by_balance_delta=true 之前,不得宣称成功。

评论

支持 Markdown