Skip to content

Comments

feat(wallet): expose kit/network in context and wire NEXT_PUBLIC_STEL…#295

Merged
davedumto merged 1 commit intoStreamFi-x:devfrom
akintewe:issue-231-stellar-wallet-provider
Feb 25, 2026
Merged

feat(wallet): expose kit/network in context and wire NEXT_PUBLIC_STEL…#295
davedumto merged 1 commit intoStreamFi-x:devfrom
akintewe:issue-231-stellar-wallet-provider

Conversation

@akintewe
Copy link
Contributor

Summary

This PR completes the migration from StarkNet to Stellar by replacing StarknetConfig with a custom StellarWalletProvider React context, and wiring up network configuration via environment variable.

Changes

contexts/stellar-wallet-context.tsx

  • Initialized StellarWalletsKit with allowAllModules() (Freighter, xBull, Albedo, Lobstr, etc.)
  • Network resolved from NEXT_PUBLIC_STELLAR_NETWORK env var at module load: "pubnet"WalletNetwork.PUBLIC, anything else (including unset) → WalletNetwork.TESTNET
  • Created StellarWalletContext React context exposing:
    • kit — the StellarWalletsKit instance (for signing transactions)
    • publicKey / address — connected wallet's Stellar public key (string | null)
    • isConnected — boolean connection state
    • status"connected" | "disconnected" | "connecting"
    • connect() — opens the built-in wallet selection modal
    • disconnect() — clears connection state and localStorage
    • network — active WalletNetwork value
    • isConnecting / isLoading / error — UI state helpers
  • Auto-connect on mount: restores the last-used wallet from localStorage silently on page load
  • Exported useStellarWallet() hook with a guard error if used outside the provider

components/providers.tsx

  • All @starknet-react imports removed
  • StarknetConfig replaced with StellarWalletProvider
  • Provider hierarchy maintained: StellarWalletProvider > ThemeProvider > AuthProvider > children

Acceptance Criteria

  • StarknetConfig completely removed from providers.tsx
  • contexts/stellar-wallet-context.tsx created
  • StellarWalletProvider wraps the app in providers.tsx
  • Stellar Wallets Kit initialized with allowAllModules() (Freighter, xBull, Albedo, Lobstr, etc.)
  • Network configurable via NEXT_PUBLIC_STELLAR_NETWORK env var (testnet / pubnet)
  • Context exposes: kit, publicKey, isConnected, connect(), disconnect(), network
  • useStellarWallet() hook exported and usable from any component
  • Provider hierarchy: StellarWalletProvider > ThemeProvider > AuthProvider > children
  • No @starknet-react imports remain in providers.tsx

Environment Variable

Add to your .env.local:

# "pubnet" for production, omit or set to anything else for testnet
NEXT_PUBLIC_STELLAR_NETWORK=testnet

Closes #231

…LAR_NETWORK

- Resolve NEXT_PUBLIC_STELLAR_NETWORK at module load: "pubnet" maps to
  WalletNetwork.PUBLIC, anything else (including unset) defaults to TESTNET
- Pass the resolved network constant into StellarWalletsKit constructor
  instead of the previous hardcoded WalletNetwork.TESTNET
- Add kit (StellarWalletsKit instance) and network (WalletNetwork) to
  StellarWalletContextType and the Provider value so consumers can sign
  transactions and inspect the active network without prop-drilling
@vercel
Copy link

vercel bot commented Feb 24, 2026

@akintewe is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davedumto
Copy link
Contributor

Hi @akintewe Loom video needed

@akintewe
Copy link
Contributor Author

@davedumto this is it.

Screen.Recording.2026-02-25.at.8.39.00.AM.mov

@akintewe
Copy link
Contributor Author

@davedumto this is it.

Screen.Recording.2026-02-25.at.8.39.00.AM.mov

Screenshot 2026-02-25 at 8 46 15 AM

@davedumto davedumto merged commit ad875d5 into StreamFi-x:dev Feb 25, 2026
4 of 5 checks passed
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.

Create Stellar Wallet Provider to replace StarknetConfig

2 participants