1inch
БесплатноЗапускает вложенные скриптыНе проверен1inch DEX aggregator: same-chain EVM swaps, SOL↔EVM cross-chain, limit orders. Use when swapping tokens with best routing or placing limit orders (e.g…
от Starchild-ai-agent★ 34 звезды на GitHubОб этом скилле
1inch (Script-First, Install-and-Use)
This skill is designed for your architecture: do not rely on platform-injected tools.
- ✅ Uses only skill-local scripts under
skills/1inch/scripts/ - ✅ Agent executes scripts via
bash(python3 ...) - ✅ No
oneinch_*tool calls required
Why this version fixes “tool not found”
Old design depended on runtime tool registration (oneinch_quote, oneinch_swap, ...).
If tool injection fails, agent is blocked.
New design uses deterministic local scripts:
- call 1inch HTTP API directly
- call wallet service directly (OIDC via
/.fly/api) - print JSON result
So after install, the agent always has a runnable path.
Files
scripts/_oneinch_lib.py— shared client + wallet/OIDC helpersscripts/tokens.py— token search/listscripts/quote.py— quote onlyscripts/check_allowance.py— allowance checkscripts/approve.py— approve tx broadcastscripts/swap.py— swap execution (optional auto-approve)scripts/run_swap_flow.py— one-command flow (quote + optional approve + swap + post-trade balance verification)
Environment
Required:
ONEINCH_API_KEYWALLET_SERVICE_URL(default fallback exists)- sc-proxy connectivity for 1inch API (mandatory)
Assumptions:
- Running on Fly Machine with
/.fly/apiunix socket for OIDC token minting.
sc-proxy requirement (critical)
This skill enforces 1inch calls through sc-proxy.
- It reads proxy from
HTTP_PROXY/HTTPS_PROXYfirst, else falls back toPROXY_HOST+PROXY_PORT. - If no proxy env is found, scripts fail fast with a clear error instead of silently direct-connecting.
Supported chains
ethereum, arbitrum, base, optimism, polygon, bsc, avalanche, gnosis
Agent execution rules (IMPORTANT)
When user asks for 1inch actions, follow this exact pattern:
- Never call
oneinch_*tools - Run local scripts with
bash+python3 skills/1inch/scripts/<script>.py ... - Parse JSON output and respond with concise summary
- For write actions, always do post-check using wallet balance tools (if available) or rerun script-based checks
Canonical mapping
- “查 token 地址 / 列 token” →
tokens.py - “先报价 / 看能换多少” →
quote.py - “检查授权” →
check_allowance.py - “授权” →
approve.py - “执行兑换” →
swap.py
Command examples
1) Search token
python3 skills/1inch/scripts/tokens.py --chain polygon --search POL --limit 10
2) Quote: 1 USDC -> POL
python3 skills/1inch/scripts/quote.py --chain polygon --from USDC --to POL --amount 1
3) Check allowance (USDC)
python3 skills/1inch/scripts/check_allowance.py --chain polygon --token USDC
4) Approve USDC (unlimited)
python3 skills/1inch/scripts/approve.py --chain polygon --token USDC
5) Swap: 1 USDC -> POL (auto-approve if needed)
python3 skills/1inch/scripts/swap.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve
6) One-command full flow (recommended)
python3 skills/1inch/scripts/run_swap_flow.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve
Tune retries when needed:
python3 skills/1inch/scripts/run_swap_flow.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve --swap-retries 3 --swap-retry-backoff 2
Default workflow for “买 X USDC 的 POL”
Preferred deterministic sequence:
run_swap_flow.py --auto-approve- Read JSON result and report quote, tx submission result, and verification deltas
Fallback manual sequence (if user asks step-by-step):
quote.py(confirm expected output)swap.py --auto-approve- Verify with fresh balances (before/after)
If swap returns wallet policy rejection:
- load
wallet-policyskill - propose wildcard baseline (
DENY exportPrivateKey,ALLOW *) - after user confirms, rerun swap command
Error handling
Unknown chain→ ask user to choose supported chain1inch API 4xx/5xx→ show raw error;run_swap_flow.pyautomatically retries transient/swap5xx (default: 2 retries with exponential backoff)Not enough <token> balancefrom 1inch → likely symbol mapped to a different token variant (e.g. USDC.e vs USDC); rerun with explicit token address fromtokens.pyWallet API 4xx/5xx→ show raw error, do not fabricate tx hashinsufficient allowance(without auto-approve) → rerun with--auto-approveor runapprove.pypolicyrejection → propose policy update then retry
Notes
- Amount input is human units (e.g.
--amount 1= 1 USDC), script handles decimal conversion. - Token symbol resolution comes from 1inch
/tokenson the selected chain. - If a symbol has multiple variants on a chain (e.g.,
USDC/USDC.e), prefer passing token contract address explicitly to avoid ambiguity. - For native token input, use
native/ETH.
Quick smoke test
python3 skills/1inch/scrip
Установить 1inch в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 1inch?
1inch DEX aggregator: same-chain EVM swaps, SOL↔EVM cross-chain, limit orders. Use when swapping tokens with best routing or placing limit orders (e.g. ETH→USDC on Base, SOL→ETH cross-chain, limit buy ARB at 0.80).
Как установить скилл 1inch?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл 1inch запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic