@dynamic-labs/sdk-react-core 4.31.1 → 4.31.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,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.31.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.31.1...v4.31.2) (2025-09-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* issue with Safe Wallet not auto-connecting on a Safe App ([#9479](https://github.com/dynamic-labs/dynamic-auth/issues/9479)) ([fc7458d](https://github.com/dynamic-labs/dynamic-auth/commit/fc7458db2481ed1d4cba62297f768f5e409ea0b5))
|
|
8
|
+
|
|
2
9
|
### [4.31.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.31.0...v4.31.1) (2025-09-10)
|
|
3
10
|
|
|
4
11
|
|
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": "4.31.
|
|
3
|
+
"version": "4.31.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.762",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.0-alpha.3",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.31.
|
|
19
|
-
"@dynamic-labs/iconic": "4.31.
|
|
20
|
-
"@dynamic-labs/logger": "4.31.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "4.31.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "4.31.
|
|
23
|
-
"@dynamic-labs/store": "4.31.
|
|
24
|
-
"@dynamic-labs/types": "4.31.
|
|
25
|
-
"@dynamic-labs/utils": "4.31.
|
|
26
|
-
"@dynamic-labs/wallet-book": "4.31.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "4.31.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.31.2",
|
|
19
|
+
"@dynamic-labs/iconic": "4.31.2",
|
|
20
|
+
"@dynamic-labs/logger": "4.31.2",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.31.2",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.31.2",
|
|
23
|
+
"@dynamic-labs/store": "4.31.2",
|
|
24
|
+
"@dynamic-labs/types": "4.31.2",
|
|
25
|
+
"@dynamic-labs/utils": "4.31.2",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.31.2",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.31.2",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -9,8 +9,6 @@ var multiWallet = require('@dynamic-labs/multi-wallet');
|
|
|
9
9
|
var rpcProviders = require('@dynamic-labs/rpc-providers');
|
|
10
10
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
11
11
|
var useWalletItemActions = require('../../utils/hooks/useWalletItemActions/useWalletItemActions.cjs');
|
|
12
|
-
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
13
|
-
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
14
12
|
require('@dynamic-labs/sdk-api-core');
|
|
15
13
|
var logger = require('../../shared/logger.cjs');
|
|
16
14
|
require('@dynamic-labs/iconic');
|
|
@@ -21,6 +19,10 @@ require('@dynamic-labs/utils');
|
|
|
21
19
|
require('../../utils/constants/colors.cjs');
|
|
22
20
|
require('../../utils/constants/values.cjs');
|
|
23
21
|
require('../../shared/consts/index.cjs');
|
|
22
|
+
var walletOptions = require('../../store/state/walletOptions/walletOptions.cjs');
|
|
23
|
+
var connectorsInitializing = require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
24
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
25
|
+
require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
24
26
|
require('../../events/dynamicEvents.cjs');
|
|
25
27
|
require('../../../../_virtual/_tslib.cjs');
|
|
26
28
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
@@ -57,7 +59,6 @@ require('../../context/MockContext/MockContext.cjs');
|
|
|
57
59
|
require('../../views/CollectUserDataView/useFields.cjs');
|
|
58
60
|
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
59
61
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
60
|
-
var walletOptions = require('../../store/state/walletOptions/walletOptions.cjs');
|
|
61
62
|
require('react-i18next');
|
|
62
63
|
require('../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
63
64
|
require('../Alert/Alert.cjs');
|
|
@@ -92,7 +93,6 @@ require('../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs')
|
|
|
92
93
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
93
94
|
require('../../context/OnrampContext/OnrampContext.cjs');
|
|
94
95
|
require('../../store/state/sendBalances.cjs');
|
|
95
|
-
var connectorsInitializing = require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
96
96
|
require('../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
97
97
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
98
98
|
require('../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
@@ -179,12 +179,18 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
179
179
|
});
|
|
180
180
|
const walletConnectorOptions = walletOptions.getWalletConnectorOptions();
|
|
181
181
|
const updatedConnectors = [...walletConnectorOptions];
|
|
182
|
-
|
|
182
|
+
let walletOptionToAutoConnect;
|
|
183
|
+
pendingReadyConnectorsRef.current.forEach(({ connector, shouldAutoConnect }) => {
|
|
183
184
|
let foundWallet = false;
|
|
184
185
|
for (let i = 0; i < updatedConnectors.length; i++) {
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
const hasSameKey = updatedConnectors[i].key === connector.key;
|
|
187
|
+
const isReplacingNonWalletConnectWithWalletConnect = !updatedConnectors[i].walletConnector.isWalletConnect &&
|
|
188
|
+
connector.isWalletConnect;
|
|
189
|
+
if (hasSameKey && !isReplacingNonWalletConnectWithWalletConnect) {
|
|
187
190
|
updatedConnectors[i] = Object.assign(Object.assign({}, updatedConnectors[i]), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
|
|
191
|
+
}
|
|
192
|
+
if (hasSameKey) {
|
|
193
|
+
foundWallet = true;
|
|
188
194
|
break;
|
|
189
195
|
}
|
|
190
196
|
}
|
|
@@ -192,15 +198,23 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
192
198
|
const newWalletOption = createWallet.createWallet(connectorProps.walletBook, connector);
|
|
193
199
|
updatedConnectors.push(newWalletOption);
|
|
194
200
|
}
|
|
201
|
+
if (shouldAutoConnect) {
|
|
202
|
+
walletOptionToAutoConnect = updatedConnectors.find((wallet) => wallet.key === connector.key &&
|
|
203
|
+
!wallet.walletConnector.isWalletConnect);
|
|
204
|
+
}
|
|
195
205
|
});
|
|
196
206
|
walletOptions.mergeWalletConnectorOptions(updatedConnectors);
|
|
197
207
|
pendingReadyConnectorsRef.current = [];
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', {
|
|
201
|
-
connector,
|
|
208
|
+
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] processReadyConnectors', {
|
|
209
|
+
walletOptionToAutoConnect,
|
|
202
210
|
});
|
|
203
|
-
|
|
211
|
+
if (walletOptionToAutoConnect && !primaryWallet) {
|
|
212
|
+
handleWalletItemClick(walletOptionToAutoConnect);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const handleProviderReady = (props) => {
|
|
216
|
+
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', props);
|
|
217
|
+
pendingReadyConnectorsRef.current.push(props);
|
|
204
218
|
if (readyDebounceTimeoutRef.current) {
|
|
205
219
|
clearTimeout(readyDebounceTimeoutRef.current);
|
|
206
220
|
}
|
|
@@ -220,27 +234,7 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
220
234
|
// Process any remaining connectors on cleanup
|
|
221
235
|
processReadyConnectors();
|
|
222
236
|
};
|
|
223
|
-
}, [connectorProps.walletBook]);
|
|
224
|
-
// add listener for autoConnect event
|
|
225
|
-
React.useEffect(() => {
|
|
226
|
-
const handleAutoConnect = ({ connector, }) => {
|
|
227
|
-
logger.logger.debug('[WalletConnectorEvents] handleAutoConnect', { connector });
|
|
228
|
-
const walletConnectorOptions = walletOptions.getWalletConnectorOptions();
|
|
229
|
-
const walletOption = walletConnectorOptions.find((wallet) => wallet.walletConnector.key === connector.key);
|
|
230
|
-
logger.logger.debug('[WalletConnectorEvents] handleAutoConnect - found walletOption', Boolean(walletOption));
|
|
231
|
-
if (!walletOption)
|
|
232
|
-
return;
|
|
233
|
-
handleWalletItemClick(walletOption);
|
|
234
|
-
};
|
|
235
|
-
// if there's a connected wallet, we should not auto connect another wallet
|
|
236
|
-
if (primaryWallet) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
walletConnectorCore.walletConnectorEvents.on('autoConnect', handleAutoConnect);
|
|
240
|
-
return () => {
|
|
241
|
-
walletConnectorCore.walletConnectorEvents.off('autoConnect', handleAutoConnect);
|
|
242
|
-
};
|
|
243
|
-
}, [handleWalletItemClick, primaryWallet]);
|
|
237
|
+
}, [connectorProps.walletBook, handleWalletItemClick]);
|
|
244
238
|
// add listener for connectorInitStarted and connectorInitCompleted events
|
|
245
239
|
React.useEffect(() => {
|
|
246
240
|
const handleConnectorInitStarted = (key) => {
|
|
@@ -5,8 +5,6 @@ import { getWalletConnectorConstructorOptions } from '@dynamic-labs/multi-wallet
|
|
|
5
5
|
import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
6
6
|
import { isWalletBookPopulated } from '@dynamic-labs/wallet-book';
|
|
7
7
|
import { useWalletItemActions } from '../../utils/hooks/useWalletItemActions/useWalletItemActions.js';
|
|
8
|
-
import '../../context/DynamicContext/DynamicContext.js';
|
|
9
|
-
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
10
8
|
import '@dynamic-labs/sdk-api-core';
|
|
11
9
|
import { logger } from '../../shared/logger.js';
|
|
12
10
|
import '@dynamic-labs/iconic';
|
|
@@ -17,6 +15,10 @@ import '@dynamic-labs/utils';
|
|
|
17
15
|
import '../../utils/constants/colors.js';
|
|
18
16
|
import '../../utils/constants/values.js';
|
|
19
17
|
import '../../shared/consts/index.js';
|
|
18
|
+
import { getWalletConnectorOptions, mergeWalletConnectorOptions } from '../../store/state/walletOptions/walletOptions.js';
|
|
19
|
+
import { setConnectorInitializing } from '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
20
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
21
|
+
import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
20
22
|
import '../../events/dynamicEvents.js';
|
|
21
23
|
import '../../../../_virtual/_tslib.js';
|
|
22
24
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
@@ -53,7 +55,6 @@ import '../../context/MockContext/MockContext.js';
|
|
|
53
55
|
import '../../views/CollectUserDataView/useFields.js';
|
|
54
56
|
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
55
57
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
56
|
-
import { getWalletConnectorOptions, mergeWalletConnectorOptions } from '../../store/state/walletOptions/walletOptions.js';
|
|
57
58
|
import 'react-i18next';
|
|
58
59
|
import '../Accordion/components/AccordionItem/AccordionItem.js';
|
|
59
60
|
import '../Alert/Alert.js';
|
|
@@ -88,7 +89,6 @@ import '../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
|
88
89
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
89
90
|
import '../../context/OnrampContext/OnrampContext.js';
|
|
90
91
|
import '../../store/state/sendBalances.js';
|
|
91
|
-
import { setConnectorInitializing } from '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
92
92
|
import '../OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
93
93
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
94
94
|
import '../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
@@ -175,12 +175,18 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
175
175
|
});
|
|
176
176
|
const walletConnectorOptions = getWalletConnectorOptions();
|
|
177
177
|
const updatedConnectors = [...walletConnectorOptions];
|
|
178
|
-
|
|
178
|
+
let walletOptionToAutoConnect;
|
|
179
|
+
pendingReadyConnectorsRef.current.forEach(({ connector, shouldAutoConnect }) => {
|
|
179
180
|
let foundWallet = false;
|
|
180
181
|
for (let i = 0; i < updatedConnectors.length; i++) {
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
const hasSameKey = updatedConnectors[i].key === connector.key;
|
|
183
|
+
const isReplacingNonWalletConnectWithWalletConnect = !updatedConnectors[i].walletConnector.isWalletConnect &&
|
|
184
|
+
connector.isWalletConnect;
|
|
185
|
+
if (hasSameKey && !isReplacingNonWalletConnectWithWalletConnect) {
|
|
183
186
|
updatedConnectors[i] = Object.assign(Object.assign({}, updatedConnectors[i]), { isInstalledOnBrowser: connector.isInstalledOnBrowser(), walletConnector: connector });
|
|
187
|
+
}
|
|
188
|
+
if (hasSameKey) {
|
|
189
|
+
foundWallet = true;
|
|
184
190
|
break;
|
|
185
191
|
}
|
|
186
192
|
}
|
|
@@ -188,15 +194,23 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
188
194
|
const newWalletOption = createWallet(connectorProps.walletBook, connector);
|
|
189
195
|
updatedConnectors.push(newWalletOption);
|
|
190
196
|
}
|
|
197
|
+
if (shouldAutoConnect) {
|
|
198
|
+
walletOptionToAutoConnect = updatedConnectors.find((wallet) => wallet.key === connector.key &&
|
|
199
|
+
!wallet.walletConnector.isWalletConnect);
|
|
200
|
+
}
|
|
191
201
|
});
|
|
192
202
|
mergeWalletConnectorOptions(updatedConnectors);
|
|
193
203
|
pendingReadyConnectorsRef.current = [];
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', {
|
|
197
|
-
connector,
|
|
204
|
+
logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] processReadyConnectors', {
|
|
205
|
+
walletOptionToAutoConnect,
|
|
198
206
|
});
|
|
199
|
-
|
|
207
|
+
if (walletOptionToAutoConnect && !primaryWallet) {
|
|
208
|
+
handleWalletItemClick(walletOptionToAutoConnect);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const handleProviderReady = (props) => {
|
|
212
|
+
logger.logVerboseTroubleshootingMessage('[WalletConnectorEvents] handleProviderReady', props);
|
|
213
|
+
pendingReadyConnectorsRef.current.push(props);
|
|
200
214
|
if (readyDebounceTimeoutRef.current) {
|
|
201
215
|
clearTimeout(readyDebounceTimeoutRef.current);
|
|
202
216
|
}
|
|
@@ -216,27 +230,7 @@ const WalletConnectorEvents = ({ connectorProps, }) => {
|
|
|
216
230
|
// Process any remaining connectors on cleanup
|
|
217
231
|
processReadyConnectors();
|
|
218
232
|
};
|
|
219
|
-
}, [connectorProps.walletBook]);
|
|
220
|
-
// add listener for autoConnect event
|
|
221
|
-
useEffect(() => {
|
|
222
|
-
const handleAutoConnect = ({ connector, }) => {
|
|
223
|
-
logger.debug('[WalletConnectorEvents] handleAutoConnect', { connector });
|
|
224
|
-
const walletConnectorOptions = getWalletConnectorOptions();
|
|
225
|
-
const walletOption = walletConnectorOptions.find((wallet) => wallet.walletConnector.key === connector.key);
|
|
226
|
-
logger.debug('[WalletConnectorEvents] handleAutoConnect - found walletOption', Boolean(walletOption));
|
|
227
|
-
if (!walletOption)
|
|
228
|
-
return;
|
|
229
|
-
handleWalletItemClick(walletOption);
|
|
230
|
-
};
|
|
231
|
-
// if there's a connected wallet, we should not auto connect another wallet
|
|
232
|
-
if (primaryWallet) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
walletConnectorEvents.on('autoConnect', handleAutoConnect);
|
|
236
|
-
return () => {
|
|
237
|
-
walletConnectorEvents.off('autoConnect', handleAutoConnect);
|
|
238
|
-
};
|
|
239
|
-
}, [handleWalletItemClick, primaryWallet]);
|
|
233
|
+
}, [connectorProps.walletBook, handleWalletItemClick]);
|
|
240
234
|
// add listener for connectorInitStarted and connectorInitCompleted events
|
|
241
235
|
useEffect(() => {
|
|
242
236
|
const handleConnectorInitStarted = (key) => {
|