一键导入
swap
Perform a cross-chain atomic swap with detailed lifecycle timing. Use when the user wants to execute a test swap between two EVM networks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Perform a cross-chain atomic swap with detailed lifecycle timing. Use when the user wants to execute a test swap between two EVM networks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Interact with the Train Solver Gateway gRPC API (SolverService + ExecutionService). Use whenever the user wants to test, query, or submit transactions via the solver gateway — including getting routes, quotes, orders, submitting custom transactions, or checking transaction status. Triggers on: 'test gateway', 'call execution service', 'get routes', 'submit transaction', 'check tx status', 'grpc call', 'solver api'.
Call gRPC methods on the Train Solver NetworkService (blockchain.proto). Use when the user wants to query or debug a network gRPC service — balances, health, fees, transactions, etc.
Decode and analyze Temporal.io workflow history JSON. Use when the user provides Temporal history JSON or says something is temporal history.
| name | swap |
| description | Perform a cross-chain atomic swap with detailed lifecycle timing. Use when the user wants to execute a test swap between two EVM networks. |
| disable-model-invocation | true |
Perform an end-to-end cross-chain atomic swap using the Train solver, with detailed timing instrumentation to measure each phase of the swap lifecycle.
The swap tool lives at tools/swap-cli/. Before first use, install dependencies:
cd tools/swap-cli && npm install
The tool uses a local ethers.js wallet stored at tools/swap-cli/.wallet.json (gitignored).
Check if wallet exists:
cd tools/swap-cli && node wallet.mjs address
If no wallet exists, create one:
cd tools/swap-cli && node wallet.mjs create
Then tell the user their wallet address and ask them to fund it with test ETH on the source network.
Check balance before swapping:
cd tools/swap-cli && node wallet.mjs balance <sourceChainRpcUrl>
If balance is zero or insufficient for the swap amount + gas, tell the user the wallet address and ask them to send funds.
$ARGUMENTS should contain:
arb-sepolia)eth-sepolia)0.001)The user may provide these inline or you may need to ask for missing values. Destination RPC is auto-resolved from the AdminAPI network config.
Parse the arguments and run:
cd tools/swap-cli && node swap.mjs \
--admin-api <adminApiUrl> \
--source-network <sourceNetwork> \
--dest-network <destNetwork> \
--amount <amountInEth> \
--rpc-url <sourceChainRpcUrl> \
[--dest-rpc-url <destChainRpcUrl>] \
[--source-token <tokenContract>] \
[--dest-token <tokenContract>] \
[--include-reward]
Omit --source-token and --dest-token for native ETH swaps.
Use --include-reward so the solver redeems on the destination chain for the user (otherwise the user must submit their own redeem tx and needs gas on the dest chain).
The script will:
After the swap completes, analyze the timing report and share insights:
--include-reward so solver redeems for you