@dynamic-labs/sdk-react-core 0.18.0-RC.11 → 0.18.0-RC.12
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 +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/Main.cjs +2 -2
- package/src/lib/Main.js +2 -2
- package/src/lib/assets/index.d.ts +1 -0
- package/src/lib/assets/no-wallet-found.cjs +75 -0
- package/src/lib/assets/no-wallet-found.js +51 -0
- package/src/lib/components/TosAndPp/TosAndPp.cjs +18 -3
- package/src/lib/components/TosAndPp/TosAndPp.d.ts +1 -6
- package/src/lib/components/TosAndPp/TosAndPp.js +19 -4
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +33 -0
- package/src/lib/components/WalletInformationCard/WalletInformationCard.d.ts +11 -0
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +29 -0
- package/src/lib/components/WalletInformationCard/index.d.ts +1 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +8 -7
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -7
- package/src/lib/context/WalletContext/WalletContext.cjs +4 -2
- package/src/lib/context/WalletContext/WalletContext.d.ts +3 -1
- package/src/lib/context/WalletContext/WalletContext.js +4 -2
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +4 -3
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +4 -3
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -2
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +9 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +5 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +9 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -3
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -27
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +15 -28
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +20 -3
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +20 -3
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +8 -8
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +8 -8
- package/src/lib/views/WalletList/{SearchInstead/SearchInstead.cjs → SearchNotFoundMessage/SearchNotFoundMessage.cjs} +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +8 -0
- package/src/lib/views/WalletList/{SearchInstead/SearchInstead.js → SearchNotFoundMessage/SearchNotFoundMessage.js} +2 -2
- package/src/lib/views/WalletList/SearchNotFoundMessage/index.d.ts +1 -0
- package/src/lib/views/WalletList/WalletList.cjs +3 -2
- package/src/lib/views/WalletList/WalletList.js +3 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +27 -8
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.d.ts +0 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +28 -9
- package/src/lib/views/WalletList/SearchInstead/SearchInstead.d.ts +0 -2
- package/src/lib/views/WalletList/SearchInstead/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.18.0-RC.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.11...v0.18.0-RC.12) (2023-07-07)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add event listeners to connect-only ([#2578](https://github.com/dynamic-labs/DynamicAuth/issues/2578)) ([42fcf09](https://github.com/dynamic-labs/DynamicAuth/commit/42fcf096ac439ec883a79bf5811b27cdc360015a))
|
|
8
|
+
* add message when search finds no wallet ([#2421](https://github.com/dynamic-labs/DynamicAuth/issues/2421)) ([694ecee](https://github.com/dynamic-labs/DynamicAuth/commit/694ecee94d9f6f636364eae4aa95ea48e3ff0e0a))
|
|
9
|
+
* allow adding either ToS or PP and enable customization for both ([#2451](https://github.com/dynamic-labs/DynamicAuth/issues/2451)) ([0dce0fe](https://github.com/dynamic-labs/DynamicAuth/commit/0dce0fe534056298cbfdd9caa694231ede00c3fc))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **BridgeSummaryView:** handle primary wallet when it is not defined ([#2602](https://github.com/dynamic-labs/DynamicAuth/issues/2602)) ([8a5daa4](https://github.com/dynamic-labs/DynamicAuth/commit/8a5daa4b2ad218460ccfaab0fa68c75d0d5d569f))
|
|
15
|
+
* secondary wallets network change overrides primary wallet network ([#2603](https://github.com/dynamic-labs/DynamicAuth/issues/2603)) ([358fc45](https://github.com/dynamic-labs/DynamicAuth/commit/358fc45ecb73f31294744f7ba4dbba5779a3e1cf))
|
|
16
|
+
|
|
2
17
|
## [0.18.0-RC.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.10...v0.18.0-RC.11) (2023-07-07)
|
|
3
18
|
|
|
4
19
|
|
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.18.0-RC.
|
|
3
|
+
"version": "0.18.0-RC.12",
|
|
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.18.0-RC.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.18.0-RC.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.18.0-RC.
|
|
22
|
-
"@dynamic-labs/types": "0.18.0-RC.
|
|
23
|
-
"@dynamic-labs/utils": "0.18.0-RC.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.18.0-RC.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.18.0-RC.
|
|
19
|
+
"@dynamic-labs/logger": "0.18.0-RC.12",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.18.0-RC.12",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.18.0-RC.12",
|
|
22
|
+
"@dynamic-labs/types": "0.18.0-RC.12",
|
|
23
|
+
"@dynamic-labs/utils": "0.18.0-RC.12",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.18.0-RC.12",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.18.0-RC.12"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"semver": "7.3.8"
|
package/src/lib/Main.cjs
CHANGED
|
@@ -39,7 +39,7 @@ require('./components/Alert/Alert.cjs');
|
|
|
39
39
|
var useWalletItemActions = require('./utils/hooks/useWalletItemActions/useWalletItemActions.cjs');
|
|
40
40
|
require('./utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
41
41
|
require('./components/Popper/Popper/Popper.cjs');
|
|
42
|
-
require('./components/Popper/PopperContext/PopperContext.cjs');
|
|
42
|
+
var PopperContext = require('./components/Popper/PopperContext/PopperContext.cjs');
|
|
43
43
|
require('formik');
|
|
44
44
|
require('yup');
|
|
45
45
|
require('./components/InlineWidget/InlineWidget.cjs');
|
|
@@ -106,7 +106,7 @@ const Main = () => {
|
|
|
106
106
|
const showDynamicAuth = showAuthFlow && !isProjectSettingsLoading;
|
|
107
107
|
return (jsxRuntime.jsx(SocialRedirectContext.SocialRedirectContextProvider, { children: jsxRuntime.jsx(index.FooterAnimationContextProvider, { children: jsxRuntime.jsx(Portal.Portal, Object.assign({ zIndex: index$1.authModalZIndex, isShown: showDynamicAuth, handleClose: handleClose, withBackdrop: true, transitionEvents: {
|
|
108
108
|
onUnmount: handleOnPortalUnmount,
|
|
109
|
-
} }, { children: jsxRuntime.jsx(DynamicAuthLayout.DynamicAuthLayout, Object.assign({ transitionProps: { isShown: showDynamicAuth }, onClose: handleClose, projectSettings: projectSettings, walletConnector: selectedWalletConnector }, { children: viewToComponentMap.viewToComponentMap[view] })) })) }) }));
|
|
109
|
+
} }, { children: jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(DynamicAuthLayout.DynamicAuthLayout, Object.assign({ transitionProps: { isShown: showDynamicAuth }, onClose: handleClose, projectSettings: projectSettings, walletConnector: selectedWalletConnector }, { children: viewToComponentMap.viewToComponentMap[view] })) }) })) }) }));
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
exports.Main = Main;
|
package/src/lib/Main.js
CHANGED
|
@@ -35,7 +35,7 @@ import './components/Alert/Alert.js';
|
|
|
35
35
|
import { useWalletItemActions } from './utils/hooks/useWalletItemActions/useWalletItemActions.js';
|
|
36
36
|
import './utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
37
37
|
import './components/Popper/Popper/Popper.js';
|
|
38
|
-
import './components/Popper/PopperContext/PopperContext.js';
|
|
38
|
+
import { PopperProvider } from './components/Popper/PopperContext/PopperContext.js';
|
|
39
39
|
import 'formik';
|
|
40
40
|
import 'yup';
|
|
41
41
|
import './components/InlineWidget/InlineWidget.js';
|
|
@@ -102,7 +102,7 @@ const Main = () => {
|
|
|
102
102
|
const showDynamicAuth = showAuthFlow && !isProjectSettingsLoading;
|
|
103
103
|
return (jsx(SocialRedirectContextProvider, { children: jsx(FooterAnimationContextProvider, { children: jsx(Portal, Object.assign({ zIndex: authModalZIndex, isShown: showDynamicAuth, handleClose: handleClose, withBackdrop: true, transitionEvents: {
|
|
104
104
|
onUnmount: handleOnPortalUnmount,
|
|
105
|
-
} }, { children: jsx(DynamicAuthLayout, Object.assign({ transitionProps: { isShown: showDynamicAuth }, onClose: handleClose, projectSettings: projectSettings, walletConnector: selectedWalletConnector }, { children: viewToComponentMap[view] })) })) }) }));
|
|
105
|
+
} }, { children: jsx(PopperProvider, { children: jsx(DynamicAuthLayout, Object.assign({ transitionProps: { isShown: showDynamicAuth }, onClose: handleClose, projectSettings: projectSettings, walletConnector: selectedWalletConnector }, { children: viewToComponentMap[view] })) }) })) }) }));
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
export { Main, Main as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ReactComponent as Logo } from './logo.svg';
|
|
2
2
|
export { ReactComponent as WalletHelpIcon1 } from './wallet-help-icon-1.svg';
|
|
3
3
|
export { ReactComponent as SearchIcon } from './search.svg';
|
|
4
|
+
export { ReactComponent as NoWalletFoundIcon } from './no-wallet-found.svg';
|
|
4
5
|
export { ReactComponent as ProfileIcon } from './profile.svg';
|
|
5
6
|
export { ReactComponent as DynamicLogo } from './dynamic-logo.svg';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var _path, _rect, _rect2, _rect3;
|
|
28
|
+
var _excluded = ["title", "titleId"];
|
|
29
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
+
var SvgNoWalletFound = function SvgNoWalletFound(_ref) {
|
|
33
|
+
var title = _ref.title,
|
|
34
|
+
titleId = _ref.titleId,
|
|
35
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
37
|
+
width: 121,
|
|
38
|
+
height: 81,
|
|
39
|
+
viewBox: "0 0 121 81",
|
|
40
|
+
fill: "none",
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
"aria-labelledby": titleId
|
|
43
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
44
|
+
id: titleId
|
|
45
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
46
|
+
fillRule: "evenodd",
|
|
47
|
+
clipRule: "evenodd",
|
|
48
|
+
d: "M99.064 34.016c-6.654 0-12.048 5.394-12.048 12.048 0 6.653 5.394 12.047 12.048 12.047 6.653 0 12.047-5.394 12.047-12.047 0-6.654-5.394-12.048-12.047-12.048ZM83 46.064C83 37.192 90.192 30 99.064 30c8.871 0 16.063 7.192 16.063 16.064 0 3.712-1.259 7.13-3.373 9.85l8.658 8.658a2.008 2.008 0 0 1-2.84 2.84l-8.658-8.658a15.994 15.994 0 0 1-9.85 3.373C90.192 62.127 83 54.935 83 46.064Z",
|
|
49
|
+
fill: "#16254D",
|
|
50
|
+
fillOpacity: 0.07
|
|
51
|
+
})), _rect || (_rect = /*#__PURE__*/React__namespace.createElement("rect", {
|
|
52
|
+
y: 8,
|
|
53
|
+
width: 121,
|
|
54
|
+
height: 16,
|
|
55
|
+
rx: 4,
|
|
56
|
+
fill: "#16254D",
|
|
57
|
+
fillOpacity: 0.05
|
|
58
|
+
})), _rect2 || (_rect2 = /*#__PURE__*/React__namespace.createElement("rect", {
|
|
59
|
+
y: 30,
|
|
60
|
+
width: 75,
|
|
61
|
+
height: 16,
|
|
62
|
+
rx: 4,
|
|
63
|
+
fill: "#16254D",
|
|
64
|
+
fillOpacity: 0.05
|
|
65
|
+
})), _rect3 || (_rect3 = /*#__PURE__*/React__namespace.createElement("rect", {
|
|
66
|
+
y: 52,
|
|
67
|
+
width: 75,
|
|
68
|
+
height: 16,
|
|
69
|
+
rx: 4,
|
|
70
|
+
fill: "#16254D",
|
|
71
|
+
fillOpacity: 0.05
|
|
72
|
+
})));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.ReactComponent = SvgNoWalletFound;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _rect, _rect2, _rect3;
|
|
4
|
+
var _excluded = ["title", "titleId"];
|
|
5
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
var SvgNoWalletFound = function SvgNoWalletFound(_ref) {
|
|
9
|
+
var title = _ref.title,
|
|
10
|
+
titleId = _ref.titleId,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
width: 121,
|
|
14
|
+
height: 81,
|
|
15
|
+
viewBox: "0 0 121 81",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
"aria-labelledby": titleId
|
|
19
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
20
|
+
id: titleId
|
|
21
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d: "M99.064 34.016c-6.654 0-12.048 5.394-12.048 12.048 0 6.653 5.394 12.047 12.048 12.047 6.653 0 12.047-5.394 12.047-12.047 0-6.654-5.394-12.048-12.047-12.048ZM83 46.064C83 37.192 90.192 30 99.064 30c8.871 0 16.063 7.192 16.063 16.064 0 3.712-1.259 7.13-3.373 9.85l8.658 8.658a2.008 2.008 0 0 1-2.84 2.84l-8.658-8.658a15.994 15.994 0 0 1-9.85 3.373C90.192 62.127 83 54.935 83 46.064Z",
|
|
25
|
+
fill: "#16254D",
|
|
26
|
+
fillOpacity: 0.07
|
|
27
|
+
})), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
|
|
28
|
+
y: 8,
|
|
29
|
+
width: 121,
|
|
30
|
+
height: 16,
|
|
31
|
+
rx: 4,
|
|
32
|
+
fill: "#16254D",
|
|
33
|
+
fillOpacity: 0.05
|
|
34
|
+
})), _rect2 || (_rect2 = /*#__PURE__*/React.createElement("rect", {
|
|
35
|
+
y: 30,
|
|
36
|
+
width: 75,
|
|
37
|
+
height: 16,
|
|
38
|
+
rx: 4,
|
|
39
|
+
fill: "#16254D",
|
|
40
|
+
fillOpacity: 0.05
|
|
41
|
+
})), _rect3 || (_rect3 = /*#__PURE__*/React.createElement("rect", {
|
|
42
|
+
y: 52,
|
|
43
|
+
width: 75,
|
|
44
|
+
height: 16,
|
|
45
|
+
rx: 4,
|
|
46
|
+
fill: "#16254D",
|
|
47
|
+
fillOpacity: 0.05
|
|
48
|
+
})));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { SvgNoWalletFound as ReactComponent };
|
|
@@ -8,9 +8,24 @@ require('@dynamic-labs/utils');
|
|
|
8
8
|
var isConnectOnly = require('../../utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs');
|
|
9
9
|
var Typography = require('../Typography/Typography.cjs');
|
|
10
10
|
|
|
11
|
-
const TosAndPp = (
|
|
12
|
-
const { user, authMode } = useInternalDynamicContext.useInternalDynamicContext();
|
|
13
|
-
|
|
11
|
+
const TosAndPp = () => {
|
|
12
|
+
const { user, authMode, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
13
|
+
const connectionType = isConnectOnly.isConnectOnly(user, authMode)
|
|
14
|
+
? 'connecting'
|
|
15
|
+
: 'logging in';
|
|
16
|
+
const renderTermsOfServices = () => {
|
|
17
|
+
if (!termsOfServiceUrl) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
return (jsxRuntime.jsx("a", Object.assign({ className: 'tos-and-pp__link', href: termsOfServiceUrl, target: '_blank', rel: 'noreferrer' }, { children: "Terms of Service" })));
|
|
21
|
+
};
|
|
22
|
+
const renderPrivacyPolicy = () => {
|
|
23
|
+
if (!privacyPolicyUrl) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [termsOfServiceUrl && jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u00A0&\u00A0" }), jsxRuntime.jsx("a", Object.assign({ className: 'tos-and-pp__link', href: privacyPolicyUrl, target: '_blank', rel: 'noreferrer' }, { children: "Privacy Policy" }))] }));
|
|
27
|
+
};
|
|
28
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(privacyPolicyUrl || termsOfServiceUrl) && (jsxRuntime.jsxs(Typography.Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: 'tos-and-pp__text' }, { children: ["By ", connectionType, ", you agree to", jsxRuntime.jsx("br", {}), "our\u00A0", renderTermsOfServices(), renderPrivacyPolicy(), "."] }))), customTermsOfServices, customPrivacyPolicy] }));
|
|
14
29
|
};
|
|
15
30
|
|
|
16
31
|
exports.TosAndPp = TosAndPp;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
privacyPolicyUrl: string;
|
|
4
|
-
termsOfServiceUrl: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const TosAndPp: ({ privacyPolicyUrl, termsOfServiceUrl, }: Props) => JSX.Element | null;
|
|
7
|
-
export {};
|
|
2
|
+
export declare const TosAndPp: () => JSX.Element | null;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
3
3
|
import '@dynamic-labs/utils';
|
|
4
4
|
import { isConnectOnly } from '../../utils/hooks/authenticationHooks/helpers/isConnectOnly.js';
|
|
5
5
|
import { Typography } from '../Typography/Typography.js';
|
|
6
6
|
|
|
7
|
-
const TosAndPp = (
|
|
8
|
-
const { user, authMode } = useInternalDynamicContext();
|
|
9
|
-
|
|
7
|
+
const TosAndPp = () => {
|
|
8
|
+
const { user, authMode, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, } = useInternalDynamicContext();
|
|
9
|
+
const connectionType = isConnectOnly(user, authMode)
|
|
10
|
+
? 'connecting'
|
|
11
|
+
: 'logging in';
|
|
12
|
+
const renderTermsOfServices = () => {
|
|
13
|
+
if (!termsOfServiceUrl) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return (jsx("a", Object.assign({ className: 'tos-and-pp__link', href: termsOfServiceUrl, target: '_blank', rel: 'noreferrer' }, { children: "Terms of Service" })));
|
|
17
|
+
};
|
|
18
|
+
const renderPrivacyPolicy = () => {
|
|
19
|
+
if (!privacyPolicyUrl) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return (jsxs(Fragment, { children: [termsOfServiceUrl && jsx(Fragment, { children: "\u00A0&\u00A0" }), jsx("a", Object.assign({ className: 'tos-and-pp__link', href: privacyPolicyUrl, target: '_blank', rel: 'noreferrer' }, { children: "Privacy Policy" }))] }));
|
|
23
|
+
};
|
|
24
|
+
return (jsxs(Fragment, { children: [(privacyPolicyUrl || termsOfServiceUrl) && (jsxs(Typography, Object.assign({ variant: 'body_small', weight: 'regular', className: 'tos-and-pp__text' }, { children: ["By ", connectionType, ", you agree to", jsx("br", {}), "our\u00A0", renderTermsOfServices(), renderPrivacyPolicy(), "."] }))), customTermsOfServices, customPrivacyPolicy] }));
|
|
10
25
|
};
|
|
11
26
|
|
|
12
27
|
export { TosAndPp };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Typography = require('../Typography/Typography.cjs');
|
|
8
|
+
require('@dynamic-labs/sdk-api');
|
|
9
|
+
require('../../shared/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
15
|
+
require('@dynamic-labs/utils');
|
|
16
|
+
require('../../utils/constants/colors.cjs');
|
|
17
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('ethers');
|
|
19
|
+
require('../../shared/consts/index.cjs');
|
|
20
|
+
var Icon = require('../Icon/Icon.cjs');
|
|
21
|
+
|
|
22
|
+
const WalletInformationCard = ({ address, ens, balance, icon, network, menu, }) => {
|
|
23
|
+
const details = React.useMemo(() => {
|
|
24
|
+
const shortenAddress = shortenWalletAddress.shortenWalletAddress(address, 4, 4);
|
|
25
|
+
if (ens) {
|
|
26
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'primary', variant: 'body_normal', truncate: true }, { children: ens })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: shortenAddress }))] }));
|
|
27
|
+
}
|
|
28
|
+
return (jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: shortenAddress })));
|
|
29
|
+
}, [ens, address]);
|
|
30
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-information-card' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-information-card__header' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-information-card__details-container' }, { children: [icon && (jsxRuntime.jsx(Icon.Icon, Object.assign({ className: 'wallet-information-card__icon' }, { children: icon }))), jsxRuntime.jsx("div", Object.assign({ className: 'wallet-information-card__details' }, { children: details })), jsxRuntime.jsx("div", Object.assign({ className: 'wallet-information-card__menu' }, { children: menu }))] })), network] })), jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-information-card__balance-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_small' }, { children: "Balance" })), balance] }))] })));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.WalletInformationCard = WalletInformationCard;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, ReactElement, ReactNode } from 'react';
|
|
2
|
+
type WalletInformationCardProps = {
|
|
3
|
+
address: string;
|
|
4
|
+
ens?: string;
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
network?: ReactNode;
|
|
7
|
+
balance?: ReactNode;
|
|
8
|
+
menu?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const WalletInformationCard: FC<WalletInformationCardProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Typography } from '../Typography/Typography.js';
|
|
4
|
+
import '@dynamic-labs/sdk-api';
|
|
5
|
+
import '../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
11
|
+
import '@dynamic-labs/utils';
|
|
12
|
+
import '../../utils/constants/colors.js';
|
|
13
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import 'ethers';
|
|
15
|
+
import '../../shared/consts/index.js';
|
|
16
|
+
import { Icon } from '../Icon/Icon.js';
|
|
17
|
+
|
|
18
|
+
const WalletInformationCard = ({ address, ens, balance, icon, network, menu, }) => {
|
|
19
|
+
const details = useMemo(() => {
|
|
20
|
+
const shortenAddress = shortenWalletAddress(address, 4, 4);
|
|
21
|
+
if (ens) {
|
|
22
|
+
return (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ color: 'primary', variant: 'body_normal', truncate: true }, { children: ens })), jsx(Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: shortenAddress }))] }));
|
|
23
|
+
}
|
|
24
|
+
return (jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: shortenAddress })));
|
|
25
|
+
}, [ens, address]);
|
|
26
|
+
return (jsxs("div", Object.assign({ className: 'wallet-information-card' }, { children: [jsxs("div", Object.assign({ className: 'wallet-information-card__header' }, { children: [jsxs("div", Object.assign({ className: 'wallet-information-card__details-container' }, { children: [icon && (jsx(Icon, Object.assign({ className: 'wallet-information-card__icon' }, { children: icon }))), jsx("div", Object.assign({ className: 'wallet-information-card__details' }, { children: details })), jsx("div", Object.assign({ className: 'wallet-information-card__menu' }, { children: menu }))] })), network] })), jsxs("div", Object.assign({ className: 'wallet-information-card__balance-container' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_small' }, { children: "Balance" })), balance] }))] })));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { WalletInformationCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletInformationCard } from './WalletInformationCard';
|
|
@@ -91,7 +91,7 @@ var useSetShowAuthFlowWithInit = require('./hooks/useSetShowAuthFlowWithInit/use
|
|
|
91
91
|
|
|
92
92
|
const EMPTY_INITIAL_USER = undefined;
|
|
93
93
|
const DynamicContext = React.createContext(undefined);
|
|
94
|
-
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', walletsByChain, 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, }) => {
|
|
94
|
+
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', walletsByChain, 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, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
95
95
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
96
96
|
if (!environmentId) {
|
|
97
97
|
throw new utils.MissingEnvironmentIdError();
|
|
@@ -151,7 +151,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
151
151
|
});
|
|
152
152
|
const [authMode, setAuthMode] = useLocalStorage.useLocalStorage(localStorage$1.AUTH_MODE, initialAuthenticationMode);
|
|
153
153
|
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId();
|
|
154
|
-
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, connectWalletByAddressAndChain, unlinkConnectedWallet,
|
|
154
|
+
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, connectWalletByAddressAndChain, unlinkConnectedWallet, } = useConnectWallet.useConnectWallet({
|
|
155
155
|
authMode,
|
|
156
156
|
clearPrimaryWalletId,
|
|
157
157
|
enableVisitTrackingOnConnectOnly,
|
|
@@ -230,7 +230,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
230
230
|
handleRemoveLsNetworks();
|
|
231
231
|
setOnboardingOnlyJwt(undefined);
|
|
232
232
|
removeConnectedWalletsInfo();
|
|
233
|
-
setConnectedWallet(null);
|
|
234
233
|
removeConnectedUser();
|
|
235
234
|
clearPrimaryWalletId();
|
|
236
235
|
removeConnectedNameService();
|
|
@@ -246,7 +245,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
246
245
|
removeAuthTokenAndUser,
|
|
247
246
|
handleRemoveLsNetworks,
|
|
248
247
|
removeConnectedWalletsInfo,
|
|
249
|
-
setConnectedWallet,
|
|
250
248
|
removeConnectedUser,
|
|
251
249
|
clearPrimaryWalletId,
|
|
252
250
|
removeConnectedNameService,
|
|
@@ -277,6 +275,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
277
275
|
verifiedCredentials: (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || [],
|
|
278
276
|
});
|
|
279
277
|
const { loadingNetwork, network, setNetwork } = useWalletEventListeners.useWalletEventListeners({
|
|
278
|
+
authMode,
|
|
280
279
|
computeConnectedStateForWallets,
|
|
281
280
|
connectWalletByAddressAndChain,
|
|
282
281
|
handleLogOut,
|
|
@@ -322,7 +321,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
322
321
|
setMultiWalletWidgetState('idle');
|
|
323
322
|
if (authMode !== 'connect-only') {
|
|
324
323
|
removeConnectedWalletsInfo();
|
|
325
|
-
setConnectedWallet(null);
|
|
326
324
|
}
|
|
327
325
|
if (!localStorage.LocalStorage.getFromLS(localStorage$1.AUTH_USER)) {
|
|
328
326
|
localStorage.LocalStorage.removeFromLS(localStorage$1.AUTH_TOKEN);
|
|
@@ -343,7 +341,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
343
341
|
primaryWallet,
|
|
344
342
|
clearAllWalletConnectSessions,
|
|
345
343
|
removeConnectedWalletsInfo,
|
|
346
|
-
setConnectedWallet,
|
|
347
344
|
]);
|
|
348
345
|
const value = React.useMemo(() => {
|
|
349
346
|
var _a, _b;
|
|
@@ -369,6 +366,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
369
366
|
connectedWalletsInfo,
|
|
370
367
|
consumeNonce,
|
|
371
368
|
cssOverrides,
|
|
369
|
+
customPrivacyPolicy,
|
|
370
|
+
customTermsOfServices,
|
|
372
371
|
debugError,
|
|
373
372
|
decodedAuthToken: decodeJwt.decodeJwt(getAuthToken.getAuthToken()),
|
|
374
373
|
decodedOnboardingOnlyToken: decodeJwt.decodeJwt(onboardingOnlyJwt),
|
|
@@ -474,6 +473,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
474
473
|
computeConnectedStateForWallets,
|
|
475
474
|
connectWallet,
|
|
476
475
|
connectedWallet,
|
|
476
|
+
customPrivacyPolicy,
|
|
477
|
+
customTermsOfServices,
|
|
477
478
|
primaryWallet,
|
|
478
479
|
secondaryWallets,
|
|
479
480
|
connectedWalletsInfo,
|
|
@@ -598,7 +599,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
598
599
|
isBridgeFlow,
|
|
599
600
|
isUserConnected,
|
|
600
601
|
loginWithEmail,
|
|
601
|
-
}) }, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
602
|
+
}) }, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad, connectWalletByAddressAndChain: connectWalletByAddressAndChain }, { children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
602
603
|
};
|
|
603
604
|
|
|
604
605
|
exports.DynamicContext = DynamicContext;
|
|
@@ -39,6 +39,8 @@ export interface IDynamicContext {
|
|
|
39
39
|
connectedWalletsInfo: ConnectedWalletConnectorType[] | [];
|
|
40
40
|
consumeNonce: () => string | undefined;
|
|
41
41
|
cssOverrides?: string | JSX.Element;
|
|
42
|
+
customPrivacyPolicy?: ReactNode;
|
|
43
|
+
customTermsOfServices?: ReactNode;
|
|
42
44
|
debugError: boolean;
|
|
43
45
|
decodedAuthToken: Omit<DynamicJwt, 'jwt'> | undefined;
|
|
44
46
|
decodedOnboardingOnlyToken: Omit<DynamicJwt, 'jwt'> | undefined;
|
|
@@ -163,6 +165,7 @@ export interface DynamicContextProps {
|
|
|
163
165
|
notInTheListImageUrl?: string;
|
|
164
166
|
onboardingImageUrl?: string;
|
|
165
167
|
policiesConsentInnerComponent?: ReactNode | ReactNode[];
|
|
168
|
+
customPrivacyPolicy?: ReactNode;
|
|
166
169
|
privacyPolicyUrl?: string;
|
|
167
170
|
shadowDOMEnabled?: boolean;
|
|
168
171
|
signWithEmailWalletName?: string;
|
|
@@ -170,6 +173,7 @@ export interface DynamicContextProps {
|
|
|
170
173
|
socialMediaIconUrl?: Record<string, string> | Record<SocialNetworkIconType, string>;
|
|
171
174
|
socialMediaLinkText?: string;
|
|
172
175
|
socialMediaUrl?: string;
|
|
176
|
+
customTermsOfServices?: ReactNode;
|
|
173
177
|
termsOfServiceUrl?: string;
|
|
174
178
|
toolkitEnabled?: boolean;
|
|
175
179
|
walletConnectV1Bridge?: string;
|
|
@@ -179,4 +183,4 @@ export interface DynamicContextProps {
|
|
|
179
183
|
theme?: ThemeData | ThemeSetting;
|
|
180
184
|
}
|
|
181
185
|
export declare const DynamicContext: import("react").Context<IDynamicContext | undefined>;
|
|
182
|
-
export declare const DynamicContextProvider: ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl, appName, walletsByChain, 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;
|
|
186
|
+
export declare const DynamicContextProvider: ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl, appName, walletsByChain, cssOverrides, defaultNumberOfWalletsToShow, flowNetwork, initialAuthenticationMode, debugError, displayTermsOfService, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel, multiWallet: deprecatedMultiWallet, notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }: DynamicContextProps) => JSX.Element;
|
|
@@ -87,7 +87,7 @@ import { useSetShowAuthFlowWithInit } from './hooks/useSetShowAuthFlowWithInit/u
|
|
|
87
87
|
|
|
88
88
|
const EMPTY_INITIAL_USER = undefined;
|
|
89
89
|
const DynamicContext = createContext(undefined);
|
|
90
|
-
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', walletsByChain, 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, }) => {
|
|
90
|
+
const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', walletsByChain, 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, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectV1Bridge, walletConnectors: walletConnectorsProp, }, children, theme, }) => {
|
|
91
91
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
92
92
|
if (!environmentId) {
|
|
93
93
|
throw new MissingEnvironmentIdError();
|
|
@@ -147,7 +147,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
147
147
|
});
|
|
148
148
|
const [authMode, setAuthMode] = useLocalStorage(AUTH_MODE, initialAuthenticationMode);
|
|
149
149
|
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId();
|
|
150
|
-
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, connectWalletByAddressAndChain, unlinkConnectedWallet,
|
|
150
|
+
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, connectWalletByAddressAndChain, unlinkConnectedWallet, } = useConnectWallet({
|
|
151
151
|
authMode,
|
|
152
152
|
clearPrimaryWalletId,
|
|
153
153
|
enableVisitTrackingOnConnectOnly,
|
|
@@ -226,7 +226,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
226
226
|
handleRemoveLsNetworks();
|
|
227
227
|
setOnboardingOnlyJwt(undefined);
|
|
228
228
|
removeConnectedWalletsInfo();
|
|
229
|
-
setConnectedWallet(null);
|
|
230
229
|
removeConnectedUser();
|
|
231
230
|
clearPrimaryWalletId();
|
|
232
231
|
removeConnectedNameService();
|
|
@@ -242,7 +241,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
242
241
|
removeAuthTokenAndUser,
|
|
243
242
|
handleRemoveLsNetworks,
|
|
244
243
|
removeConnectedWalletsInfo,
|
|
245
|
-
setConnectedWallet,
|
|
246
244
|
removeConnectedUser,
|
|
247
245
|
clearPrimaryWalletId,
|
|
248
246
|
removeConnectedNameService,
|
|
@@ -273,6 +271,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
273
271
|
verifiedCredentials: (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || [],
|
|
274
272
|
});
|
|
275
273
|
const { loadingNetwork, network, setNetwork } = useWalletEventListeners({
|
|
274
|
+
authMode,
|
|
276
275
|
computeConnectedStateForWallets,
|
|
277
276
|
connectWalletByAddressAndChain,
|
|
278
277
|
handleLogOut,
|
|
@@ -318,7 +317,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
318
317
|
setMultiWalletWidgetState('idle');
|
|
319
318
|
if (authMode !== 'connect-only') {
|
|
320
319
|
removeConnectedWalletsInfo();
|
|
321
|
-
setConnectedWallet(null);
|
|
322
320
|
}
|
|
323
321
|
if (!LocalStorage.getFromLS(AUTH_USER)) {
|
|
324
322
|
LocalStorage.removeFromLS(AUTH_TOKEN);
|
|
@@ -339,7 +337,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
339
337
|
primaryWallet,
|
|
340
338
|
clearAllWalletConnectSessions,
|
|
341
339
|
removeConnectedWalletsInfo,
|
|
342
|
-
setConnectedWallet,
|
|
343
340
|
]);
|
|
344
341
|
const value = useMemo(() => {
|
|
345
342
|
var _a, _b;
|
|
@@ -365,6 +362,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
365
362
|
connectedWalletsInfo,
|
|
366
363
|
consumeNonce,
|
|
367
364
|
cssOverrides,
|
|
365
|
+
customPrivacyPolicy,
|
|
366
|
+
customTermsOfServices,
|
|
368
367
|
debugError,
|
|
369
368
|
decodedAuthToken: decodeJwt(getAuthToken()),
|
|
370
369
|
decodedOnboardingOnlyToken: decodeJwt(onboardingOnlyJwt),
|
|
@@ -470,6 +469,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
470
469
|
computeConnectedStateForWallets,
|
|
471
470
|
connectWallet,
|
|
472
471
|
connectedWallet,
|
|
472
|
+
customPrivacyPolicy,
|
|
473
|
+
customTermsOfServices,
|
|
473
474
|
primaryWallet,
|
|
474
475
|
secondaryWallets,
|
|
475
476
|
connectedWalletsInfo,
|
|
@@ -594,7 +595,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
|
|
|
594
595
|
isBridgeFlow,
|
|
595
596
|
isUserConnected,
|
|
596
597
|
loginWithEmail,
|
|
597
|
-
}) }, { children: jsx(WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
598
|
+
}) }, { children: jsx(WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad, connectWalletByAddressAndChain: connectWalletByAddressAndChain }, { children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
598
599
|
};
|
|
599
600
|
|
|
600
601
|
export { DynamicContext, DynamicContextProvider };
|