fix
This commit is contained in:
parent
358249daba
commit
c6249764f0
2 changed files with 4 additions and 3 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue