near-intents

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NEAR Intents Integration

NEAR Intents 集成

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.
通过1Click REST API实现跨链代币兑换。获取报价后,API会提供存款地址,您只需构建存款交易,即可自动收到兑换后的代币。

Quick Start - Pick Your Path

快速开始 - 选择适合你的路径

Use CaseStart 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
使用场景开始文档
React应用
react-swap-widget.md
- 展示实现模式的示例
Node.js / 脚本
server-example.md
- 展示实现模式的示例
API参考
api-quote.md
api-tokens.md
api-status.md
链特定存款指南
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
GET /v0/tokens → POST /v0/quote (dry) → POST /v0/quote (wet) → Deposit TX → POST /v0/deposit/submit → GET /v0/status

Rule Categories

规则分类

PriorityCategoryFiles
1Examples
react-swap-widget.md
,
server-example.md
2API
api-quote.md
,
api-tokens.md
,
api-status.md
,
api-deposit-submit.md
3Deposits
deposit-evm.md
,
deposit-solana.md
,
deposit-near.md
,
deposit-ton.md
,
deposit-tron.md
,
deposit-stellar.md
4React Hooks
react-hooks.md
5Advanced
intents-balance.md
,
passive-deposit.md
优先级分类文件
1示例
react-swap-widget.md
,
server-example.md
2API文档
api-quote.md
,
api-tokens.md
,
api-status.md
,
api-deposit-submit.md
3存款指南
deposit-evm.md
,
deposit-solana.md
,
deposit-near.md
,
deposit-ton.md
,
deposit-tron.md
,
deposit-stellar.md
4React Hooks
react-hooks.md
5进阶内容
intents-balance.md
,
passive-deposit.md

Critical Knowledge

关键知识点

  1. Use
    assetId
    from /v0/tokens
    - never construct manually
  2. dry: true
    = preview only,
    dry: false
    = get deposit address (valid ~10 min)
  3. Poll status until terminal:
    SUCCESS
    ,
    FAILED
    ,
    REFUNDED
    ,
    INCOMPLETE_DEPOSIT
  4. Chain-to-chain is default -
    depositType
    and
    recipientType
    default to chain endpoints
  1. 使用/v0/tokens接口返回的
    assetId
    - 切勿手动构造
  2. dry: true
    = 仅预览,
    dry: false
    = 获取存款地址(有效期约10分钟)
  3. 轮询状态 直到进入终态:
    SUCCESS
    ,
    FAILED
    ,
    REFUNDED
    ,
    INCOMPLETE_DEPOSIT
  4. 默认跨链模式 -
    depositType
    recipientType
    默认使用链端点

Index

目录

  1. Examples (HIGH)
    • react-swap-widget - Minimum viable React swap implementation with wagmi
    • server-example - Node.js script for server-side swaps
  2. 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
  3. 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)
  4. React Hooks (MEDIUM)
    • react-hooks - Reusable hooks for tokens, quotes, status polling
  5. Advanced (LOW)
    • intents-balance - Hold balances in intents.near for faster swaps
    • passive-deposit - QR code flow for manual transfers
  6. References
    • concepts - Swap lifecycle, statuses, CEX warning, authentication
  1. 示例(高优先级)
    • react-swap-widget - 基于wagmi的最简React兑换实现示例
    • server-example - 用于服务端兑换的Node.js脚本示例
  2. API参考(核心)
    • api-tokens - 获取支持的代币列表,建议缓存结果
    • api-quote - 获取兑换报价,dry=true用于预览,dry=false用于获取存款地址
    • api-deposit-submit - 存款完成后通知API以加速处理
    • api-status - 轮询直到进入终态(SUCCESS、FAILED、REFUNDED)
    • api-any-input-withdrawals - 查询ANY_INPUT类型报价的提现记录
  3. 链存款指南(高优先级)
    • deposit-evm - Ethereum、Base、Arbitrum、Polygon、BSC转账指南
    • deposit-solana - 原生SOL和SPL代币转账指南
    • deposit-near - 通过钱包选择器进行NEP-141代币转账
    • deposit-ton - 通过TonConnect进行原生TON转账
    • deposit-tron - 原生TRX和TRC-20代币转账指南
    • deposit-stellar - Stellar转账指南(必须填写MEMO)
  4. React Hooks(中优先级)
    • react-hooks - 可复用的代币、报价、状态轮询Hooks
  5. 进阶内容(低优先级)
    • intents-balance - 在intents.near中持有余额以加速兑换
    • passive-deposit - 用于手动转账的二维码流程
  6. 参考资料
    • concepts - 兑换生命周期、状态说明、CEX警告、认证机制

Resources

资源