mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-03-11 01:27:30 +01:00
chore: bump dependencies (#325)
This commit is contained in:
parent
543c61179c
commit
5ee6b95c87
24 changed files with 3234 additions and 2672 deletions
1
@types/index.d.ts
vendored
1
@types/index.d.ts
vendored
|
@ -21,3 +21,4 @@ declare module 'balanceofsatoshis/request';
|
|||
declare module 'balanceofsatoshis/swaps';
|
||||
declare module 'balanceofsatoshis/balances';
|
||||
declare module 'balanceofsatoshis/network';
|
||||
declare module 'balanceofsatoshis/commands';
|
||||
|
|
3
next-env.d.ts
vendored
3
next-env.d.ts
vendored
|
@ -1,3 +1,6 @@
|
|||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||
|
|
5698
package-lock.json
generated
5698
package-lock.json
generated
File diff suppressed because it is too large
Load diff
82
package.json
82
package.json
|
@ -36,19 +36,19 @@
|
|||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.21",
|
||||
"@apollo/client": "^3.4.9",
|
||||
"@emotion/babel-plugin": "^11.3.0",
|
||||
"@visx/axis": "^1.17.1",
|
||||
"@visx/chord": "^1.17.1",
|
||||
"@visx/curve": "^1.7.0",
|
||||
"@visx/event": "^1.7.0",
|
||||
"@visx/group": "^1.17.1",
|
||||
"@visx/responsive": "^1.10.1",
|
||||
"@visx/scale": "^1.14.0",
|
||||
"@visx/shape": "^1.17.1",
|
||||
"@visx/tooltip": "^1.17.1",
|
||||
"@visx/axis": "^2.1.0",
|
||||
"@visx/chord": "^2.1.0",
|
||||
"@visx/curve": "^2.1.0",
|
||||
"@visx/event": "^2.1.0",
|
||||
"@visx/group": "^2.1.0",
|
||||
"@visx/responsive": "^2.1.0",
|
||||
"@visx/scale": "^2.1.0",
|
||||
"@visx/shape": "^2.1.0",
|
||||
"@visx/tooltip": "^2.1.0",
|
||||
"apollo-server-micro": "^2.25.2",
|
||||
"balanceofsatoshis": "^10.7.3",
|
||||
"balanceofsatoshis": "^10.9.2",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"bech32": "^2.0.0",
|
||||
"bip32": "^2.0.6",
|
||||
|
@ -62,20 +62,20 @@
|
|||
"date-fns": "^2.23.0",
|
||||
"graphql": "^15.5.1",
|
||||
"graphql-iso-date": "^3.6.1",
|
||||
"graphql-middleware": "^6.0.10",
|
||||
"graphql-middleware": "^6.1.4",
|
||||
"graphql-rate-limit": "^3.1.0",
|
||||
"js-cookie": "^3.0.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"ln-service": "^51.10.0",
|
||||
"ln-service": "^52.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^11.0.1",
|
||||
"next": "^11.1.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"numeral": "^2.0.6",
|
||||
"qrcode.react": "^1.0.1",
|
||||
"react": "^17.0.2",
|
||||
"react-circular-progressbar": "^2.0.4",
|
||||
"react-copy-to-clipboard": "^5.0.3",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-feather": "^2.0.9",
|
||||
"react-grid-layout": "^1.2.5",
|
||||
|
@ -85,29 +85,29 @@
|
|||
"react-spinners": "^0.11.0",
|
||||
"react-spring": "^9.2.4",
|
||||
"react-table": "^7.7.0",
|
||||
"react-toastify": "^7.0.4",
|
||||
"react-toastify": "^8.0.0",
|
||||
"react-tooltip": "^4.2.21",
|
||||
"secp256k1": "^4.0.2",
|
||||
"socks-proxy-agent": "^6.0.0",
|
||||
"styled-components": "^5.3.0",
|
||||
"styled-components": "^5.3.1",
|
||||
"styled-react-modal": "^2.1.0",
|
||||
"styled-theming": "^2.2.0",
|
||||
"uuid": "^8.3.2",
|
||||
"winston": "^3.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@babel/core": "^7.15.0",
|
||||
"@commitlint/cli": "^13.1.0",
|
||||
"@commitlint/config-conventional": "^13.1.0",
|
||||
"@graphql-codegen/add": "^2.0.2",
|
||||
"@graphql-codegen/cli": "^1.21.8",
|
||||
"@graphql-codegen/fragment-matcher": "^2.0.1",
|
||||
"@graphql-codegen/introspection": "^1.18.2",
|
||||
"@graphql-codegen/near-operation-file-preset": "^1.18.6",
|
||||
"@graphql-codegen/typescript": "^1.22.4",
|
||||
"@graphql-codegen/typescript-operations": "^1.18.4",
|
||||
"@graphql-codegen/typescript-react-apollo": "^2.3.1",
|
||||
"@graphql-codegen/typescript-resolvers": "^1.20.0",
|
||||
"@graphql-codegen/add": "^3.1.0",
|
||||
"@graphql-codegen/cli": "^2.1.1",
|
||||
"@graphql-codegen/fragment-matcher": "^3.1.0",
|
||||
"@graphql-codegen/introspection": "^2.1.0",
|
||||
"@graphql-codegen/near-operation-file-preset": "^2.1.2",
|
||||
"@graphql-codegen/typescript": "^2.1.2",
|
||||
"@graphql-codegen/typescript-operations": "^2.1.2",
|
||||
"@graphql-codegen/typescript-react-apollo": "^3.1.2",
|
||||
"@graphql-codegen/typescript-resolvers": "^2.1.2",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"@testing-library/react": "^12.0.0",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
|
@ -117,13 +117,13 @@
|
|||
"@types/d3-time-format": "^3.0.0",
|
||||
"@types/graphql-iso-date": "^3.4.0",
|
||||
"@types/js-cookie": "^2.2.7",
|
||||
"@types/js-yaml": "^4.0.2",
|
||||
"@types/jsonwebtoken": "^8.5.4",
|
||||
"@types/node": "^16.4.7",
|
||||
"@types/js-yaml": "^4.0.3",
|
||||
"@types/jsonwebtoken": "^8.5.5",
|
||||
"@types/node": "^16.7.2",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@types/numeral": "^2.0.1",
|
||||
"@types/qrcode.react": "^1.0.2",
|
||||
"@types/react": "^17.0.15",
|
||||
"@types/react": "^17.0.19",
|
||||
"@types/react-copy-to-clipboard": "^5.0.1",
|
||||
"@types/react-grid-layout": "^1.1.2",
|
||||
"@types/react-qr-reader": "^2.1.4",
|
||||
|
@ -131,12 +131,12 @@
|
|||
"@types/react-slider": "^1.3.1",
|
||||
"@types/react-table": "^7.7.2",
|
||||
"@types/secp256k1": "^4.0.3",
|
||||
"@types/styled-components": "^5.1.11",
|
||||
"@types/styled-components": "^5.1.13",
|
||||
"@types/styled-react-modal": "^1.2.1",
|
||||
"@types/styled-theming": "^2.2.5",
|
||||
"@types/uuid": "^8.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.5",
|
||||
"@typescript-eslint/parser": "^4.28.5",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
||||
"@typescript-eslint/parser": "^4.29.3",
|
||||
"apollo-server": "^2.25.2",
|
||||
"apollo-server-testing": "^2.25.2",
|
||||
"babel-jest": "^27.0.6",
|
||||
|
@ -144,22 +144,22 @@
|
|||
"babel-plugin-inline-react-svg": "^2.0.1",
|
||||
"babel-plugin-styled-components": "^1.13.2",
|
||||
"babel-preset-react-app": "^10.0.0",
|
||||
"eslint": "^7.31.0",
|
||||
"eslint-config-next": "^11.0.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-next": "^11.1.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"eslint-plugin-prettier": "^3.4.1",
|
||||
"eslint-plugin-react": "^7.24.0",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"husky": "^7.0.1",
|
||||
"husky": "^7.0.2",
|
||||
"jest": "^27.0.6",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"lint-staged": "^11.1.1",
|
||||
"lint-staged": "^11.1.2",
|
||||
"prettier": "^2.3.2",
|
||||
"standard-version": "^9.3.1",
|
||||
"typescript": "^4.3.5"
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.+(ts|tsx)": [
|
||||
|
|
|
@ -7,7 +7,7 @@ export const BoltzApi = {
|
|||
try {
|
||||
const response = await fetchWithProxy(`${appUrls.boltz}/getpairs`);
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting pairs from Boltz: %o', error);
|
||||
throw new Error('ErrorGettingBoltzPairs');
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export const BoltzApi = {
|
|||
`${appUrls.boltz}/getfeeestimation`
|
||||
);
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting fee estimations from Boltz: %o', error);
|
||||
throw new Error(error);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export const BoltzApi = {
|
|||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting fee estimations from Boltz: %o', error);
|
||||
throw new Error(error);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export const BoltzApi = {
|
|||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting fee estimations from Boltz: %o', error);
|
||||
throw new Error(error);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export const BoltzApi = {
|
|||
}
|
||||
);
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error broadcasting transaction from Boltz: %o', error);
|
||||
throw new Error(error);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ export const LnMarketsApi = {
|
|||
},
|
||||
});
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
`Error getting user info from ${appUrls.lnMarkets}/user. Error: %o`,
|
||||
error
|
||||
|
@ -35,7 +35,7 @@ export const LnMarketsApi = {
|
|||
}
|
||||
);
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
`Error getting invoice to deposit from LnMarkets. Error: %o`,
|
||||
error
|
||||
|
@ -58,7 +58,7 @@ export const LnMarketsApi = {
|
|||
}
|
||||
);
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(`Error withdrawing from LnMarkets. Error: %o`, error);
|
||||
throw new Error('ProblemWithdrawingFromLnMarkets');
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ export const getSHA256Hash = (
|
|||
export const decodeMacaroon = (macaroon: string, password: string) => {
|
||||
try {
|
||||
return AES.decrypt(macaroon, password).toString(Utf8);
|
||||
} catch (err) {
|
||||
} catch (error: any) {
|
||||
logger.error(`Error decoding macaroon with password: ${password}`);
|
||||
throw new Error('WrongPasswordForLogin');
|
||||
}
|
||||
|
|
|
@ -84,8 +84,8 @@ export const readFile = (
|
|||
try {
|
||||
const file = fs.readFileSync(filePath, encoding);
|
||||
return file;
|
||||
} catch (err) {
|
||||
logger.error('Something went wrong while reading the file: \n' + err);
|
||||
} catch (error: any) {
|
||||
logger.error('Something went wrong while reading the file: \n' + error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -106,9 +106,9 @@ export const parseYaml = (filePath: string): AccountConfigType | null => {
|
|||
const yamlObject = yaml.load(yamlConfig);
|
||||
// TODO: validate this, before returning?
|
||||
return yamlObject as AccountConfigType;
|
||||
} catch (err) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
'Something went wrong while parsing the YAML config file: \n' + err
|
||||
'Something went wrong while parsing the YAML config file: \n' + error
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ const saveHashedYaml = (config: AccountConfigType, filePath: string): void => {
|
|||
const yamlString = yaml.dump(config);
|
||||
fs.writeFileSync(filePath, yamlString);
|
||||
logger.info('Succesfully saved');
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
'Error saving yaml file with hashed passwords. Passwords are still in cleartext on your server.'
|
||||
);
|
||||
|
@ -377,9 +377,9 @@ export const readMacaroons = (macaroonPath: string): string | null => {
|
|||
try {
|
||||
const ssoAdmin = fs.readFileSync(`${macaroonPath}/admin.macaroon`, 'hex');
|
||||
return ssoAdmin;
|
||||
} catch (err) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
'Something went wrong while reading the admin.macaroon: \n' + err
|
||||
'Something went wrong while reading the admin.macaroon: \n' + error
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
@ -394,16 +394,16 @@ export const createDirectory = (dirname: string) => {
|
|||
if (!fs.existsSync(curDir)) {
|
||||
fs.mkdirSync(curDir);
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code !== 'EEXIST') {
|
||||
if (err.code === 'ENOENT') {
|
||||
} catch (error: any) {
|
||||
if (error.code !== 'EEXIST') {
|
||||
if (error.code === 'ENOENT') {
|
||||
throw new Error(
|
||||
`ENOENT: No such file or directory, mkdir '${dirname}'. Ensure that path separator is '${
|
||||
os.platform() === 'win32' ? '\\\\' : '/'
|
||||
}'`
|
||||
);
|
||||
} else {
|
||||
throw err;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -423,9 +423,9 @@ export const readCookie = (cookieFile: string): string | null => {
|
|||
logger.verbose(`Found cookie at path ${cookieFile}`);
|
||||
const cookie = fs.readFileSync(cookieFile, 'utf-8');
|
||||
return cookie;
|
||||
} catch (err) {
|
||||
logger.error('Something went wrong while reading cookie: \n' + err);
|
||||
throw new Error(err);
|
||||
} catch (error: any) {
|
||||
logger.error('Something went wrong while reading cookie: \n' + error);
|
||||
throw new Error(error);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
@ -437,9 +437,9 @@ export const readCookie = (cookieFile: string): string | null => {
|
|||
|
||||
const cookie = fs.readFileSync(cookieFile, 'utf-8');
|
||||
return cookie;
|
||||
} catch (err) {
|
||||
logger.error('Something went wrong while reading the cookie: \n' + err);
|
||||
throw new Error(err);
|
||||
} catch (error: any) {
|
||||
logger.error('Something went wrong while reading the cookie: \n' + error);
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -448,8 +448,8 @@ export const refreshCookie = (cookieFile: string) => {
|
|||
try {
|
||||
logger.verbose('Refreshing cookie for next authentication');
|
||||
fs.writeFileSync(cookieFile, crypto.randomBytes(64).toString('hex'));
|
||||
} catch (err) {
|
||||
logger.error('Something went wrong while refreshing cookie: \n' + err);
|
||||
throw new Error(err);
|
||||
} catch (error: any) {
|
||||
logger.error('Something went wrong while refreshing cookie: \n' + error);
|
||||
throw new Error(error);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -117,7 +117,7 @@ export const getLnMarketsAuth = async (
|
|||
logger.debug('Get lnUrl from LnMarkets response: %o', json);
|
||||
lnUrl = json?.lnurl;
|
||||
if (!lnUrl) throw new Error();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(
|
||||
`Error getting lnAuth url from ${appUrls.lnMarkets}. Error: %o`,
|
||||
error
|
||||
|
@ -141,7 +141,7 @@ export const getLnMarketsAuth = async (
|
|||
}
|
||||
|
||||
return { newCookie: true, cookieString: json.token, json };
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error authenticating with LnUrl service: %o', error);
|
||||
throw new Error('ProblemAuthenticatingWithLnUrlService');
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export const bitcoinResolvers = {
|
|||
const json = await response.json();
|
||||
|
||||
return JSON.stringify(json);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting bitcoin price: %o', error);
|
||||
throw new Error('Problem getting Bitcoin price.');
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ export const bitcoinResolvers = {
|
|||
};
|
||||
}
|
||||
throw new Error('Problem getting Bitcoin fees.');
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting bitcoin fees: %o', error);
|
||||
throw new Error('Problem getting Bitcoin fees.');
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { logger } from 'server/helpers/logger';
|
|||
import { rebalance } from 'balanceofsatoshis/swaps';
|
||||
import { pay } from 'balanceofsatoshis/network';
|
||||
import { getAccountingReport } from 'balanceofsatoshis/balances';
|
||||
import request from '@alexbosworth/request';
|
||||
import { fetchRequest } from 'balanceofsatoshis/commands';
|
||||
import { RebalanceResponseType } from 'server/types/balanceofsatoshis.types';
|
||||
import { getErrorMsg } from 'server/helpers/helpers';
|
||||
|
||||
|
@ -50,7 +50,7 @@ export const bosResolvers = {
|
|||
getAccountingReport({
|
||||
lnd,
|
||||
logger,
|
||||
request,
|
||||
request: fetchRequest,
|
||||
is_csv: true,
|
||||
...params,
|
||||
})
|
||||
|
|
|
@ -55,7 +55,7 @@ export const getContext = (context: ResolverContext) => {
|
|||
lnd = getAuthLnd(data.id, sso, accountConfig);
|
||||
id = data.id;
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.silly('Authentication cookie failed');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ const reduceTokens = (array: GroupedObject | TotalGroupedObject) => {
|
|||
const reducedArray = [];
|
||||
for (const key in array) {
|
||||
if (Object.prototype.hasOwnProperty.call(array, key)) {
|
||||
const channel = array[key];
|
||||
const channel: { tokens: number }[] = array[key];
|
||||
const reduced = channel.reduce((a, b) => a + b.tokens, 0);
|
||||
reducedArray.push({ channel: key, tokens: reduced });
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ export const invoiceResolvers = {
|
|||
let route;
|
||||
try {
|
||||
route = JSON.parse(params.route);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Corrupt route json: %o', error);
|
||||
throw new Error('Corrupt Route JSON');
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ export const invoiceResolvers = {
|
|||
let route;
|
||||
try {
|
||||
route = JSON.parse(routeJSON);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Corrupt route json: %o', error);
|
||||
throw new Error('Corrupt Route JSON');
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ export const lnUrlResolvers = {
|
|||
}
|
||||
|
||||
return { ...json, message: json.event || 'LnServiceSuccess' };
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error authenticating with LnUrl service: %o', error);
|
||||
throw new Error('ProblemAuthenticatingWithLnUrlService');
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ export const lnUrlResolvers = {
|
|||
}
|
||||
|
||||
return json;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error fetching from LnUrl service: %o', error);
|
||||
throw new Error('ProblemFetchingFromLnUrlService');
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ export const lnUrlResolvers = {
|
|||
if (lnServiceResponse.status === 'ERROR') {
|
||||
throw new Error(lnServiceResponse.reason || 'LnServiceError');
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error paying to LnUrl service: %o', error);
|
||||
throw new Error('ProblemPayingLnUrlService');
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ export const lnUrlResolvers = {
|
|||
|
||||
// Return invoice id to check status
|
||||
return info.id;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error withdrawing from LnUrl service: %o', error);
|
||||
throw new Error('ProblemWithdrawingFromLnUrlService');
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ export const lnUrlResolvers = {
|
|||
}
|
||||
|
||||
return 'Successfully requested a channel open';
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error requesting channel from LnUrl service: %o', error);
|
||||
throw new Error(
|
||||
`Error requesting channel from LnUrl service: ${error}`
|
||||
|
|
|
@ -72,7 +72,7 @@ export const peerResolvers = {
|
|||
is_temporary: isTemporary,
|
||||
});
|
||||
return success;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error adding peer: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ export const peerResolvers = {
|
|||
public_key: params.publicKey,
|
||||
});
|
||||
return success;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error removing peer: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ export const toolsResolvers = {
|
|||
let backupObj = { backup: '', channels: [] as ChannelType[] };
|
||||
try {
|
||||
backupObj = JSON.parse(params.backup);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Corrupt backup file: %o', error);
|
||||
throw new Error('Corrupt backup file');
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export const toolsResolvers = {
|
|||
channels,
|
||||
});
|
||||
return is_valid;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error verifying backups: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ export const toolsResolvers = {
|
|||
let backupObj = { backup: '' };
|
||||
try {
|
||||
backupObj = JSON.parse(params.backup);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Corrupt backup file: %o', error);
|
||||
throw new Error('Corrupt backup file');
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export const toolsResolvers = {
|
|||
backup,
|
||||
});
|
||||
return true;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error recovering funds from channels: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export const toolsResolvers = {
|
|||
lnd,
|
||||
});
|
||||
return JSON.stringify(backups);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error getting backups: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ export const toolsResolvers = {
|
|||
});
|
||||
|
||||
return message.signed_by;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error verifying message: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ export const toolsResolvers = {
|
|||
});
|
||||
|
||||
return message.signature;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error('Error signing message: %o', error);
|
||||
throw new Error(getErrorMsg(error));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ export const BitcoinPrice: React.FC = () => {
|
|||
try {
|
||||
const prices = JSON.parse(data.getBitcoinPrice);
|
||||
setPrices({ type: 'fetched', state: { prices } });
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
setPrices({ type: 'dontShow' });
|
||||
stopPolling();
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ export const ChatInit: React.FC = () => {
|
|||
sender,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
localStorage.removeItem('sentChats');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export const DetailsUpload = ({ upload }: DetailsUploadType) => {
|
|||
|
||||
try {
|
||||
channels = JSON.parse(data);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
toast.error('Error Parsing File');
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export const useLocalStorage = <T,>(
|
|||
try {
|
||||
const item = window.localStorage.getItem(key);
|
||||
return item ? JSON.parse(item) : initialValue;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.warn(`Error reading localStorage key “${key}”:`, error);
|
||||
return initialValue;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export const useLocalStorage = <T,>(
|
|||
|
||||
// We dispatch a custom event so every useLocalStorage hook are notified
|
||||
window.dispatchEvent(new Event('local-storage'));
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.warn(`Error setting localStorage key “${key}”:`, error);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -78,7 +78,7 @@ export const getProps = async (
|
|||
query,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// Ignore SSR query errors
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ export const LnUrlCard = () => {
|
|||
if (tag === 'login') {
|
||||
auth({ variables: { url: urlString } });
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
toast.error('Problem decoding LNURL');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -81,7 +81,7 @@ const SwapsProvider: React.FC = ({ children }) => {
|
|||
try {
|
||||
const swaps = JSON.parse(localStorage.getItem('swaps') || '[]');
|
||||
dispatch({ type: 'init', swaps });
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
toast.error('Invalid swaps stored in browser');
|
||||
}
|
||||
}, []);
|
||||
|
|
Loading…
Add table
Reference in a new issue