跨链桥代币:无缝跨链资产转移 - Openclaw Skills

作者:互联网

2026-03-28

AI教程

什么是 跨链桥代币?

跨链桥代币技能为在各种区块链层级之间转移资产提供了一个专门且简化的工作流程。与复杂的跨链兑换不同,此技能专注于输入代币和输出代币相同的场景,例如将 USDC 从 Ethereum 移动到 Base。通过利用 Openclaw Skills 框架,它消除了与多个桥接界面和协议特定要求交互的手动复杂性。

该技能专为效率而设计,直接与专用的跨链执行器集成,处理报价、安全性验证和执行监控等繁重工作。它是 Openclaw Skills 支持的任何多链策略的重要组成部分,为用户提供了一种可靠的方式,以最小的摩擦管理碎片化生态系统中的流动性。

下载入口:https://github.com/openclaw/skills/tree/main/skills/wpank/bridge-tokens

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install bridge-tokens

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 bridge-tokens。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

跨链桥代币 应用场景

  • 将 USDC 从 Ethereum 移动到 Base 以利用更低的交易费用
  • 将 ETH 转移到 Arbitrum 以与特定的 Layer 2 去中心化应用交互
  • 将稳定币或原生资产移动到目标链上的不同接收地址
  • 将来自 Polygon 和 Optimism 等多个网络的代币持有整合到单个链中
  • 在维护原始代币类型的同时,在受支持的网络之间快速桥接资产
跨链桥代币 工作原理
  1. 该技能从用户的自然语言请求中识别代币、金额、源链和目标链。
  2. 它使用集成的协议元数据解析源链和目标链上的特定代币地址。
  3. 该技能通过检查是否支持这两条链并确保代币在两个网络中都存在来验证请求。
  4. 它将操作委托给专门的跨链执行器子代理,由其管理技术执行和安全协议。
  5. 系统在整个桥接生命周期中监控交易,直到在目标链上确认结算。
  6. 为用户生成一份全面的桥接报告,详细说明收到的最终金额、支付的费用和交易 ID。

跨链桥代币 配置指南

要在您的 Openclaw Skills 环境中部署此功能,请确保您的代理可以访问所需的 MCP 工具和链提供商。您可以使用以下命令结构验证与必要桥接基础设施的连接:

# 确保在您的环境中配置了必要的 MCP 服务器
openclaw-agent install mcp-uniswap

您还必须确保您的钱包在源链上有资金,以支付桥接金额和初始交易所需的 Gas 费用。

跨链桥代币 数据架构与分类体系

跨链桥代币技能利用结构化的数据模式来管理跨链状态和参数。这确保了 Openclaw Skills 能够准确跟踪资产在网络之间的移动。

参数 要求 描述
token 必填 要桥接的代币符号或合约地址。
amount 必填 要转移的代币的可读数量。
sourceChain 必填 代币当前所在的目标网络名称(例如 ethereum)。
destChain 必填 代币将发送到的目标网络名称(例如 base)。
recipient 选填 接收地址;如果未指定,默认为发送者的钱包。
name: bridge-tokens
description: Bridge tokens from one chain to another without swapping. Simplified cross-chain transfer where the output token is the same as the input token. Use when the user wants to move tokens between chains.
model: opus
allowed-tools: [Task(subagent_type:cross-chain-executor), mcp__uniswap__getSupportedChains, mcp__uniswap__getTokenInfo]

Bridge Tokens

Overview

Bridges tokens from one chain to another — a simplified cross-chain operation where the token stays the same (e.g., USDC on Ethereum to USDC on Base). Delegates to the cross-chain-executor agent with tokenOut = tokenIn to streamline the workflow.

This is the simpler sibling of cross-chain-swap. Use this when the user just wants to move tokens, not swap them.

When to Use

Activate when the user asks:

  • "Bridge 1000 USDC from Ethereum to Base"
  • "Move my ETH to Arbitrum"
  • "Transfer USDC to Optimism"
  • "Send tokens to another chain"
  • "Bridge tokens"
  • "Move all my USDC from Polygon to Base"

Parameters

Parameter Required Default Description
token Yes Token symbol or address to bridge
amount Yes Amount to bridge (human-readable)
sourceChain Yes Source chain name (e.g., "ethereum")
destChain Yes Destination chain name (e.g., "base")
recipient No Same wallet Recipient address on destination chain

Workflow

  1. Extract parameters from the user's request. Identify:

    • Which token to bridge.
    • The amount.
    • Source and destination chains.
    • Resolve the same token's address on both chains via mcp__uniswap__getTokenInfo.
  2. Validate inputs:

    • Verify both chains are supported via mcp__uniswap__getSupportedChains.
    • Verify the token exists on both chains.
    • If source and destination chain are the same: inform the user no bridge is needed.
  3. Delegate to cross-chain-executor: Invoke Task(subagent_type:cross-chain-executor) with:

    • tokenIn = token (on source chain).
    • tokenOut = same token (on destination chain).
    • amount, sourceChain, destChain, recipient.
    • The agent handles quoting, safety, execution, monitoring, and confirmation.
  4. Present results: Format the bridge report for the user, highlighting:

    • Amount sent and received (should be very close, minus bridge fee).
    • Bridge fee.
    • Settlement time.

Output Format

Bridge Complete

  Token:       USDC
  Sent:        1,000.00 USDC on Ethereum
  Received:    999.50 USDC on Base
  Bridge Fee:  0.50 USDC ($0.50)
  Settlement:  1 min 48 sec

  Source Tx:   0xabc...123
  Bridge ID:   0x789...abc
  Dest Tx:     0xdef...456

  Risk: LOW | Safety: APPROVED

Important Notes

  • Bridge operations transfer the same token between chains. The received amount will be slightly less due to bridge fees.
  • Settlement times vary by chain pair (typically 1-10 minutes).
  • Not all tokens are bridgeable between all chains. The executor will check availability.
  • For moving tokens AND swapping to a different token, use cross-chain-swap instead.

Error Handling

Error User-Facing Message Suggested Action
Token not available on dest "[Token] is not available on [destChain]." Use cross-chain-swap to swap to a native token
Same chain "Source and destination are the same chain. No bridge needed." No action needed
Unsupported chain "Chain [name] is not supported." Check supported chains
Safety veto "This bridge was blocked by safety checks: [reason]." Reduce amount or check configuration
Bridge stuck "Bridge settlement is delayed. Monitoring continues." Wait — recovery instructions provided
Insufficient balance "Not enough [token] on [chain]." Check balance and reduce amount