Skip to content

feat: add WalletConnect integration, fund, and withdraw commands#7

Open
arein wants to merge 1 commit intochrisling-dev:mainfrom
arein:main
Open

feat: add WalletConnect integration, fund, and withdraw commands#7
arein wants to merge 1 commit intochrisling-dev:mainfrom
arein:main

Conversation

@arein
Copy link

@arein arein commented Mar 10, 2026

hyperliquid.mp4

Summary

  • Add WalletConnect account type via CWP (CLI Wallet Protocol) — scan QR code with mobile wallet, no private key handling
  • New hl fund <amount> command: deposit USDC to Hyperliquid via Arbitrum Bridge2 (approve + transfer, with pre-flight balance check and on-chain receipt verification)
  • New hl withdraw <amount> command: withdraw USDC from Hyperliquid to Arbitrum via ExchangeClient.withdraw3()
  • New lib/cwp.ts: adapter that proxies signTypedData to the walletconnect CLI binary, satisfying AbstractViemJsonRpcAccount
  • DB migration 002: adds walletconnect account type and cwp_provider column
  • Account setup wizard gains "Connect via WalletConnect" option with QR code flow
  • Account listing conditionally shows Provider column for WalletConnect accounts
  • Testnet-aware RPC/chain selection for fund command

Test plan

  • pnpm build compiles clean
  • hl account add → select WalletConnect → scan QR → account saved
  • hl account ls → shows walletconnect account with provider
  • hl fund 5 → deposits 5 USDC to Hyperliquid (approve + transfer confirmed on-chain)
  • hl withdraw 5 → withdraws 5 USDC from Hyperliquid (signTypedData via WalletConnect)
  • hl account positions → reads positions correctly
  • Testnet flow (requires testnet USDC on Arbitrum Sepolia)

🤖 Generated with Claude Code

- Add WalletConnect account type with CWP binary adapter for signing
- New `hl fund <amount>` command: deposit USDC to Hyperliquid via Arbitrum bridge
  - Pre-flight USDC balance check, receipt verification, testnet support
- New `hl withdraw <amount>` command: withdraw USDC from Hyperliquid
  - Address validation on --destination flag
- New `lib/cwp.ts`: CWP binary adapter satisfying AbstractViemJsonRpcAccount
- DB migration 002: add walletconnect account type and cwp_provider column
- Account setup wizard: "Connect via WalletConnect" option with QR code flow
- Account listing: conditional Provider column for WalletConnect accounts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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