| name | solver-gateway |
| description | 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'. |
Solver Gateway Client
Interact with the Train Solver Gateway gRPC services via gRPC-web.
Available Services
SolverService (public, no auth)
- GetRoutes — List available swap routes
- GetQuote — Get a quote for a swap
- GetOrder — Get order details by hashlock
- RevealSecret — Reveal secret for an order
ExecutionService (programmatic tx submission)
- SubmitTransaction — Submit a custom transaction for execution
- GetTransactionStatus — Poll transaction result by correlation ID
How to Use
Run the gateway client script:
node <skill-path>/scripts/gateway.mjs <command> [args] [--endpoint URL]
Default endpoint: https://train-solver-api.lb.layerswap.io
Commands
node gateway.mjs routes
node gateway.mjs quote --source-network eth-sepolia --dest-network base-sepolia \
--source-token 0x0000000000000000000000000000000000000000 \
--dest-token 0x0000000000000000000000000000000000000000 \
--amount 1000000000000000
node gateway.mjs order --hashlock 0xabc123...
node gateway.mjs submit \
--network eth-sepolia \
--wallet 0xYourWallet \
--to 0xTargetContract \
--amount 0 \
--calldata 0x... \
--correlation-id my-custom-id
node gateway.mjs status --correlation-id my-custom-id
Setup (first time only)
cd <skill-path>/scripts
npm install
Proto Reference
The proto definitions are in the solver repo at protos/solver.proto. Key message shapes:
SubmitExecutionRequest: network_slug, wallet_address, to_address, call_data, amount, token_contract, correlation_id
GetExecutionStatusResponse: correlation_id, status (pending/confirmed/failed/rejected/unknown), tx_hash, block_number, failure_reason, network_slug
GetQuoteRequest: source_network, destination_network, source_token, destination_token, amount, receive_amount