Skip to content

feat: issue solana to evm orders#44

Open
Asem-Abdelhady wants to merge 4 commits intofeature/v2-117-add-solana-wallet-connection-to-the-uifrom
feature/v2-112-issue-solana-to-evm-orders
Open

feat: issue solana to evm orders#44
Asem-Abdelhady wants to merge 4 commits intofeature/v2-117-add-solana-wallet-connection-to-the-uifrom
feature/v2-112-issue-solana-to-evm-orders

Conversation

@Asem-Abdelhady
Copy link
Copy Markdown

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

Summary

  • Add Solana→EVM intent issuance: users on Solana devnet can open escrow intents targeting EVM output tokens
  • Integrate Solana wallet connection (Phantom, Solflare) for transaction signing via @solana/wallet-adapter-*
  • Add openSolanaEscrow in solanaEscrowLib.ts: Anchor-based Borsh encoding, PDA derivation, ATA resolution, and sendAndConfirmSolanaTx submission
  • Add solanaTx.ts: resilient send-and-confirm loop with 30 s timeout, 1 retry on timeout, immediate throw on program errors
  • Guard Solana/EVM input exclusivity in InputTokenModal — cannot mix chains in a single order
  • Route Solana balance checks to store.solanaBalances in IssueIntent.svelte
  • Fix intent-list display for Solana inputs: use full 32-byte mint address instead of idToToken() (EVM-only)
  • Fix containerToIntent routing after JSON round-trip (bigint-as-string from DB)
  • Replace bigint-buffer (CVE-2025-3194) with bigint-buffer-fixed@^1.1.6 via bun overrides

Code changes

File What changed
src/lib/libraries/solanaEscrowLib.ts New: Anchor tx builder for Solana escrow open
src/lib/utils/solanaTx.ts New: resilient send+confirm with retry
src/lib/utils/solana-wallet.svelte.ts New: Svelte 5 reactive Solana wallet state
src/lib/libraries/intentFactory.ts Branch on Solana input chain → call openSolanaEscrow
src/lib/screens/IssueIntent.svelte Skip EVM allowance check for Solana inputs; fix balance check
src/lib/components/InputTokenModal.svelte Enforce Solana/EVM exclusivity on toggle
src/lib/libraries/intentList.ts Fix Solana token display (full 32-byte mint)
src/lib/utils/intent.ts BigInt() coerce originChainId after DB round-trip
src/lib/config.ts Solana devnet chain + tokens + oracle; fix polygon client chain
package.json Add @coral-xyz/anchor; bigint-buffer CVE override

Test plan

  • Run bun run test:unit — all 44 tests pass
  • Testnet: select Solana devnet USDC as input + Base Sepolia USDC as output → intent submits, appears in list with correct amounts
  • Reload page → intent list renders without InvalidAddressError
  • InputTokenModal: enabling Solana chain auto-disables all EVM chains and vice-versa
  • IssueIntent with Solana input: "Execute Open" button shown (not "Set Allow"); balance check uses Solana balance
  • Confirm Solana devnet oracle address in submitted order: outputs[0].oracle = 0xe48a6f95...

Closes

  • V2-117
  • V2-112

Expected output

Screen.Recording.2026-04-08.at.1.00.29.PM.mov

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78f9d580-a421-4f4a-83d5-9d92866bf716

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/v2-112-issue-solana-to-evm-orders

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…stnet guard, timeout, as any, console.log, tests

- Fix polygon public client: chain was incorrectly set to `base`, now `polygon`
- Fix getSolanaConnection: throw on unsupported testnet instead of silently falling through to devnet
- Remove solanaMainnet from chainList(true) and coinList(true) until mainnet programs are deployed
- Raise CONFIRM_TIMEOUT_MS from 5 s to 30 s to reduce spurious retries on congested slots
- Narrow `as any` casts in solanaEscrowLib.ts: typed anchorWallet with Transaction/VersionedTransaction generics, removed unnecessary `connection as any`, consolidated eslint-disable comments
- Remove pre-existing console.log from intentFactory.ts compact signing path
- Add tests/unit/solanaEscrowLib.test.ts: empty-inputs guard and Borsh encoding error wrapping
@Asem-Abdelhady Asem-Abdelhady requested a review from reednaa April 8, 2026 11:03
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