near-intents
它能做什么
这项技能涵盖使用 NEAR Intents 1Click API 进行的跨链代币兑换。该 API 可在 EVM 链、Solana、NEAR、TON、Stellar 和 Tron 之间工作,适合开发兑换组件、跨链桥页面或多链转账脚本的开发者。
适用场景
- ✓当你想构建一个在链之间转移代币的兑换组件的时候。
- ✓当你需要在不同区块链之间转账的跨链桥界面时。
- ✓当你想要一个服务器脚本,用来获取兑换报价并跟踪其状态的时候。
技能链接
https://github.com/internet-court/internet-court-skill/blob/main/vendored/near/near-intents/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我希望我的网站上有一个兑换组件,让用户在 Solana 和以太坊之间转移代币。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会获取受支持代币的列表,请求报价,然后在源链上构建一笔存款交易。API 会提供存款地址,并自动交付兑换得到的代币。智能体会检查状态,直到兑换完成。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
NEAR Intents Integration
Cross-chain token swaps via 1Click REST API. Get a quote, API provides deposit addresses, you build the deposit transaction and receive the resulting token automatically.
Quick Start - Pick Your Path
| Use Case | Start Here |
|---|---|
| React App | react-swap-widget.md - Example showing the pattern |
| Node.js / Script | server-example.md - Example showing the pattern |
| API Reference | api-quote.md → api-tokens.md → api-status.md |
| Chain-specific Deposits | deposit-{chain}.md |
Integration Flow
GET /v0/tokens → POST /v0/quote (dry) → POST /v0/quote (wet) → Deposit TX → POST /v0/deposit/submit → GET /v0/status
Rule Categories
| Priority | Category | Files |
|---|---|---|
| 1 | Examples | react-swap-widget.md, server-example.md |
| 2 | API | api-quote.md, api-tokens.md, api-status.md, api-deposit-submit.md |
| 3 | Deposits | deposit-evm.md, deposit-solana.md, deposit-near.md, deposit-ton.md, deposit-tron.md, deposit-stellar.md |
| 4 | React Hooks | react-hooks.md |
| 5 | Advanced | intents-balance.md, passive-deposit.md |
Critical Knowledge
- Use
assetIdfrom /v0/tokens - never construct manually dry: true= preview only,dry: false= get deposit address (valid ~10 min)- Poll status until terminal:
SUCCESS,FAILED,REFUNDED,INCOMPLETE_DEPOSIT - Chain-to-chain is default -
depositTypeandrecipientTypedefault to chain endpoints
Index
Examples (HIGH)
- react-swap-widget - Minimum viable React swap implementation with wagmi
- server-example - Node.js script for server-side swaps
API Reference (CRITICAL)
- api-tokens - Fetch supported tokens, cache result
- api-quote - Get swap quote, dry=true for preview, dry=false for deposit address
- api-deposit-submit - Notify API after deposit to speed up processing
- api-status - Poll until terminal state (SUCCESS, FAILED, REFUNDED)
- api-any-input-withdrawals - Query withdrawals for ANY_INPUT quotes
Chain Deposits (HIGH)
- deposit-evm - Ethereum, Base, Arbitrum, Polygon, BSC transfers
- deposit-solana - Native SOL and SPL token transfers
- deposit-near - NEP-141 token transfers via wallet selector
- deposit-ton - Native TON transfers via TonConnect
- deposit-tron - Native TRX and TRC-20 transfers
- deposit-stellar - Stellar transfers (MEMO REQUIRED)
React Hooks (MEDIUM)
- react-hooks - Reusable hooks for tokens, quotes, status polling
Advanced (LOW)
- intents-balance - Hold balances in intents.near for faster swaps
- passive-deposit - QR code flow for manual transfers
References
- concepts - Swap lifecycle, statuses, CEX warning, authentication
Resources
常见问题
我在哪里获取代币标识符?
该技能要求使用代币列表端点中的 assetId,绝不要手动构建。
dry 模式有什么作用?
dry 报价只预览兑换。非 dry 报价会返回一个存款地址,该地址大约 10 分钟内有效。
涵盖哪些链?
EVM 链、Solana、NEAR、TON、Stellar 和 Tron。
详情
作者的原始描述
Cross-chain token swap integration using NEAR Intents 1Click API. Use when building swap widgets, bridge interfaces, or multi-chain transfers across EVM, Solana, NEAR, TON, Stellar, and Tron.
热度
- GitHub 星标
- 7.0k
- 排名
- #13654
- 许可证
- —
- 更新时间
- 2026/10/26
评论
- …
同一仓库的更多技能
internet-court
7.0k帮你的智能体安全地向其他 AI 智能体或付费服务付款、雇用或进行交易,并指引它找到合适的专业指南。
genlayer-erc7710-connector
7.0k帮你的智能体把 AI 审核结果与权限系统连接起来,使不合格的审核可以限制或取消智能体的权限。
genlayer-intelligent-contracts
7.0k帮你的智能体定义 AI 裁判的规则、证据和输出,用于检查另一个智能体是否遵循了其授权范围。
x402-erc7710
7.0k帮你的智能体按次为网络服务付款,并设置在权限预算范围内的持续支出。