关于 emblem-token-swap
emblem-token-swap 是用于在 Solana、Ethereum、Base、BSC、Polygon 和 Hedera 上执行引导式代币兑换的 EmblemAI 技能,并通过 ChangeNow 跨链桥接。支持兑换前查询余额和报价,所有资金操作均需用户确认。
主要功能
- 01在六条支持的链上兑换代币
- 02执行前获取兑换报价
- 03通过 ChangeNow 跨链桥接资产
- 04查询余额并搜索代币
- 05兑换前要求用户确认
适用场景
- 01在 Solana 或 EVM 链上兑换代币
- 02预览交易并检查源代币余额
- 03通过 ChangeNow 在不同链之间桥接代币
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ emblemcompany/ agent-skills --skill emblem-token-swap安装后在 Claude Code 中输入/emblem-token-swap确认已加载。
附带文件scripts/swap-helper.sh
详细介绍
Emblem 代币兑换
由 EmblemAI 提供支持的引导式代币兑换。通过自动路由,在 Solana、Ethereum、Base、BSC、Polygon 和 Hedera 上兑换代币。通过 ChangeNow 进行跨链桥接。
需要:npm install -g @emblemvault/agentwallet
此技能可以做什么
| 链 | 报价工具 | 兑换工具 | 余额工具 | 代币搜索 |
|---|---|---|---|---|
| Solana | splBuyIntent (quote mode) | splBuyIntent (swap mode) | solanaBalances | findSolanaSwapToken |
| Ethereum | ethSwapQuote | ethSwap | ethGetBalances | searchCryptoByName |
| Base | baseSwapQuote | baseSwap | baseGetBalances | searchEvmTokensBirdeye |
| BSC | bscSwapQuote | bscSwap | bscGetBalances | searchEvmTokensBirdeye |
| Polygon | polygonSwapQuote | polygonSwap | polygonGetBalances | searchEvmTokensBirdeye |
| Hedera | hederaTokensSwapQuote | hederaTokensSwap | hederaGetBalances | hederaFindTokens |
| 跨链 | getChangeNowSwapQuote | swapUsingChangeNow | — | getChangeNowSupportedCurrencies |
说明
- Solana 的报价和执行都使用
splBuyIntent——它支持按名称、符号或 CA 查找代币,以及灵活指定金额(美元、SOL 或代币数量) - EVM 链(Ethereum、Base、BSC、Polygon)通过自动 DEX 聚合进行路由
- 跨链桥接通过 ChangeNow 支持 500 多种货币
- Bitcoin 支持查询余额(
getBTCBalances),但没有链上兑换工具——BTC 跨链桥接请使用 ChangeNow
快速开始
npm install -g @emblemvault/agentwallet
# Solana swap (uses splBuyIntent)
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"
# Cross-chain bridge (uses ChangeNow)
emblemai --agent --profile default -m "Use getChangeNowSwapQuote to get a quote for bridging 0.05 ETH from Ethereum to SOL on Solana"
触发短语:
- “将 SOL 兑换为 USDC”
- “将 ETH 换成 USDT”
- “兑换我的代币”
- “将代币桥接到 Base”
工作流:安全兑换代币
第 1 步:检查余额
确认源代币余额充足。
emblemai --agent --profile default -m "Use solanaBalances to show my Solana token balances"
第 2 步:获取报价
执行前预览兑换。
emblemai --agent --profile default -m "Use splBuyIntent to get a quote for swapping 5 SOL to USDC"
第 3 步:执行兑换
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"
安全模式要求你在执行前确认。
第 4 步:验证
确认新余额。
emblemai --agent --profile default -m "Use solanaBalances to show my updated balances"
兑换模式
Solana 兑换
# By token amount
emblemai --agent --profile default -m "Use splBuyIntent to swap 0.5 SOL for USDC"
# By dollar amount
emblemai --agent --profile default -m "Use splBuyIntent to swap $20 of SOL for JUP"
# By token name
emblemai --agent --profile default -m "Use splBuyIntent to swap 100 USDC for BONK"
EVM 兑换
# Ethereum
emblemai --agent --profile default -m "Use ethSwapQuote to get a quote for swapping 0.01 ETH to USDC, then use ethSwap to execute"
# Base
emblemai --agent --profile default -m "Use baseSwapQuote to quote 0.005 ETH to USDC on Base"
# BSC
emblemai --agent --profile default -m "Use bscSwapQuote to quote 0.1 BNB to USDT on BSC"
# Polygon
emblemai --agent --profile default -m "Use polygonSwapQuote to quote 10 POL to USDC on Polygon"
Hedera 兑换
emblemai --agent --profile default -m "Use hederaTokensSwapQuote to get a quote for 100 HBAR to USDC, then use hederaTokensSwap to execute"
跨链桥接
emblemai --agent --profile default -m "Use getChangeNowSwapQuote to quote bridging 0.1 ETH to SOL"
emblemai --agent --profile default -m "Use getChangeNowSupportedCurrencies to show available bridge currencies"
沟通规则
兑换请求中务必包含以下内容:
- 工具名称 — 指定确切的工具,以确保可靠路由
- 金额 — 美元金额或代币数量
- 源代币 — 要兑换出的代币
- 目标代币 — 要兑换成的代币
| 不佳示例 | 良好示例 |
|---|---|
"swap sol usdc" | "Use splBuyIntent to swap 5 SOL for USDC" |
"buy eth" | "Use ethSwap to swap 100 USDC to ETH on Ethereum" |
"bridge" | "Use getChangeNowSwapQuote to bridge 0.05 ETH to SOL" |
安全性
所有兑换都需要用户明确确认(安全模式)。Agent 将:
- 显示兑换详情(金额、路线、预计输出)
- 等待你批准后再执行
- 报告交易结果
任何涉及价值转移的操作都不会绕过确认。
辅助脚本
bash scripts/swap-helper.sh
交互式兑换指南请参阅 scripts/swap-helper.sh。
链接
评论
支持 Markdown