Accommodate intent.ts standardise-order-classes API changes#39
Open
Asem-Abdelhady wants to merge 3 commits intodevelopfrom
Open
Accommodate intent.ts standardise-order-classes API changes#39Asem-Abdelhady wants to merge 3 commits intodevelopfrom
Asem-Abdelhady wants to merge 3 commits intodevelopfrom
Conversation
- 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
590ef83 to
0e50986
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The
intent.tspackage refactored its class hierarchy, introducing two breaking changes:orderToIntent()signature changed — now requires an explicit{ namespace, inputSettler, order }object instead of accepting anOrderContainerdirectly. Thenamespacefield ("eip155"|"solana") determines which intent class to instantiate.StandardOrderIntentrenamed toStandardEVMIntent— the class was renamed to reflect that it's EVM-specific.idToTokenremoved 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): OrderIntentwrapper that auto-detects namespace from the order'soriginChainId(Solana chain IDs →"solana", everything else →"eip155") and callsorderToIntentwith the correct shape.All
orderToIntent(container)call sites replaced withcontainerToIntent(container)across 10 files (state.svelte.ts,flowProgress.ts,solver.ts,intentList.ts,+page.svelte, and all affected screens).intentExecution.ts— importsStandardEVMIntent as StandardOrderIntentto preserve all existinginstanceofchecks without cascading renames.intentList.ts— localidToToken()implementation (lower 160 bits of the compact lock ID = token address), replacing the removed library export.Test plan
orderId()crashes)Expected output for standard and multichains outputs
Screen.Recording.2026-04-07.at.11.31.00.AM.mov