Skip to content

Accommodate intent.ts standardise-order-classes API changes#39

Open
Asem-Abdelhady wants to merge 3 commits intodevelopfrom
asem/V2-109/accommodate-intent.ts-solana-changes
Open

Accommodate intent.ts standardise-order-classes API changes#39
Asem-Abdelhady wants to merge 3 commits intodevelopfrom
asem/V2-109/accommodate-intent.ts-solana-changes

Conversation

@Asem-Abdelhady
Copy link
Copy Markdown

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

Context

The intent.ts package refactored its class hierarchy, introducing two breaking changes:

  1. orderToIntent() signature changed — now requires an explicit { namespace, inputSettler, order } object instead of accepting an OrderContainer directly. The namespace field ("eip155" | "solana") determines which intent class to instantiate.

  2. StandardOrderIntent renamed to StandardEVMIntent — the class was renamed to reflect that it's EVM-specific.

  3. idToToken removed from the public exports — was used to extract a token address from a compact lock ID.

Changes

  • src/lib/utils/intent.ts (new)containerToIntent(container: OrderContainer): OrderIntent wrapper that auto-detects namespace from the order's originChainId (Solana chain IDs → "solana", everything else → "eip155") and calls orderToIntent with the correct shape.

  • All orderToIntent(container) call sites replaced with containerToIntent(container) across 10 files (state.svelte.ts, flowProgress.ts, solver.ts, intentList.ts, +page.svelte, and all affected screens).

  • intentExecution.ts — imports StandardEVMIntent as StandardOrderIntent to preserve all existing instanceof checks without cascading renames.

  • intentList.ts — local idToToken() implementation (lower 160 bits of the compact lock ID = token address), replacing the removed library export.

Test plan

  • App loads without runtime errors
  • Existing EVM orders load from IndexedDB and display correctly in IntentList
  • Order IDs resolve correctly (no orderId() crashes)
  • Intent issuance (escrow + compact) works end-to-end
  • Finalise / claim flow works for existing orders

Expected output for standard and multichains outputs

Screen.Recording.2026-04-07.at.11.31.00.AM.mov

@Asem-Abdelhady Asem-Abdelhady requested a review from reednaa April 7, 2026 09:34
- add containerToIntent() helper in utils/intent.ts that wraps orderToIntent
  with automatic namespace detection (solana vs eip155) from OrderContainer
- replace all orderToIntent(container) call sites with containerToIntent()
- alias StandardOrderIntent as StandardEVMIntent in intentExecution.ts
- add local idToToken() in intentList.ts (removed from @lifi/intent exports)
- Bump @lifi/intent from 0.0.3-alpha.1 to 0.0.4
- Add chainNamespace field to CoreToken in toCoreTokenContext
- Fix containerToIntent: use 'in' narrowing for proper TypeScript overload resolution
- Add StandardSolanaIntent guards in IntentFactory compact/escrow methods
- Add StandardSolanaIntent guard in Solver.claim before finaliseIntent
@Asem-Abdelhady Asem-Abdelhady force-pushed the asem/V2-109/accommodate-intent.ts-solana-changes branch from 590ef83 to 0e50986 Compare April 7, 2026 10:27
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