From 150a5e98dbb7c5523d311eb780b462c2e26991b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Tue, 6 Jun 2023 23:20:41 +0200 Subject: [PATCH 1/3] fix native auth login token handling --- CHANGELOG.md | 3 +++ package.json | 2 +- src/hooks/common-helpers/loginTokenState.ts | 20 +++++++++++++++ src/hooks/useExtensionLogin.tsx | 15 ++++------- src/hooks/useLedgerLogin.tsx | 15 ++++------- src/hooks/useMobileAppLogin.tsx | 18 ++++++------- src/hooks/useNativeAuthLoginToken.ts | 28 --------------------- src/hooks/useWebWalletLogin.tsx | 12 ++------- src/utils/getNativeAuthClient.ts | 5 ++++ 9 files changed, 49 insertions(+), 69 deletions(-) create mode 100644 src/hooks/common-helpers/loginTokenState.ts delete mode 100644 src/hooks/useNativeAuthLoginToken.ts create mode 100644 src/utils/getNativeAuthClient.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 039f505..0ff5886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### [0.6.1](https://github.com/useElven/core/releases/tag/v0.6.1) (2023-06-07) +- fix native auth login token handling + ### [0.6.0](https://github.com/useElven/core/releases/tag/v0.6.0) (2023-06-04) - improvements for nonce incrementation to let trigger multiple transactions at the same time. The logic is slightly different, but it shouldn't break anything (you can test it [here](https://useelven-react-vite-demo.netlify.app/). For now, additional steps are required for the Web Wallet to manage the pending states in UI properly. They solution is presented in the [demo here](https://github.com/useElven/react-vite/blob/main/src/components/demo/EgldTx.tsx)). There will be more improvements in that regard. diff --git a/package.json b/package.json index dbc0436..326d56e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@useelven/core", - "version": "0.6.0", + "version": "0.6.1", "description": "Core hooks for MultiversX React DApps", "license": "MIT", "author": "Julian Ćwirko ", diff --git a/src/hooks/common-helpers/loginTokenState.ts b/src/hooks/common-helpers/loginTokenState.ts new file mode 100644 index 0000000..fb5e63e --- /dev/null +++ b/src/hooks/common-helpers/loginTokenState.ts @@ -0,0 +1,20 @@ +import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; +import { + setLoginInfoState, + loginInfoState, + setLoggingInState, +} from '../../store/auth'; + +export const getLoginToken = async () => { + const client = getNativeAuthClient(); + let token = loginInfoState.loginToken; + + if (!token) { + setLoggingInState('pending', true); + token = await client.initialize(); + setLoggingInState('pending', false); + } + + setLoginInfoState('loginToken', token); + return token; +}; diff --git a/src/hooks/useExtensionLogin.tsx b/src/hooks/useExtensionLogin.tsx index 265e2a6..483cec0 100644 --- a/src/hooks/useExtensionLogin.tsx +++ b/src/hooks/useExtensionLogin.tsx @@ -13,24 +13,17 @@ import { useLogout } from './useLogout'; import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; +import { getLoginToken } from './common-helpers/loginTokenState'; import { useNetwork } from './useNetwork'; -import { useNativeAuthLoginToken } from './useNativeAuthLoginToken'; +import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; export const useExtensionLogin = (params?: Login) => { const { logout } = useLogout(); const { loggedIn, pending, error } = useLoggingIn(); const networkStateSnap = useNetwork(); - const { loginToken, nativeAuthClient } = useNativeAuthLoginToken(); const login = async () => { - if (!loginToken) { - setLoggingInState( - 'error', - 'Login token is not present. Please try again.' - ); - setLoggingInState('pending', false); - return; - } + const loginToken = await getLoginToken(); const providerInstance = ExtensionProvider.getInstance(); @@ -101,6 +94,8 @@ export const useExtensionLogin = (params?: Login) => { setLoginInfoState('expires', getNewLoginExpiresTimestamp()); setLoggingInState('loggedIn', Boolean(address)); + const nativeAuthClient = getNativeAuthClient(); + if (signature && nativeAuthClient) { setLoginInfoState('signature', signature); const accessToken = nativeAuthClient.getToken( diff --git a/src/hooks/useLedgerLogin.tsx b/src/hooks/useLedgerLogin.tsx index ec0a021..ae12e04 100644 --- a/src/hooks/useLedgerLogin.tsx +++ b/src/hooks/useLedgerLogin.tsx @@ -14,23 +14,16 @@ import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; import { useNetwork } from './useNetwork'; -import { useNativeAuthLoginToken } from './useNativeAuthLoginToken'; +import { getLoginToken } from './common-helpers/loginTokenState'; +import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; export const useLedgerLogin = (params?: Login) => { const { logout } = useLogout(); const { loggedIn, pending, error } = useLoggingIn(); const networkStateSnap = useNetwork(); - const { loginToken, nativeAuthClient } = useNativeAuthLoginToken(); const login = async (addressIndex = 0) => { - if (!loginToken) { - setLoggingInState( - 'error', - 'Login token is not present. Please try again.' - ); - setLoggingInState('pending', false); - return; - } + const loginToken = await getLoginToken(); const apiNetworkProvider = networkStateSnap.apiNetworkProvider; const dappProvider = networkStateSnap.dappProvider; @@ -65,6 +58,8 @@ export const useLedgerLogin = (params?: Login) => { userAddress = loginInfo.address; } + const nativeAuthClient = getNativeAuthClient(); + if (loginInfo.signature && nativeAuthClient) { const sigString = loginInfo.signature.toString('hex'); setLoginInfoState('signature', sigString); diff --git a/src/hooks/useMobileAppLogin.tsx b/src/hooks/useMobileAppLogin.tsx index e2b2523..536b612 100644 --- a/src/hooks/useMobileAppLogin.tsx +++ b/src/hooks/useMobileAppLogin.tsx @@ -24,7 +24,8 @@ import { DappProvider } from '../types/network'; import { ApiNetworkProvider } from '@multiversx/sdk-network-providers/out'; import { useConfig } from './useConfig'; import { useNetwork } from './useNetwork'; -import { useNativeAuthLoginToken } from './useNativeAuthLoginToken'; +import { getLoginToken } from './common-helpers/loginTokenState'; +import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; export const useMobileAppLogin = (params?: Login) => { const { logout } = useLogout(); @@ -35,7 +36,6 @@ export const useMobileAppLogin = (params?: Login) => { >(); const networkStateSnap = useNetwork(); const configStateSnap = useConfig(); - const { loginToken, nativeAuthClient } = useNativeAuthLoginToken(); const dappProviderRef = useRef( networkStateSnap.dappProvider as DappProvider @@ -49,14 +49,7 @@ export const useMobileAppLogin = (params?: Login) => { }; const login = async () => { - if (!loginToken) { - setLoggingInState( - 'error', - 'Login token is not present. Please try again.' - ); - setLoggingInState('pending', false); - return; - } + const loginToken = await getLoginToken(); const relayAddress = getRelayAddressFromNetwork( configStateSnap.walletConnectV2RelayAddresses as string[] @@ -97,6 +90,9 @@ export const useMobileAppLogin = (params?: Login) => { setAccountState('nonce', account.nonce.valueOf()); setLoggingInState('loggedIn', Boolean(address)); + + const nativeAuthClient = getNativeAuthClient(); + if (signature && nativeAuthClient) { setLoginInfoState('signature', signature); const accessToken = nativeAuthClient.getToken( @@ -184,6 +180,8 @@ export const useMobileAppLogin = (params?: Login) => { setLoginInfoState('loginMethod', LoginMethodsEnum.walletconnect); + const loginToken = await getLoginToken(); + await dappProvider.login({ token: loginToken, approval, diff --git a/src/hooks/useNativeAuthLoginToken.ts b/src/hooks/useNativeAuthLoginToken.ts deleted file mode 100644 index a504f4a..0000000 --- a/src/hooks/useNativeAuthLoginToken.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NativeAuthClient } from '@multiversx/sdk-native-auth-client'; -import { useConfig } from './useConfig'; -import { useEffect, useState } from 'react'; - -export const useNativeAuthLoginToken = () => { - const [loginToken, setLoginToken] = useState(); - const [nativeAuthClient, setNativeAuthClient] = useState(); - const { apiAddress } = useConfig(); - - useEffect(() => { - const getToken = async () => { - const client = new NativeAuthClient({ apiUrl: apiAddress }); - const loginToken = await client.initialize(); - - setLoginToken(loginToken); - setNativeAuthClient(client); - }; - - if (apiAddress) { - getToken(); - } - }, [apiAddress]); - - return { - loginToken, - nativeAuthClient, - }; -}; diff --git a/src/hooks/useWebWalletLogin.tsx b/src/hooks/useWebWalletLogin.tsx index 0947ca3..0bd29e4 100644 --- a/src/hooks/useWebWalletLogin.tsx +++ b/src/hooks/useWebWalletLogin.tsx @@ -8,25 +8,17 @@ import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; import { useConfig } from './useConfig'; -import { useNativeAuthLoginToken } from './useNativeAuthLoginToken'; +import { getLoginToken } from './common-helpers/loginTokenState'; export const useWebWalletLogin = (params?: Login) => { const { logout } = useLogout(); const { loggedIn, pending, error } = useLoggingIn(); const configStateSnap = useConfig(); - const { loginToken } = useNativeAuthLoginToken(); const login = async () => { setLoggingInState('pending', true); - if (!loginToken) { - setLoggingInState( - 'error', - 'Login token is not present. Please try again.' - ); - setLoggingInState('pending', false); - return; - } + const loginToken = await getLoginToken(); const providerInstance = new WalletProvider( `${configStateSnap.walletAddress}${DAPP_INIT_ROUTE}` diff --git a/src/utils/getNativeAuthClient.ts b/src/utils/getNativeAuthClient.ts new file mode 100644 index 0000000..ec18b37 --- /dev/null +++ b/src/utils/getNativeAuthClient.ts @@ -0,0 +1,5 @@ +import { NativeAuthClient } from '@multiversx/sdk-native-auth-client'; +import { configState } from '../store/config'; + +export const getNativeAuthClient = () => + new NativeAuthClient({ apiUrl: configState.apiAddress }); From ad0cdb89d1582d22628f3cbcfe0748337e3091fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Wed, 7 Jun 2023 00:01:19 +0200 Subject: [PATCH 2/3] rename file --- .gitignore | 1 + .../{loginTokenState.ts => getLoginToken.ts} | 12 +++++++++--- src/hooks/useExtensionLogin.tsx | 2 +- src/hooks/useLedgerLogin.tsx | 2 +- src/hooks/useMobileAppLogin.tsx | 2 +- src/hooks/useWebWalletLogin.tsx | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) rename src/hooks/common-helpers/{loginTokenState.ts => getLoginToken.ts} (57%) diff --git a/.gitignore b/.gitignore index dd87e2d..16d2e37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules build +.vscode diff --git a/src/hooks/common-helpers/loginTokenState.ts b/src/hooks/common-helpers/getLoginToken.ts similarity index 57% rename from src/hooks/common-helpers/loginTokenState.ts rename to src/hooks/common-helpers/getLoginToken.ts index fb5e63e..d3c277f 100644 --- a/src/hooks/common-helpers/loginTokenState.ts +++ b/src/hooks/common-helpers/getLoginToken.ts @@ -4,15 +4,21 @@ import { loginInfoState, setLoggingInState, } from '../../store/auth'; +import { errorParse } from 'src/utils/errorParse'; export const getLoginToken = async () => { const client = getNativeAuthClient(); let token = loginInfoState.loginToken; if (!token) { - setLoggingInState('pending', true); - token = await client.initialize(); - setLoggingInState('pending', false); + try { + setLoggingInState('pending', true); + token = await client.initialize(); + } catch (e) { + setLoggingInState('error', errorParse(e)); + } finally { + setLoggingInState('pending', false); + } } setLoginInfoState('loginToken', token); diff --git a/src/hooks/useExtensionLogin.tsx b/src/hooks/useExtensionLogin.tsx index 483cec0..fdca561 100644 --- a/src/hooks/useExtensionLogin.tsx +++ b/src/hooks/useExtensionLogin.tsx @@ -13,7 +13,7 @@ import { useLogout } from './useLogout'; import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; -import { getLoginToken } from './common-helpers/loginTokenState'; +import { getLoginToken } from './common-helpers/getLoginToken'; import { useNetwork } from './useNetwork'; import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; diff --git a/src/hooks/useLedgerLogin.tsx b/src/hooks/useLedgerLogin.tsx index ae12e04..c0d5ecc 100644 --- a/src/hooks/useLedgerLogin.tsx +++ b/src/hooks/useLedgerLogin.tsx @@ -14,7 +14,7 @@ import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; import { useNetwork } from './useNetwork'; -import { getLoginToken } from './common-helpers/loginTokenState'; +import { getLoginToken } from './common-helpers/getLoginToken'; import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; export const useLedgerLogin = (params?: Login) => { diff --git a/src/hooks/useMobileAppLogin.tsx b/src/hooks/useMobileAppLogin.tsx index 536b612..1ee3885 100644 --- a/src/hooks/useMobileAppLogin.tsx +++ b/src/hooks/useMobileAppLogin.tsx @@ -24,7 +24,7 @@ import { DappProvider } from '../types/network'; import { ApiNetworkProvider } from '@multiversx/sdk-network-providers/out'; import { useConfig } from './useConfig'; import { useNetwork } from './useNetwork'; -import { getLoginToken } from './common-helpers/loginTokenState'; +import { getLoginToken } from './common-helpers/getLoginToken'; import { getNativeAuthClient } from 'src/utils/getNativeAuthClient'; export const useMobileAppLogin = (params?: Login) => { diff --git a/src/hooks/useWebWalletLogin.tsx b/src/hooks/useWebWalletLogin.tsx index 0bd29e4..55e0e1e 100644 --- a/src/hooks/useWebWalletLogin.tsx +++ b/src/hooks/useWebWalletLogin.tsx @@ -8,7 +8,7 @@ import { Login } from '../types/account'; import { useLoggingIn } from './useLoggingIn'; import { errorParse } from '../utils/errorParse'; import { useConfig } from './useConfig'; -import { getLoginToken } from './common-helpers/loginTokenState'; +import { getLoginToken } from './common-helpers/getLoginToken'; export const useWebWalletLogin = (params?: Login) => { const { logout } = useLogout(); From 95cd8ddb267afe0b7a8c33ae72cea916dbc1e9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Wed, 7 Jun 2023 02:12:36 +0200 Subject: [PATCH 3/3] update dependencies --- package-lock.json | 246 +++++++++++++++++++++++----------------------- package.json | 12 +-- 2 files changed, 129 insertions(+), 129 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98fcc5a..176d796 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@useelven/core", - "version": "0.5.0", + "version": "0.6.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@useelven/core", - "version": "0.5.0", + "version": "0.6.1", "license": "MIT", "dependencies": { "@multiversx/sdk-core": "12.2.1", "@multiversx/sdk-extension-provider": "2.0.7", "@multiversx/sdk-hw-provider": "6.0.0", - "@multiversx/sdk-native-auth-client": "^1.0.2", + "@multiversx/sdk-native-auth-client": "1.0.2", "@multiversx/sdk-network-providers": "1.4.0", "@multiversx/sdk-wallet-connect-provider": "3.2.1", "@multiversx/sdk-web-wallet-provider": "3.0.0", @@ -23,18 +23,18 @@ "devDependencies": { "@types/lodash.clonedeep": "4.5.7", "@types/node": "20.2.5", - "@types/react": "18.2.7", - "@typescript-eslint/eslint-plugin": "5.59.7", - "@typescript-eslint/parser": "5.59.7", + "@types/react": "18.2.8", + "@typescript-eslint/eslint-plugin": "5.59.9", + "@typescript-eslint/parser": "5.59.9", "esbuild": "0.17.19", - "eslint": "8.41.0", + "eslint": "8.42.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-prettier": "4.2.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", "prettier": "2.8.8", "rimraf": "5.0.1", - "typescript": "5.0.4" + "typescript": "5.1.3" }, "engines": { "node": "^14.13.1 || >=16.0.0" @@ -454,9 +454,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.42.0.tgz", + "integrity": "sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1083,9 +1083,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.7", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.7.tgz", - "integrity": "sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==", + "version": "18.2.8", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.8.tgz", + "integrity": "sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -1106,15 +1106,15 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.7.tgz", - "integrity": "sha512-BL+jYxUFIbuYwy+4fF86k5vdT9lT0CNJ6HtwrIvGh0PhH8s0yy5rjaKH2fDCrz5ITHy07WCzVGNvAmjJh4IJFA==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", + "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/type-utils": "5.59.7", - "@typescript-eslint/utils": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/type-utils": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -1140,14 +1140,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.7.tgz", - "integrity": "sha512-VhpsIEuq/8i5SF+mPg9jSdIwgMBBp0z9XqjiEay+81PYLJuroN+ET1hM5IhkiYMJd9MkTz8iJLt7aaGAgzWUbQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", + "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/typescript-estree": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "debug": "^4.3.4" }, "engines": { @@ -1167,13 +1167,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.7.tgz", - "integrity": "sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", + "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/visitor-keys": "5.59.7" + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1184,13 +1184,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.7.tgz", - "integrity": "sha512-ozuz/GILuYG7osdY5O5yg0QxXUAEoI4Go3Do5xeu+ERH9PorHBPSdvD3Tjp2NN2bNLh1NJQSsQu2TPu/Ly+HaQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", + "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.7", - "@typescript-eslint/utils": "5.59.7", + "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1211,9 +1211,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.7.tgz", - "integrity": "sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", + "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1224,13 +1224,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz", - "integrity": "sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", + "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/visitor-keys": "5.59.7", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1251,17 +1251,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.7.tgz", - "integrity": "sha512-yCX9WpdQKaLufz5luG4aJbOpdXf/fjwGMcLFXZVPUz3QqLirG5QcwwnIHNf8cjLjxK4qtzTO8udUtMQSAToQnQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", + "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/typescript-estree": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -1277,12 +1277,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz", - "integrity": "sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", + "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.7", + "@typescript-eslint/types": "5.59.9", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -2632,16 +2632,16 @@ } }, "node_modules/eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.42.0.tgz", + "integrity": "sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/js": "8.42.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -3230,9 +3230,9 @@ } }, "node_modules/glob": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.6.tgz", - "integrity": "sha512-U/rnDpXJGF414QQQZv5uVsabTVxMSwzS5CH0p3DRCIV6ownl4f7PzGnkGmvlum2wB+9RlJWJZ6ACU1INnBqiPA==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz", + "integrity": "sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", @@ -5383,15 +5383,15 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/u2f-api": { @@ -5939,9 +5939,9 @@ } }, "@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.42.0.tgz", + "integrity": "sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==", "dev": true }, "@humanwhocodes/config-array": { @@ -6530,9 +6530,9 @@ "dev": true }, "@types/react": { - "version": "18.2.7", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.7.tgz", - "integrity": "sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==", + "version": "18.2.8", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.8.tgz", + "integrity": "sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==", "dev": true, "requires": { "@types/prop-types": "*", @@ -6553,15 +6553,15 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.7.tgz", - "integrity": "sha512-BL+jYxUFIbuYwy+4fF86k5vdT9lT0CNJ6HtwrIvGh0PhH8s0yy5rjaKH2fDCrz5ITHy07WCzVGNvAmjJh4IJFA==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.9.tgz", + "integrity": "sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/type-utils": "5.59.7", - "@typescript-eslint/utils": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/type-utils": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -6571,53 +6571,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.7.tgz", - "integrity": "sha512-VhpsIEuq/8i5SF+mPg9jSdIwgMBBp0z9XqjiEay+81PYLJuroN+ET1hM5IhkiYMJd9MkTz8iJLt7aaGAgzWUbQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.9.tgz", + "integrity": "sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/typescript-estree": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.7.tgz", - "integrity": "sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.9.tgz", + "integrity": "sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/visitor-keys": "5.59.7" + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9" } }, "@typescript-eslint/type-utils": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.7.tgz", - "integrity": "sha512-ozuz/GILuYG7osdY5O5yg0QxXUAEoI4Go3Do5xeu+ERH9PorHBPSdvD3Tjp2NN2bNLh1NJQSsQu2TPu/Ly+HaQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.9.tgz", + "integrity": "sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.7", - "@typescript-eslint/utils": "5.59.7", + "@typescript-eslint/typescript-estree": "5.59.9", + "@typescript-eslint/utils": "5.59.9", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.7.tgz", - "integrity": "sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.9.tgz", + "integrity": "sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz", - "integrity": "sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.9.tgz", + "integrity": "sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/visitor-keys": "5.59.7", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/visitor-keys": "5.59.9", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6626,28 +6626,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.7.tgz", - "integrity": "sha512-yCX9WpdQKaLufz5luG4aJbOpdXf/fjwGMcLFXZVPUz3QqLirG5QcwwnIHNf8cjLjxK4qtzTO8udUtMQSAToQnQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.9.tgz", + "integrity": "sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.7", - "@typescript-eslint/types": "5.59.7", - "@typescript-eslint/typescript-estree": "5.59.7", + "@typescript-eslint/scope-manager": "5.59.9", + "@typescript-eslint/types": "5.59.9", + "@typescript-eslint/typescript-estree": "5.59.9", "eslint-scope": "^5.1.1", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.7", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz", - "integrity": "sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==", + "version": "5.59.9", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.9.tgz", + "integrity": "sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.7", + "@typescript-eslint/types": "5.59.9", "eslint-visitor-keys": "^3.3.0" } }, @@ -7747,16 +7747,16 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.42.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.42.0.tgz", + "integrity": "sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/js": "8.42.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -8177,9 +8177,9 @@ } }, "glob": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.6.tgz", - "integrity": "sha512-U/rnDpXJGF414QQQZv5uVsabTVxMSwzS5CH0p3DRCIV6ownl4f7PzGnkGmvlum2wB+9RlJWJZ6ACU1INnBqiPA==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz", + "integrity": "sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==", "dev": true, "requires": { "foreground-child": "^3.1.0", @@ -9692,9 +9692,9 @@ } }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==" + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==" }, "u2f-api": { "version": "0.2.7", diff --git a/package.json b/package.json index 326d56e..11bc53c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@multiversx/sdk-core": "12.2.1", "@multiversx/sdk-extension-provider": "2.0.7", "@multiversx/sdk-hw-provider": "6.0.0", - "@multiversx/sdk-native-auth-client": "^1.0.2", + "@multiversx/sdk-native-auth-client": "1.0.2", "@multiversx/sdk-network-providers": "1.4.0", "@multiversx/sdk-wallet-connect-provider": "3.2.1", "@multiversx/sdk-web-wallet-provider": "3.0.0", @@ -59,18 +59,18 @@ "devDependencies": { "@types/lodash.clonedeep": "4.5.7", "@types/node": "20.2.5", - "@types/react": "18.2.7", - "@typescript-eslint/eslint-plugin": "5.59.7", - "@typescript-eslint/parser": "5.59.7", + "@types/react": "18.2.8", + "@typescript-eslint/eslint-plugin": "5.59.9", + "@typescript-eslint/parser": "5.59.9", "esbuild": "0.17.19", - "eslint": "8.41.0", + "eslint": "8.42.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-prettier": "4.2.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", "prettier": "2.8.8", "rimraf": "5.0.1", - "typescript": "5.0.4" + "typescript": "5.1.3" }, "peerDependencies": { "react": "18.2.0"