Skip to content

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

Merged
reednaa merged 5 commits intodevelopfrom
asem/V2-109/accommodate-intent.ts-solana-changes
May 6, 2026
Merged

Accommodate intent.ts standardise-order-classes API changes#39
reednaa merged 5 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 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: 0bd12ba0-6131-47d1-8f4b-c260d6c494e7

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 asem/V2-109/accommodate-intent.ts-solana-changes

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.

…changes

Resolve merge conflicts caused by tab-to-spaces reformatting on develop
(Mobile fixes #32). Accept develop's formatting and functional additions
(same-chain timings, wallet connectors, token management), then re-apply
PR #39's API migration (containerToIntent wrapper, Solana gating,
recipient field, @lifi/intent v0.0.4).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🚀 Preview deployed!

Worker: lintent-pr-39
URL: https://lintent-pr-39.li-fi374.workers.dev

@reednaa reednaa merged commit c696007 into develop May 6, 2026
7 checks passed
@reednaa reednaa deleted the asem/V2-109/accommodate-intent.ts-solana-changes branch May 6, 2026 13:17
@lifi-qa-agent
Copy link
Copy Markdown

lifi-qa-agent Bot commented May 6, 2026

🔍 QA Review — V2-109

🔗 Linear Ticket · PR #3 intent.ts · PR #39 lintent

⚠️ Note: No write access to lifinance/lintent or lifinance/intent.ts — formal GitHub review actions (CHANGES_REQUESTED / APPROVE) are blocked. All findings posted as plain comments.

🧠 What this ticket does

Extends the @lifi/intent library with Solana support, adding StandardSolana order type, Borsh serialization matching catalyst-intent-svm's layout, and StandardSolanaIntent class. Also adapts lintent.org (the demo app) to the updated intent.ts v0.0.4 API: renames StandardOrderIntentStandardEVMIntent, and wraps the changed orderToIntent() call in a containerToIntent() helper that auto-detects namespace from originChainId.

Verdict: Needs Work — 1 High (.claude/settings.local.json committed in violation of .gitignore), 1 Medium (containerToIntent() dispatch has no unit test in lintent PR #39).


📋 Ticket Summary

Add Solana as a pure order on @lifi/intent (intent.ts)

Acceptance Criteria:

  1. Intent structures handle a Solana originating Intent — ✅ Met (StandardSolanaIntent, StandardSolana type, Borsh encoding in intent.ts PR Support Polymer Allocator and improve project structure #3; evidence: src/intent/solanaStandard.ts, src/types/order.ts)
  2. Intent structures handle an EVM originating intent — ✅ Met (StandardEVMIntent, StandardEVM type; evidence: src/intent/standard.ts, src/types/order.ts)
  3. Only touch Same-chain intents — ⚠️ Partial — intent.ts PR Support Polymer Allocator and improve project structure #3 also adds EVM→Solana output routing in buildMandateOutputs. If "same-chain" means single-origin StandardOrder (vs MultichainOrder), this is met. If it means same-chain origin and destination, EVM→Solana cross-chain outputs may exceed scope. Clarification from ticket author requested.

🏷️ PR Naming


✅ Ticket Coverage — High (intent.ts PR #3) / Medium (lintent PR #39)

intent.ts PR #3: Comprehensive — StandardSolana type, Borsh encoding, output routing, outputRecipient option, chainNamespace on CoreToken. Tests in solanaStandard.spec.ts (271 lines), output-encoding.spec.ts, shared.spec.ts, fromOrder.spec.ts cover encoding golden values, mutation tests, u32 overflow guards, PDA routing, and error paths.

lintent PR #39: Adapts 10 call sites from orderToIntent()containerToIntent(). The new src/lib/utils/intent.ts dispatch helper has no dedicated unit test. The only test in the PR (recipientField.test.ts) tests the recipient field (V2-116 feature, stacked on this branch).


⚠️ Issues Found (2)

# Severity Type Issue / File
1 🔴 High Code .claude/settings.local.json committed — violates .gitignore; must be removed — lintent PR #39
2 🟠 Medium Test gap containerToIntent() dispatch logic has no unit test — src/lib/utils/intent.ts (new)

🔴 [High] .claude/settings.local.json committed — violates .gitignore

lintent PR #39 adds .claude/settings.local.json to the repository. The repo's own .gitignore contains .claude and .claude/* — this file should never have been tracked. It contains internal Claude Code tool permission allowlists (Bash command patterns) and is a local developer artifact with no relevance to the codebase.

Fix: Remove .claude/settings.local.json from the PR. Run git rm --cached .claude/settings.local.json to untrack it, then amend or add a commit. Verify git check-ignore -v .claude/settings.local.json confirms it is gitignored.

🟠 [Medium] containerToIntent() dispatch logic has no unit test — src/lib/utils/intent.ts (new)

src/lib/utils/intent.ts adds a SOLANA_CHAIN_IDS set and a dispatch function that routes to StandardEVMIntent, StandardSolanaIntent, or MultichainOrderIntent based on originChainId. This is the critical namespace-detection path used by 10 call sites across the app. The only test in the PR (recipientField.test.ts) does not cover this module.

Missing tests (add to tests/unit/containerToIntent.test.ts (new)):

  • Solana devnet chainId → returns StandardSolanaIntent
  • Solana mainnet chainId → returns StandardSolanaIntent
  • EVM chainId (e.g. 1n for Ethereum) → returns StandardEVMIntent
  • Multichain input settler → returns MultichainOrderIntent

🧪 Test Coverage

Layer Score Files reviewed
Unit Partial (lintent) / Good (intent.ts) solanaStandard.spec.ts, output-encoding.spec.ts, shared.spec.ts, fromOrder.spec.ts, standard.spec.ts, recipientField.test.ts
Integration N/A UI and library — no DB/worker interactions
E2e N/A Manual test plan partially complete (intent creation unchecked)

Unit gaps:


🔗 Downstream Impact

Related to V2-108 (Lintent.org Solana). V2-116 (Add Recipient field on lintent.org, lintent PR #41) is stacked on this branch and must wait for V2-109 to merge first.


QA Agent (lifi-qa-agent[bot]) — 2026-05-06

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.

2 participants