Update lnurl.ts

This commit is contained in:
Marcos Rodriguez Velez 2025-02-16 22:26:34 -04:00
parent bbf746b011
commit 238ee798ab

View file

@ -6,6 +6,7 @@ import CryptoJS from 'crypto-js';
// @ts-ignore theres no types for secp256k1
import secp256k1 from 'secp256k1';
import { parse } from 'url'; // eslint-disable-line n/no-deprecated-api
import { timeoutFetch } from '../util/fetch';
const ONION_REGEX = /^(http:\/\/[^/:@]+\.onion(?::\d{1,5})?)(\/.*)?$/; // regex for onion URL
@ -111,7 +112,7 @@ export default class Lnurl {
}
async fetchGet(url: string): Promise<any> {
const resp = await fetch(url, { method: 'GET' });
const resp = await timeoutFetch(url, { method: 'GET' });
if (resp.status >= 300) {
throw new Error('Bad response from server');
}