Skip to content

Repository files navigation

Eco Protocol

Routes CLI

Send assets across chains with a single command.

License: MITNode.js Version

Routes CLI is a terminal tool for publishing cross-chain intents built on the Eco Routes Protocol. You lock a reward on your source chain; competitive solvers race to deliver the result on your destination chain. Supports EVM (Ethereum, Base, Optimism, and more), and Solana.


See It In Action

$ eco-routes-cli publish --private-key 0xYOUR_PRIVATE_KEY
? Select source chain: Base
? Select destination chain: Optimism
? Route token: USDC
? Route amount: 100
? Reward token: USDC
? Reward amount: 101
┌─────────────────────────────────────────────┐
│ Intent Summary │
├──────────────────┬──────────────────────────┤
│ Source chain │ Base (8453) │
│ Destination │ Optimism (10) │
│ Route │ 100 USDC → Optimism │
│ Reward │ 101 USDC on Base │
│ Route deadline │ 2026-02-26 14:00 UTC │
│ Reward deadline │ 2026-02-26 15:00 UTC │
└──────────────────┴──────────────────────────┘
? Confirm and publish intent? Yes
⠋ Publishing intent...
✔ Intent published — tx: 0xabc123...def456

Quick Start

1. Install globally

npm i -g eco-routes-cli

2. Publish your first EVM intent

eco-routes-cli publish --private-key 0xYOUR_PRIVATE_KEY

Follow the prompts to select source chain (e.g. Base), destination chain (e.g. Optimism), token, and amounts. Done.

Tip: pass --source and --destination to skip chain selection prompts.

Prefer not to pass keys inline? Copy .env.example to .env and set EVM_PRIVATE_KEY (or SVM_PRIVATE_KEY for Solana) — the CLI will pick it up automatically.


What Is an Intent?

An intent describes what you want to happen on the destination chain and what reward you're offering to whoever makes it happen. Solvers — independent actors monitoring the protocol — race to fulfill your intent and claim the reward. The faster the solver, the better the deal for everyone.

This is powered by the Eco Routes Protocol. For the full picture of how intents are encoded, published, and proven, see ARCHITECTURE.md.


Command Reference

CommandDescription
eco-routes-cli publishInteractive intent publishing wizard
eco-routes-cli publish --source <chain> --destination <chain>Skip chain selection prompts
eco-routes-cli chainsList all supported chains
eco-routes-cli tokensList all configured tokens

publish flags:

FlagAliasDescription
--source-sSource chain name or ID
--destination-dDestination chain name or ID
--route-token <symbol|address>Token delivered on the destination chain
--reward-token <symbol|address>Token paid on the source chain
--route-token-decimals <n>Token decimals; required when --route-token is a raw address
--reward-token-decimals <n>Token decimals; required when --reward-token is a raw address
--amount <value>Reward amount in human units (e.g. 5); requires --reward-token
--route-amount <value>Route amount in human units, only needed as a manual fallback when the quote service is down; requires --route-token
--private-key-kEVM private key (overrides EVM_PRIVATE_KEY env)
--private-key-tvmTVM (Tron) private key (overrides TVM_PRIVATE_KEY env)
--private-key-svmSVM private key (overrides SVM_PRIVATE_KEY env)
--recipientRecipient address on the destination chain
--portal-addressPortal contract address on the source chain
--prover-addressProver contract address on the source chain
--prover-type <name>Prover type to use (e.g. LayerZero, Hyperlane)
--dry-runValidate and preview without broadcasting
--yes-ySkip the confirmation prompt (required for a non-interactive publish)
--jsonMachine-readable output: one JSON object on stdout, human logs on stderr
--watch-wWatch for fulfillment after publishing

Publish non-interactively:

eco-routes-cli publish -s base -d optimism \
--reward-token USDC --route-token USDC --amount 5 \
--recipient 0xYourRecipient -y --json

Private key formats:

ChainFormatExample
EVM0x + 64 hex chars0xac09...ff80
Tron64 hex chars, no 0xac09...ff80
SolanaBase585Jd7F...
SolanaJSON byte array[1,2,3,...]
SolanaComma-separated bytes1,2,3,...

Configuration Reference

Copy .env.example to .env. All variables except the private keys are optional.

VariableRequiredDescription
EVM_PRIVATE_KEYFor EVM chainsEVM wallet private key (0x…)
SVM_PRIVATE_KEYFor SolanaSolana wallet key (base58, array, or bytes)
EVM_RPC_URLNoOverride RPC for all EVM chains
SVM_RPC_URLNoOverride Solana RPC (default: mainnet-beta)
SOLVER_URLNoUse a custom solver endpoint for quotes
QUOTES_PREPRODNoForce preprod quote service (set to true)
PORTAL_ADDRESS_ETHNoOverride Ethereum portal contract
PORTAL_ADDRESS_BASENoOverride Base portal contract
PORTAL_ADDRESS_OPTIMISMNoOverride Optimism portal contract
PORTAL_ADDRESS_SOLANANoOverride Solana portal contract

See .env.example for the complete list of portal address overrides.


Troubleshooting

IssueFix
Private key errorCheck the format matches the chain type — see Private key formats above
Chain not foundRun eco-routes-cli chains to verify the exact chain name or ID
Insufficient balanceEnsure your wallet has the reward token plus gas on the source chain
Quote unavailableNot all chain pairs have live routes yet — try a different pair
RPC timeoutSet a custom RPC endpoint via EVM_RPC_URL / TVM_RPC_URL / SVM_RPC_URL

Enable verbose output for more detail:

DEBUG=* eco-routes-cli publish

Going Deeper


License

MIT © Eco Protocol

Built with viem, and @solana/web3.js. Powered by the Eco Routes Protocol.

Eco Protocol

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages