@dynamic-labs/sdk-react-core 5.13.0 → 5.15.0
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 +38 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +14 -14
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/lib/store/utils/settingsUtils/settingsUtils.cjs +21 -2
- package/src/lib/store/utils/settingsUtils/settingsUtils.js +21 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.cjs +1 -4
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.js +1 -4
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -7
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -7
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +3 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +3 -0
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
|
-
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
10
9
|
require('@dynamic-labs-sdk/client/core');
|
|
11
10
|
require('@dynamic-labs/sdk-api-core');
|
|
12
11
|
require('eventemitter3');
|
|
@@ -30,6 +29,7 @@ require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
|
30
29
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
31
30
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
32
31
|
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
32
|
+
require('../../../events/dynamicEvents.cjs');
|
|
33
33
|
var storeTokenAndUser = require('../../../client/extension/storeTokenAndUser/storeTokenAndUser.cjs');
|
|
34
34
|
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
35
35
|
|
|
@@ -71,9 +71,6 @@ const useAuthenticatePasskeyMFA = () => {
|
|
|
71
71
|
}
|
|
72
72
|
// eslint-disable-next-line prefer-destructuring
|
|
73
73
|
mfaToken = response.mfaToken;
|
|
74
|
-
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
75
|
-
mfaToken: response.mfaToken,
|
|
76
|
-
});
|
|
77
74
|
return {
|
|
78
75
|
isEmailVerificationRequired: false,
|
|
79
76
|
isSmsVerificationRequired: false,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { authenticatePasskeyMFA } from '@dynamic-labs-sdk/client';
|
|
5
|
-
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
6
5
|
import '@dynamic-labs-sdk/client/core';
|
|
7
6
|
import '@dynamic-labs/sdk-api-core';
|
|
8
7
|
import 'eventemitter3';
|
|
@@ -26,6 +25,7 @@ import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
|
26
25
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
27
26
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
28
27
|
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
28
|
+
import '../../../events/dynamicEvents.js';
|
|
29
29
|
import { storeTokenAndUser } from '../../../client/extension/storeTokenAndUser/storeTokenAndUser.js';
|
|
30
30
|
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
31
31
|
|
|
@@ -67,9 +67,6 @@ const useAuthenticatePasskeyMFA = () => {
|
|
|
67
67
|
}
|
|
68
68
|
// eslint-disable-next-line prefer-destructuring
|
|
69
69
|
mfaToken = response.mfaToken;
|
|
70
|
-
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
71
|
-
mfaToken: response.mfaToken,
|
|
72
|
-
});
|
|
73
70
|
return {
|
|
74
71
|
isEmailVerificationRequired: false,
|
|
75
72
|
isSmsVerificationRequired: false,
|
|
@@ -31,7 +31,7 @@ var user = require('../../../data/api/user/user.cjs');
|
|
|
31
31
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
32
32
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
33
33
|
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
34
|
-
|
|
34
|
+
require('../../../events/dynamicEvents.cjs');
|
|
35
35
|
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
36
36
|
|
|
37
37
|
const useMfa = () => {
|
|
@@ -129,9 +129,6 @@ const useMfa = () => {
|
|
|
129
129
|
if (!response) {
|
|
130
130
|
throw new Error('Failed to authenticate recovery code');
|
|
131
131
|
}
|
|
132
|
-
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
133
|
-
mfaToken: response.mfaToken,
|
|
134
|
-
});
|
|
135
132
|
return {
|
|
136
133
|
isEmailVerificationRequired: false,
|
|
137
134
|
isSmsVerificationRequired: false,
|
|
@@ -157,9 +154,6 @@ const useMfa = () => {
|
|
|
157
154
|
}
|
|
158
155
|
// eslint-disable-next-line prefer-destructuring
|
|
159
156
|
mfaToken = response.mfaToken;
|
|
160
|
-
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
161
|
-
mfaToken: response.mfaToken,
|
|
162
|
-
});
|
|
163
157
|
return {
|
|
164
158
|
isEmailVerificationRequired: false,
|
|
165
159
|
isSmsVerificationRequired: false,
|
|
@@ -27,7 +27,7 @@ import { refreshUserJwt } from '../../../data/api/user/user.js';
|
|
|
27
27
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
28
28
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
29
29
|
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
30
|
-
import
|
|
30
|
+
import '../../../events/dynamicEvents.js';
|
|
31
31
|
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
32
32
|
|
|
33
33
|
const useMfa = () => {
|
|
@@ -125,9 +125,6 @@ const useMfa = () => {
|
|
|
125
125
|
if (!response) {
|
|
126
126
|
throw new Error('Failed to authenticate recovery code');
|
|
127
127
|
}
|
|
128
|
-
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
129
|
-
mfaToken: response.mfaToken,
|
|
130
|
-
});
|
|
131
128
|
return {
|
|
132
129
|
isEmailVerificationRequired: false,
|
|
133
130
|
isSmsVerificationRequired: false,
|
|
@@ -153,9 +150,6 @@ const useMfa = () => {
|
|
|
153
150
|
}
|
|
154
151
|
// eslint-disable-next-line prefer-destructuring
|
|
155
152
|
mfaToken = response.mfaToken;
|
|
156
|
-
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
157
|
-
mfaToken: response.mfaToken,
|
|
158
|
-
});
|
|
159
153
|
return {
|
|
160
154
|
isEmailVerificationRequired: false,
|
|
161
155
|
isSmsVerificationRequired: false,
|
|
@@ -36,6 +36,7 @@ var isCookieEnabled = require('../../../client/extension/functions/isCookieEnabl
|
|
|
36
36
|
var generateChainingSignature = require('../../../client/extension/functions/generateChainingSignature/generateChainingSignature.cjs');
|
|
37
37
|
var getSessionPublicKey = require('../../../client/extension/functions/getSessionPublicKey/getSessionPublicKey.cjs');
|
|
38
38
|
var useDynamicWaas = require('../useDynamicWaas/useDynamicWaas.cjs');
|
|
39
|
+
var useGetElevatedAccessToken = require('../useGetElevatedAccessToken/useGetElevatedAccessToken.cjs');
|
|
39
40
|
var useGetMfaToken = require('../useGetMfaToken/useGetMfaToken.cjs');
|
|
40
41
|
|
|
41
42
|
const useSetWalletConnectorFetchers = (walletOptions, environmentId, projectSettings,
|
|
@@ -46,6 +47,7 @@ onUnauthorized) => {
|
|
|
46
47
|
var _a, _b, _c;
|
|
47
48
|
const apiBaseUrl = dynamicContextProps.useApiBaseUrl();
|
|
48
49
|
const getMfaToken = useGetMfaToken.useGetMfaToken();
|
|
50
|
+
const getElevatedAccessToken = useGetElevatedAccessToken.useGetElevatedAccessToken();
|
|
49
51
|
const isCookieAuthEnabled = projectSettings && isCookieEnabled.isCookieEnabled();
|
|
50
52
|
const svmGasSponsorshipEnabled = (_c = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.svmGasSponsorshipEnabled) !== null && _c !== void 0 ? _c : false;
|
|
51
53
|
const svmGasSponsorshipEnabledRef = React.useRef(svmGasSponsorshipEnabled);
|
|
@@ -62,6 +64,7 @@ onUnauthorized) => {
|
|
|
62
64
|
apiBaseUrl: apiBaseUrl !== null && apiBaseUrl !== void 0 ? apiBaseUrl : apiUrl.DEFAULT_WAAS_API_URL,
|
|
63
65
|
authMode: isCookieAuthEnabled ? 'cookie' : 'header',
|
|
64
66
|
environmentId,
|
|
67
|
+
getElevatedAccessToken,
|
|
65
68
|
getEvmGasSponsorshipEnabled: () => evmGasSponsorshipEnabledRef.current,
|
|
66
69
|
getMfaToken,
|
|
67
70
|
getSessionPublicKey: getSessionPublicKey.getSessionPublicKey,
|
|
@@ -32,6 +32,7 @@ import { isCookieEnabled } from '../../../client/extension/functions/isCookieEna
|
|
|
32
32
|
import { generateChainingSignature } from '../../../client/extension/functions/generateChainingSignature/generateChainingSignature.js';
|
|
33
33
|
import { getSessionPublicKey } from '../../../client/extension/functions/getSessionPublicKey/getSessionPublicKey.js';
|
|
34
34
|
import { configWaasWalletConnector } from '../useDynamicWaas/useDynamicWaas.js';
|
|
35
|
+
import { useGetElevatedAccessToken } from '../useGetElevatedAccessToken/useGetElevatedAccessToken.js';
|
|
35
36
|
import { useGetMfaToken } from '../useGetMfaToken/useGetMfaToken.js';
|
|
36
37
|
|
|
37
38
|
const useSetWalletConnectorFetchers = (walletOptions, environmentId, projectSettings,
|
|
@@ -42,6 +43,7 @@ onUnauthorized) => {
|
|
|
42
43
|
var _a, _b, _c;
|
|
43
44
|
const apiBaseUrl = useApiBaseUrl();
|
|
44
45
|
const getMfaToken = useGetMfaToken();
|
|
46
|
+
const getElevatedAccessToken = useGetElevatedAccessToken();
|
|
45
47
|
const isCookieAuthEnabled = projectSettings && isCookieEnabled();
|
|
46
48
|
const svmGasSponsorshipEnabled = (_c = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.embeddedWallets) === null || _b === void 0 ? void 0 : _b.svmGasSponsorshipEnabled) !== null && _c !== void 0 ? _c : false;
|
|
47
49
|
const svmGasSponsorshipEnabledRef = useRef(svmGasSponsorshipEnabled);
|
|
@@ -58,6 +60,7 @@ onUnauthorized) => {
|
|
|
58
60
|
apiBaseUrl: apiBaseUrl !== null && apiBaseUrl !== void 0 ? apiBaseUrl : DEFAULT_WAAS_API_URL,
|
|
59
61
|
authMode: isCookieAuthEnabled ? 'cookie' : 'header',
|
|
60
62
|
environmentId,
|
|
63
|
+
getElevatedAccessToken,
|
|
61
64
|
getEvmGasSponsorshipEnabled: () => evmGasSponsorshipEnabledRef.current,
|
|
62
65
|
getMfaToken,
|
|
63
66
|
getSessionPublicKey,
|