getAlby / js-lightning-tools

Collection of helpful building blocks and tools to develop Bitcoin Lightning web apps
https://www.npmjs.com/package/@getalby/lightning-tools
MIT License
29 stars 13 forks source link

ReferenceError: fetch is not defined #126

Open mubarak23 opened 8 months ago

mubarak23 commented 8 months ago

Trying to generate an invoice, but i getting this error

import { LightningAddress } from "@getalby/lightning-tools";

if (!process.env.MERCHANT_LN_ADDRESS) {
  throw new Error(
    "Merchant's Lightning address environment variable is not defined"
  );
}

const ln = new LightningAddress(process.env.LN_ADDRESS)

await ln.fetch()
console.log('await ln.fetch()',  await ln.fetch())

error ReferenceError: fetch is not defined