@dynamic-labs/sdk-react-core 2.3.1-alpha.0 → 2.3.2
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
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
### [2.3.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.1...v2.3.2) (2024-07-16)
|
|
3
|
+
|
|
4
|
+
### [2.3.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.1-alpha.0...v2.3.1) (2024-07-13)
|
|
5
|
+
|
|
2
6
|
### [2.3.1-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.0...v2.3.1-alpha.0) (2024-07-12)
|
|
3
7
|
|
|
4
8
|
|
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": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "2.3.
|
|
21
|
-
"@dynamic-labs/logger": "2.3.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.3.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.3.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.3.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.3.
|
|
26
|
-
"@dynamic-labs/store": "2.3.
|
|
27
|
-
"@dynamic-labs/types": "2.3.
|
|
28
|
-
"@dynamic-labs/utils": "2.3.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.3.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.3.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.3.
|
|
20
|
+
"@dynamic-labs/iconic": "2.3.2",
|
|
21
|
+
"@dynamic-labs/logger": "2.3.2",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.3.2",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.3.2",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.3.2",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.3.2",
|
|
26
|
+
"@dynamic-labs/store": "2.3.2",
|
|
27
|
+
"@dynamic-labs/types": "2.3.2",
|
|
28
|
+
"@dynamic-labs/utils": "2.3.2",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.3.2",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.3.2",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.3.2",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -164,8 +164,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
164
164
|
if (!environmentId) {
|
|
165
165
|
throw new utils.MissingEnvironmentIdError();
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
try {
|
|
168
|
+
logger$1.logger.setLogLevel(logLevel);
|
|
169
|
+
walletConnectorCore.logger.setLogLevel(logLevel);
|
|
170
|
+
}
|
|
171
|
+
catch (_j) {
|
|
172
|
+
// logger could be messing up with SSR so we are catching the errors
|
|
173
|
+
/* empty */
|
|
174
|
+
}
|
|
169
175
|
if (environmentId === PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID) {
|
|
170
176
|
logger$1.logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
171
177
|
}
|
|
@@ -185,11 +191,17 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
185
191
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = React.useState(false);
|
|
186
192
|
const { user, unauthenticatedUser } = useUser.useUser();
|
|
187
193
|
const isAuthenticated = useIsAuthenticated.useIsAuthenticated(user);
|
|
188
|
-
|
|
189
|
-
|
|
194
|
+
try {
|
|
195
|
+
if (user) {
|
|
196
|
+
logger$1.logger.setMetaData('user', user);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
logger$1.logger.setMetaData('user', undefined);
|
|
200
|
+
}
|
|
190
201
|
}
|
|
191
|
-
|
|
192
|
-
|
|
202
|
+
catch (e) {
|
|
203
|
+
// It was messing up with SSR so we are catching the errors
|
|
204
|
+
/* empty */
|
|
193
205
|
}
|
|
194
206
|
const { consumeNonce } = useFetchNonce.useFetchNonce(environmentId);
|
|
195
207
|
const [qrcodeUri, setQrcodeUri] = React.useState('');
|
|
@@ -709,8 +721,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
709
721
|
};
|
|
710
722
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
711
723
|
const DynamicContextProvider = (props) => {
|
|
712
|
-
|
|
713
|
-
|
|
724
|
+
try {
|
|
725
|
+
logger.Logger.setEnvironmentId(props.settings.environmentId);
|
|
726
|
+
logger.Logger.setEmitErrors(props.emitErrors);
|
|
727
|
+
}
|
|
728
|
+
catch (e) {
|
|
729
|
+
// Sometimes in SSR Logger is not available
|
|
730
|
+
/* empty */
|
|
731
|
+
}
|
|
714
732
|
useParentDynamicContextGuard.useParentDynamicContextGuard();
|
|
715
733
|
return (jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(UserWalletsContext.UserWalletsProvider, { children: jsxRuntime.jsx(FieldsStateContext.FieldsStateProvider, { children: jsxRuntime.jsx(IpConfigurationContext.IpConfigurationContextProvider, { children: jsxRuntime.jsx(MfaSettingsContext.MfaSettingsContextProvider, { children: jsxRuntime.jsx(WidgetRegistryContextProvider.WidgetRegistryContextProvider, { children: jsxRuntime.jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }) }) }) }) }));
|
|
716
734
|
};
|
|
@@ -160,8 +160,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
160
160
|
if (!environmentId) {
|
|
161
161
|
throw new MissingEnvironmentIdError();
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
try {
|
|
164
|
+
logger.setLogLevel(logLevel);
|
|
165
|
+
logger$1.setLogLevel(logLevel);
|
|
166
|
+
}
|
|
167
|
+
catch (_j) {
|
|
168
|
+
// logger could be messing up with SSR so we are catching the errors
|
|
169
|
+
/* empty */
|
|
170
|
+
}
|
|
165
171
|
if (environmentId === PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID) {
|
|
166
172
|
logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
167
173
|
}
|
|
@@ -181,11 +187,17 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
181
187
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = useState(false);
|
|
182
188
|
const { user, unauthenticatedUser } = useUser();
|
|
183
189
|
const isAuthenticated = useIsAuthenticated(user);
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
try {
|
|
191
|
+
if (user) {
|
|
192
|
+
logger.setMetaData('user', user);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
logger.setMetaData('user', undefined);
|
|
196
|
+
}
|
|
186
197
|
}
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
catch (e) {
|
|
199
|
+
// It was messing up with SSR so we are catching the errors
|
|
200
|
+
/* empty */
|
|
189
201
|
}
|
|
190
202
|
const { consumeNonce } = useFetchNonce(environmentId);
|
|
191
203
|
const [qrcodeUri, setQrcodeUri] = useState('');
|
|
@@ -705,8 +717,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, enable
|
|
|
705
717
|
};
|
|
706
718
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
707
719
|
const DynamicContextProvider = (props) => {
|
|
708
|
-
|
|
709
|
-
|
|
720
|
+
try {
|
|
721
|
+
Logger.setEnvironmentId(props.settings.environmentId);
|
|
722
|
+
Logger.setEmitErrors(props.emitErrors);
|
|
723
|
+
}
|
|
724
|
+
catch (e) {
|
|
725
|
+
// Sometimes in SSR Logger is not available
|
|
726
|
+
/* empty */
|
|
727
|
+
}
|
|
710
728
|
useParentDynamicContextGuard();
|
|
711
729
|
return (jsx(ErrorBoundary, { children: jsx(ErrorContextProvider, { children: jsx(UserWalletsProvider, { children: jsx(FieldsStateProvider, { children: jsx(IpConfigurationContextProvider, { children: jsx(MfaSettingsContextProvider, { children: jsx(WidgetRegistryContextProvider, { children: jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }) }) }) }) }));
|
|
712
730
|
};
|