Community生产力与协作github.com

emblemcompany/emblem-token-swap

通过 EmblemAI 在 6 条区块链上执行代币交换。自动路由优化和跨链桥接,基于 ChangeNow。当用户想要交换代币、兑换加密货币、转换货币或跨链桥接资产时使用。

emblem-token-swap 是什么?

该技能通过 EmblemAI 和 ChangeNow 实现 6 条区块链之间的代币交换与跨链桥接。它自动优化路由,确保用户以最佳汇率和最低滑点完成交易。支持比特币、以太坊、币安智能链、Polygon、Avalanche 和 Solana 等主流区块链,无需用户手动选择 DEX 或桥接协议。开发者只需提供源代币、目标代币和数量即可启动交换,技能会处理去中心化交易所聚合、跨链流动性匹配和交易执行。适用于 Claude Code、Cursor 等 AI Agent 平台,简化了多链 DeFi 操作。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/emblemcompany/agent-skills/tree/main/skills/emblem-token-swap

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

emblem-token-swap 是做什么的?

通过 EmblemAI 在 6 条区块链上执行代币交换。自动路由优化和跨链桥接,基于 ChangeNow。当用户想要交换代币、兑换加密货币、转换货币或跨链桥接资产时使用。

主要功能

  • 代币交换:在 6 条支持的区块链之间交换代币(ERC-20、BEP-20 等)。
  • 自动路由优化:自动选择最佳路由和 DEX 聚合器,以获取最优汇率。
  • 跨链桥接:通过 ChangeNow 支持不同区块链之间的资产桥接。
  • 汇率查询:在交易前获取实时报价和滑点信息。
  • 交易执行:接收用户地址和代币详情后自动执行交换。

支持的区块链

  1. 比特币
  2. 以太坊(包括 ERC-20 代币)
  3. 币安智能链(包括 BEP-20 代币)
  4. Polygon
  5. Avalanche C-Chain
  6. Solana

API 端点

端点描述
GET /quotes获取最佳交换报价
POST /swap执行代币交换
GET /status检查交易状态
GET /supported-chains列出支持的所有区块链

使用条件

  • 需要有效的 EmblemAI API 密钥(通过 EMBLEM_API_KEY 环境变量设置)。
  • 用户必须提供有效的钱包地址(接收地址)。
  • 输入的源代币和目标代币必须在该技能支持的网络和代币列表中。

如何使用

  1. 获取报价:发送请求以获取交换汇率。
  2. 确认交换:如果报价符合用户预期,则发起交换。
  3. 跟踪状态:使用交易哈希检查交换状态。

示例 CLI 用法

# 获取 ETH 到 MATIC 的报价
curl -X GET "https://api.emblemai.com/v1/quotes?from=ETH&to=MATIC&amount=0.1" \
  -H "Authorization: Bearer $EMBLEM_API_KEY"

# 执行交换
curl -X POST "https://api.emblemai.com/v1/swap" \
  -H "Authorization: Bearer $EMBLEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "ETH",
    "to": "USDC",
    "amount": 0.5,
    "fromChain": "ethereum",
    "toChain": "polygon",
    "recipient": "0x..."
  }'

# 检查交换状态
curl -X GET "https://api.emblemai.com/v1/status?txHash=0x..." \
  -H "Authorization: Bearer $EMBLEM_API_KEY"

最佳实践

  • 始终先调用 /quotes 以获取实时汇率和估计滑点。
  • 在执行交换前验证用户地址是否正确。
  • 如果汇率波动过大(例如超过 2%),考虑拒绝交易或通知用户。
  • 记录所有交换以便审计。

错误处理

错误码含义
400请求参数缺失或无效
401API 密钥无效
429请求速率限制达到
500内部服务器错误
503链上服务暂不可用

安全注意事项

  • 切勿在日志中暴露私钥或 API 密钥。
  • 只接受来自受信用户或经过身份验证的请求的交换指令。
  • 建议在交易前通过用户确认来防止误操作。
  • 注意链上 gas 费用;如果费用过高,建议提示用户。

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

emblemcompany/emblem-ai

One-shot user management for apps, multi-chain wallet authentication, an AI-powered assistant, and AI app introspection. Use when the user wants to let website users sign in with wallets, email/password, or social login and give each user a wallet-enabled account, then embed EmblemAI chat surfaces, connect plugins, or add Reflexive observability. Provides React components, TypeScript SDKs, session-based authentication, and pointers to the React and agent-wallet skills for specialized workflows.

emblemcompany/emblem-ai-agent-wallet

Connect to EmblemVault and manage wallet-aware workflows via EmblemAI with review-first, operator-controlled actions. Supports Solana, Ethereum, Base, BSC, Polygon, Hedera, and Bitcoin. Also use when the user needs Emblem's auth model explained: one browser auth flow can log a user in with wallets, email/password, or social sign-in, while agent mode can auto-provision a profile-scoped wallet with no manual setup.

emblemcompany/emblem-ai-prompt-examples

Curated prompt and usage examples for research, portfolio review, quote requests, approval-gated drafts, NFT discovery, prediction-market analysis, and assistant workflows. Emphasis is review-first, trust-boundary-aware use of external data, and explicit confirmation before any value-moving action. Use when the user wants example prompts, phrasing guidance, or sample requests for end-user EmblemAI tasks.

emblemcompany/emblem-ai-react

React integration skill for EmblemAI's one-shot user management. Use when the user wants to add website authentication plus wallet-enabled users to a React app with EmblemAuthProvider, ConnectButton, social/email/wallet login, chat components, React auth hooks, React composition patterns, or Migrate.fun React hooks.

emblemcompany/emblem-defi-yield

DeFi yield research and liquid staking via EmblemAI. Discover yield opportunities, compare protocols, check DeFi positions with Nansen, and enter liquid staking via token swaps. Use when the user wants to research yields, find staking options, or review DeFi positions.

emblemcompany/emblem-market-research

Crypto market intelligence via EmblemAI. Trending tokens, on-chain analytics, derivatives data, and smart money tracking from CoinGecko, CoinGlass, Birdeye, and Nansen. Use when the user wants market data, trending tokens, derivatives analytics, or on-chain intelligence.

emblemcompany/emblem-memecoin-scout

Memecoin discovery and risk assessment via EmblemAI. Trending memecoins on Solana, Base, and Hedera. Pump.fun and LaunchLab new token alerts, Clanker discovery, rug-pull detection, holder analysis, and smart money tracking. Use when the user wants to find new memecoins, check if a token is a rug pull, or scout trending low-cap tokens.

emblemcompany/emblem-portfolio-tracker

Track crypto portfolio across 7 blockchains via EmblemAI. Aggregated balances with USD values, conditional trade P&L, and DeFi position tracking via Nansen. Use when the user wants to check their portfolio, see balances across chains, or review trade positions.

相关技能