Skip to content

feat: add Hyperliquid bridge commands#454

Draft
kome12 wants to merge 1 commit into
mainfrom
feat/hl-bridge
Draft

feat: add Hyperliquid bridge commands#454
kome12 wants to merge 1 commit into
mainfrom
feat/hl-bridge

Conversation

@kome12

@kome12 kome12 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add nansen bridge top-level command for EVM ↔ Hyperliquid bridging via Relay
    • nansen bridge quote — get bridge quotes (fees, steps, execution type)
    • nansen bridge execute — sign and broadcast all steps (EVM txs or EIP-712 for HL withdrawals)
    • nansen bridge status — check bridge completion status
  • Calls nansen-api /api/v1/bridge/* endpoints
  • Supports local wallets and Privy server wallets
  • Reuses existing signing infra (signEvmTransaction, hashTypedData, signSecp256k1)

Supported flows

  • Deposit (EVM → HL): signs legacy EVM txs (approve + deposit), broadcasts via RPC, polls status
  • Withdraw (HL → EVM): signs EIP-712 messages (authorize + deposit), proxies via /bridge/execute, polls status

Files changed

  • src/bridge.js (new) — core bridge module
  • src/trading.js — export evmRpcCall, getQuotesDir, safeQuotesPath for reuse
  • src/rpc-urls.js — add arbitrum, polygon, bnb RPC endpoints
  • src/cli.js — register bridge commands, update help text

Test plan

  • E2E deposit: 10 USDC Base → 8.78 USDC on Hyperliquid (via dev API)
  • E2E withdraw: 8.78 USDC Hyperliquid → 8.76 USDC on Base (via dev API)
  • Status polling works for both directions
  • Quote displays fees, steps, and execution type correctly
  • Unit tests

🤖 Generated with Claude Code

Add `nansen bridge` top-level command for EVM <-> Hyperliquid bridging:
- `nansen bridge quote` — get bridge quotes via nansen-api/Relay
- `nansen bridge execute` — sign and broadcast (EVM txs or EIP-712 for HL)
- `nansen bridge status` — check bridge completion

Reuses existing signing infra (signEvmTransaction, hashTypedData,
signSecp256k1) and wallet providers (local + Privy).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kome12 kome12 self-assigned this Jun 9, 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