@dynamic-labs/sdk-react-core 0.18.0-RC.2 → 0.18.0-RC.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.cjs +5 -1
- package/src/lib/layout/DynamicAuthLayout/FooterContent/WalletListFooterContent/WalletListFooterContent.js +5 -1
- package/src/lib/shared/utils/classes/storage/localStorage.cjs +20 -0
- package/src/lib/shared/utils/classes/storage/localStorage.d.ts +1 -0
- package/src/lib/shared/utils/classes/storage/localStorage.js +20 -0
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +6 -1
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.d.ts +3 -1
- package/src/lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js +6 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.cjs +2 -3
- package/src/lib/utils/functions/getAuthToken/getAuthToken.d.ts +1 -1
- package/src/lib/utils/functions/getAuthToken/getAuthToken.js +2 -3
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.18.0-RC.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.2...v0.18.0-RC.3) (2023-06-16)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add skeleton to walletlistfooter ([#2361](https://github.com/dynamic-labs/DynamicAuth/issues/2361)) ([676be6c](https://github.com/dynamic-labs/DynamicAuth/commit/676be6c108dff8df7175f0587cf0568658276e4e))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **local-storage:** load auth token when stringified ([#2368](https://github.com/dynamic-labs/DynamicAuth/issues/2368)) ([3a54266](https://github.com/dynamic-labs/DynamicAuth/commit/3a54266fde3cd1f7362ccc490f89b8925132271b))
|
|
13
|
+
|
|
2
14
|
## [0.18.0-RC.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.1...v0.18.0-RC.2) (2023-06-16)
|
|
3
15
|
|
|
4
16
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.18.0-RC.
|
|
3
|
+
"version": "0.18.0-RC.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"formik": "2.2.9",
|
|
17
17
|
"qrcode": "1.5.1",
|
|
18
18
|
"ethers": "5.7.2",
|
|
19
|
-
"@dynamic-labs/logger": "0.18.0-RC.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.18.0-RC.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.18.0-RC.
|
|
22
|
-
"@dynamic-labs/types": "0.18.0-RC.
|
|
23
|
-
"@dynamic-labs/utils": "0.18.0-RC.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.18.0-RC.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.18.0-RC.
|
|
19
|
+
"@dynamic-labs/logger": "0.18.0-RC.3",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.18.0-RC.3",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.18.0-RC.3",
|
|
22
|
+
"@dynamic-labs/types": "0.18.0-RC.3",
|
|
23
|
+
"@dynamic-labs/utils": "0.18.0-RC.3",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.18.0-RC.3",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.18.0-RC.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"semver": "7.3.8"
|
|
@@ -170,6 +170,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
170
170
|
primaryWallet,
|
|
171
171
|
projectSettings,
|
|
172
172
|
user,
|
|
173
|
+
walletBook: walletBook$1,
|
|
173
174
|
});
|
|
174
175
|
const setShowAuthFlowWithInit = useSetShowAuthFlowWithInit.useSetShowAuthFlowWithInit({
|
|
175
176
|
setShowAuthFlow,
|
|
@@ -35,6 +35,7 @@ require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
|
35
35
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
36
36
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
37
37
|
require('../../../../components/Alert/Alert.cjs');
|
|
38
|
+
var Skeleton = require('../../../../components/Skeleton/Skeleton.cjs');
|
|
38
39
|
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
39
40
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
40
41
|
require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
@@ -49,7 +50,7 @@ var Item = require('./Item/Item.cjs');
|
|
|
49
50
|
var WalletExtensionOrAppContinueButton = require('./WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs');
|
|
50
51
|
|
|
51
52
|
const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
52
|
-
var _a;
|
|
53
|
+
var _a, _b;
|
|
53
54
|
const { wallets } = useInternalDynamicContext.useInternalDynamicContext();
|
|
54
55
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
55
56
|
const [selectedUrl, setSelectedUrl] = React.useState('');
|
|
@@ -79,6 +80,9 @@ const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
|
79
80
|
url: links.android,
|
|
80
81
|
},
|
|
81
82
|
];
|
|
83
|
+
if (!Object.keys((_b = walletBook$1 === null || walletBook$1 === void 0 ? void 0 : walletBook$1.wallets) !== null && _b !== void 0 ? _b : {}).length) {
|
|
84
|
+
return jsxRuntime.jsx(Skeleton.Skeleton, { className: 'walletlist-footer-content__container' });
|
|
85
|
+
}
|
|
82
86
|
return (jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-footer-content__container' }, { children: jsxRuntime.jsxs(EnterTileAnimation.EnterTileAnimation, Object.assign({ delay: '300ms' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-footer-content__icon' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName, style: { height: pixelToRem.pixelToRem(56), width: pixelToRem.pixelToRem(56) } }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'walletlist-footer-content__typography-wrapper' }, { children: [jsxRuntime.jsxs(Typography.Typography, Object.assign({ as: 'p', variant: 'title', weight: 'medium' }, { children: ["We recommend installing", ' ', walletBook.getWalletBookWallet(walletBook$1, walletName).name] })), jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'label', variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'walletlist-footer-content__typography--label' }, { children: "Select your preferred option below:" }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'walletlist-footer-content__buttons-wrapper' }, { children: walletLinksElements.map((element, i) => element.isEnabled ? (jsxRuntime.jsx("button", Object.assign({ onClick: () => setSelectedUrl(element.url) }, { children: jsxRuntime.jsx(Item.Item, { StartIcon: element.icon, heading: element.content, url: element.url }) }), i)) : undefined) })), isCustodialServiceWallet && (jsxRuntime.jsxs("div", Object.assign({ className: 'walletlist-footer-content__custodial-wallet-area' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'walletlist-footer-content__custodial-wallet-area--title', as: 'p', color: 'secondary', variant: 'body_normal', weight: 'regular' }, { children: "If you don't want to install a wallet, then use:" })), jsxRuntime.jsx(NewToWeb3WalletItem.NewToWeb3WalletItem, { wallet: newToWeb3Wallet })] }))), jsxRuntime.jsx(WalletExtensionOrAppContinueButton.WalletExtensionOrAppContinueButton, { selectedUrl: selectedUrl, wallet: newToWeb3Wallet })] })) })));
|
|
83
87
|
};
|
|
84
88
|
|
|
@@ -31,6 +31,7 @@ import '../../../../context/ErrorContext/ErrorContext.js';
|
|
|
31
31
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
32
32
|
import '../../../../components/IconButton/IconButton.js';
|
|
33
33
|
import '../../../../components/Alert/Alert.js';
|
|
34
|
+
import { Skeleton } from '../../../../components/Skeleton/Skeleton.js';
|
|
34
35
|
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
35
36
|
import '../../../../context/MockContext/MockContext.js';
|
|
36
37
|
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
@@ -45,7 +46,7 @@ import { Item } from './Item/Item.js';
|
|
|
45
46
|
import { WalletExtensionOrAppContinueButton } from './WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js';
|
|
46
47
|
|
|
47
48
|
const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
48
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
49
50
|
const { wallets } = useInternalDynamicContext();
|
|
50
51
|
const { walletBook } = useWalletBookContext();
|
|
51
52
|
const [selectedUrl, setSelectedUrl] = useState('');
|
|
@@ -75,6 +76,9 @@ const WalletListFooterContent = ({ chains, newToWeb3WalletChainMap, }) => {
|
|
|
75
76
|
url: links.android,
|
|
76
77
|
},
|
|
77
78
|
];
|
|
79
|
+
if (!Object.keys((_b = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _b !== void 0 ? _b : {}).length) {
|
|
80
|
+
return jsx(Skeleton, { className: 'walletlist-footer-content__container' });
|
|
81
|
+
}
|
|
78
82
|
return (jsx("div", Object.assign({ className: 'walletlist-footer-content__container' }, { children: jsxs(EnterTileAnimation, Object.assign({ delay: '300ms' }, { children: [jsx("div", Object.assign({ className: 'walletlist-footer-content__icon' }, { children: jsx(WalletIcon, { walletName: walletName, style: { height: pixelToRem(56), width: pixelToRem(56) } }) })), jsxs("div", Object.assign({ className: 'walletlist-footer-content__typography-wrapper' }, { children: [jsxs(Typography, Object.assign({ as: 'p', variant: 'title', weight: 'medium' }, { children: ["We recommend installing", ' ', getWalletBookWallet(walletBook, walletName).name] })), jsx(Typography, Object.assign({ as: 'label', variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'walletlist-footer-content__typography--label' }, { children: "Select your preferred option below:" }))] })), jsx("div", Object.assign({ className: 'walletlist-footer-content__buttons-wrapper' }, { children: walletLinksElements.map((element, i) => element.isEnabled ? (jsx("button", Object.assign({ onClick: () => setSelectedUrl(element.url) }, { children: jsx(Item, { StartIcon: element.icon, heading: element.content, url: element.url }) }), i)) : undefined) })), isCustodialServiceWallet && (jsxs("div", Object.assign({ className: 'walletlist-footer-content__custodial-wallet-area' }, { children: [jsx(Typography, Object.assign({ className: 'walletlist-footer-content__custodial-wallet-area--title', as: 'p', color: 'secondary', variant: 'body_normal', weight: 'regular' }, { children: "If you don't want to install a wallet, then use:" })), jsx(NewToWeb3WalletItem, { wallet: newToWeb3Wallet })] }))), jsx(WalletExtensionOrAppContinueButton, { selectedUrl: selectedUrl, wallet: newToWeb3Wallet })] })) })));
|
|
79
83
|
};
|
|
80
84
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var localStorage = require('../../../../utils/constants/localStorage.cjs');
|
|
6
|
+
require('../../../../utils/constants/colors.cjs');
|
|
5
7
|
var logger = require('../../../logger.cjs');
|
|
6
8
|
|
|
7
9
|
class LocalStorage {
|
|
@@ -14,6 +16,24 @@ class LocalStorage {
|
|
|
14
16
|
LocalStorage.__suffix__ = suffix;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
19
|
+
// Will be refactored on INC-155
|
|
20
|
+
static getAuthTokenValue() {
|
|
21
|
+
if (typeof window === 'undefined') {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const value = window.localStorage.getItem(LocalStorage.getDynamicLSKey(localStorage.AUTH_TOKEN));
|
|
25
|
+
try {
|
|
26
|
+
if (value) {
|
|
27
|
+
return JSON.parse(value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
logger.logger.error(e);
|
|
32
|
+
// Return auth token string for backwards compatibility
|
|
33
|
+
return value || undefined;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
17
37
|
static getFromLS(key) {
|
|
18
38
|
if (typeof window === 'undefined') {
|
|
19
39
|
return undefined;
|
|
@@ -3,6 +3,7 @@ export declare class LocalStorage {
|
|
|
3
3
|
static getSuffix: () => string;
|
|
4
4
|
private static getDynamicLSKey;
|
|
5
5
|
static setSuffix(localStorageSuffix?: string): void;
|
|
6
|
+
static getAuthTokenValue(): string | undefined;
|
|
6
7
|
static getFromLS<T = any>(key: string): T | undefined;
|
|
7
8
|
static removeFromLS(key: string): void;
|
|
8
9
|
static setToLS<T = any>(key: string, value: T): void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AUTH_TOKEN } from '../../../../utils/constants/localStorage.js';
|
|
2
|
+
import '../../../../utils/constants/colors.js';
|
|
1
3
|
import { logger } from '../../../logger.js';
|
|
2
4
|
|
|
3
5
|
class LocalStorage {
|
|
@@ -10,6 +12,24 @@ class LocalStorage {
|
|
|
10
12
|
LocalStorage.__suffix__ = suffix;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
15
|
+
// Will be refactored on INC-155
|
|
16
|
+
static getAuthTokenValue() {
|
|
17
|
+
if (typeof window === 'undefined') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const value = window.localStorage.getItem(LocalStorage.getDynamicLSKey(AUTH_TOKEN));
|
|
21
|
+
try {
|
|
22
|
+
if (value) {
|
|
23
|
+
return JSON.parse(value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
logger.error(e);
|
|
28
|
+
// Return auth token string for backwards compatibility
|
|
29
|
+
return value || undefined;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
13
33
|
static getFromLS(key) {
|
|
14
34
|
if (typeof window === 'undefined') {
|
|
15
35
|
return undefined;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var index = require('../../functions/lastAuthenticatedAccount/index.cjs');
|
|
7
7
|
|
|
8
|
-
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }) => {
|
|
8
|
+
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, walletBook, }) => {
|
|
9
9
|
var _a;
|
|
10
10
|
const [sdkHasLoaded, setSdkHasLoaded] = React.useState(false);
|
|
11
11
|
const primaryWalletIsLoading = user &&
|
|
@@ -13,6 +13,10 @@ const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSet
|
|
|
13
13
|
!primaryWallet;
|
|
14
14
|
const connectOnlyUserIsLoading = authMode === 'connect-only' && connectedInfo && !connectedWallet;
|
|
15
15
|
React.useEffect(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
if (!Object.keys((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {}).length) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
16
20
|
if (projectSettings) {
|
|
17
21
|
if (primaryWalletIsLoading || connectOnlyUserIsLoading) {
|
|
18
22
|
return;
|
|
@@ -25,6 +29,7 @@ const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSet
|
|
|
25
29
|
user,
|
|
26
30
|
primaryWalletIsLoading,
|
|
27
31
|
connectOnlyUserIsLoading,
|
|
32
|
+
walletBook,
|
|
28
33
|
]);
|
|
29
34
|
return {
|
|
30
35
|
sdkHasLoaded,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
3
|
+
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
3
4
|
import { UserProfile, Wallet } from '../../../types';
|
|
4
5
|
import { ConnectedWalletConnectorType } from '../../../../utils/hooks/useConnectWallet/useConnectWallet';
|
|
5
6
|
type Props = {
|
|
@@ -9,8 +10,9 @@ type Props = {
|
|
|
9
10
|
primaryWallet: Wallet | null;
|
|
10
11
|
projectSettings: ProjectSettings | undefined;
|
|
11
12
|
user: UserProfile | undefined;
|
|
13
|
+
walletBook: WalletBookSchema;
|
|
12
14
|
};
|
|
13
|
-
export declare const useGlobalLoading: ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }: Props) => {
|
|
15
|
+
export declare const useGlobalLoading: ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, walletBook, }: Props) => {
|
|
14
16
|
sdkHasLoaded: boolean;
|
|
15
17
|
setSdkHasLoaded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
16
18
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { lastAuthenticatedAccount } from '../../functions/lastAuthenticatedAccount/index.js';
|
|
3
3
|
|
|
4
|
-
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, }) => {
|
|
4
|
+
const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSettings, primaryWallet, user, walletBook, }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const [sdkHasLoaded, setSdkHasLoaded] = useState(false);
|
|
7
7
|
const primaryWalletIsLoading = user &&
|
|
@@ -9,6 +9,10 @@ const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSet
|
|
|
9
9
|
!primaryWallet;
|
|
10
10
|
const connectOnlyUserIsLoading = authMode === 'connect-only' && connectedInfo && !connectedWallet;
|
|
11
11
|
useEffect(() => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!Object.keys((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {}).length) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
12
16
|
if (projectSettings) {
|
|
13
17
|
if (primaryWalletIsLoading || connectOnlyUserIsLoading) {
|
|
14
18
|
return;
|
|
@@ -21,6 +25,7 @@ const useGlobalLoading = ({ authMode, connectedInfo, connectedWallet, projectSet
|
|
|
21
25
|
user,
|
|
22
26
|
primaryWalletIsLoading,
|
|
23
27
|
connectOnlyUserIsLoading,
|
|
28
|
+
walletBook,
|
|
24
29
|
]);
|
|
25
30
|
return {
|
|
26
31
|
sdkHasLoaded,
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
6
|
-
require('../../constants/colors.cjs');
|
|
7
5
|
var helpers = require('../../../context/DynamicContext/helpers.cjs');
|
|
8
6
|
require('@dynamic-labs/sdk-api');
|
|
9
7
|
require('../../../shared/logger.cjs');
|
|
@@ -14,6 +12,7 @@ require('../../../context/ViewContext/ViewContext.cjs');
|
|
|
14
12
|
require('react');
|
|
15
13
|
require('@dynamic-labs/wallet-book');
|
|
16
14
|
require('@dynamic-labs/utils');
|
|
15
|
+
require('../../constants/colors.cjs');
|
|
17
16
|
var localStorage = require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
17
|
require('ethers');
|
|
19
18
|
require('../../../shared/consts/index.cjs');
|
|
@@ -22,7 +21,7 @@ const getAuthToken = () => {
|
|
|
22
21
|
if (typeof window === 'undefined') {
|
|
23
22
|
return undefined;
|
|
24
23
|
}
|
|
25
|
-
const token = localStorage.LocalStorage.
|
|
24
|
+
const token = localStorage.LocalStorage.getAuthTokenValue();
|
|
26
25
|
if (!token) {
|
|
27
26
|
return undefined;
|
|
28
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getAuthToken: () =>
|
|
1
|
+
export declare const getAuthToken: () => string | undefined;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { AUTH_TOKEN } from '../../constants/localStorage.js';
|
|
2
|
-
import '../../constants/colors.js';
|
|
3
1
|
import { isAuthTokenExpired } from '../../../context/DynamicContext/helpers.js';
|
|
4
2
|
import '@dynamic-labs/sdk-api';
|
|
5
3
|
import '../../../shared/logger.js';
|
|
@@ -10,6 +8,7 @@ import '../../../context/ViewContext/ViewContext.js';
|
|
|
10
8
|
import 'react';
|
|
11
9
|
import '@dynamic-labs/wallet-book';
|
|
12
10
|
import '@dynamic-labs/utils';
|
|
11
|
+
import '../../constants/colors.js';
|
|
13
12
|
import { LocalStorage } from '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
13
|
import 'ethers';
|
|
15
14
|
import '../../../shared/consts/index.js';
|
|
@@ -18,7 +17,7 @@ const getAuthToken = () => {
|
|
|
18
17
|
if (typeof window === 'undefined') {
|
|
19
18
|
return undefined;
|
|
20
19
|
}
|
|
21
|
-
const token = LocalStorage.
|
|
20
|
+
const token = LocalStorage.getAuthTokenValue();
|
|
22
21
|
if (!token) {
|
|
23
22
|
return undefined;
|
|
24
23
|
}
|
|
@@ -9,7 +9,6 @@ var api = require('../../../../data/api.cjs');
|
|
|
9
9
|
var index = require('../../../functions/storeAuthToken/index.cjs');
|
|
10
10
|
require('@dynamic-labs/multi-wallet');
|
|
11
11
|
require('@dynamic-labs/utils');
|
|
12
|
-
require('../../../constants/colors.cjs');
|
|
13
12
|
require('@dynamic-labs/sdk-api');
|
|
14
13
|
require('../../../../shared/logger.cjs');
|
|
15
14
|
require('@dynamic-labs/iconic');
|
|
@@ -17,6 +16,7 @@ require('@dynamic-labs/wallet-connector-core');
|
|
|
17
16
|
require('react/jsx-runtime');
|
|
18
17
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
19
18
|
require('@dynamic-labs/wallet-book');
|
|
19
|
+
require('../../../constants/colors.cjs');
|
|
20
20
|
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
21
|
require('ethers');
|
|
22
22
|
require('../../../../shared/consts/index.cjs');
|
|
@@ -5,7 +5,6 @@ import { verifyEmail } from '../../../../data/api.js';
|
|
|
5
5
|
import { storeAuthToken } from '../../../functions/storeAuthToken/index.js';
|
|
6
6
|
import '@dynamic-labs/multi-wallet';
|
|
7
7
|
import '@dynamic-labs/utils';
|
|
8
|
-
import '../../../constants/colors.js';
|
|
9
8
|
import '@dynamic-labs/sdk-api';
|
|
10
9
|
import '../../../../shared/logger.js';
|
|
11
10
|
import '@dynamic-labs/iconic';
|
|
@@ -13,6 +12,7 @@ import '@dynamic-labs/wallet-connector-core';
|
|
|
13
12
|
import 'react/jsx-runtime';
|
|
14
13
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
15
14
|
import '@dynamic-labs/wallet-book';
|
|
15
|
+
import '../../../constants/colors.js';
|
|
16
16
|
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
17
17
|
import 'ethers';
|
|
18
18
|
import '../../../../shared/consts/index.js';
|
|
@@ -8,8 +8,6 @@ var utils = require('@dynamic-labs/utils');
|
|
|
8
8
|
var api = require('../../../data/api.cjs');
|
|
9
9
|
var index = require('../../functions/storeAuthToken/index.cjs');
|
|
10
10
|
require('@dynamic-labs/multi-wallet');
|
|
11
|
-
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
12
|
-
require('../../constants/colors.cjs');
|
|
13
11
|
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
14
12
|
require('@dynamic-labs/iconic');
|
|
15
13
|
require('react/jsx-runtime');
|
|
@@ -17,6 +15,8 @@ var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
|
17
15
|
require('react');
|
|
18
16
|
var logger = require('../../../shared/logger.cjs');
|
|
19
17
|
require('@dynamic-labs/wallet-book');
|
|
18
|
+
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
19
|
+
require('../../constants/colors.cjs');
|
|
20
20
|
var localStorage = require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
21
|
require('ethers');
|
|
22
22
|
require('../../../shared/consts/index.cjs');
|
|
@@ -4,8 +4,6 @@ import { DynamicError, WalletUsedError, ChainalysisError, NoAccessError } from '
|
|
|
4
4
|
import { verifyWallet, linkWallet } from '../../../data/api.js';
|
|
5
5
|
import { storeAuthToken } from '../../functions/storeAuthToken/index.js';
|
|
6
6
|
import '@dynamic-labs/multi-wallet';
|
|
7
|
-
import { LAST_USED_WALLET } from '../../constants/localStorage.js';
|
|
8
|
-
import '../../constants/colors.js';
|
|
9
7
|
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
10
8
|
import '@dynamic-labs/iconic';
|
|
11
9
|
import 'react/jsx-runtime';
|
|
@@ -13,6 +11,8 @@ import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
|
13
11
|
import 'react';
|
|
14
12
|
import { logger } from '../../../shared/logger.js';
|
|
15
13
|
import '@dynamic-labs/wallet-book';
|
|
14
|
+
import { LAST_USED_WALLET } from '../../constants/localStorage.js';
|
|
15
|
+
import '../../constants/colors.js';
|
|
16
16
|
import { LocalStorage } from '../../../shared/utils/classes/storage/localStorage.js';
|
|
17
17
|
import 'ethers';
|
|
18
18
|
import '../../../shared/consts/index.js';
|