lsps1 breaking changes

This commit is contained in:
Nitesh Balusu 2024-07-14 11:04:41 -04:00
parent 9c3648d04f
commit 4fe8be5cd9
3 changed files with 10 additions and 13 deletions

View file

@ -271,7 +271,7 @@ module.exports = (args, cbk) => {
return cbk(null, {id: args.recovery});
}
if (!getQuote.response || !getQuote.response.payment) {
if (!getQuote.response || !getQuote.response.payment || !getQuote.response.payment.bolt11) {
return cbk([503, 'UnexpectedMissingQuoteInLsps1OpenQuoteResponse']);
}
@ -279,7 +279,7 @@ module.exports = (args, cbk) => {
return cbk([503, 'UnexpectedAbsentOrderIdInLsps1OpenQuoteResponse']);
}
const request = getQuote.response.payment.bolt11_invoice;
const request = getQuote.response.payment.bolt11.invoice;
if (!request) {
return cbk([503, 'UnexpectedMissingPaymentRequestInQuoteResponse']);

View file

@ -458,20 +458,19 @@ module.exports = (args, cbk) => {
client_balance_sat: Number().toString(),
funding_confirms_within_blocks: confTarget,
created_at: new Date().toISOString(),
expires_at: expiryDate(orderExpiryMs),
lsp_balance_sat: message.params.lsp_balance_sat,
order_id: message.order,
order_state: orderStateCreated,
payment: {
bolt11_invoice: makeInvoice.request,
fee_total_sat: makeInvoice.tokens.toString(),
min_fee_for_0conf: null,
min_onchain_payment_confirmations: null,
onchain_address: null,
onchain_payment: null,
order_total_sat: makeInvoice.tokens.toString(),
state: paymentStateExpectedPayment,
bolt11: {
expires_at: expiryDate(orderExpiryMs),
fee_total_sat: makeInvoice.tokens.toString(),
invoice: makeInvoice.request,
order_total_sat: makeInvoice.tokens.toString(),
state: paymentStateExpectedPayment,
},
},
required_channel_confirmations: message.params.required_channel_confirmations,
token: String(),
},
});

View file

@ -95,8 +95,6 @@ module.exports = (args, cbk) => {
min_funding_confirms_within_blocks: defaultFundingConfirmedBlocks,
min_initial_client_balance_sat: Number().toString(),
min_initial_lsp_balance_sat: args.min_capacity.toString(),
min_onchain_payment_confirmations: null,
min_onchain_payment_size_sat: null,
min_required_channel_confirmations: defaultChannelActiveConfs,
supports_zero_channel_reserve: false,
},