cleanup
This commit is contained in:
parent
fe098c9e3e
commit
cbcac82541
7 changed files with 8 additions and 95 deletions
|
|
@ -342,10 +342,6 @@ export default class {
|
||||||
return { numSatoshis: Number(res.response.numSatoshis), paymentHash: res.response.paymentHash }
|
return { numSatoshis: Number(res.response.numSatoshis), paymentHash: res.response.paymentHash }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GetFeeLimitAmount(amount: number): number {
|
|
||||||
return Math.ceil(amount * this.getSettings().lndSettings.feeRateLimit + this.getSettings().lndSettings.feeFixedLimit);
|
|
||||||
} */
|
|
||||||
|
|
||||||
async ChannelBalance(): Promise<{ local: number, remote: number }> {
|
async ChannelBalance(): Promise<{ local: number, remote: number }> {
|
||||||
// console.log("Getting channel balance")
|
// console.log("Getting channel balance")
|
||||||
const res = await this.lightning.channelBalance({})
|
const res = await this.lightning.channelBalance({})
|
||||||
|
|
@ -359,7 +355,7 @@ export default class {
|
||||||
throw new Error("lnd node is currently out of sync")
|
throw new Error("lnd node is currently out of sync")
|
||||||
}
|
}
|
||||||
if (useProvider) {
|
if (useProvider) {
|
||||||
const res = await this.liquidProvider.PayInvoice(invoice, decodedAmount, from/* , feeLimit */)
|
const res = await this.liquidProvider.PayInvoice(invoice, decodedAmount, from)
|
||||||
const providerDst = this.liquidProvider.GetProviderDestination()
|
const providerDst = this.liquidProvider.GetProviderDestination()
|
||||||
return { feeSat: res.network_fee + res.service_fee, valueSat: res.amount_paid, paymentPreimage: res.preimage, providerDst }
|
return { feeSat: res.network_fee + res.service_fee, valueSat: res.amount_paid, paymentPreimage: res.preimage, providerDst }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ export default class {
|
||||||
throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing
|
throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing
|
||||||
}
|
}
|
||||||
const nostrSettings = this.settings.getSettings().nostrRelaySettings
|
const nostrSettings = this.settings.getSettings().nostrRelaySettings
|
||||||
const { max, /* networkFeeBps, */ networkFeeFixed, serviceFeeBps } = this.applicationManager.paymentManager.GetMaxPayableInvoice(user.balance_sats)
|
const { max, networkFeeFixed, serviceFeeBps } = this.applicationManager.paymentManager.GetMaxPayableInvoice(user.balance_sats)
|
||||||
return {
|
return {
|
||||||
userId: ctx.user_id,
|
userId: ctx.user_id,
|
||||||
balance: user.balance_sats,
|
balance: user.balance_sats,
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ export default class {
|
||||||
|
|
||||||
const ndebitString = ndebitEncode({ pubkey: app.nostr_public_key!, pointer: u.identifier, relay: nostrSettings.relays[0] })
|
const ndebitString = ndebitEncode({ pubkey: app.nostr_public_key!, pointer: u.identifier, relay: nostrSettings.relays[0] })
|
||||||
log("🔗 [DEBUG] Generated ndebit for user", { userId: u.user.user_id, ndebit: ndebitString })
|
log("🔗 [DEBUG] Generated ndebit for user", { userId: u.user.user_id, ndebit: ndebitString })
|
||||||
const { max, /* networkFeeBps, */networkFeeFixed, serviceFeeBps } = this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats)
|
const { max, networkFeeFixed, serviceFeeBps } = this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats)
|
||||||
return {
|
return {
|
||||||
identifier: u.identifier,
|
identifier: u.identifier,
|
||||||
info: {
|
info: {
|
||||||
|
|
@ -225,7 +225,7 @@ export default class {
|
||||||
const app = await this.storage.applicationStorage.GetApplication(appId)
|
const app = await this.storage.applicationStorage.GetApplication(appId)
|
||||||
const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier)
|
const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier)
|
||||||
const nostrSettings = this.settings.getSettings().nostrRelaySettings
|
const nostrSettings = this.settings.getSettings().nostrRelaySettings
|
||||||
const { max, /* networkFeeBps, */ networkFeeFixed, serviceFeeBps } = this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats)
|
const { max, networkFeeFixed, serviceFeeBps } = this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats)
|
||||||
return {
|
return {
|
||||||
max_withdrawable: max, identifier: req.user_identifier, info: {
|
max_withdrawable: max, identifier: req.user_identifier, info: {
|
||||||
userId: user.user.user_id, balance: user.user.balance_sats,
|
userId: user.user.user_id, balance: user.user.balance_sats,
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ export class LiquidityManager {
|
||||||
if (!providerReady) {
|
if (!providerReady) {
|
||||||
throw new Error("cannot use liquidity provider, it is not ready")
|
throw new Error("cannot use liquidity provider, it is not ready")
|
||||||
}
|
}
|
||||||
// const feeLimit = this.liquidityProvider.CalculateExpectedFeeLimit(amount)
|
|
||||||
return 'provider'
|
return 'provider'
|
||||||
}
|
}
|
||||||
if (!providerReady) {
|
if (!providerReady) {
|
||||||
|
|
@ -97,7 +96,6 @@ export class LiquidityManager {
|
||||||
if (!canHandle) {
|
if (!canHandle) {
|
||||||
return 'lnd'
|
return 'lnd'
|
||||||
}
|
}
|
||||||
// const feeLimit = this.liquidityProvider.CalculateExpectedFeeLimit(amount)
|
|
||||||
return 'provider'
|
return 'provider'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@ export class LiquidityProvider {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
this.feesCache = {
|
this.feesCache = {
|
||||||
// networkFeeBps: res.network_max_fee_bps,
|
|
||||||
networkFeeFixed: res.network_max_fee_fixed,
|
networkFeeFixed: res.network_max_fee_fixed,
|
||||||
serviceFeeBps: res.service_fee_bps
|
serviceFeeBps: res.service_fee_bps
|
||||||
}
|
}
|
||||||
|
|
@ -158,9 +157,6 @@ export class LiquidityProvider {
|
||||||
const maxWithoutFixed = Math.floor(balance / div)
|
const maxWithoutFixed = Math.floor(balance / div)
|
||||||
const fee = balance - maxWithoutFixed
|
const fee = balance - maxWithoutFixed
|
||||||
return balance - Math.max(fee, networkFeeFixed)
|
return balance - Math.max(fee, networkFeeFixed)
|
||||||
/* const totalBps = networkFeeBps + serviceFeeBps
|
|
||||||
const div = 1 + (totalBps / 10000)
|
|
||||||
return Math.floor((this.latestReceivedBalance - networkFeeFixed) / div) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GetLatestBalance = () => {
|
GetLatestBalance = () => {
|
||||||
|
|
@ -181,15 +177,6 @@ export class LiquidityProvider {
|
||||||
return Math.max(serviceFee, fees.networkFeeFixed)
|
return Math.max(serviceFee, fees.networkFeeFixed)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CalculateExpectedFeeLimit = (amount: number) => {
|
|
||||||
const fees = this.GetFees()
|
|
||||||
const serviceFeeRate = fees.serviceFeeBps / 10000
|
|
||||||
const serviceFee = Math.ceil(serviceFeeRate * amount)
|
|
||||||
const networkMaxFeeRate = fees.networkFeeBps / 10000
|
|
||||||
const networkFeeLimit = Math.ceil(amount * networkMaxFeeRate + fees.networkFeeFixed)
|
|
||||||
return serviceFee + networkFeeLimit
|
|
||||||
} */
|
|
||||||
|
|
||||||
CanProviderPay = async (amount: number, localServiceFee: number): Promise<boolean> => {
|
CanProviderPay = async (amount: number, localServiceFee: number): Promise<boolean> => {
|
||||||
if (!this.IsReady()) {
|
if (!this.IsReady()) {
|
||||||
this.log("provider is not ready")
|
this.log("provider is not ready")
|
||||||
|
|
@ -229,12 +216,11 @@ export class LiquidityProvider {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PayInvoice = async (invoice: string, decodedAmount: number, from: 'user' | 'system'/* , feeLimit?: number */) => {
|
PayInvoice = async (invoice: string, decodedAmount: number, from: 'user' | 'system') => {
|
||||||
try {
|
try {
|
||||||
if (!this.IsReady()) {
|
if (!this.IsReady()) {
|
||||||
throw new Error("liquidity provider is not ready yet, disabled or unreachable")
|
throw new Error("liquidity provider is not ready yet, disabled or unreachable")
|
||||||
}
|
}
|
||||||
// const feeLimitToUse = feeLimit ? feeLimit : this.CalculateExpectedFeeLimit(decodedAmount)
|
|
||||||
const providerServiceFee = this.GetServiceFee(decodedAmount)
|
const providerServiceFee = this.GetServiceFee(decodedAmount)
|
||||||
this.pendingPayments[invoice] = decodedAmount + providerServiceFee
|
this.pendingPayments[invoice] = decodedAmount + providerServiceFee
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
|
|
@ -245,7 +231,7 @@ export class LiquidityProvider {
|
||||||
this.lastSeenBeacon = 0
|
this.lastSeenBeacon = 0
|
||||||
}, 1000 * 10)
|
}, 1000 * 10)
|
||||||
this.pendingPaymentsAck[invoice] = true
|
this.pendingPaymentsAck[invoice] = true
|
||||||
const res = await this.client.PayInvoice({ invoice, amount: 0,/* fee_limit_sats: feeLimitToUse */ })
|
const res = await this.client.PayInvoice({ invoice, amount: 0 })
|
||||||
delete this.pendingPaymentsAck[invoice]
|
delete this.pendingPaymentsAck[invoice]
|
||||||
if (res.status === 'ERROR') {
|
if (res.status === 'ERROR') {
|
||||||
this.log("error paying invoice", res.reason)
|
this.log("error paying invoice", res.reason)
|
||||||
|
|
@ -312,7 +298,6 @@ export class LiquidityProvider {
|
||||||
this.log("configured to send to ")
|
this.log("configured to send to ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fees: { networkFeeBps: number, networkFeeFixed: number, serviceFeeBps: number }
|
|
||||||
onBeaconEvent = async (beaconData: { content: string, pub: string }) => {
|
onBeaconEvent = async (beaconData: { content: string, pub: string }) => {
|
||||||
if (beaconData.pub !== this.pubDestination) {
|
if (beaconData.pub !== this.pubDestination) {
|
||||||
this.log(ERROR, "got beacon from invalid pub", beaconData.pub, this.pubDestination)
|
this.log(ERROR, "got beacon from invalid pub", beaconData.pub, this.pubDestination)
|
||||||
|
|
|
||||||
|
|
@ -205,32 +205,6 @@ export default class {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* getServiceFee(action: Types.UserOperationType, amount: number, appUser: boolean): number {
|
|
||||||
switch (action) {
|
|
||||||
case Types.UserOperationType.INCOMING_TX:
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.incomingTxFee * amount)
|
|
||||||
case Types.UserOperationType.OUTGOING_TX:
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.outgoingTxFee * amount)
|
|
||||||
case Types.UserOperationType.INCOMING_INVOICE:
|
|
||||||
if (appUser) {
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.incomingAppUserInvoiceFee * amount)
|
|
||||||
}
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.incomingAppInvoiceFee * amount)
|
|
||||||
case Types.UserOperationType.OUTGOING_INVOICE:
|
|
||||||
if (appUser) {
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.outgoingAppUserInvoiceFee * amount)
|
|
||||||
}
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.outgoingAppInvoiceFee * amount)
|
|
||||||
case Types.UserOperationType.OUTGOING_USER_TO_USER || Types.UserOperationType.INCOMING_USER_TO_USER:
|
|
||||||
if (appUser) {
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.userToUserFee * amount)
|
|
||||||
}
|
|
||||||
return Math.ceil(this.settings.getSettings().serviceFeeSettings.appToUserFee * amount)
|
|
||||||
default:
|
|
||||||
throw new Error("Unknown service action type")
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|
||||||
async SetMockInvoiceAsPaid(req: Types.SetMockInvoiceAsPaidRequest) {
|
async SetMockInvoiceAsPaid(req: Types.SetMockInvoiceAsPaidRequest) {
|
||||||
if (!this.settings.getSettings().lndSettings.mockLnd) {
|
if (!this.settings.getSettings().lndSettings.mockLnd) {
|
||||||
throw new Error("mock disabled, cannot set invoice as paid")
|
throw new Error("mock disabled, cannot set invoice as paid")
|
||||||
|
|
@ -279,11 +253,6 @@ export default class {
|
||||||
|
|
||||||
GetFees = (): Types.CumulativeFees => {
|
GetFees = (): Types.CumulativeFees => {
|
||||||
const { outgoingAppUserInvoiceFeeBps } = this.settings.getSettings().serviceFeeSettings
|
const { outgoingAppUserInvoiceFeeBps } = this.settings.getSettings().serviceFeeSettings
|
||||||
/* if (this.lnd.liquidProvider.IsReady()) {
|
|
||||||
const fees = this.lnd.liquidProvider.GetFees()
|
|
||||||
const networkFeeBps = fees.networkFeeBps + fees.serviceFeeBps
|
|
||||||
return { networkFeeBps, networkFeeFixed: fees.networkFeeFixed, serviceFeeBps: outgoingAppUserInvoiceFeeBps }
|
|
||||||
} */
|
|
||||||
const { feeFixedLimit } = this.settings.getSettings().lndSettings
|
const { feeFixedLimit } = this.settings.getSettings().lndSettings
|
||||||
return { networkFeeFixed: feeFixedLimit, serviceFeeBps: outgoingAppUserInvoiceFeeBps }
|
return { networkFeeFixed: feeFixedLimit, serviceFeeBps: outgoingAppUserInvoiceFeeBps }
|
||||||
}
|
}
|
||||||
|
|
@ -295,11 +264,6 @@ export default class {
|
||||||
const fee = balance - maxWithoutFixed
|
const fee = balance - maxWithoutFixed
|
||||||
const max = balance - Math.max(fee, networkFeeFixed)
|
const max = balance - Math.max(fee, networkFeeFixed)
|
||||||
return { max, networkFeeFixed, serviceFeeBps }
|
return { max, networkFeeFixed, serviceFeeBps }
|
||||||
|
|
||||||
/* const totalBps = networkFeeBps + serviceFeeBps
|
|
||||||
const div = 1 + (totalBps / 10000)
|
|
||||||
const max = Math.floor((balance - networkFeeFixed) / div)
|
|
||||||
return { max, serviceFeeBps, networkFeeBps, networkFeeFixed } */
|
|
||||||
}
|
}
|
||||||
async DecodeInvoice(req: Types.DecodeInvoiceRequest): Promise<Types.DecodeInvoiceResponse> {
|
async DecodeInvoice(req: Types.DecodeInvoiceRequest): Promise<Types.DecodeInvoiceResponse> {
|
||||||
const decoded = await this.lnd.DecodeInvoice(req.invoice)
|
const decoded = await this.lnd.DecodeInvoice(req.invoice)
|
||||||
|
|
@ -324,9 +288,6 @@ export default class {
|
||||||
const payAmount = req.amount !== 0 ? req.amount : Number(decoded.numSatoshis)
|
const payAmount = req.amount !== 0 ? req.amount : Number(decoded.numSatoshis)
|
||||||
const isAppUserPayment = userId !== linkedApplication.owner.user_id
|
const isAppUserPayment = userId !== linkedApplication.owner.user_id
|
||||||
const serviceFee = this.getSendServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment)
|
const serviceFee = this.getSendServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment)
|
||||||
/* if (req.fee_limit_sats && req.fee_limit_sats < serviceFee) {
|
|
||||||
throw new Error("fee limit provided is too low to cover service fees")
|
|
||||||
} */
|
|
||||||
const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice)
|
const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice)
|
||||||
if (internalInvoice && internalInvoice.paid_at_unix > 0) {
|
if (internalInvoice && internalInvoice.paid_at_unix > 0) {
|
||||||
throw new Error("this invoice was already paid")
|
throw new Error("this invoice was already paid")
|
||||||
|
|
@ -339,7 +300,7 @@ export default class {
|
||||||
if (internalInvoice) {
|
if (internalInvoice) {
|
||||||
paymentInfo = await this.PayInternalInvoice(userId, internalInvoice, { payAmount, serviceFee }, linkedApplication, req.debit_npub)
|
paymentInfo = await this.PayInternalInvoice(userId, internalInvoice, { payAmount, serviceFee }, linkedApplication, req.debit_npub)
|
||||||
} else {
|
} else {
|
||||||
paymentInfo = await this.PayExternalInvoice(userId, req.invoice, { payAmount, serviceFee, amountForLnd: req.amount, /* feeLimit: req.fee_limit_sats */ }, linkedApplication, req.debit_npub, ack)
|
paymentInfo = await this.PayExternalInvoice(userId, req.invoice, { payAmount, serviceFee, amountForLnd: req.amount }, linkedApplication, req.debit_npub, ack)
|
||||||
}
|
}
|
||||||
const feeDiff = serviceFee - paymentInfo.networkFee
|
const feeDiff = serviceFee - paymentInfo.networkFee
|
||||||
if (isAppUserPayment && feeDiff > 0) {
|
if (isAppUserPayment && feeDiff > 0) {
|
||||||
|
|
@ -360,22 +321,7 @@ export default class {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* getUse = async (payAmount: number, localServiceFee: number): Promise<{ use: 'lnd' | 'provider', feeLimit: number }> => {
|
async PayExternalInvoice(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, amountForLnd: number }, linkedApplication: Application, debitNpub?: string, ack?: (op: Types.UserOperation) => void) {
|
||||||
const use = await this.liquidityManager.beforeOutInvoicePayment(payAmount, localServiceFee)
|
|
||||||
if (use === 'lnd') {
|
|
||||||
const lndFeeLimit = this.lnd.GetFeeLimitAmount(payAmount)
|
|
||||||
if (inputLimit && inputLimit < lndFeeLimit) {
|
|
||||||
this.log("WARNING requested fee limit is lower than suggested, payment might fail")
|
|
||||||
}
|
|
||||||
return { use: 'lnd', feeLimit: inputLimit || lndFeeLimit }
|
|
||||||
}
|
|
||||||
if (inputLimit && inputLimit < use.feeLimit) {
|
|
||||||
this.log("WARNING requested fee limit is lower than suggested by provider, payment might fail")
|
|
||||||
}
|
|
||||||
return { use: 'provider', feeLimit: inputLimit || use.feeLimit }
|
|
||||||
} */
|
|
||||||
|
|
||||||
async PayExternalInvoice(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, amountForLnd: number, /* feeLimit?: number */ }, linkedApplication: Application, debitNpub?: string, ack?: (op: Types.UserOperation) => void) {
|
|
||||||
if (this.settings.getSettings().serviceSettings.disableExternalPayments) {
|
if (this.settings.getSettings().serviceSettings.disableExternalPayments) {
|
||||||
throw new Error("something went wrong sending payment, please try again later")
|
throw new Error("something went wrong sending payment, please try again later")
|
||||||
}
|
}
|
||||||
|
|
@ -392,10 +338,6 @@ export default class {
|
||||||
const { amountForLnd, payAmount, serviceFee } = amounts
|
const { amountForLnd, payAmount, serviceFee } = amounts
|
||||||
const totalAmountToDecrement = payAmount + serviceFee
|
const totalAmountToDecrement = payAmount + serviceFee
|
||||||
const use = await this.liquidityManager.beforeOutInvoicePayment(payAmount, serviceFee)
|
const use = await this.liquidityManager.beforeOutInvoicePayment(payAmount, serviceFee)
|
||||||
/* const routingFeeLimit = this.lnd.GetFeeLimitAmount(payAmount)
|
|
||||||
const use = await this.liquidityManager.beforeOutInvoicePayment(payAmount) */
|
|
||||||
// const remainingLimit = amounts.feeLimit ? amounts.feeLimit - serviceFee : undefined
|
|
||||||
// const { use, feeLimit: routingFeeLimit } = await this.getUse(payAmount, remainingLimit)
|
|
||||||
const provider = use === 'provider' ? this.lnd.liquidProvider.GetProviderDestination() : undefined
|
const provider = use === 'provider' ? this.lnd.liquidProvider.GetProviderDestination() : undefined
|
||||||
const pendingPayment = await this.storage.StartTransaction(async tx => {
|
const pendingPayment = await this.storage.StartTransaction(async tx => {
|
||||||
await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement, invoice, tx)
|
await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement, invoice, tx)
|
||||||
|
|
@ -409,13 +351,6 @@ export default class {
|
||||||
const payment = await this.lnd.PayInvoice(invoice, amountForLnd, serviceFee, payAmount, { useProvider: use === 'provider', from: 'user' }, index => {
|
const payment = await this.lnd.PayInvoice(invoice, amountForLnd, serviceFee, payAmount, { useProvider: use === 'provider', from: 'user' }, index => {
|
||||||
this.storage.paymentStorage.SetExternalPaymentIndex(pendingPayment.serial_id, index)
|
this.storage.paymentStorage.SetExternalPaymentIndex(pendingPayment.serial_id, index)
|
||||||
})
|
})
|
||||||
/* const feeDiff = serviceFee - payment.feeSat
|
|
||||||
if (feeDiff > 0) {
|
|
||||||
// this.log("refund routing fee", routingFeeLimit, payment.feeSat, "sats")
|
|
||||||
this.log("")
|
|
||||||
await this.storage.userStorage.IncrementUserBalance(userId, routingFeeLimit - payment.feeSat, "routing_fee_refund:" + invoice)
|
|
||||||
} */
|
|
||||||
|
|
||||||
await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, payment.feeSat, serviceFee, true, payment.providerDst)
|
await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, payment.feeSat, serviceFee, true, payment.providerDst)
|
||||||
return { preimage: payment.paymentPreimage, amtPaid: payment.valueSat, networkFee: payment.feeSat, serialId: pendingPayment.serial_id }
|
return { preimage: payment.paymentPreimage, amtPaid: payment.valueSat, networkFee: payment.feeSat, serialId: pendingPayment.serial_id }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ export const initBootstrappedInstance = async (T: TestBase) => {
|
||||||
await new Promise<void>(res => {
|
await new Promise<void>(res => {
|
||||||
const interval = setInterval(async () => {
|
const interval = setInterval(async () => {
|
||||||
const canHandle = bootstrapped.liquidityProvider.IsReady()
|
const canHandle = bootstrapped.liquidityProvider.IsReady()
|
||||||
console.log("can handle", canHandle)
|
|
||||||
if (canHandle) {
|
if (canHandle) {
|
||||||
clearInterval(interval)
|
clearInterval(interval)
|
||||||
res()
|
res()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue