swap-execute
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "execute swap", "send swap transaction", "submit swap", "broadcast swap", "run the swap", "execute the trade"…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
KyberSwap Execute Skill
Execute a swap transaction on-chain using Foundry's cast send. This skill takes the output from swap-build and broadcasts the transaction.
Prerequisites
- Foundry installed:
castmust be available in PATH - Wallet configured: One of the methods below
- ETH for gas: Sender must have native token for gas fees
Wallet Setup (One-Time)
⚠️ USE YOUR EXISTING WALLET MANAGEMENT FIRST ⚠️
If you or your agent already have wallet management (key management service, vault, HSM, custodial API, MPC signer, or any secure signing infrastructure), use that. Skip the examples below entirely.
The wallet options below are example setups for development and testing only. They have known security issues: plaintext password files on disk, private keys in shell environments, no access control, no audit trail, no key rotation. Do not use them with real funds in production. Consider this from the very start — not after you've already built around a testing setup.
Option A: Encrypted Keystore (Recommended)
# Import private key to encrypted keystore
cast wallet import mykey --interactive
# Enter private key, then set encryption password
# Create password file securely (prompts without echoing to terminal)
printf "Password: " && read -s pw && printf '\n' && echo "$pw" > ~/.foundry/.password && chmod 600 ~/.foundry/.password
# Verify
cast wallet list
Option B: Environment Variable Set the key in your current shell session only (do not persist to shell profiles):
printf "Enter private key: " && read -s PRIVATE_KEY && printf '\n' && export PRIVATE_KEY
See the security section in ${CLAUDE_PLUGIN_ROOT}/skills/swap-execute/references/wallet-setup.md for details.
NEVER echo, print, log, or display any private key value, even in error messages or debug output.
Option C: Ledger Hardware Wallet
- Connect Ledger, open Ethereum app
- No setup needed, will prompt for physical confirmation
See ${CLAUDE_PLUGIN_ROOT}/skills/swap-execute/references/wallet-setup.md for detailed instructions.
Input
This skill requires the JSON output from swap-build:
{
"type": "kyberswap-swap",
"chain": "ethereum",
"tx": {
"to": "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
"data": "0x...",
"value": "1000000000000000000",
"gas": "250000"
},
"sender": "0x...",
"tokenIn": { "symbol": "ETH", "amount": "1" },
"tokenOut": { "symbol": "USDC", "amount": "2345.67" }
}
Workflow
Step 1: Validate Input
Ensure the user has provided or you have access to the swap output JSON containing:
tx.to— Router addresstx.data— Encoded calldatatx.value— Transaction value in wei (for native token swaps)chain— Chain to execute onsender— Sender address
If the JSON is not available, ask the user to run /swap-build first.
Step 2: Determine RPC URL
Use the appropriate RPC endpoint for the chain:
| Chain | RPC URL |
|---|---|
| ethereum | https://ethereum-rpc.publicnode.com |
| arbitrum | https://arb1.arbitrum.io/rpc |
| polygon | https://polygon-rpc.com |
| optimism | https://mainnet.optimism.io |
| base | https://mainnet.base.org |
| bsc | https://bsc-dataseed.binance.org |
| avalanche | https://api.avax.network/ext/bc/C/rpc |
| linea | https://rpc.linea.build |
| mantle | https://rpc.mantle.xyz |
| sonic | https://rpc.soniclabs.com |
| berachain | https://rpc.berachain.com |
| ronin | https://api.roninchain.com/rpc |
| unichain | https://rpc.unichain.org |
| hyperevm | https://rpc.hyperliquid.xyz/evm |
| plasma | https://plasma.drpc.org |
| etherlink | https://node.mainnet.etherlink.com |
| monad | https://rpc.monad.xyz |
| megaeth | https://rpc.megaeth.com |
Or the user can specify a custom RPC with --rpc-url.
Step 3: Confirm Execution
CRITICAL: Always confirm before executing. Transactions are irreversible.
Time-sensitive: Routes expire in ~30 seconds. If the user takes too long to confirm, re-build with a fresh quote from
/swap-buildbefore executing. Stale routes cause on-chain reverts that waste gas.
Present the transaction details:
## Swap Execution — Final Confirmation
**{tokenIn.amount} {tokenIn.symbol} → {tokenOut.amount} {tokenOut.symbol}** on {chain}
| Field | Value |
|-------|-------|
| Router | `{tx.to}` |
| Value | {tx.value} wei ({value in ETH} ETH) |
| Gas Limit | {tx.gas} |
| Sender | `{sender}` |
⚠️ **WARNING: This action is IRREVERSIBLE.**
- Funds will be sent from your wallet
- Gas fees will be charged even if the swap fails
- Verify the router address is correct: `0x6131B5fae19EA4f9D964eAc0408E4408b66337b5`
**Do you want to execute this swap?** (yes/no)
Wait for explicit "yes" confirmation before proceeding.
Step 3b: Simulate Transaction (Recommended)
Before sending, simulate the
Установить swap-execute в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл swap-execute?
This skill should be used when the user asks to "execute swap", "send swap transaction", "submit swap", "broadcast swap", "run the swap", "execute the trade", or wants to submit a previously built swap transaction on-chain. Uses Foundry's `cast send` to broadcast transactions. Requires swap calldata from swap-build skill output.
Как установить скилл swap-execute?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл swap-execute запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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