Skip to content

feat: EVM → Solana intent issuing#37

Open
Asem-Abdelhady wants to merge 5 commits intodevelopfrom
asem/V2-111/evm-to-solana-intents
Open

feat: EVM → Solana intent issuing#37
Asem-Abdelhady wants to merge 5 commits intodevelopfrom
asem/V2-111/evm-to-solana-intents

Conversation

@Asem-Abdelhady
Copy link
Copy Markdown

@Asem-Abdelhady Asem-Abdelhady commented Apr 5, 2026

Summary

Closes V2-111.

Enables users to issue intents from an EVM chain with Solana as the output chain. The user connects their EVM wallet as usual and optionally a Solana wallet to receive the output. No Solana signing is required for issuance.

What's included

Solana wallet connection

  • SolanaWalletButton component supporting Phantom and Solflare via wallet-adapter
  • SolanaWalletStore Svelte 5 class-based store managing connect/disconnect state

Chain & token config

  • solanaDevnet and solanaMainnet chain definitions with RPC constants
  • Solana program IDs and PDAs (SOLANA_OUTPUT_SETTLER_PDA, POLYMER_ORACLE, etc.)
  • SOL, wSOL, USDC tokens added to coinList for both devnet and mainnet
  • SPL mint addresses stored as bytes32 hex (Base58 decoded → 32-byte big-endian)

Intent construction

  • intentFactory.openIntent passes outputRecipient (Solana bytes32 address) and chainNamespace: "solana" when building EVM→Solana intents
  • IssueIntent shows a Solana recipient field when any output token is on Solana — empty field correctly disables the submit button

Balance & display

  • getSolanaBalance fetches native SOL and SPL token balances via @solana/web3.js
  • InputTokenModal filters and displays Solana tokens correctly
  • intentList handles Solana order types without crashing (32-byte token addresses, Solana-origin order IDs)

Infrastructure

  • Bigint-safe serializeOrder / deserializeOrder for DB storage (PGLite doesn't survive native JSON.stringify of bigints)
  • solanaAddressToBytes32 and isValidSolanaAddress utilities
  • vite-plugin-node-polyfills for @solana/web3.js browser compatibility
  • input_settler_escrow ABI added

Also closes

  • Solana wallet connect UI (V2-117)
  • Solana Recipient field (V2-108)

Test plan

  • Select a Solana output token (e.g. USDC on Solana Devnet) in IssueIntent — Solana recipient field appears and submit is disabled until a valid Base58 address is entered
  • Connect Phantom/Solflare via the Solana Wallet button — balance updates
  • Enter an invalid address → field shows error state, button stays disabled
  • Issue an EVM→Solana intent → order appears in IntentList without crashing
  • bun testsolanaUtils and orderSerialization unit tests pass
  • bun run check — no TypeScript errors

Expected output

Screen.Recording.2026-04-05.at.9.36.42.PM.mov

- Add Solana chain config, program IDs, and PDAs
- Add Solana wallet connection (Phantom/Solflare)
- Add EVM→Solana intent construction with Solana output recipient
- Add Solana token balance fetching
- Add bigint-safe order serialization for DB storage
- Add input_settler_escrow ABI
- Add Solana address utilities and unit tests
Adds Solana-aware orderId computation and token address handling
to intentList so EVM→Solana orders (and any previously stored
Solana→EVM orders) display without crashing.
@Asem-Abdelhady Asem-Abdelhady force-pushed the asem/V2-111/evm-to-solana-intents branch from 0f1f294 to 9ddfa3a Compare April 5, 2026 08:25
… unused dep

- Require non-empty valid Base58 address before Solana output can be submitted
- Extract SOLANA_DEVNET_RPC / SOLANA_MAINNET_RPC as named constants
- Add AbortSignal timeout (10 s) to getSolanaBalance RPC calls; return null on
  error so callers can distinguish 'zero balance' from 'RPC unavailable'
- Fix allowance-skip: EVM inputs always need allowance even when hasSolanaOutput
- Replace null-as-unknown-as-string for undeployed mainnet program IDs with
  typed null + requireSolanaProgram() runtime guard that throws a clear message
- Replace inline dynamic import type in intentList.ts with top-level import type
- Replace manual hex→Uint8Array loop with Buffer.from(hex, 'hex')
- Drop unused @solana/spl-token dependency — token balances are fetched directly
  via connection.getParsedTokenAccountsByOwner() from @solana/web3.js; removing
  it eliminates the bigint-buffer@1.1.5 (CVE-2025-3194) transitive dep entirely
- Update .claude/CLAUDE.md PDA values to match catalyst-intent-svm test fixtures
@Asem-Abdelhady Asem-Abdelhady force-pushed the asem/V2-111/evm-to-solana-intents branch from 934147d to 2c812d9 Compare April 5, 2026 19:09
Solana chain outputs cannot be queried or filled via an EVM client.
Filter them out of the fill-status effect and show a static disabled
Fill button so the UI does not throw or log warnings.
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