Skip to content

feat: add Stellar (STL) wallet support - #827

Open
chybisov wants to merge 13 commits into
mainfrom
feature/emb-463-stellar-add-support-on-widgetsdk
Open

feat: add Stellar (STL) wallet support#827
chybisov wants to merge 13 commits into
mainfrom
feature/emb-463-stellar-add-support-on-widgetsdk

Conversation

@chybisov

@chybisov chybisov commented Jul 13, 2026

Copy link
Copy Markdown
Member

🔗 Linear: EMB-463 · Stellar: Add support on widget/SDK

Part of EMB-463 — client-side Stellar support for the widget. Blocked by lifinance/sdk#427 (publish @lifi/sdk-provider-stellar).

What

  • New @lifi/widget-provider-stellar using Stellar Wallets Kit v2.5.0, base StellarContext + useSDKProviders wiring, wallet-management integration (useAccount, useCombinedWallets, StellarListItemButton, connect-menu), widget provider enablement, and playground wiring.
  • Install-gated wallet set (shown only when installed): Freighter, Rabet, Hana, Lobstr, Klever, OneKey, Bitget, and xBull (gated to window.xBullSDK); WalletConnect offered when a project id is configured. Albedo + HOT excluded (always-on / no install state).
  • Stellar is gated out of the route selector until execution lands.

Verified locally

✅ type-checks across packages; dev playground renders and the connect menu lists the installed Stellar wallets without runtime errors.

Blocked by / notes

Introduce @lifi/widget-provider-stellar (Stellar Wallets Kit v2.5.0), the base StellarContext + useSDKProviders wiring, wallet-management integration (useAccount, useCombinedWallets, StellarListItemButton, connect-menu switch), and enable the Stellar ecosystem in the widget wallet providers. Stellar is gated out of the route selector until execution lands.

Install-gated wallets (shown only when installed): Freighter, Rabet, Hana, Lobstr, Klever, OneKey, Bitget, and xBull (gated to window.xBullSDK); WalletConnect offered when a project id is configured. Albedo and HOT are excluded (always-on / no install state).

Depends on @lifi/sdk-provider-stellar being published; lockfile update follows once it lands on npm.
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 851052f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@lifi/widget-provider-stellar Minor
@lifi/widget-provider Minor
@lifi/wallet-management Minor
@lifi/widget Minor
@lifi/widget-checkout Patch
@lifi/widget-provider-bitcoin Patch
@lifi/widget-provider-ethereum Patch
@lifi/widget-provider-mesh Major
@lifi/widget-provider-solana Patch
@lifi/widget-provider-sui Patch
@lifi/widget-provider-transak Major
@lifi/widget-provider-tron Patch
vite-iframe Patch
connectkit Patch
dynamic Patch
nft-checkout Patch
privy-ethers-example Patch
privy Patch
rainbowkit Patch
reown Patch
vite-project Patch
deposit-flow Patch
nextjs Patch
nextjs15 Patch
svelte Patch
tanstack-router-example Patch
vue Patch
zustand-widget-config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

⚠️ E2E Playground — no results

The build or test run did not produce any test data (build failed or run was cancelled).

See the workflow run for details.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

✅ E2E Dev Smoke — passing

Check Result
Dev server start (pnpm dev) ✅ started
Smoke tests ✅ passed

4 passed · 0 failed · 0 skipped · 32s

View run

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

E2E Examples — all passed

All examples passed in the latest run.

chybisov and others added 2 commits July 15, 2026 10:53
Temporarily pin the widget packages' @lifi/sdk and @lifi/sdk-provider-*
deps to the sdk#427 preview build (0.0.0-preview-5e098f3) so CI can
install and build against the unreleased @lifi/sdk-provider-stellar
(its first npm publish). Replace with the real release versions before
merge. examples/ + e2e are untouched (they consume the published
@lifi/widget).

This is the first successful install on the branch, so the lockfile is
regenerated (the Stellar subtree was never locked) and 5 native
build-script deps pnpm flagged (@stellar/stellar-sdk, secp256k1,
tiny-secp256k1, blake-hash, usb) are set to allowBuilds: false, matching
the existing browser-bundle convention.

Verified: pnpm install --frozen-lockfile, pnpm check:types, and pnpm
build all pass.
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

E2E Playground results

passed  158 passed

Details

stats  158 tests across 10 suites
duration  2 minutes, 31 seconds
commit  851052f

📥 Download full HTML report (open the run → Artifacts → playwright-report)

chybisov added 6 commits July 15, 2026 12:44
Add ChainType.STL to supportedChainTypes in useAvailableChains so the
widget requests Stellar chains from getChains and they become available
in the route selector. Removes the Phase-1 gate that omitted STL.
Add ChainType.STL to the verified and search token chainTypes in
useTokens so getTokens returns Stellar tokens, matching the getChains
change.
Stellar wallets are connectable, so the ecosystem switches must cover
STL:
- useChainTypeFromAddress: detect Stellar addresses via the Stellar
  provider's isAddress, returning ChainType.STL.
- useAccountDisconnect: add the ChainType.STL case so disconnecting a
  Stellar wallet actually calls the Stellar provider's disconnect
  instead of silently no-opping.
Add the Stellar entry (ChainType.STL, ChainId.XLM, stellar.svg) to
chainTypeIcons so Stellar chains group under the ecosystem avatar
instead of falling back to individual chain logos.
The Phase-1 gate was removed earlier in this branch, so the changeset's
claim that Stellar is not yet selectable no longer matches the code.
Resolves the merge by taking main's newer pnpm-workspace.yaml (its trimmed
minimumReleaseAgeExclude and overrides) and re-adding only the Stellar-specific
allowBuilds entries: @stellar/stellar-sdk plus the native hardware-wallet deps
the Stellar Wallets Kit's Trezor tree pulls in.

Repins every @lifi/sdk* package to 0.0.0-preview-207d898, which is the first
preview carrying StellarStepExecutor — the previous pin (5e098f3) shipped a
getStepExecutor that throws. All @lifi/sdk* pins must move together: the
provider tarballs hard-pin @lifi/sdk to their own preview version, and a second
copy of @lifi/sdk breaks route execution because executionState is a
module-level singleton. Example pins are deliberately left on published
versions.

Also pins @reown/appkit to an exact 1.8.23 instead of >=1.8.20: the Stellar
Wallets Kit tree otherwise drags in a second appkit minor, and two appkit copies
mean two AppKitNetwork type identities.

Known gap: widget-playground{,-vite} check:types still reports 2 errors in
ReownWalletProvider.tsx. appkit resolves viem under [email protected] while the
widget resolves it under 7.0.2, so AppKitNetwork and the widget's chain objects
are different type identities. Both are private packages and neither ships. A
blanket typescript override fixes it but breaks madge, whose
@typescript-eslint/typescript-estree peer-caps at typescript <6.1.0.
@chybisov
chybisov marked this pull request as ready for review July 29, 2026 10:38
Comment thread pnpm-lock.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CVE-2026-41242 in protobufjs - critical severity
protobufjs compiles protobuf definitions into JavaScript (JS) functions. In versions prior to 8.0.1 and 7.5.5, attackers can inject arbitrary code in the "type" fields of protobuf definitions, which will then execute during object decoding using that definition. Versions 8.0.1 and 7.5.5 patch the issue.

Details

Remediation Aikido suggests bumping this package to version 7.5.5 to resolve this issue

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

// Module-level singleton — the kit + connection state are shared across the app,
// mirroring the Solana wallet-standard store. The config from the first mount
// wins (it is stable for the lifetime of the app).
let store: StellarWalletsKitStore | undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module-level variable 'store' caches mutable store state across imports; avoid request-scoped data in globals or make intentional shared cache explicit.

Details

✨ AI Reasoning
​A module-level mutable variable is declared to hold the store singleton and is used to cache the store instance for reuse. This means state (selected wallet, address, connected flag, etc.) can persist across uses of the module. In long-running server processes (Node.js) such globals persist between requests and users, potentially leaking user-specific data or causing race conditions. The pattern creates a shared in-memory singleton rather than request-scoped state.

🔧 How do I fix it?
Avoid storing request-specific data in module-level variables. Use request-scoped variables or explicitly mark shared caches as intentional.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

chybisov and others added 4 commits July 29, 2026 12:45
…orkspace

widget-provider-stellar was the only package declaring typescript ^6.0.3; every
sibling declares ^7.0.2. That second typescript in the workspace made pnpm
resolve viem twice — once per typescript peer — so @reown/appkit and the widget
held different viem type identities and AppKitNetwork stopped accepting the
widget's chain objects. check:types failed in widget-playground and
widget-playground-vite as a result.

viem now resolves to a single snapshot and all 17 packages type-check.

This also removes the need for the @reown/appkit exact pin added earlier as a
workaround, so pnpm-workspace.yaml overrides are identical to main again — the
only remaining diff there is the Stellar allowBuilds entries.
Matches the SDK branch head. The previous pin (207d898) predated the
@stellar/stellar-sdk ^16.1.0 range bump, so the published sdk-provider-stellar
tarball declared a range the branch no longer used.

All seven @lifi/sdk* pins move together, as they must: the provider tarballs
hard-pin @lifi/sdk to their own preview version, and a second copy of @lifi/sdk
breaks route execution because executionState is a module-level singleton.
Verified one copy resolves across widget, widget-provider-stellar and
wallet-management. Example pins stay on published versions.
Matches the SDK branch head (lifinance/sdk#427, c3280231), which refines the
Stellar approval handling. The previous pin (3a18dab) predated that commit.

All seven @lifi/sdk* pins move together, as they must: the provider tarballs
hard-pin @lifi/sdk to their own preview version, and a second copy of @lifi/sdk
breaks route execution because executionState is a module-level singleton.
Verified one copy resolves across widget, widget-provider, widget-provider-stellar
and wallet-management. Example pins stay on published versions.
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