Skip to content

Commit

Permalink
🚧 add logs in pay invoice action
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelStark committed Dec 20, 2024
1 parent 71df136 commit 3d007fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/plugin-bitcoin-lightning-network/src/actions/pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ export class PayInvoiceAction {
constructor(private lnbitsProvider: LNBitsProvider) {}

async payInvoice(invoice: string): Promise<{ status: string }> {
console.log(`Paying invoice: ${invoice}`);
console.log(`Received bolt11 invoice: ${invoice}`);
const decodedInvoice =
this.lnbitsProvider.toHumanFriendlyInvoice(invoice);
console.log(`Decoded invoice: ${JSON.stringify(decodedInvoice)}`);

try {
await this.lnbitsProvider.payInvoice(invoice);

console.log("Invoice paid successfully");
return {
status: "success",
};
Expand Down

0 comments on commit 3d007fa

Please sign in to comment.