emblem-token-swap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Emblem Token Swap

Emblem代币兑换

Guided token swapping powered by EmblemAI. Swap tokens on Solana, Ethereum, Base, BSC, Polygon, and Hedera with automatic routing. Cross-chain bridging via ChangeNow.
Requires:
npm install -g @emblemvault/agentwallet

EmblemAI提供支持的引导式代币兑换功能。支持在Solana、Ethereum、Base、BSC、Polygon和Hedera上兑换代币,并提供自动路由功能。通过ChangeNow实现跨链桥接。
需要安装:
npm install -g @emblemvault/agentwallet

What This Skill Can Do

功能说明

ChainQuote ToolSwap ToolBalance ToolToken Search
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
Cross-chain
getChangeNowSwapQuote
swapUsingChangeNow
getChangeNowSupportedCurrencies
报价工具兑换工具余额工具代币搜索
Solana
splBuyIntent
(报价模式)
splBuyIntent
(兑换模式)
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

Notes

注意事项

  • Solana uses
    splBuyIntent
    for both quotes and execution — it handles token lookup by name/symbol/CA and flexible amounts ($USD, SOL, or token quantity)
  • EVM chains (Ethereum, Base, BSC, Polygon) route through automatic DEX aggregation
  • Cross-chain bridges via ChangeNow support 500+ currencies
  • Bitcoin has balance support (
    getBTCBalances
    ) but no on-chain swap tools — use ChangeNow for BTC bridges

  • Solana 同时使用
    splBuyIntent
    完成报价和执行——它支持按名称/符号/合约地址查询代币,支持灵活的金额设置(美元、SOL或代币数量)
  • EVM链(Ethereum、Base、BSC、Polygon)通过自动DEX聚合路由
  • 跨链桥接通过ChangeNow实现,支持500+币种
  • Bitcoin支持余额查询(
    getBTCBalances
    )但没有链上兑换工具——使用ChangeNow进行BTC桥接

Quick Start

快速开始

bash
npm install -g @emblemvault/agentwallet
bash
npm install -g @emblemvault/agentwallet

Solana swap (uses splBuyIntent)

Solana兑换 (使用splBuyIntent)

emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"

Cross-chain bridge (uses ChangeNow)

跨链桥接 (使用ChangeNow)

emblemai --agent --profile default -m "Use getChangeNowSwapQuote to get a quote for bridging 0.05 ETH from Ethereum to SOL on Solana"

**Trigger phrases:**
- "Swap SOL to USDC"
- "Exchange ETH for USDT"
- "Convert my tokens"
- "Bridge tokens to Base"

---
emblemai --agent --profile default -m "Use getChangeNowSwapQuote to get a quote for bridging 0.05 ETH from Ethereum to SOL on Solana"

**触发词:**
- "Swap SOL to USDC"
- "Exchange ETH for USDT"
- "Convert my tokens"
- "Bridge tokens to Base"

---

Workflow: Safe Token Swap

工作流:安全代币兑换

Step 1: Check Balance

步骤1:检查余额

Confirm you have enough of the source token.
bash
emblemai --agent --profile default -m "Use solanaBalances to show my Solana token balances"
确认你持有足够的源代币。
bash
emblemai --agent --profile default -m "Use solanaBalances to show my Solana token balances"

Step 2: Get a Quote

步骤2:获取报价

Preview the swap before executing.
bash
emblemai --agent --profile default -m "Use splBuyIntent to get a quote for swapping 5 SOL to USDC"
执行兑换前先预览兑换方案。
bash
emblemai --agent --profile default -m "Use splBuyIntent to get a quote for swapping 5 SOL to USDC"

Step 3: Execute the Swap

步骤3:执行兑换

bash
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"
Safe mode requires your confirmation before executing.
bash
emblemai --agent --profile default -m "Use splBuyIntent to swap 5 SOL for USDC on Solana"
安全模式下执行前需要你手动确认。

Step 4: Verify

步骤4:验证结果

Confirm the new balance.
bash
emblemai --agent --profile default -m "Use solanaBalances to show my updated balances"

确认更新后的余额。
bash
emblemai --agent --profile default -m "Use solanaBalances to show my updated balances"

Swap Patterns

兑换示例

Solana Swaps

Solana兑换

bash
undefined
bash
undefined

By token amount

按代币数量兑换

emblemai --agent --profile default -m "Use splBuyIntent to swap 0.5 SOL for USDC"
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"
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"
undefined
emblemai --agent --profile default -m "Use splBuyIntent to swap 100 USDC for BONK"
undefined

EVM Swaps

EVM链兑换

bash
undefined
bash
undefined

Ethereum

Ethereum

emblemai --agent --profile default -m "Use ethSwapQuote to get a quote for swapping 0.01 ETH to USDC, then use ethSwap to execute"
emblemai --agent --profile default -m "Use ethSwapQuote to get a quote for swapping 0.01 ETH to USDC, then use ethSwap to execute"

Base

Base

emblemai --agent --profile default -m "Use baseSwapQuote to quote 0.005 ETH to USDC on Base"
emblemai --agent --profile default -m "Use baseSwapQuote to quote 0.005 ETH to USDC on Base"

BSC

BSC

emblemai --agent --profile default -m "Use bscSwapQuote to quote 0.1 BNB to USDT on BSC"
emblemai --agent --profile default -m "Use bscSwapQuote to quote 0.1 BNB to USDT on BSC"

Polygon

Polygon

emblemai --agent --profile default -m "Use polygonSwapQuote to quote 10 POL to USDC on Polygon"
undefined
emblemai --agent --profile default -m "Use polygonSwapQuote to quote 10 POL to USDC on Polygon"
undefined

Hedera Swaps

Hedera兑换

bash
emblemai --agent --profile default -m "Use hederaTokensSwapQuote to get a quote for 100 HBAR to USDC, then use hederaTokensSwap to execute"
bash
emblemai --agent --profile default -m "Use hederaTokensSwapQuote to get a quote for 100 HBAR to USDC, then use hederaTokensSwap to execute"

Cross-Chain Bridge

跨链桥接

bash
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"

bash
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"

Communication Rules

请求规范

Always include these in swap requests:
  1. Tool name — specify the exact tool for reliable routing
  2. Amount — dollar value or token quantity
  3. Source token — what you're swapping from
  4. Target token — what you're swapping to
BadGood
"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"

兑换请求中必须包含以下信息:
  1. 工具名称 — 指定准确的工具以保证路由可靠
  2. 金额 — 美元价值或代币数量
  3. 源代币 — 你要支出的代币
  4. 目标代币 — 你要兑换获得的代币
错误示例正确示例
"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"

Safety

安全说明

All swaps require explicit user confirmation (safe mode). The agent will:
  1. Show you the swap details (amount, route, estimated output)
  2. Wait for your approval before executing
  3. Report the transaction result
Never bypasses confirmation for any value-moving operation.

所有兑换操作都需要用户明确确认(安全模式)。Agent会执行以下流程:
  1. 展示兑换详情(金额、路由、预计到账数量)
  2. 等待你批准后再执行
  3. 返回交易结果
任何涉及资产转移的操作都不会跳过确认步骤。

Helper Script

辅助脚本

bash
bash scripts/swap-helper.sh
See scripts/swap-helper.sh for an interactive swap walkthrough.

bash
bash scripts/swap-helper.sh
查看 scripts/swap-helper.sh 获取交互式兑换引导流程。

Links

相关链接