Skip to content

feat: Stellar wallet connection#245

Open
emarc99 wants to merge 17 commits intostarkyorg:mainfrom
emarc99:feat-stellar-wallet-connect
Open

feat: Stellar wallet connection#245
emarc99 wants to merge 17 commits intostarkyorg:mainfrom
emarc99:feat-stellar-wallet-connect

Conversation

@emarc99
Copy link
Contributor

@emarc99 emarc99 commented Sep 26, 2025

Implement Stellar Wallet Connection Support

Summary

Added comprehensive Stellar blockchain wallet connection functionality with support for both Testnet and Mainnet networks.

Key Changes

  • Network Configuration: Added Stellar Testnet and Mainnet to network configurations
  • Dynamic Network Detection: Implemented automatic blockchain network detection and routing
  • Wallet Connection: Created modular Stellar wallet connection with Freighter integration
  • Verification System: Added Stellar signature verification API and UI components
  • Unified Architecture: Built scalable wallet connection system supporting multiple blockchains

Features

  • ✅ Stellar Testnet/Mainnet support
  • ✅ Dynamic network-based wallet popup display
  • ✅ Modular wallet connection architecture
  • ✅ Complete verification flow for Stellar transactions
  • ✅ Reusable components for future blockchain integrations

UI of Changes

image

Files Added/Modified

  • New Stellar verification page and API endpoints
  • Enhanced verification router with dynamic blockchain detection
  • Stellar-specific utilities and type definitions
  • Updated network configurations and database entities

  - Add stellar-mainnet and stellar-testnet to
  network configurations
  - Add relevant Stellar icons to public assets
  - Update WalletConnect to handle Stellar
  - Update database schema to support Stellar
  networks in DiscordServerConfig
  - Extend component props to support stellar
  network type
  - Add Stellar wallet display support with XLM
  balance
  - Fix Stellar SDK type issues for transaction
  source handling
  - Fix WatchTowerLogger type compatibility
  - Fix React hooks rules violations by moving conditional routing after hooks
@emarc99
Copy link
Contributor Author

emarc99 commented Sep 26, 2025

@Marchand-Nicolas, if you prefer, I can push a commit that performs the user's identity verification without either of the below, esp. on mainnet;

  • account existence check
  • funding accounts first

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Great job! Well done!!
It's working perfectly on testnet, but it doesn't work on mainnet, I have this error when signing:

Image

I guess you have to change the message a bit on mainnet

WATCHTOWER_TOKEN=xxx
LOG_EVERY_X_BLOCK=1 No newline at end of file
LOG_EVERY_X_BLOCK=1
DATABASE_URL=postgresql://host:password@localhost:5432/db_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove those env variables (DATABASE_URL, NEXT_PUBLIC_STELLAR_ENABLED).

Instead of having NEXT_PUBLIC_STELLAR_ENABLED, just make it always enabled (If we want to disable it, we can just remove it from networks.json)

"label": "Starknet Mainnet",
"name": "mainnet",
"url": "https://starknet.preview.apibara.org",
"indexer": true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep this one to true (for your test you can definitely disable it, but please don't commit it)

try {
if (networkName === "ethereum-mainnet" && ETHEREUM_ENABLED) {
// Check if it's a Stellar network
if (network.chain === "stellar") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to check if it's stellar. On this page it's always ethereum

@@ -0,0 +1,115 @@
import { useCallback, useState } from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this hook is not used, so you can delete it

where: {
discordServerId: body.discordServerId,
discordMemberId: body.discordMemberId,
starknetNetwork: body.network, // This field might need to be renamed to support multiple chains
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess you can remove this comment ?

@emarc99
Copy link
Contributor Author

emarc99 commented Sep 30, 2025

All duly noted, ser!

@emarc99
Copy link
Contributor Author

emarc99 commented Oct 10, 2025

Should finalize it all in a few, ser.

Resolved conflicts:
- configs/networks.json: Kept our Horizon API URLs and testnet support
- types/networks.ts: Kept our organized type structure with ChainType
- verify-stellar page: Kept our full implementation vs placeholder
- public/assets: Renamed stellar-icon.png to stellar-icon1.png to keep both versions

Merged incoming changes:
- Dashboard analytics section from PR starkyorg#247
- Download button styles updates
- Added StellarAccount type
- Extended networkType prop to include "stellar"
- Added Stellar address handling in getAddress()
- Added "Stellar wallet" label display
- Added XLM balance display with proper formatting
- Extended networkType prop to include "stellar"
- Added Stellar network icon mapping (/assets/stellar-icon.png)
- Added "Stellar network:" label
@emarc99
Copy link
Contributor Author

emarc99 commented Oct 11, 2025

@Marchand-Nicolas this is good for a merge.

Screenshot 2025-10-11 034949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement wallet connection for Stellar

2 participants