openocean

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenOcean Skill (Starchild Adapter)

OpenOcean Skill(Starchild适配器)

Use this skill when user asks to:
  • get OpenOcean quote
  • execute swap via OpenOcean route
  • run OpenOcean trade through Starchild wallet
当用户提出以下需求时使用本Skill:
  • 获取OpenOcean报价
  • 通过OpenOcean路由执行交换
  • 通过Starchild钱包完成OpenOcean交易

Runtime Mode

运行模式

Script-only. Does not register tools.
Imports:
from skills.openocean.exports import openocean_gas_price, openocean_quote, openocean_swap
仅脚本模式。不注册工具。
导入语句:
from skills.openocean.exports import openocean_gas_price, openocean_quote, openocean_swap

Functions

函数

  • 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)
  • 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)

Current Scope

当前适用范围

  • Ethereum mainnet execution path tested (ETH -> ERC20 and ERC20 -> ETH)
  • Uses Starchild wallet runtime (
    /agent/transfer
    ) to broadcast
  • Built-in ERC20 approval flow (checks allowance and sends approve when needed)
  • Verifies result by balance delta (works when tx hash is delayed)
  • 已测试以太坊主网执行流程(ETH -> ERC20 及 ERC20 -> ETH)
  • 使用Starchild钱包运行时(
    /agent/transfer
    )进行广播
  • 内置ERC20授权流程(检查额度,必要时发送授权请求)
  • 通过余额差值验证结果(适用于交易哈希延迟返回的场景)

Safety Checklist

安全检查清单

  1. First call
    openocean_quote
    and show output.
  2. Confirm amount and slippage with user.
  3. Execute with small amount first.
  4. Require verification result (
    verified_by_balance_delta=true
    ) before claiming success.
  1. 先调用
    openocean_quote
    并展示输出结果。
  2. 与用户确认金额和滑点设置。
  3. 先执行小额交易测试。
  4. 需验证结果(
    verified_by_balance_delta=true
    )后再确认交易成功。