diff --git a/src/services/main/applicationManager.ts b/src/services/main/applicationManager.ts index 1f7a2216..e0395222 100644 --- a/src/services/main/applicationManager.ts +++ b/src/services/main/applicationManager.ts @@ -131,6 +131,6 @@ export default class { } async GetAppUserLNURLInfo(appId: string, req: Types.GetAppUserLNURLInfoRequest): Promise { const user = await this.storage.applicationStorage.GetApplicationUser(appId, req.user_identifier) - return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id) + return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id, req.base_url_override) } } \ No newline at end of file diff --git a/src/services/main/paymentManager.ts b/src/services/main/paymentManager.ts index b4552679..2a947804 100644 --- a/src/services/main/paymentManager.ts +++ b/src/services/main/paymentManager.ts @@ -164,7 +164,7 @@ export default class { callback: `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/handle`, defaultDescription: "lnurl withdraw from lightning.pub", k1: callbackK1.key, - maxWithdrawable: maxWithdrawable, + maxWithdrawable: maxWithdrawable * 1000, minWithdrawable: 0, balanceCheck: this.balanceCheckUrl(newBalanceCheckK1.key), payLink: `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${payInfoK1.key}`, @@ -173,12 +173,12 @@ export default class { async HandleLnurlWithdraw(k1: string, invoice: string): Promise { const key = await this.storage.paymentStorage.UseUserEphemeralKey(k1, 'withdraw') - this.PayInvoice(key.user.user_id, { - invoice: invoice, - amount: 0 - }).catch(err => { + try { + await this.PayInvoice(key.user.user_id, { invoice: invoice, amount: 0s }) + } catch (err: any) { console.error("error sending payment for lnurl withdraw to ", key.user.user_id, err) - }) + throw new Error("failed to pay invoice") + } } async GetLnurlPayInfoFromUser(userId: string, baseUrl?: string): Promise { @@ -187,7 +187,7 @@ export default class { return { tag: 'payRequest', callback: `${url}?k1=${payK1.key}`, - maxSendable: 10000000, + maxSendable: 10000000000, minSendable: 0, metadata: defaultLnurlPayMetadata }