Skip to content

feat: support Solana→EVM intent issuing#38

Open
Asem-Abdelhady wants to merge 1 commit intoasem/V2-111/evm-to-solana-intentsfrom
asem/V2-112/solana-to-evm-intents
Open

feat: support Solana→EVM intent issuing#38
Asem-Abdelhady wants to merge 1 commit intoasem/V2-111/evm-to-solana-intentsfrom
asem/V2-112/solana-to-evm-intents

Conversation

@Asem-Abdelhady
Copy link
Copy Markdown

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

What

Adds support for Solana→EVM intent issuing: a user with a Solana wallet can lock SPL tokens on Solana devnet and specify an EVM address to receive the output on any supported EVM chain.

This PR stacks on top of #37 (EVM→Solana), which must merge first.

Changes

New: solanaEscrowLib.ts

  • openSolanaEscrow() calls input_settler_escrow.open() on Solana via the Anchor program
  • Derives PDAs (polymer, input_settler_escrow, order_context) from config constants
  • Computes orderId = keccak256(borsh(StandardOrder)) to match the Rust derive_id() logic
  • Wraps the 60 s confirmation wait in Promise.race with a descriptive timeout error
  • Borsh encode call wrapped in try/catch so IDL mismatches surface with context

Updated: intentFactory.ts

  • New isSolanaChain(inputChain) branch in openIntent() calls openSolanaEscrow and saves the order with the Solana input settler address
  • outputRecipient defaults to account() (connected EVM wallet) if not provided

Updated: IssueIntent.svelte

  • EVM recipient input field appears when the input chain is Solana and the output is EVM
  • Tri-state submit guard: blocks on missing Solana wallet, invalid EVM recipient, or insufficient balance

Tests

  • 4 unit tests for openSolanaEscrow: empty inputs guard, happy path, Borsh encode error, and 60 s timeout

Out of scope

Proof relay and claim for Solana→EVM intents are not implemented in this PR. Once the escrow is opened on Solana, the ReceiveMessage screen renders disabled buttons with a TODO comment. The validate/claim step (relaying through the Polymer oracle to the EVM input settler) is tracked separately.

Test plan

  • Connect a Solana wallet (Phantom / Solflare) on devnet
  • Select a Solana input token (SOL or USDC) and an EVM output token on a supported testnet
  • Confirm the EVM Recipient field appears and validates the address
  • Submit — verify the Solana transaction lands on devnet explorer and the order appears in IntentList
  • Confirm the Fill screen shows a disabled Fill button for EVM→Solana output rows (covered by feat: EVM → Solana intent issuing #37)
  • Run bun run test:unit — 32 pass, 0 fail

Closes: V2-112

Expected output

Screen.Recording.2026-04-06.at.6.44.18.AM.mov

@Asem-Abdelhady Asem-Abdelhady force-pushed the asem/V2-112/solana-to-evm-intents branch from 6e0298e to 9fac2da Compare April 6, 2026 05:13
- Add solanaEscrowLib to open escrow on Solana chain via Anchor program
- Add Solana input chain branch in intentFactory using openSolanaEscrow
- Add EVM recipient field in IssueIntent for Solana→EVM intents
- Update flowProgress, intentList, Finalise, ReceiveMessage to handle StandardSolanaIntent type
@Asem-Abdelhady Asem-Abdelhady force-pushed the asem/V2-112/solana-to-evm-intents branch from 9fac2da to 62820bb Compare April 6, 2026 05:19
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