Skip to content

Extract intent library, migrate wallet connector, and overhaul test suite#25

Open
reednaa wants to merge 17 commits intomainfrom
develop
Open

Extract intent library, migrate wallet connector, and overhaul test suite#25
reednaa wants to merge 17 commits intomainfrom
develop

Conversation

@reednaa
Copy link
Member

@reednaa reednaa commented Mar 3, 2026

Summary

  • Extract @lifi/intent package: Core logic from the monolithic intent.ts (923 lines) and orderServer.ts (564 lines) has been extracted into an external @lifi/intent package. Utility functions (idLib, convert, typedMessage, interopableAddresses, orderLib) are now consumed from the package rather than maintained locally.
  • Split remaining library code: What stays in the app is reorganised into focused modules — intentExecution.ts (signing & on-chain execution), intentFactory.ts (order construction), and coreDeps.ts (oracle/settler dependency injection).
  • Migrate wallet connector: Replaced web3-onboard with wagmi (wagmi.ts, walletClient.ts, walletClientRuntime.ts). Chain switching and wallet signing now go through wagmi hooks.
  • Chain ID migration: Removed chain-string identifiers throughout in favour of numeric chainId values, aligning with viem/wagmi conventions.
  • E2E test suite: Added full end-to-end tests for the standard escrow order flow — both a blackbox variant (mock allocator) and a live variant — with a shared bootstrap helper.
  • Unit tests: Added unit tests covering intentList, orderValidationDeps, and wallet-client chain switching. Removed stale orderLib, orderServer, and issuance tests that tested now-extracted code.
  • Monorepo reverted: A mono-repo structure was introduced and then collapsed — the lintent app is back at the top level with a cleaned-up package.json and bun.lock.

Test plan

  • bun test — all unit tests pass
  • bun run test:e2e with .env.e2e populated — blackbox E2E passes
  • Manually exercise connect-wallet → issue intent → fill intent → finalise flow in the browser
  • Confirm wagmi wallet connector works across supported chains (chain switching, signing)

@reednaa reednaa self-assigned this Mar 3, 2026
reednaa added 3 commits March 3, 2026 16:04
# Conflicts:
#	src/lib/libraries/intent.ts
#	src/lib/libraries/orderServer.ts
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