diff --git a/src/app.config.ts b/src/app.config.ts index bd7190d..0384841 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -64,6 +64,18 @@ export const appConfig: AppConfig = { ticketValidationEndpoint: '/api/tickets/validate', maxTicketsPerUser: 10 } + }, + wallet: { + name: 'wallet', + enabled: true, + lazy: false, + config: { + defaultReceiveAmount: 1000, // 1000 sats + maxReceiveAmount: 1000000, // 1M sats + apiConfig: { + baseUrl: import.meta.env.VITE_LNBITS_BASE_URL || 'http://localhost:5000' + } + } } }, diff --git a/src/app.ts b/src/app.ts index 7c3a7f9..5ee12b8 100644 --- a/src/app.ts +++ b/src/app.ts @@ -15,6 +15,7 @@ import nostrFeedModule from './modules/nostr-feed' import chatModule from './modules/chat' import eventsModule from './modules/events' import marketModule from './modules/market' +import walletModule from './modules/wallet' // Root component import App from './App.vue' @@ -41,7 +42,8 @@ export async function createAppInstance() { ...nostrFeedModule.routes || [], ...chatModule.routes || [], ...eventsModule.routes || [], - ...marketModule.routes || [] + ...marketModule.routes || [], + ...walletModule.routes || [] ].filter(Boolean) // Create router with all routes available immediately @@ -117,6 +119,13 @@ export async function createAppInstance() { ) } + // Register wallet module + if (appConfig.modules.wallet?.enabled) { + moduleRegistrations.push( + pluginManager.register(walletModule, appConfig.modules.wallet) + ) + } + // Wait for all modules to register await Promise.all(moduleRegistrations) diff --git a/src/components/layout/Navbar.vue b/src/components/layout/Navbar.vue index de2ddb5..b1a6cee 100644 --- a/src/components/layout/Navbar.vue +++ b/src/components/layout/Navbar.vue @@ -155,10 +155,10 @@ const handleLogout = async () => { -
+ -
+ diff --git a/src/core/di-container.ts b/src/core/di-container.ts index e24ebd1..907b8e2 100644 --- a/src/core/di-container.ts +++ b/src/core/di-container.ts @@ -142,6 +142,9 @@ export const SERVICE_TOKENS = { NOSTRMARKET_SERVICE: Symbol('nostrmarketService'), NOSTRMARKET_API: Symbol('nostrmarketAPI'), + // Wallet services + WALLET_SERVICE: Symbol('walletService'), + // API services LNBITS_API: Symbol('lnbitsAPI'), } as const diff --git a/src/core/services/PaymentService.ts b/src/core/services/PaymentService.ts index 4d890c5..c19c4bb 100644 --- a/src/core/services/PaymentService.ts +++ b/src/core/services/PaymentService.ts @@ -100,6 +100,14 @@ export class PaymentService extends BaseService { return wallet?.adminkey || null } + /** + * Get the preferred wallet's invoice key for read-only operations + */ + getPreferredWalletInvoiceKey(): string | null { + const wallet = this.getPreferredWallet() + return wallet?.inkey || null + } + /** * Generate QR code for Lightning payment request */ diff --git a/src/modules/wallet/components/ReceiveDialog.vue b/src/modules/wallet/components/ReceiveDialog.vue new file mode 100644 index 0000000..fb1182b --- /dev/null +++ b/src/modules/wallet/components/ReceiveDialog.vue @@ -0,0 +1,386 @@ + + +