Skip to content

Comments

#20 Add Universal Stellar Wallet Connect Support#33

Open
Wetshakat wants to merge 1 commit intoSudiptaPaul-31:mainfrom
Wetshakat:feature/stellar-wallet-connect
Open

#20 Add Universal Stellar Wallet Connect Support#33
Wetshakat wants to merge 1 commit intoSudiptaPaul-31:mainfrom
Wetshakat:feature/stellar-wallet-connect

Conversation

@Wetshakat
Copy link

PR Description:
Closes #20
Summary

This PR implements a universal Stellar wallet connection system that allows users to connect multiple wallets from the UI, including Freighter, Albedo, and a placeholder for Lobstr. It provides a flexible, modular, and future-proof approach to wallet integration in the Stellar ecosystem.

Users can connect, view their public key in a shortened format, and disconnect wallets with proper handling of errors or missing wallet extensions.

Features Implemented

Connect Wallet button visible in the header/navigation.

Supports multiple Stellar wallets:

Freighter: Browser extension with reliable detection and async injection handling.

Albedo: Web wallet via official @albedo-link/intent package.

Lobstr: Placeholder for future WalletConnect integration.

Global connection state via React Context.

Public key display in shortened format once connected.

Disconnect functionality to clear wallet state.

Error handling for unsupported or uninstalled wallets.

Modular, extensible architecture for adding more Stellar wallets in the future.

Technical Details

Uses client-only components ("use client") to ensure wallets injected in the browser are detected properly.

Freighter integration now waits for the wallet to inject using polling.

Albedo integration is network-aware and retrieves public keys securely.

Modular adapter pattern allows future wallets (like Lobstr or others) to be plugged in easily.

Compatible with Stellar SDK for transaction handling.

Provides loading and error states in the UI for better user experience.

Acceptance Criteria

"Connect Wallet" button implemented and visible.

Users can connect using Freighter.

Users can connect using Albedo.

Public key is retrieved and displayed correctly in shortened format.

Users can disconnect their wallet.

Errors are handled cleanly.

Implementation is extensible for additional Stellar wallets.

No regression in existing UI or functionality.

Technical Details

Uses client-only components ("use client") to ensure wallets injected in the browser are detected properly.

Freighter integration now waits for the wallet to inject using polling.

Albedo integration is network-aware and retrieves public keys securely.

Modular adapter pattern allows future wallets (like Lobstr or others) to be plugged in easily.

Compatible with Stellar SDK for transaction handling.

Provides loading and error states in the UI for better user experience.

@Wetshakat
Copy link
Author

@SudiptaPaul-31 kindly review

@chiscookeke11
Copy link
Collaborator

Please fix conflicts @Wetshakat

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.

Add Universal Stellar Wallet Connect Support

2 participants