Skip to content

feat: add swidge command to WalletConnect CLI#32

Merged
arein merged 1 commit into
mainfrom
feat/cli-swidge
Mar 5, 2026
Merged

feat: add swidge command to WalletConnect CLI#32
arein merged 1 commit into
mainfrom
feat/cli-swidge

Conversation

@arein
Copy link
Copy Markdown
Contributor

@arein arein commented Mar 5, 2026

Summary

  • Add walletconnect swidge command for cross-chain bridging via LI.FI REST API
  • Enhanced send-transaction to auto-detect insufficient ETH and offer to bridge from another chain (TTY prompt / auto in pipe mode)
  • Default connect now requests all EVM chains instead of just Ethereum mainnet
  • Zero new dependencies — uses fetch() for LI.FI API and RPC calls, WalletConnect for tx execution
  • Library exports (index.ts, client.ts) unchanged — no breaking changes

Key design decisions

  • No @lifi/sdk or viem dependency — keeps cli-sdk lightweight
  • WalletConnect for execution — bridge txs go through the connected wallet (user approves in wallet app)
  • ERC-20 approval uses exact amount (not max-uint256) for security
  • Race-safe balance scanning — collect-then-reduce pattern for parallel RPC calls
  • Input validation — CAIP-2 chain IDs and amounts validated before use

Test plan

  • Build passes
  • All tests pass (cli-sdk: 17 tests including 10 new swidge tests)
  • Lint clean
  • Manual test: walletconnect swidge with WCT->USDC cross-chain swap (approval + quote worked, user declined due to rate)
  • Manual test: walletconnect connect now connects with all EVM chains
  • Manual test: auto-bridge triggered via send-transaction on underfunded chain

Generated with Claude Code

Add `walletconnect swidge` command for cross-chain bridging through
connected wallets. Enhanced `send-transaction` to auto-detect
insufficient ETH and offer to bridge from another chain.

Uses LI.FI REST API for quoting with zero new dependencies —
transactions are sent through WalletConnect for wallet approval.
Default connect now requests all EVM chains instead of just Ethereum.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arein arein merged commit 79de3fe into main Mar 5, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant