Commit graph

8 commits

Author SHA1 Message Date
e5db949aae Refactor wallet balance handling and integrate PaymentService for centralized management
- Replaced direct wallet balance computation in Navbar and WalletPage with a centralized totalBalance property from PaymentService, improving code maintainability.
- Updated CreateProductDialog, CreateStoreDialog, and MerchantStore components to utilize PaymentService for retrieving wallet admin and invoice keys, enhancing consistency across the application.
- These changes streamline wallet management and improve the overall architecture of the wallet module.
2025-09-17 20:23:46 +02:00
f75aae6be6 Add wallet module with receive and send functionality
- Introduced a new wallet module that includes components for sending and receiving Bitcoin payments.
- Implemented WalletService to manage payment links and transactions, including methods for creating LNURL pay links and sending payments.
- Added dialogs for receiving and sending payments, enhancing user interaction with the wallet.
- Updated app configuration to enable the wallet module and integrated it into the main application flow.

These changes provide users with a comprehensive wallet experience, allowing for seamless Bitcoin transactions.
2025-09-14 23:08:01 +02:00
8ba4d46767 Add methods to PaymentService for preferred wallet selection
- Introduced getPreferredWallet() to consistently retrieve the first wallet from userWallets.
- Added getPreferredWalletAdminKey() to obtain the admin key of the preferred wallet for administrative tasks.

These enhancements improve wallet management and ensure consistent wallet selection across the application.
2025-09-14 17:59:17 +02:00
4feb5459cc Refactor authentication architecture to eliminate dual auth complexity
This major refactor consolidates the authentication system to use a single
source of truth, eliminating timing issues and architectural complexity
that was causing chat and payment functionality problems.

Key Changes:
• Remove old global useAuth composable and replace with useAuthService wrapper
• Update all 25+ files to use consistent auth pattern via dependency injection
• Eliminate dual auth detection workarounds from services (ChatService, PaymentService, etc.)
• Fix TypeScript errors and add proper Uint8Array conversion for Nostr private keys
• Consolidate auth state management to AuthService as single source of truth

Benefits:
• Resolves chat peer loading and message subscription timing issues
• Fixes wallet detection problems for Lightning payments
• Eliminates race conditions between global and injected auth
• Maintains API compatibility while improving architecture
• Reduces code complexity and improves maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 00:47:02 +02:00
5633aa154b Enhance PaymentService and useTicketPurchase composable for improved wallet handling
- Introduced asynchronous methods in PaymentService for retrieving user wallets and checking wallet balances, allowing for dual authentication detection.
- Updated getUserWalletsAsync, hasWalletWithBalanceAsync, and getWalletWithBalanceAsync methods to streamline wallet access and balance checks.
- Refactored useTicketPurchase composable to load user wallets asynchronously on component mount, improving user experience during ticket purchases.
- Enhanced error handling and logging for wallet loading and payment processes.

These changes improve the reliability and responsiveness of wallet interactions within the payment flow.
2025-09-07 00:19:43 +02:00
e8b9f04494 Refactor PaymentService and related components for improved state management
- Reset payment state on initialization in PaymentService to prevent stuck states.
- Introduce forceResetPaymentState method for debugging purposes.
- Update useTicketPurchase and useLightningPayment composables to reflect changes in computed properties for better state handling.
- Ensure OrderHistory component resets payment state on mount to enhance user experience.
2025-09-05 16:18:13 +02:00
099c16abc9 Refactor PaymentService methods for clarity and consistency
- Rename methods in PaymentService for improved readability: payInvoiceWithUserWallet to payWithWallet, openExternalLightningWallet to openExternalWallet, and handlePaymentWithFallback to handlePayment.
- Update related composables (useTicketPurchase, useLightningPayment) to reflect method name changes, ensuring consistent usage across the application.
- Modify RelayHub initialization process to set relay URLs before calling initialize, enhancing configuration clarity.
- Remove legacy compatibility flags in RelayHub to streamline the codebase and improve maintainability.
2025-09-05 15:23:03 +02:00
0bced11623 Add PaymentService integration to enhance ticket purchasing and lightning payment functionality
- Introduce PAYMENT_SERVICE token in di-container for dependency injection.
- Update base module to register and initialize PaymentService, ensuring it is available for use.
- Refactor useTicketPurchase and useLightningPayment composables to utilize PaymentService for wallet management, payment processing, and QR code generation.
- Delegate payment handling and error management to PaymentService, streamlining the payment workflow and improving user experience.
2025-09-05 15:17:51 +02:00