@dynamic-labs/sdk-react-core 4.40.1 → 4.40.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 +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +2 -1
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/SetSelectedWalletConnectorKey.type.d.ts +5 -0
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.cjs +19 -5
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.d.ts +3 -3
- package/src/lib/context/DynamicContext/hooks/useSelectedWalletConnector/useSelectedWalletConnector.js +19 -5
- package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +4 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +4 -1
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +4 -1
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +4 -1
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +7 -2
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +7 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +8 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +8 -2
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +24 -6
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +24 -6
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.40.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.1...v4.40.2) (2025-10-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* upgrade node to 20.20 in sanity-yarn-add-sdk job for compatibility ([#9743](https://github.com/dynamic-labs/dynamic-auth/issues/9743)) ([58d7e32](https://github.com/dynamic-labs/dynamic-auth/commit/58d7e32cd3965fba983c91c6345eae3bfe8dd1d5))
|
|
8
|
+
|
|
2
9
|
### [4.40.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.0...v4.40.1) (2025-10-24)
|
|
3
10
|
|
|
4
11
|
### Bug Fixes
|
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.40.
|
|
3
|
+
"version": "4.40.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.813",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.0-alpha.23",
|
|
@@ -15,17 +15,17 @@
|
|
|
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.40.
|
|
19
|
-
"@dynamic-labs/iconic": "4.40.
|
|
20
|
-
"@dynamic-labs/locale": "4.40.
|
|
21
|
-
"@dynamic-labs/logger": "4.40.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.40.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.40.
|
|
24
|
-
"@dynamic-labs/store": "4.40.
|
|
25
|
-
"@dynamic-labs/types": "4.40.
|
|
26
|
-
"@dynamic-labs/utils": "4.40.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.40.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.40.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.40.2",
|
|
19
|
+
"@dynamic-labs/iconic": "4.40.2",
|
|
20
|
+
"@dynamic-labs/locale": "4.40.2",
|
|
21
|
+
"@dynamic-labs/logger": "4.40.2",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.40.2",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.40.2",
|
|
24
|
+
"@dynamic-labs/store": "4.40.2",
|
|
25
|
+
"@dynamic-labs/types": "4.40.2",
|
|
26
|
+
"@dynamic-labs/utils": "4.40.2",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.40.2",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.40.2",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -5,10 +5,11 @@ import { DynamicEventsCallbacks, Wallet } from '../../../../shared';
|
|
|
5
5
|
import { MultiWalletWidgetStateSetter } from '../../../../utils/hooks/multiWallet';
|
|
6
6
|
import { ChainsToConnect } from '../../types';
|
|
7
7
|
import { SetShowAuthFlow } from '../useShowAuthFlow';
|
|
8
|
+
import { SetSelectedWalletConnectorKey } from '../useSelectedWalletConnector/SetSelectedWalletConnectorKey.type';
|
|
8
9
|
export type UseHandleLogoutParams = {
|
|
9
10
|
clearAllWalletConnectSessions: () => void;
|
|
10
11
|
bridgeChains: ChainsToConnect[] | undefined;
|
|
11
|
-
setSelectedWalletConnectorKey:
|
|
12
|
+
setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
|
|
12
13
|
setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
|
|
13
14
|
setShowBridgeWidget: Dispatch<SetStateAction<boolean>>;
|
|
14
15
|
user: UserProfile | undefined;
|
|
@@ -6,15 +6,29 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
const useSelectedWalletConnector = ({ walletConnectorOptions, }) => {
|
|
9
|
-
const [
|
|
9
|
+
const [selectedWalletConnectorData, setSelectedWalletConnectorData] = React.useState(null);
|
|
10
|
+
/**
|
|
11
|
+
* To keep backwards compatibility, this also accepts a single string param which will be just the key
|
|
12
|
+
*/
|
|
13
|
+
const setSelectedWalletConnectorKey = (data) => {
|
|
14
|
+
if (typeof data === 'string') {
|
|
15
|
+
setSelectedWalletConnectorData({ key: data });
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
setSelectedWalletConnectorData(data);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
10
21
|
// Instead of storing the selected connector directly, we derive it from the wallets
|
|
11
22
|
// This way if wallets change, the selected connector will be updated too
|
|
12
23
|
const selectedWalletConnector = React.useMemo(() => {
|
|
13
|
-
var _a
|
|
14
|
-
if (!
|
|
24
|
+
var _a;
|
|
25
|
+
if (!selectedWalletConnectorData)
|
|
15
26
|
return null;
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
const option = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorData.key &&
|
|
28
|
+
(!selectedWalletConnectorData.chain ||
|
|
29
|
+
walletConnector.connectedChain === selectedWalletConnectorData.chain));
|
|
30
|
+
return (_a = option === null || option === void 0 ? void 0 : option.walletConnector) !== null && _a !== void 0 ? _a : null;
|
|
31
|
+
}, [selectedWalletConnectorData, walletConnectorOptions]);
|
|
18
32
|
return { selectedWalletConnector, setSelectedWalletConnectorKey };
|
|
19
33
|
};
|
|
20
34
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { WalletOption } from '../../../../shared';
|
|
2
|
+
import { SetSelectedWalletConnectorKey } from './SetSelectedWalletConnectorKey.type';
|
|
3
3
|
type useSelectedWalletConnectorProps = {
|
|
4
4
|
walletConnectorOptions: WalletOption[];
|
|
5
5
|
};
|
|
6
6
|
export declare const useSelectedWalletConnector: ({ walletConnectorOptions, }: useSelectedWalletConnectorProps) => {
|
|
7
|
-
selectedWalletConnector: import("
|
|
8
|
-
setSelectedWalletConnectorKey:
|
|
7
|
+
selectedWalletConnector: import("@dynamic-labs/wallet-connector-core").WalletConnectorCore.WalletConnector | null;
|
|
8
|
+
setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
|
@@ -2,15 +2,29 @@
|
|
|
2
2
|
import { useState, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
const useSelectedWalletConnector = ({ walletConnectorOptions, }) => {
|
|
5
|
-
const [
|
|
5
|
+
const [selectedWalletConnectorData, setSelectedWalletConnectorData] = useState(null);
|
|
6
|
+
/**
|
|
7
|
+
* To keep backwards compatibility, this also accepts a single string param which will be just the key
|
|
8
|
+
*/
|
|
9
|
+
const setSelectedWalletConnectorKey = (data) => {
|
|
10
|
+
if (typeof data === 'string') {
|
|
11
|
+
setSelectedWalletConnectorData({ key: data });
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
setSelectedWalletConnectorData(data);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
6
17
|
// Instead of storing the selected connector directly, we derive it from the wallets
|
|
7
18
|
// This way if wallets change, the selected connector will be updated too
|
|
8
19
|
const selectedWalletConnector = useMemo(() => {
|
|
9
|
-
var _a
|
|
10
|
-
if (!
|
|
20
|
+
var _a;
|
|
21
|
+
if (!selectedWalletConnectorData)
|
|
11
22
|
return null;
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
const option = walletConnectorOptions.find(({ walletConnector }) => walletConnector.key === selectedWalletConnectorData.key &&
|
|
24
|
+
(!selectedWalletConnectorData.chain ||
|
|
25
|
+
walletConnector.connectedChain === selectedWalletConnectorData.chain));
|
|
26
|
+
return (_a = option === null || option === void 0 ? void 0 : option.walletConnector) !== null && _a !== void 0 ? _a : null;
|
|
27
|
+
}, [selectedWalletConnectorData, walletConnectorOptions]);
|
|
14
28
|
return { selectedWalletConnector, setSelectedWalletConnectorKey };
|
|
15
29
|
};
|
|
16
30
|
|
|
@@ -13,6 +13,7 @@ import { ConnectWalletOptions } from '../../../utils/hooks/useConnectWallet/useC
|
|
|
13
13
|
import { ThemeData, ThemeSetting } from '../../ThemeContext';
|
|
14
14
|
import { DisplayOrder, SetDisplayOrderPriority, SetShowAuthFlow } from '../hooks';
|
|
15
15
|
import { SetCallbackType } from '../useCustomerCallbacks';
|
|
16
|
+
import { SetSelectedWalletConnectorKey } from '../hooks/useSelectedWalletConnector/SetSelectedWalletConnectorKey.type';
|
|
16
17
|
import { SettingsOverrides } from './SettingsOverrides';
|
|
17
18
|
import { SocialSettings } from './SocialSettings';
|
|
18
19
|
export type ChainsToConnect = {
|
|
@@ -134,7 +135,7 @@ export interface IDynamicContext {
|
|
|
134
135
|
setPasskeySuccessPopup: (key: PasskeySuccessEnum) => void;
|
|
135
136
|
setPrimaryWallet: (walletId: string) => Promise<void>;
|
|
136
137
|
setQrcodeUri: Dispatch<SetStateAction<string>>;
|
|
137
|
-
setSelectedWalletConnectorKey:
|
|
138
|
+
setSelectedWalletConnectorKey: SetSelectedWalletConnectorKey;
|
|
138
139
|
setSelectedWalletWithAction: (walletWithAction: WalletWithAction | null) => void;
|
|
139
140
|
setShowAuthFlow: SetShowAuthFlow;
|
|
140
141
|
/**
|