near-intents
Universal cross-chain swap & bridge skill for OpenClaw using the NEAR Intents 1Click SDK. Supports 14+ blockchains including NEAR, Base, Ethereum, Solana, and…
от jiayaoqijia★ 81 звезда на GitHub
Установить near-intents в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
NEAR Intents Skill — 1Click SDK
📋 TL;DR
What it does: Universal cross-chain swap & bridge tool powered by the 1Click API and the @defuse-protocol/one-click-sdk-typescript SDK.
Supported chains: NEAR, Base, Ethereum, Arbitrum, Solana, BSC, Gnosis, Starknet, Bitcoin, Dogecoin, Zcash, Litecoin.
How it works:
- Get a quote from the 1Click API → receive a deposit address
- Send tokens to the deposit address on the origin chain
- 1Click handles the swap/bridge automatically
- Tokens arrive at the recipient address on the destination chain
Key facts:
- Minimum ~$0.10 USD per swap
- NEAR account only required when the origin asset is on NEAR
- No NEAR account needed for cross-chain swaps from other chains (e.g., Arb USDC → Sol USDC)
- JWT authentication optional but avoids 0.2% fee → register at partners.near-intents.org
Core Concept
All swaps go through the 1Click API (https://1click.chaindefuser.com):
User Wallet ──► [Deposit to 1Click address] ──► Market Makers ──► Recipient on Destination Chain
There is no need to interact with intents.near directly — the 1Click API abstracts everything.
executeIntent() API
The single entry point exported by index.ts:
import { executeIntent } from './index';
const result = await executeIntent({
assetIn: 'NEAR', // Origin token (see Asset Naming below)
assetOut: 'base:USDC', // Destination token
amount: '1.0', // Human-readable amount
recipient: '0x...', // Destination address (optional if same-chain NEAR)
mode: 'auto', // 'auto' (default) or 'manual'
swapType: 'EXACT_INPUT', // 'EXACT_INPUT' (default) or 'EXACT_OUTPUT'
});
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
assetIn |
string | ✅ | Origin asset symbol (e.g., 'NEAR', 'base:USDC', 'arb:ARB') |
assetOut |
string | ✅ | Destination asset symbol |
amount |
string | ✅ | Human-readable amount (e.g., '1.0', '0.5') |
recipient |
string | ❌ | Destination address. Required for cross-chain. Defaults to NEAR account |
refundAddress |
string | ⚠️ | REQUIRED for non-NEAR origins. Address on origin chain for refunds if swap fails. CRITICAL for fund safety! |
mode |
string | ❌ | 'auto' sends deposit automatically from NEAR account. 'manual' returns quote + deposit address for user to send manually |
swapType |
string | ❌ | 'EXACT_INPUT' (amount = input), 'EXACT_OUTPUT' (amount = desired output) |
⚠️ CRITICAL: Refund Address Safety
When assetIn is on a non-NEAR chain (e.g., 'base:USDC', 'arb:ARB', 'btc:BTC'):
refundAddressis REQUIRED — the function will throw an error if missing- ALWAYS ask the user for their wallet address on the origin chain
- NEVER assume or guess — using the wrong address = permanent fund loss
- Explain to the user: "If the swap fails, your tokens will be refunded to this address"
Example:
// ❌ WRONG - Missing refundAddress for non-NEAR origin
await executeIntent({
assetIn: 'base:USDC', // Base origin
assetOut: 'NEAR',
amount: '0.5',
recipient: 'user.near',
mode: 'manual'
});
// → Error: Cross-chain swap from base:USDC requires refundAddress parameter
// ✅ CORRECT - User's Base wallet address provided
await executeIntent({
assetIn: 'base:USDC',
assetOut: 'NEAR',
amount: '0.5',
recipient: 'user.near',
refundAddress: '0x123...', // User's Base address
mode: 'manual'
});
Why this matters:
- Swaps can fail due to market conditions, liquidity issues, or timing
- Failed swaps trigger automatic refunds to
refundAddresson the origin chain - If
refundAddressis wrong or belongs to someone else, funds are permanently lost
Returns
- Auto mode:
"Swap Successful! 1.0 NEAR → 0.97 USDC\nTransaction: https://nearblocks.io/txns/...\nExplorer: https://explorer.near-intents.org/transactions/..." - Manual mode: Formatted instructions with deposit address, amounts, tracking URL, and deadline
Asset Naming
Use chain:SYMBOL format. Omit chain prefix for NEAR-native tokens.
| Chain | Prefix | Examples |
|---|---|---|
| NEAR | (none) | NEAR, USDC, USDT, wNEAR |
| Base | base: |
base:USDC |
| Ethereum | eth: |
eth:ETH, eth:USDC |
| Arbitrum | arb: |
arb:USDC, arb:ARB |
| Solana | sol: |
sol:SOL, sol:USDC |
| BSC | bsc: |
bsc:USDC |
| Bitcoin | btc: |
btc:BTC (native only) |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- AI-AGENT-GUIDE.md
- CHANGELOG.md
- INSTALL.md
- QUICKSTART.md
- README.md
- RELEASE_NOTES.md
- SOURCE.md
- TOKENS.md
- TRUST.auto.yaml
- USAGE_GUIDE.md
- _meta.json
- index.ts
- lib-1click/1-get-tokens.ts
- lib-1click/2-get-quote.ts
- lib-1click/3-send-deposit.ts
- lib-1click/4-submit-tx-hash-OPTIONAL.ts
- lib-1click/5-check-status-OPTIONAL.ts
- lib-1click/6-full-swap.ts
- lib-1click/near.ts
- lib-1click/utils.ts
- manifest.json
- package-lock.json
- package.json
- scripts/generate-account.ts
- scripts/logic.ts
- scripts/price-service.ts
- scripts/test_intent.ts
- skill-card.md
- tsconfig.json
FAQ
Что делает скилл near-intents?
Universal cross-chain swap & bridge skill for OpenClaw using the NEAR Intents 1Click SDK. Supports 14+ blockchains including NEAR, Base, Ethereum, Solana, and Bitcoin.
Как установить скилл near-intents?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл near-intents запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…