This commit is contained in:
boufni95 2025-09-16 19:50:32 +00:00
parent 358249daba
commit c6249764f0
2 changed files with 4 additions and 3 deletions

View file

@ -290,7 +290,8 @@ export default class {
async NewInvoice(value: number, memo: string, expiry: number, { useProvider, from }: TxActionOptions): Promise<Invoice> {
if (useProvider) {
const invoice = await this.liquidProvider.AddInvoice(value, memo, from)
console.log("using provider")
const invoice = await this.liquidProvider.AddInvoice(value, memo, from, expiry)
const providerDst = this.liquidProvider.GetProviderDestination()
return { payRequest: invoice, providerDst }
}

View file

@ -165,12 +165,12 @@ export class LiquidityProvider {
return true
}
AddInvoice = async (amount: number, memo: string, from: 'user' | 'system') => {
AddInvoice = async (amount: number, memo: string, from: 'user' | 'system', expiry: number) => {
try {
if (!this.ready) {
throw new Error("liquidity provider is not ready yet")
}
const res = await this.client.NewInvoice({ amountSats: amount, memo })
const res = await this.client.NewInvoice({ amountSats: amount, memo, expiry })
if (res.status === 'ERROR') {
this.log("error creating invoice", res.reason)
throw new Error(res.reason)