Skip to content

Monorepo implementation, resolves FRONT-597 - #1498

Merged
arentant merged 733 commits into
devfrom
dev-monorepo
Jul 28, 2026
Merged

Monorepo implementation, resolves FRONT-597#1498
arentant merged 733 commits into
devfrom
dev-monorepo

Conversation

@arentant

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Sep 24, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
layerswap-monorepo-bridge Canceled Canceled Jul 28, 2026 11:54am
layerswapapp Error Error Jul 28, 2026 11:54am
widget-playground Canceled Canceled Jul 28, 2026 11:54am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
layerswap-dynamic-example Ignored Ignored Preview Jul 28, 2026 11:54am
layerswap-explorer-monorepo Ignored Ignored Preview Jul 28, 2026 11:54am
layerswap-explorer-monorepo (sandbox) Ignored Ignored Jul 28, 2026 11:54am

Request Review

@arentant arentant changed the title Monorepo initial implementation Monorepo initial implementation, resolves FRONT-597 Sep 24, 2025
@vercel

vercel Bot commented Sep 29, 2025

Copy link
Copy Markdown

Deployment failed with the following error:

The `vercel.json` schema validation failed with the following message: should NOT have additional property `rootDirectory`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

@vercel

vercel Bot commented Sep 29, 2025

Copy link
Copy Markdown

Deployment failed with the following error:

The `vercel.json` schema validation failed with the following message: should NOT have additional property `projects`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

arentant and others added 30 commits July 22, 2026 15:33
…idget internals

Every chain package's create*Connection factory reimplemented the same
~40-line cycle: compute snapshot inputs, compare by identity, rebuild the
provider snapshot only on change, notify the store only on a new reference,
plus subscription wiring and teardown. A memoization fix in one copy would
never propagate to the other seven.

Add createMemoizedConnectionStore to @layerswap/widget/internal (next to its
hook-based twin createConnectionStoreFromHook — no new dependency edges, all
wallet packages already import from that subpath) and migrate the eight
vanilla-store factories (evm, svm, bitcoin, fuel, starknet, ton, tron,
paradex) to declare only computeInputs / buildSnapshot / subscribe /
onUpdateProps / onDestroy. Per-recompute side effects (EVM/SVM registry
configure) stay in buildSnapshot, which runs exactly when the old recompute
path did; Starknet's dispose moves to onDestroy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…es, split Paradex service

- Add a WalletConnectionService interface to @layerswap/widget/types and
  implement it in all 8 chain *ConnectionService classes, so a missing or
  renamed core method fails at compile time instead of breaking the
  create*Connection factory at runtime.
- Move the WalletConnectConfig type to @layerswap/widget/types; the EVM and
  SVM packages now re-export the shared definition instead of each keeping
  a verbatim copy that could silently drift.
- Extract ParadexAccountMapper from ParadexConnectionService: the persisted
  L1 <-> Paradex account mapping, selected-account state, address integrity
  validation, and active-connection resolution now live in an SDK-free class,
  leaving the service with provider coordination and SDK connect flows only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Gate the destination auto-connect effect on useProvidersConnectReady so it
  can't open an unscoped wallet modal (and permanently mark the destination
  as prompted) before the destination's provider hydrates.
- Compare array fields element-by-element in shallowEqualProvider so the
  first hook-based provider adapted through createConnectionStoreFromHook
  doesn't broadcast a store update on every parent render.
- Memoize additionalConnectorsStore snapshots on their inputs (cached pages
  and recents identity) and skip listener notification when nothing changed,
  preserving the identity-based memoization in EVM/SVM connection snapshots.
- Apply button role/tabIndex/keyboard handling in AddressPickerItem only when
  onClick is passed, so the AddressBook usage inside cmdk's role="option"
  item no longer nests an interactive control or leaves a dead Tab stop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…live list

connect() freezes a provider snapshot in state, and ConnectorsList re-resolved
it against filteredProviders — which excludes hideFromList providers like
Paradex. A Paradex-scoped modal opened before its EVM/Starknet peers published
their connectors was stuck with the empty snapshot until closed and reopened.
Resolve against the full live provider list from useWallet instead, so the
modal re-renders in place as connectors arrive.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The L1 -> Paradex account mapping is persisted (ls-paradex-accounts), but the
Paradex descriptor never declared a hasPersistedSession probe, so a refreshed
page never hydrated the lazy provider and the restored wallet stayed invisible
until the connect modal forced a load. Probe the persisted store's partialized
payload (mapping contents, not key presence — the key exists for every
visitor) so LayerswapProvider's phase-2 hydration loads Paradex on mount, the
same way Bitcoin/Starknet/TON/SVM/Fuel sessions resurface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e claim

The `hasPersistedSession` comments in the paradex and starknet descriptors
claimed the persisted key "exists for every visitor once the store hydrates";
zustand v4's persist only writes on migration or on a store write, so the key
appears after any wallet-store set(), not on hydration. Restate the actual
constraint (key presence isn't a session signal) and cut the narration-heavy
comments in imtblPassport/persistedSession down to their load-bearing facts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
refactor(wallets): migrate chain wallet providers to class + Zustand stores
some fixes related to tron wallet detection. connection and reconnection
…ect modal

The wallet list is fed by several async sources (lazy ecosystem SDK
chunks, per-namespace WalletConnect Explorer fetches), and the modal made
decisions from incomplete snapshots:

- The multichain ecosystem picker rendered the variants array frozen at
  click time, so ecosystems that settled later (e.g. MetaMask's Solana
  side) never appeared. The picker now re-derives variants live and keeps
  whichever version knows more.
- Multichain-ness had two disagreeing definitions (tile-level registry
  chains synthesis vs click-time availableConnectors name scan). Both now
  go through resolveChainConnectors via getLiveVariants(), scoped to the
  modal's featured providers so scoped connects never offer foreign
  ecosystems.
- Provider `ready` never covered the WalletConnect registry fetch. The
  page-1 browse fetch now has a tracked status (idle/loading/ready/error)
  plus a deduped, retryable ensureBrowseLoaded(), and awaitProvidersSettled
  gates on it (timeout 1200ms -> 3000ms to absorb the network round-trip).
- Registry page-1 fetches are prefetched on connect-button hover/focus and
  on modal open, re-fired after descriptor hydration since that can
  instantiate new namespace stores.
- The tile grid shows a bounded loading tail while any source is still
  publishing and a retry row when a registry fetch failed, instead of
  silently reading as complete.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The deposit widget derived hasWalletMethods from the wallet-providers
registry, which is only populated in WalletProvidersProvider's post-commit
effect. On first paint the registry was always empty, so the step stack
rooted on transfer-crypto (easy deposit) and re-rooted to method-picker one
effect tick later — a visible flash of the wrong flow on every load.

Expose the fact the decision actually needs — "did the integrator configure
any wallet-connection providers" — via a render-time context computed from
the walletProviders prop (mirroring exactly which providers produce a
registry entry), and use it in DepositStepProvider. The first render (and
SSR) now roots the stack on the correct step directly; the re-root effect
remains as the safety net for runtime provider-list changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hydrate

A partially-hydrated wallet list invites clicks that commit to the one
loaded ecosystem before a wallet's other ecosystems are known (MetaMask
-> EVM-only connect with no ecosystem picker). Instead of deciding from
an incomplete snapshot:

- Block the connector grid with a skeleton (tiles mirroring the real
  Connector geometry, so nothing jumps) while any featured provider is
  still a stub or not ready. Bounded at 5s so a broken SDK chunk can't
  lock the modal; past the deadline the list renders progressively with
  the existing loading tail.
- Registry (WalletConnect API) wallets never block - they only append
  tiles, so they keep the progressive tail and the retry row.
- Fold the gate into isListVisible so the load-more IntersectionObserver
  re-attaches when the sentinel mounts after the gate lifts.
- Show a "Checking for more networks..." row in the multichain ecosystem
  picker while sources are still settling, so late-appearing ecosystem
  rows read as loading instead of popping in silently.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

3 participants