@dynamic-labs/sdk-react-core 4.10.4 → 4.11.1
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 +19 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +16 -4
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +16 -4
- package/src/lib/components/index.d.ts +0 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -5
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -5
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -1
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +15 -14
- package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +15 -14
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +0 -1
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +1 -2
- package/src/lib/data/api/api.cjs +7 -2
- package/src/lib/data/api/api.d.ts +1 -1
- package/src/lib/data/api/api.js +7 -2
- package/src/lib/data/api/wallets/wallets.cjs +7 -7
- package/src/lib/data/api/wallets/wallets.js +7 -7
- package/src/lib/shared/consts/index.cjs +0 -2
- package/src/lib/shared/consts/index.d.ts +0 -1
- package/src/lib/shared/consts/index.js +1 -2
- package/src/lib/store/internalImplementation/store.cjs +1 -1
- package/src/lib/store/internalImplementation/store.js +2 -2
- package/src/lib/store/state/nonce/nonce.cjs +1 -1
- package/src/lib/store/state/nonce/nonce.js +1 -1
- package/src/lib/store/stateConfig.cjs +2 -2
- package/src/lib/store/stateConfig.d.ts +1 -1
- package/src/lib/store/stateConfig.js +2 -2
- package/src/lib/store/utils/settingsUtils/settingsUtils.d.ts +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.cjs +1 -1
- package/src/lib/utils/functions/updatePrimaryWalletId/updatePrimaryWalletId.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -1
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +1 -1
- package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +1 -1
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +1 -1
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +1 -1
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -1
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +1 -1
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +1 -1
- package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.cjs +1 -1
- package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.js +1 -1
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +1 -1
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +1 -1
- package/src/lib/views/LoginView/useLoginView/useLoginView.cjs +0 -1
- package/src/lib/views/LoginView/useLoginView/useLoginView.js +0 -1
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs +1 -1
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.js +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -1
- package/src/lib/components/Switch/Switch.cjs +0 -11
- package/src/lib/components/Switch/Switch.js +0 -7
- package/src/lib/components/Toolkit/Toolkit.cjs +0 -118
- package/src/lib/components/Toolkit/Toolkit.d.ts +0 -2
- package/src/lib/components/Toolkit/Toolkit.js +0 -114
- package/src/lib/components/Toolkit/components/AuthModeSwitch.cjs +0 -12
- package/src/lib/components/Toolkit/components/AuthModeSwitch.d.ts +0 -7
- package/src/lib/components/Toolkit/components/AuthModeSwitch.js +0 -8
- package/src/lib/components/Toolkit/components/LoginWithEmailSwitch.cjs +0 -112
- package/src/lib/components/Toolkit/components/LoginWithEmailSwitch.d.ts +0 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailSwitch.js +0 -108
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.cjs +0 -112
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.d.ts +0 -1
- package/src/lib/components/Toolkit/components/LoginWithEmailViewDisplayPriorityOrderSwitch.js +0 -108
- package/src/lib/components/Toolkit/components/PrimaryColorInput.cjs +0 -21
- package/src/lib/components/Toolkit/components/PrimaryColorInput.d.ts +0 -2
- package/src/lib/components/Toolkit/components/PrimaryColorInput.js +0 -17
- package/src/lib/components/Toolkit/components/TemplateSelect.cjs +0 -18
- package/src/lib/components/Toolkit/components/TemplateSelect.d.ts +0 -1
- package/src/lib/components/Toolkit/components/TemplateSelect.js +0 -14
- package/src/lib/components/Toolkit/components/ThemeSwitch.cjs +0 -27
- package/src/lib/components/Toolkit/components/ThemeSwitch.d.ts +0 -1
- package/src/lib/components/Toolkit/components/ThemeSwitch.js +0 -23
- package/src/lib/components/Toolkit/components/index.d.ts +0 -6
- package/src/lib/components/Toolkit/index.d.ts +0 -1
package/src/lib/data/api/api.js
CHANGED
|
@@ -3,6 +3,8 @@ import { SDKApi, Configuration } from '@dynamic-labs/sdk-api-core';
|
|
|
3
3
|
import { FetchService } from '@dynamic-labs/utils';
|
|
4
4
|
import { VERSION, API_VERSION } from '../../../version.js';
|
|
5
5
|
import ApiEndpoint from '../../config/ApiEndpoint.js';
|
|
6
|
+
import { isGlobalWalletPopup } from '../../shared/utils/functions/isGlobalWalletPopup/isGlobalWalletPopup.js';
|
|
7
|
+
import { getProjectSettings } from '../../store/state/projectSettings/projectSettings.js';
|
|
6
8
|
import '../../utils/constants/values.js';
|
|
7
9
|
import '../../../../_virtual/_tslib.js';
|
|
8
10
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -19,8 +21,8 @@ import '../../context/ViewContext/ViewContext.js';
|
|
|
19
21
|
import '@dynamic-labs/wallet-book';
|
|
20
22
|
import '../../shared/consts/index.js';
|
|
21
23
|
import '../../store/state/nonce/nonce.js';
|
|
24
|
+
import { randomString } from '../../utils/functions/randomString/randomString.js';
|
|
22
25
|
import { isCookieEnabled } from '../../utils/functions/isCookieEnabled/isCookieEnabled.js';
|
|
23
|
-
import { getProjectSettings } from '../../store/state/projectSettings/projectSettings.js';
|
|
24
26
|
import '../../store/state/user/user.js';
|
|
25
27
|
import '../../locale/locale.js';
|
|
26
28
|
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
@@ -29,7 +31,7 @@ import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
|
29
31
|
const sdkApi = ({ customHeaders } = {}) => {
|
|
30
32
|
const settings = {
|
|
31
33
|
basePath: ApiEndpoint.getBaseUrl(),
|
|
32
|
-
headers: Object.assign({ 'Content-Type': 'application/json' }, customHeaders),
|
|
34
|
+
headers: Object.assign({ 'Content-Type': 'application/json', 'x-dyn-request-id': randomString(50) }, customHeaders),
|
|
33
35
|
};
|
|
34
36
|
const minJwt = getMinAuthToken();
|
|
35
37
|
if (minJwt) {
|
|
@@ -43,6 +45,9 @@ const sdkApi = ({ customHeaders } = {}) => {
|
|
|
43
45
|
const credentials = projectSettings && isCookieEnabled(projectSettings) ? 'include' : undefined;
|
|
44
46
|
settings.headers['x-dyn-version'] = `WalletKit/${VERSION}`;
|
|
45
47
|
settings.headers['x-dyn-api-version'] = `API/${API_VERSION}`;
|
|
48
|
+
settings.headers['x-dyn-is-global-wallet-popup'] = isGlobalWalletPopup()
|
|
49
|
+
? 'true'
|
|
50
|
+
: 'false';
|
|
46
51
|
return new SDKApi(new Configuration(Object.assign(Object.assign({}, settings), { credentials, fetchApi: FetchService.fetch })));
|
|
47
52
|
};
|
|
48
53
|
|
|
@@ -23,8 +23,8 @@ const storeSelectedWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, funct
|
|
|
23
23
|
return user;
|
|
24
24
|
}
|
|
25
25
|
catch (e) {
|
|
26
|
-
yield utils.logResponseError(e, 'Error
|
|
27
|
-
|
|
26
|
+
const data = yield utils.logResponseError(e, 'Error transfering wallet');
|
|
27
|
+
throw new utils$1.DynamicError(data.error);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
const linkWallet = (environmentId_1, _b) => _tslib.__awaiter(void 0, [environmentId_1, _b], void 0, function* (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, }) {
|
|
@@ -85,8 +85,8 @@ const unlinkWallet = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({
|
|
|
85
85
|
return user;
|
|
86
86
|
}
|
|
87
87
|
catch (e) {
|
|
88
|
-
yield utils.logResponseError(e, 'Error
|
|
89
|
-
|
|
88
|
+
const data = yield utils.logResponseError(e, 'Error transfering wallet');
|
|
89
|
+
throw new utils$1.DynamicError(data.error);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
const transferWallet = (environmentId_2, _d) => _tslib.__awaiter(void 0, [environmentId_2, _d], void 0, function* (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }) {
|
|
@@ -110,8 +110,8 @@ const transferWallet = (environmentId_2, _d) => _tslib.__awaiter(void 0, [enviro
|
|
|
110
110
|
return user;
|
|
111
111
|
}
|
|
112
112
|
catch (e) {
|
|
113
|
-
yield utils.logResponseError(e, 'Error transfering wallet');
|
|
114
|
-
|
|
113
|
+
const data = yield utils.logResponseError(e, 'Error transfering wallet');
|
|
114
|
+
throw new utils$1.DynamicError(data.error);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
const verifyWallet = (environmentId_3, _e) => _tslib.__awaiter(void 0, [environmentId_3, _e], void 0, function* (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, sessionPublicKey, }) {
|
|
@@ -157,7 +157,7 @@ const verifyWallet = (environmentId_3, _e) => _tslib.__awaiter(void 0, [environm
|
|
|
157
157
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
158
158
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
throw new utils$1.DynamicError(data.error);
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
const upgradeEmbeddedWalletToV2 = (_f) => _tslib.__awaiter(void 0, [_f], void 0, function* ({ environmentId, sessionPublicKey, }) {
|
|
@@ -19,8 +19,8 @@ const storeSelectedWallet = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
|
19
19
|
return user;
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
|
-
yield logResponseError(e, 'Error
|
|
23
|
-
|
|
22
|
+
const data = yield logResponseError(e, 'Error transfering wallet');
|
|
23
|
+
throw new DynamicError(data.error);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
const linkWallet = (environmentId_1, _b) => __awaiter(void 0, [environmentId_1, _b], void 0, function* (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, }) {
|
|
@@ -81,8 +81,8 @@ const unlinkWallet = (_c) => __awaiter(void 0, [_c], void 0, function* ({ enviro
|
|
|
81
81
|
return user;
|
|
82
82
|
}
|
|
83
83
|
catch (e) {
|
|
84
|
-
yield logResponseError(e, 'Error
|
|
85
|
-
|
|
84
|
+
const data = yield logResponseError(e, 'Error transfering wallet');
|
|
85
|
+
throw new DynamicError(data.error);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
const transferWallet = (environmentId_2, _d) => __awaiter(void 0, [environmentId_2, _d], void 0, function* (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }) {
|
|
@@ -106,8 +106,8 @@ const transferWallet = (environmentId_2, _d) => __awaiter(void 0, [environmentId
|
|
|
106
106
|
return user;
|
|
107
107
|
}
|
|
108
108
|
catch (e) {
|
|
109
|
-
yield logResponseError(e, 'Error transfering wallet');
|
|
110
|
-
|
|
109
|
+
const data = yield logResponseError(e, 'Error transfering wallet');
|
|
110
|
+
throw new DynamicError(data.error);
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
const verifyWallet = (environmentId_3, _e) => __awaiter(void 0, [environmentId_3, _e], void 0, function* (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, sessionPublicKey, }) {
|
|
@@ -153,7 +153,7 @@ const verifyWallet = (environmentId_3, _e) => __awaiter(void 0, [environmentId_3
|
|
|
153
153
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
154
154
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
throw new DynamicError(data.error);
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
const upgradeEmbeddedWalletToV2 = (_f) => __awaiter(void 0, [_f], void 0, function* ({ environmentId, sessionPublicKey, }) {
|
|
@@ -36,7 +36,6 @@ const defaultWalletsForChains = {
|
|
|
36
36
|
};
|
|
37
37
|
// z-index
|
|
38
38
|
const tooltipZIndex = 2147483647;
|
|
39
|
-
const toolkitZIndex = 2147483646;
|
|
40
39
|
const authModalZIndex = 2147483645;
|
|
41
40
|
const widgetModalZIndex = 2147483643;
|
|
42
41
|
|
|
@@ -45,6 +44,5 @@ exports.countryCodes = countryCodes;
|
|
|
45
44
|
exports.defaultWalletsForChains = defaultWalletsForChains;
|
|
46
45
|
exports.tShirtSizes = tShirtSizes;
|
|
47
46
|
exports.teamNames = teamNames;
|
|
48
|
-
exports.toolkitZIndex = toolkitZIndex;
|
|
49
47
|
exports.tooltipZIndex = tooltipZIndex;
|
|
50
48
|
exports.widgetModalZIndex = widgetModalZIndex;
|
|
@@ -4,6 +4,5 @@ export declare const countryCodes: import("country-list").Country[];
|
|
|
4
4
|
export declare const teamNames: string[];
|
|
5
5
|
export declare const defaultWalletsForChains: ChainToWalletMap;
|
|
6
6
|
export declare const tooltipZIndex = 2147483647;
|
|
7
|
-
export declare const toolkitZIndex = 2147483646;
|
|
8
7
|
export declare const authModalZIndex = 2147483645;
|
|
9
8
|
export declare const widgetModalZIndex = 2147483643;
|
|
@@ -32,8 +32,7 @@ const defaultWalletsForChains = {
|
|
|
32
32
|
};
|
|
33
33
|
// z-index
|
|
34
34
|
const tooltipZIndex = 2147483647;
|
|
35
|
-
const toolkitZIndex = 2147483646;
|
|
36
35
|
const authModalZIndex = 2147483645;
|
|
37
36
|
const widgetModalZIndex = 2147483643;
|
|
38
37
|
|
|
39
|
-
export { authModalZIndex, countryCodes, defaultWalletsForChains, tShirtSizes, teamNames,
|
|
38
|
+
export { authModalZIndex, countryCodes, defaultWalletsForChains, tShirtSizes, teamNames, tooltipZIndex, widgetModalZIndex };
|
|
@@ -36,7 +36,7 @@ const initializeStore = (props) => {
|
|
|
36
36
|
partialize: stateConfig.transformStateForLocalStorage,
|
|
37
37
|
storage: getStorage(),
|
|
38
38
|
// Map each entry to its initialValue
|
|
39
|
-
store: store$1.createStore(() => stateConfig.
|
|
39
|
+
store: store$1.createStore(() => stateConfig.createInitialState(props)),
|
|
40
40
|
version: stateConfig.storeVersion,
|
|
41
41
|
}));
|
|
42
42
|
};
|
|
@@ -3,7 +3,7 @@ import { persist, createStore } from '@dynamic-labs/store';
|
|
|
3
3
|
import { STORE_STORAGE_KEY } from '../../utils/constants/localStorage.js';
|
|
4
4
|
import '../../utils/constants/colors.js';
|
|
5
5
|
import '../../utils/constants/values.js';
|
|
6
|
-
import { transformStateForLocalStorage,
|
|
6
|
+
import { transformStateForLocalStorage, createInitialState, storeVersion } from '../stateConfig.js';
|
|
7
7
|
import { syncLegacyStorage } from './utils/syncLegacyStorage/syncLegacyStorage.js';
|
|
8
8
|
|
|
9
9
|
let store;
|
|
@@ -32,7 +32,7 @@ const initializeStore = (props) => {
|
|
|
32
32
|
partialize: transformStateForLocalStorage,
|
|
33
33
|
storage: getStorage(),
|
|
34
34
|
// Map each entry to its initialValue
|
|
35
|
-
store: createStore(() =>
|
|
35
|
+
store: createStore(() => createInitialState(props)),
|
|
36
36
|
version: storeVersion,
|
|
37
37
|
}));
|
|
38
38
|
};
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
8
|
require('@dynamic-labs/sdk-api-core');
|
|
9
9
|
require('../../../config/ApiEndpoint.cjs');
|
|
10
|
+
require('../projectSettings/projectSettings.cjs');
|
|
10
11
|
require('../../../utils/constants/values.cjs');
|
|
11
12
|
require('@dynamic-labs/multi-wallet');
|
|
12
13
|
require('../../../shared/logger.cjs');
|
|
@@ -19,7 +20,6 @@ require('react/jsx-runtime');
|
|
|
19
20
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
20
21
|
require('@dynamic-labs/wallet-book');
|
|
21
22
|
require('../../../shared/consts/index.cjs');
|
|
22
|
-
require('../projectSettings/projectSettings.cjs');
|
|
23
23
|
var dynamicContextProps = require('../dynamicContextProps/dynamicContextProps.cjs');
|
|
24
24
|
require('../primaryWalletId/primaryWalletId.cjs');
|
|
25
25
|
require('../user/user.cjs');
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
4
4
|
import '@dynamic-labs/sdk-api-core';
|
|
5
5
|
import '../../../config/ApiEndpoint.js';
|
|
6
|
+
import '../projectSettings/projectSettings.js';
|
|
6
7
|
import '../../../utils/constants/values.js';
|
|
7
8
|
import '@dynamic-labs/multi-wallet';
|
|
8
9
|
import '../../../shared/logger.js';
|
|
@@ -15,7 +16,6 @@ import 'react/jsx-runtime';
|
|
|
15
16
|
import '../../../context/ViewContext/ViewContext.js';
|
|
16
17
|
import '@dynamic-labs/wallet-book';
|
|
17
18
|
import '../../../shared/consts/index.js';
|
|
18
|
-
import '../projectSettings/projectSettings.js';
|
|
19
19
|
import { useEnvironmentId, getEnvironmentId } from '../dynamicContextProps/dynamicContextProps.js';
|
|
20
20
|
import '../primaryWalletId/primaryWalletId.js';
|
|
21
21
|
import '../user/user.js';
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
/**
|
|
7
7
|
* Returns the initial state for the SdkStore
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const createInitialState = (dynamicContextProps) => ({
|
|
10
10
|
connectedWalletsInfo: [],
|
|
11
11
|
connectorsInitializing: {},
|
|
12
12
|
dynamicContextProps,
|
|
@@ -52,6 +52,6 @@ const transformStateForLocalStorage = (state) => ({
|
|
|
52
52
|
*/
|
|
53
53
|
const storeVersion = '2025-02-21';
|
|
54
54
|
|
|
55
|
-
exports.
|
|
55
|
+
exports.createInitialState = createInitialState;
|
|
56
56
|
exports.storeVersion = storeVersion;
|
|
57
57
|
exports.transformStateForLocalStorage = transformStateForLocalStorage;
|
|
@@ -3,7 +3,7 @@ import { SdkStore } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns the initial state for the SdkStore
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const createInitialState: (dynamicContextProps: DynamicContextProps) => SdkStore;
|
|
7
7
|
/**
|
|
8
8
|
* Filters out which variables should be stored to local storage.
|
|
9
9
|
* Also allows transforming them before storage.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the initial state for the SdkStore
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const createInitialState = (dynamicContextProps) => ({
|
|
6
6
|
connectedWalletsInfo: [],
|
|
7
7
|
connectorsInitializing: {},
|
|
8
8
|
dynamicContextProps,
|
|
@@ -48,4 +48,4 @@ const transformStateForLocalStorage = (state) => ({
|
|
|
48
48
|
*/
|
|
49
49
|
const storeVersion = '2025-02-21';
|
|
50
50
|
|
|
51
|
-
export {
|
|
51
|
+
export { createInitialState, storeVersion, transformStateForLocalStorage };
|
|
@@ -9,7 +9,7 @@ type GetAndUse<N extends string, P extends keyof ProjectSettingsGeneral, S exten
|
|
|
9
9
|
* Many properties are set both under projectSettings.general and dynamicSettings.
|
|
10
10
|
* This is a helper function to get the value from either of them.
|
|
11
11
|
*/
|
|
12
|
-
export declare const makeGetAndUse: <N extends string, P extends keyof ProjectSettingsGeneral, S extends "shadowDOMEnabled" | "bridgeChains" | "accessDeniedButton" | "accessDeniedMessagePrimary" | "accessDeniedMessageSecondary" | "apiBaseUrl" | "appLogoUrl" | "appName" | "coinbaseWalletPreference" | "cssOverrides" | "customPrivacyPolicy" | "defaultPhoneInputIso2" | "detectNewWalletsForLinking" | "customTermsOfServices" | "debugError" | "deepLinkPreference" | "defaultNumberOfWalletsToShow" | "displaySiweStatement" | "enableConnectOnlyFallback" | "enableVisitTrackingOnConnectOnly" | "environmentId" | "events" | "flowNetwork" | "handlers" | "initialAuthenticationMode" | "localStorageSuffix" | "logLevel" | "mobileExperience" | "networkValidationMode" | "newToWeb3WalletChainMap" | "notInTheListImageUrl" | "onboardingImageUrl" | "overrides" | "social" | "policiesConsentInnerComponent" | "privacyPolicyUrl" | "recommendedWallets" | "redirectUrl" | "siweStatement" | "showLockedWalletView" | "socialMediaIconUrl" | "socialMediaLinkText" | "socialMediaUrl" | "socialProvidersFilter" | "suppressEndUserConsoleWarning" | "termsOfServiceUrl" | "
|
|
12
|
+
export declare const makeGetAndUse: <N extends string, P extends keyof ProjectSettingsGeneral, S extends "shadowDOMEnabled" | "bridgeChains" | "accessDeniedButton" | "accessDeniedMessagePrimary" | "accessDeniedMessageSecondary" | "apiBaseUrl" | "appLogoUrl" | "appName" | "coinbaseWalletPreference" | "cssOverrides" | "customPrivacyPolicy" | "defaultPhoneInputIso2" | "detectNewWalletsForLinking" | "customTermsOfServices" | "debugError" | "deepLinkPreference" | "defaultNumberOfWalletsToShow" | "displaySiweStatement" | "enableConnectOnlyFallback" | "enableVisitTrackingOnConnectOnly" | "environmentId" | "events" | "flowNetwork" | "handlers" | "initialAuthenticationMode" | "localStorageSuffix" | "logLevel" | "mobileExperience" | "networkValidationMode" | "newToWeb3WalletChainMap" | "notInTheListImageUrl" | "onboardingImageUrl" | "overrides" | "social" | "policiesConsentInnerComponent" | "privacyPolicyUrl" | "recommendedWallets" | "redirectUrl" | "siweStatement" | "showLockedWalletView" | "socialMediaIconUrl" | "socialMediaLinkText" | "socialMediaUrl" | "socialProvidersFilter" | "suppressEndUserConsoleWarning" | "termsOfServiceUrl" | "walletConnectors" | "walletConnectorExtensions" | "walletConnectPreferredChains" | "walletsFilter" | "tokensFilter" | "transactionConfirmation">(name: N, projectSettingName: P, dynamicSettingName: S) => GetAndUse<N, P, S>;
|
|
13
13
|
export declare const getAppLogoUrl: () => string | null | undefined, useAppLogoUrl: () => string | null | undefined;
|
|
14
14
|
export declare const getAppName: () => string | undefined, useAppName: () => string | undefined;
|
|
15
15
|
export declare const getNotInTheListImageUrl: () => string | null | undefined, useNotInTheListImageUrl: () => string | null | undefined;
|