@dynamic-labs/sdk-react-core 0.17.13 → 0.17.15
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -1
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -1
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -1
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -1
- package/src/lib/views/WalletList/data.cjs +2 -1
- package/src/lib/views/WalletList/data.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.17.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.14...v0.17.15) (2023-06-28)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **wc_v1_bridget:** disable WC v2 when WC v1 bridge is set ([#2505](https://github.com/dynamic-labs/DynamicAuth/issues/2505)) ([#2506](https://github.com/dynamic-labs/DynamicAuth/issues/2506)) ([ed7dcf2](https://github.com/dynamic-labs/DynamicAuth/commit/ed7dcf2168f5486a780933060e61eff3fe0ff59e))
|
|
8
|
+
|
|
9
|
+
### [0.17.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.13...v0.17.14) (2023-06-27)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add support for custom walletconnect v1 bridge ([#2487](https://github.com/dynamic-labs/DynamicAuth/issues/2487)) ([#2498](https://github.com/dynamic-labs/DynamicAuth/issues/2498)) ([c050e56](https://github.com/dynamic-labs/DynamicAuth/commit/c050e569c05801f661940e7b5a76677992fa2b86))
|
|
15
|
+
|
|
2
16
|
### [0.17.13](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.12...v0.17.13) (2023-06-27)
|
|
3
17
|
|
|
4
18
|
|
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": "0.17.
|
|
3
|
+
"version": "0.17.15",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"formik": "2.2.9",
|
|
17
17
|
"qrcode": "1.5.1",
|
|
18
18
|
"ethers": "5.7.2",
|
|
19
|
-
"@dynamic-labs/logger": "0.17.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.17.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.17.
|
|
22
|
-
"@dynamic-labs/types": "0.17.
|
|
23
|
-
"@dynamic-labs/utils": "0.17.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.17.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.17.
|
|
19
|
+
"@dynamic-labs/logger": "0.17.15",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.17.15",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.17.15",
|
|
22
|
+
"@dynamic-labs/types": "0.17.15",
|
|
23
|
+
"@dynamic-labs/utils": "0.17.15",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.17.15",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.17.15"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"semver": "7.3.8"
|
|
@@ -87,7 +87,7 @@ var useSetShowAuthFlowWithInit = require('./hooks/useSetShowAuthFlowWithInit/use
|
|
|
87
87
|
|
|
88
88
|
const EMPTY_INITIAL_USER = undefined;
|
|
89
89
|
const DynamicContext = React.createContext(undefined);
|
|
90
|
-
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displayTermsOfService = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
90
|
+
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displayTermsOfService = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
91
91
|
var _a, _b, _c, _d, _e;
|
|
92
92
|
logger.logger.setLogLevel(logLevel);
|
|
93
93
|
walletConnectorCore.logger.setLogLevel(logLevel);
|
|
@@ -137,6 +137,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
137
137
|
flowNetwork,
|
|
138
138
|
networkConfigurations: serverNetworkConfigurations,
|
|
139
139
|
projectSettings,
|
|
140
|
+
walletConnectV1Bridge,
|
|
140
141
|
walletConnectorsProp,
|
|
141
142
|
walletUiUtils,
|
|
142
143
|
});
|
|
@@ -154,10 +154,11 @@ export interface DynamicContextProps {
|
|
|
154
154
|
socialMediaUrl?: string;
|
|
155
155
|
termsOfServiceUrl?: string;
|
|
156
156
|
toolkitEnabled?: boolean;
|
|
157
|
+
walletConnectV1Bridge?: string;
|
|
157
158
|
walletConnectors?: WalletConnectorsMethod[];
|
|
158
159
|
walletsFilter?: (options: WalletOption[]) => WalletOption[];
|
|
159
160
|
};
|
|
160
161
|
theme?: ThemeData | ThemeSetting;
|
|
161
162
|
}
|
|
162
163
|
export declare const DynamicContext: import("react").Context<IDynamicContext | undefined>;
|
|
163
|
-
export declare const DynamicContextProvider: ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl, appName, cssOverrides, defaultNumberOfWalletsToShow, flowNetwork, initialAuthenticationMode, debugError, displayTermsOfService, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel, multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled, walletConnectors: walletConnectorsProp, }, children, theme, }: DynamicContextProps) => JSX.Element;
|
|
164
|
+
export declare const DynamicContextProvider: ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl, appName, cssOverrides, defaultNumberOfWalletsToShow, flowNetwork, initialAuthenticationMode, debugError, displayTermsOfService, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel, multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }: DynamicContextProps) => JSX.Element;
|
|
@@ -83,7 +83,7 @@ import { useSetShowAuthFlowWithInit } from './hooks/useSetShowAuthFlowWithInit/u
|
|
|
83
83
|
|
|
84
84
|
const EMPTY_INITIAL_USER = undefined;
|
|
85
85
|
const DynamicContext = createContext(undefined);
|
|
86
|
-
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displayTermsOfService = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
86
|
+
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displayTermsOfService = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
87
87
|
var _a, _b, _c, _d, _e;
|
|
88
88
|
logger.setLogLevel(logLevel);
|
|
89
89
|
logger$1.setLogLevel(logLevel);
|
|
@@ -133,6 +133,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
133
133
|
flowNetwork,
|
|
134
134
|
networkConfigurations: serverNetworkConfigurations,
|
|
135
135
|
projectSettings,
|
|
136
|
+
walletConnectV1Bridge,
|
|
136
137
|
walletConnectorsProp,
|
|
137
138
|
walletUiUtils,
|
|
138
139
|
});
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var data = require('../../../views/WalletList/data.cjs');
|
|
7
7
|
|
|
8
|
-
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }) => {
|
|
8
|
+
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
9
9
|
const wallets = React.useMemo(() => {
|
|
10
10
|
if (!projectSettings)
|
|
11
11
|
return [];
|
|
@@ -16,6 +16,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
16
16
|
flowNetwork,
|
|
17
17
|
networkConfigurations,
|
|
18
18
|
skipMemo: true,
|
|
19
|
+
walletConnectV1Bridge,
|
|
19
20
|
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
20
21
|
walletUiUtils,
|
|
21
22
|
});
|
|
@@ -26,6 +27,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
26
27
|
flowNetwork,
|
|
27
28
|
networkConfigurations,
|
|
28
29
|
skipMemo: true,
|
|
30
|
+
walletConnectV1Bridge,
|
|
29
31
|
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
30
32
|
walletUiUtils,
|
|
31
33
|
});
|
|
@@ -37,6 +39,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
37
39
|
networkConfigurations,
|
|
38
40
|
projectSettings,
|
|
39
41
|
walletConnectorsProp,
|
|
42
|
+
walletConnectV1Bridge,
|
|
40
43
|
flowNetwork,
|
|
41
44
|
]);
|
|
42
45
|
return { wallets };
|
|
@@ -7,10 +7,11 @@ type Props = {
|
|
|
7
7
|
flowNetwork?: 'mainnet' | 'testnet';
|
|
8
8
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
9
9
|
projectSettings: ProjectSettings | undefined;
|
|
10
|
+
walletConnectV1Bridge?: string;
|
|
10
11
|
walletConnectorsProp?: WalletConnectorsMethod[];
|
|
11
12
|
walletUiUtils: WalletUiUtils;
|
|
12
13
|
};
|
|
13
|
-
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }: Props) => {
|
|
14
|
+
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }: Props) => {
|
|
14
15
|
wallets: import("../../../shared").WalletOption[];
|
|
15
16
|
};
|
|
16
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { getInstalledWallets, getNotInstalledWallets } from '../../../views/WalletList/data.js';
|
|
3
3
|
|
|
4
|
-
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletUiUtils, walletConnectorsProp, }) => {
|
|
4
|
+
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
5
5
|
const wallets = useMemo(() => {
|
|
6
6
|
if (!projectSettings)
|
|
7
7
|
return [];
|
|
@@ -12,6 +12,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
12
12
|
flowNetwork,
|
|
13
13
|
networkConfigurations,
|
|
14
14
|
skipMemo: true,
|
|
15
|
+
walletConnectV1Bridge,
|
|
15
16
|
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
16
17
|
walletUiUtils,
|
|
17
18
|
});
|
|
@@ -22,6 +23,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
22
23
|
flowNetwork,
|
|
23
24
|
networkConfigurations,
|
|
24
25
|
skipMemo: true,
|
|
26
|
+
walletConnectV1Bridge,
|
|
25
27
|
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
26
28
|
walletUiUtils,
|
|
27
29
|
});
|
|
@@ -33,6 +35,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
33
35
|
networkConfigurations,
|
|
34
36
|
projectSettings,
|
|
35
37
|
walletConnectorsProp,
|
|
38
|
+
walletConnectV1Bridge,
|
|
36
39
|
flowNetwork,
|
|
37
40
|
]);
|
|
38
41
|
return { wallets };
|
|
@@ -26,7 +26,8 @@ const createWallets = (props) => {
|
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
return multiWallet.getEnabledWallets({
|
|
28
28
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
29
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled:
|
|
29
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
30
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
30
31
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
31
32
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
32
33
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
@@ -22,7 +22,8 @@ const createWallets = (props) => {
|
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
return getEnabledWallets({
|
|
24
24
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
25
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled:
|
|
25
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
26
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
26
27
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
27
28
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
28
29
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|