diff --git a/src/core/services/PaymentService.ts b/src/core/services/PaymentService.ts index ad35dde..4d890c5 100644 --- a/src/core/services/PaymentService.ts +++ b/src/core/services/PaymentService.ts @@ -82,6 +82,24 @@ export class PaymentService extends BaseService { return wallets.find((wallet: any) => wallet.balance_msat > 0) } + /** + * Get the preferred wallet for operations (always use wallets[0] for consistency) + * This ensures consistent wallet selection across all modules + */ + getPreferredWallet(): any | null { + const wallets = this.userWallets + if (!wallets.length) return null + return wallets[0] + } + + /** + * Get the preferred wallet's admin key for administrative operations + */ + getPreferredWalletAdminKey(): string | null { + const wallet = this.getPreferredWallet() + return wallet?.adminkey || null + } + /** * Generate QR code for Lightning payment request */