@onekeyfe/inpage-providers-hub 2.1.22 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logo = void 0;
4
+ const jsx_runtime_1 = require("preact/jsx-runtime");
5
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
6
+ const Logo = ({ style }) => ((0, jsx_runtime_1.jsx)("img", { alt: "OneKey Logo", style: style, src: "data:image/webp;base64,UklGRswEAABXRUJQVlA4WAoAAAAQAAAALwAALwAAQUxQSCgDAAABoGTbtuq6OdLTNzPbxXCJoehehJlKbkKYmZMGMDPUmZmZOWaM3tN9axXuvVKaEBETEPXhvIhYdOw5Nz35xld//wf//f3Vm0/edO6xiyJi3jBmHsxFLD7poZ/9H39+6KRFEXODGZphLL/iN9WubbvUo/Spa8ed6m9XrohhM9Uo4oKtmtqut47FvmuTbj0/YjTFXMx7StuEIrnUVVKrT82LucooVnxqmwQBpCpI0dT6yYoYFZqY94kHEAEpioW6HPCTedFExGAYT3nAgiAguRRFBA/4VAwHEXNxgS1SFdQMC1O2XhBzMYwV20wCgswuCAImt66I4by4ylYyQRAsZ4CCgK1XxbxY8rsJEBAQLFMUkGLy9yURp5goSXkaC5ILyVMiHrGVXFGclrKiKLY+Ekt+tSuoACI1MxVAtPPXJSdor1QFhApSFdReT7jQTgRBM5lB0Ayw84LbbAXQkhkVQEsKtt72bEFUBMGaIiqCYPbsu04EECqIZQChAk589zuTIAioIDURBFQQk99ttS8IIgKiKIAIIgLau3UsqqCAgoIqqqCABXAMKAKCIGKdXBDEDGRKEcBZQAQkHwvmILnToyC5II632otK2VmkqoC9W783SVnyAgg1KarJH953UhIUVMGMgqAg4MQPXrQTpCiWcovkAoidL91rK3WhJAJTCWDrPVvsNBNrkltERDDr3LJZ+kI9M6NUFexx89q/nAiCYE2sgiC5E/9aE8/ZSq4gUKgDChZan4u4yAmAgBSnAgEpJy+K2LTVVJJcmElySW7dFKO421YARXEqBFAUsfXuGA3jkL32ggogoohQUMnt3XtIDKOJS+ykLCgIYKko2HpJNBGDmPeKYwXNchFLgiKOfWVeDCKiiYN+cawlZUYtOPaXg6KJvIljfrXrRRAEFEVEBfvOX4+JJspNHPGmdj0ouQgKoNB3+uYR0US9ieXX79fUJTAHsdinLun+65dHE9M2ESfev0tl0k1S6rM+TSbdBHXXfSdGNDH9YBhx1MUv77CK9R0vX3x0xHAQMw8HEYuOPOO6x1778redLbQ7f/vytceuPeOoRRGDYdQBVlA4IH4BAACQCACdASowADAAPpE2lkiloqIhMdZqALASCWkABRXm1xMlLv4/sMpVEDsQhAZmdBuj/t2DLLfSj9jeN2h/33kRqlO8uEYD82VJykmZgAD++u9Yi1iq75P1V2sgP+qtpKI6W2w+S89zFwU6NocVAgS4Ahpa8cwJdBVEzwmXPHuS+Bkf1jepfuaBisZjtz5k66v9TsX4ZHJ5vxopXrXVhzZQUpWcle5eRr0hlxA/4qZCdCu7tBQ5hgNercW+3c8xj+8Y/zuF1X58pDYUF3k54O/II2gG8Dqeo/A55jNiCpze2OAuo27ogApJXra1b+faewFXX38yPcZcdAUmJbAX3uojPiByizCXOCi4wxWsVeiO7lp3pZm8f0ZyYUdSt4Zp0OC1vqmHm6T91y+5ksk6nQ1HLhk4+cITpVoLHyAFiOAJR65xrUvCXEZkm4vPDlcD+/++gTsKJ77gEkOU8XBObUsURriu7kcnYOLmxbgVkhgyFKQgHakg1e2tS8mJzSAA" }));
7
+ exports.Logo = Logo;
@@ -0,0 +1,330 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.injectFloatingButton = injectFloatingButton;
13
+ const jsx_runtime_1 = require("preact/jsx-runtime");
14
+ const preact_1 = require("preact");
15
+ const hooks_1 = require("preact/hooks");
16
+ const type_1 = require("./type");
17
+ const images_1 = require("./images");
18
+ let isInjected = false;
19
+ let i18n = {};
20
+ const logoStyle = {
21
+ width: '28px',
22
+ height: '28px',
23
+ };
24
+ const textStyle = {
25
+ color: 'rgba(0, 0, 0, 0.61)',
26
+ fontSize: '13px',
27
+ marginLeft: '8px',
28
+ };
29
+ const containerId = 'onekey-floating-widget';
30
+ const removeApp = () => {
31
+ var _a;
32
+ (_a = document.getElementById(containerId)) === null || _a === void 0 ? void 0 : _a.remove();
33
+ };
34
+ const useOutsideClick = (ref, callback) => {
35
+ (0, hooks_1.useEffect)(() => {
36
+ const handleClickOutside = (event) => {
37
+ if (ref.current &&
38
+ !ref.current.contains(event.target)) {
39
+ callback();
40
+ }
41
+ };
42
+ document.addEventListener('mousedown', handleClickOutside);
43
+ return () => {
44
+ document.removeEventListener('mousedown', handleClickOutside);
45
+ };
46
+ }, [callback, ref]);
47
+ };
48
+ function CloseDialog({ onClose }) {
49
+ const dialogRef = (0, hooks_1.useRef)(null);
50
+ useOutsideClick(dialogRef, onClose);
51
+ const handleDisable = (0, hooks_1.useCallback)(() => {
52
+ void globalThis.$onekey.$private.request({
53
+ method: 'wallet_disableFloatingButton',
54
+ });
55
+ removeApp();
56
+ }, []);
57
+ const handleHideOnSite = (0, hooks_1.useCallback)(() => {
58
+ void globalThis.$onekey.$private.request({
59
+ method: 'wallet_hideFloatingButtonOnSite',
60
+ params: { url: window.location.origin },
61
+ });
62
+ removeApp();
63
+ }, []);
64
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
65
+ background: 'rgba(255, 255, 255, 1)',
66
+ padding: '14px',
67
+ position: 'absolute',
68
+ right: '134px',
69
+ border: '1px rgba(0, 0, 0, 0.13) solid',
70
+ top: '60px',
71
+ width: '170px',
72
+ borderRadius: '15px',
73
+ }, ref: dialogRef, children: [(0, jsx_runtime_1.jsx)("div", { style: {
74
+ color: 'rgba(0, 0, 0, 1)',
75
+ fontSize: '12px',
76
+ fontWeight: '400',
77
+ cursor: 'pointer',
78
+ }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), (0, jsx_runtime_1.jsx)("div", { style: {
79
+ marginTop: '4px',
80
+ marginBottom: '8px',
81
+ color: 'rgba(0, 0, 0, 1)',
82
+ fontSize: '12px',
83
+ fontWeight: '400',
84
+ cursor: 'pointer',
85
+ }, onClick: handleDisable, children: i18n.disable }), (0, jsx_runtime_1.jsx)("div", { style: {
86
+ color: 'rgb(156, 156, 156)',
87
+ fontSize: '10px',
88
+ fontWeight: '400',
89
+ }, children: i18n.canBeReEnabledInSettings })] }));
90
+ }
91
+ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
92
+ const [showCloseButton, setIsShowCloseButton] = (0, hooks_1.useState)(false);
93
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
94
+ display: 'flex',
95
+ alignItems: 'center',
96
+ width: '184px',
97
+ position: 'relative',
98
+ cursor: 'pointer',
99
+ padding: '8px',
100
+ }, onMouseEnter: () => {
101
+ if (isExpanded || isShowCloseDialog) {
102
+ return;
103
+ }
104
+ setIsShowCloseButton(true);
105
+ }, onMouseLeave: () => setIsShowCloseButton(false), onClick: () => {
106
+ if (isShowCloseDialog) {
107
+ return;
108
+ }
109
+ setIsShowCloseButton(false);
110
+ onClick();
111
+ }, children: [(0, jsx_runtime_1.jsx)(images_1.Logo, { style: logoStyle }), !dataLoaded && ((0, jsx_runtime_1.jsx)("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })), (0, jsx_runtime_1.jsx)("div", { style: {
112
+ position: 'absolute',
113
+ left: '0px',
114
+ bottom: '-10px',
115
+ opacity: showCloseButton ? 1 : 0,
116
+ }, onClick: (event) => {
117
+ event.stopPropagation();
118
+ setIsShowCloseButton(false);
119
+ showCloseDialog();
120
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5ZM0.25 6.5C0.25 3.04822 3.04822 0.25 6.5 0.25C9.95178 0.25 12.75 3.04822 12.75 6.5C12.75 9.95178 9.95178 12.75 6.5 12.75C3.04822 12.75 0.25 9.95178 0.25 6.5ZM4.18306 4.18306C4.42714 3.93898 4.82286 3.93898 5.06694 4.18306L6.5 5.61612L7.93306 4.18306C8.17714 3.93898 8.57286 3.93898 8.81694 4.18306C9.06102 4.42714 9.06102 4.82286 8.81694 5.06694L7.38388 6.5L8.81694 7.93306C9.06102 8.17714 9.06102 8.57286 8.81694 8.81694C8.57286 9.06102 8.17714 9.06102 7.93306 8.81694L6.5 7.38388L5.06694 8.81694C4.82286 9.06102 4.42714 9.06102 4.18306 8.81694C3.93898 8.57286 3.93898 8.17714 4.18306 7.93306L5.61612 6.5L4.18306 5.06694C3.93898 4.82286 3.93898 4.42714 4.18306 4.18306Z", fill: "#C8C8C8" }) }) })] }));
121
+ }
122
+ function SecurityInfoRow({ title, children, }) {
123
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
124
+ display: 'flex',
125
+ height: '16px',
126
+ flexDirection: 'row',
127
+ justifyContent: 'space-between',
128
+ alignItems: 'center',
129
+ padding: '0 8px',
130
+ }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
131
+ color: 'rgba(0, 0, 0, 0.61)',
132
+ fontWeight: '500',
133
+ fontSize: '11.2px',
134
+ }, children: title }), children] }));
135
+ }
136
+ function SecurityRiskDetectionRow({ securityInfo, }) {
137
+ const { securityElement, securityStatus } = (0, hooks_1.useMemo)(() => {
138
+ const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
139
+ if (security) {
140
+ return {
141
+ securityStatus: type_1.EHostSecurityLevel.Security,
142
+ securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
143
+ color: 'rgba(0, 0, 0, 0.88)',
144
+ fontWeight: '500',
145
+ fontSize: '11.2px',
146
+ }, children: i18n.verifiedSite }), (0, jsx_runtime_1.jsx)("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.7827 2.03938C6.21439 1.54254 6.98582 1.54254 7.41751 2.03938L8.14191 2.87311C8.14557 2.87733 8.15115 2.87935 8.15666 2.87848L9.2475 2.70544C9.89755 2.60232 10.4885 3.09819 10.4998 3.75627L10.5188 4.86059C10.5189 4.86617 10.5219 4.8713 10.5267 4.87418L11.4735 5.4428C12.0378 5.78165 12.1718 6.54136 11.7574 7.05277L11.0622 7.91094C11.0586 7.91528 11.0576 7.92112 11.0594 7.9264L11.4193 8.97061C11.6337 9.59289 11.248 10.261 10.6019 10.3864L9.51762 10.5969C9.51214 10.5979 9.5076 10.6018 9.5056 10.607L9.11004 11.6382C8.87432 12.2527 8.14941 12.5166 7.57382 12.1973L6.60796 11.6616C6.60307 11.6589 6.59714 11.6589 6.59226 11.6616L5.62639 12.1973C5.05081 12.5166 4.3259 12.2527 4.09017 11.6382L3.69462 10.607C3.69262 10.6018 3.68807 10.5979 3.68259 10.5969L2.59836 10.3864C1.95224 10.261 1.56652 9.59289 1.78095 8.97061L2.14079 7.9264C2.14261 7.92112 2.14158 7.91528 2.13806 7.91094L1.44279 7.05277C1.02846 6.54137 1.16241 5.78165 1.72667 5.4428L2.67353 4.87418C2.67831 4.8713 2.68128 4.86617 2.68137 4.86059L2.70038 3.75628C2.71171 3.09819 3.30266 2.60232 3.95272 2.70544L5.04355 2.87848C5.04907 2.87935 5.05464 2.87733 5.0583 2.87311L5.7827 2.03938ZM8.31057 6.5772C8.51885 6.36893 8.51885 6.03124 8.31057 5.82296C8.10229 5.61468 7.76461 5.61468 7.55633 5.82296L6.06678 7.3125L5.6439 6.88962C5.43562 6.68134 5.09794 6.68134 4.88966 6.88962C4.68138 7.0979 4.68138 7.43559 4.88966 7.64387L5.5011 8.25531C5.81352 8.56773 6.32005 8.56773 6.63247 8.25531L8.31057 6.5772Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
147
+ };
148
+ }
149
+ const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === type_1.EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
150
+ if (highSecurity) {
151
+ return {
152
+ securityStatus: type_1.EHostSecurityLevel.High,
153
+ securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
154
+ color: 'rgba(0, 0, 0, 0.88)',
155
+ fontWeight: '500',
156
+ fontSize: '11.2px',
157
+ }, children: i18n.maliciousSiteWarning }), (0, jsx_runtime_1.jsx)("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.83981 2.21151C7.8045 0.557753 10.194 0.557748 11.1587 2.21151L17.007 12.2371C17.9792 13.9038 16.777 15.9968 14.8475 15.9968H3.15098C1.22151 15.9968 0.0193263 13.9038 0.991535 12.2371L6.83981 2.21151ZM9.00008 5.99683C9.46032 5.99683 9.83342 6.36992 9.83342 6.83016V9.33016C9.83342 9.7904 9.46032 10.1635 9.00008 10.1635C8.53984 10.1635 8.16675 9.7904 8.16675 9.33016V6.83016C8.16675 6.36992 8.53984 5.99683 9.00008 5.99683ZM7.95842 11.8302C7.95842 11.2549 8.42478 10.7885 9.00008 10.7885C9.57538 10.7885 10.0417 11.2549 10.0417 11.8302C10.0417 12.4055 9.57538 12.8718 9.00008 12.8718C8.42478 12.8718 7.95842 12.4055 7.95842 11.8302Z", fill: "#BB0007", fillOpacity: "0.836" }) })] })),
158
+ };
159
+ }
160
+ const mediumSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => type_1.EHostSecurityLevel.Medium == item.riskLevel).map((item) => item.name).join(' & ')) || '';
161
+ if (mediumSecurity) {
162
+ return {
163
+ securityStatus: type_1.EHostSecurityLevel.Medium,
164
+ securityElement: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { style: {
165
+ color: 'rgba(0, 0, 0, 0.88)',
166
+ fontWeight: '500',
167
+ fontSize: '11.2px',
168
+ }, children: i18n.suspectedMaliciousBehavior }), (0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.96786 0.159913C3.52858 0.159899 3.14962 0.159886 2.83748 0.185389C2.50802 0.212306 2.18034 0.271736 1.86503 0.432398C1.39462 0.672081 1.01217 1.05453 0.772486 1.52494C0.611824 1.84025 0.552394 2.16794 0.525477 2.49739C0.499974 2.80953 0.499986 3.18849 0.500001 3.62776V11.692C0.499986 12.1313 0.499974 12.5103 0.525477 12.8224C0.552394 13.1519 0.611824 13.4796 0.772486 13.7949C1.01217 14.2653 1.39462 14.6477 1.86503 14.8874C2.18034 15.0481 2.50802 15.1075 2.83748 15.1344C3.14962 15.1599 3.52858 15.1599 3.96786 15.1599H12.0321C12.4714 15.1599 12.8504 15.1599 13.1625 15.1344C13.492 15.1075 13.8197 15.0481 14.135 14.8874C14.6054 14.6477 14.9878 14.2653 15.2275 13.7949C15.3882 13.4796 15.4476 13.1519 15.4745 12.8224C15.5 12.5103 15.5 12.1313 15.5 11.6921V3.62778C15.5 3.18849 15.5 2.80953 15.4745 2.49739C15.4476 2.16794 15.3882 1.84025 15.2275 1.52494C14.9878 1.05453 14.6054 0.672081 14.135 0.432398C13.8197 0.271736 13.492 0.212306 13.1625 0.185389C12.8504 0.159886 12.4714 0.159899 12.0322 0.159913H3.96786ZM6.33333 6.82658C6.33333 6.36634 6.70643 5.99325 7.16667 5.99325H8C8.46024 5.99325 8.83333 6.36634 8.83333 6.82658V10.9932C8.83333 11.4535 8.46024 11.8266 8 11.8266C7.53976 11.8266 7.16667 11.4535 7.16667 10.9932V7.65991C6.70643 7.65991 6.33333 7.28682 6.33333 6.82658ZM8 3.49325C7.53976 3.49325 7.16667 3.86634 7.16667 4.32658C7.16667 4.78682 7.53976 5.15991 8 5.15991C8.46024 5.15991 8.83333 4.78682 8.83333 4.32658C8.83333 3.86634 8.46024 3.49325 8 3.49325Z", fill: "#5E4200", fillOpacity: "0.844" }) })] })),
169
+ };
170
+ }
171
+ return {
172
+ securityStatus: type_1.EHostSecurityLevel.Unknown,
173
+ securityElement: ((0, jsx_runtime_1.jsx)("span", { style: {
174
+ color: 'rgba(0, 0, 0, 0.88)',
175
+ fontWeight: '500',
176
+ fontSize: '11.2px',
177
+ }, children: i18n.unknown })),
178
+ };
179
+ }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
180
+ return ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.riskDetection, children: (0, jsx_runtime_1.jsx)("div", { style: {
181
+ display: 'flex',
182
+ alignItems: 'center',
183
+ gap: '3.2px',
184
+ }, children: securityElement }) }));
185
+ }
186
+ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
187
+ var _a, _b, _c, _d, _e, _f;
188
+ const viewRef = (0, hooks_1.useRef)(null);
189
+ useOutsideClick(viewRef, onClose);
190
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: viewRef, style: {
191
+ display: 'flex',
192
+ flexDirection: 'column',
193
+ width: '234px',
194
+ borderTopLeftRadius: '12px',
195
+ borderBottomLeftRadius: '12px',
196
+ paddingTop: '8px',
197
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
198
+ display: 'flex',
199
+ flexDirection: 'column',
200
+ gap: '8px',
201
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
202
+ padding: '0 8px',
203
+ display: 'flex',
204
+ alignItems: 'center',
205
+ flexDirection: 'row',
206
+ justifyContent: 'space-between',
207
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
208
+ display: 'flex',
209
+ flexDirection: 'row',
210
+ alignItems: 'center',
211
+ gap: '8px',
212
+ color: 'rgba(0, 0, 0, 0.88)',
213
+ fontSize: '13px',
214
+ fontWeight: '500',
215
+ }, children: [((_a = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _a === void 0 ? void 0 : _a.logo) ? ((0, jsx_runtime_1.jsx)("img", { src: (_b = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _b === void 0 ? void 0 : _b.logo, style: {
216
+ height: '24px',
217
+ width: '24px',
218
+ borderRadius: '4px',
219
+ } })) : ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "19", viewBox: "0 0 18 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
220
+ width: '24px',
221
+ height: '24px',
222
+ }, children: [(0, jsx_runtime_1.jsx)("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] })), ((_c = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _c === void 0 ? void 0 : _c.name) || (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.host)] }), (0, jsx_runtime_1.jsx)("div", { style: {
223
+ width: "24",
224
+ height: "24",
225
+ cursor: "pointer"
226
+ }, onClick: () => {
227
+ onClose();
228
+ setTimeout(() => {
229
+ showCloseDialog();
230
+ }, 200);
231
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "#BABABA" }) }) })] }), (0, jsx_runtime_1.jsx)("div", { style: {
232
+ background: 'rgba(0, 0, 0, 0.13)',
233
+ height: '0.33px',
234
+ width: '100%',
235
+ } }), ((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.dappListedBy, children: (0, jsx_runtime_1.jsx)("div", { style: {
236
+ display: 'flex',
237
+ alignItems: 'center',
238
+ gap: '2px',
239
+ }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => ((0, jsx_runtime_1.jsx)("img", { src: item.logo, style: {
240
+ width: '16px',
241
+ height: '16px',
242
+ } }))) }) })) : null, (0, jsx_runtime_1.jsx)(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? ((0, jsx_runtime_1.jsx)(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: (0, jsx_runtime_1.jsx)("span", { style: {
243
+ fontWeight: '500',
244
+ fontSize: '11.2px',
245
+ color: 'rgba(0, 0, 0, 0.88)',
246
+ }, children: securityInfo.updatedAt }) })) : null] }), (0, jsx_runtime_1.jsxs)("div", { style: {
247
+ marginTop: '8px',
248
+ textAlign: 'center',
249
+ padding: '8px 0',
250
+ background: 'rgba(249, 249, 249, 1)',
251
+ borderBottomLeftRadius: '12px',
252
+ display: "flex",
253
+ alignItems: "center",
254
+ justifyContent: "center",
255
+ }, children: [(0, jsx_runtime_1.jsx)("span", { style: {
256
+ color: 'rgba(0, 0, 0, 0.61)',
257
+ fontWeight: '400',
258
+ fontSize: '11.2px',
259
+ }, children: "Powered by" }), (0, jsx_runtime_1.jsx)(images_1.Logo, { style: {
260
+ width: '12.83px',
261
+ height: '12.83px',
262
+ marginLeft: '5.6px',
263
+ marginRight: '4.2px',
264
+ verticalAlign: 'middle',
265
+ } }), (0, jsx_runtime_1.jsx)("span", { style: {
266
+ color: 'rgba(0, 0, 0, 0.88)',
267
+ fontWeight: '600',
268
+ fontSize: '11.2px',
269
+ }, children: "OneKey" })] })] }));
270
+ }
271
+ function App() {
272
+ const [isExpanded, setIsExpanded] = (0, hooks_1.useState)(false);
273
+ const [showSecurityInfo, setIsShowSecurityInfo] = (0, hooks_1.useState)(false);
274
+ const [securityInfo, setSecurityInfo] = (0, hooks_1.useState)(null);
275
+ const [showCloseDialog, setIsShowCloseDialog] = (0, hooks_1.useState)(false);
276
+ const handleShowCloseDialog = (0, hooks_1.useCallback)(() => {
277
+ setIsShowCloseDialog(true);
278
+ }, []);
279
+ const handleClick = (0, hooks_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
280
+ setIsExpanded(!isExpanded);
281
+ setIsShowSecurityInfo(true);
282
+ if (!securityInfo) {
283
+ const result = yield window.$onekey.$private.request({
284
+ method: 'wallet_detectRiskLevel',
285
+ params: { url: window.location.origin },
286
+ });
287
+ setSecurityInfo(result.securityInfo);
288
+ }
289
+ }), [isExpanded, securityInfo]);
290
+ const borderStyle = (0, hooks_1.useMemo)(() => isExpanded
291
+ ? {
292
+ borderTopLeftRadius: '12px',
293
+ borderBottomLeftRadius: '12px',
294
+ borderTopRightRadius: '0px',
295
+ borderBottomRightRadius: '0px',
296
+ }
297
+ : {
298
+ boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
299
+ transition: 'transform 0.3s ease-in-out',
300
+ borderRadius: '100px',
301
+ }, [isExpanded]);
302
+ return ((0, jsx_runtime_1.jsxs)("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, top: '20%', right: '-146px', background: 'rgba(255, 255, 255, 1)', borderWidth: '0.33px', borderColor: 'rgba(0, 0, 0, 0.13)', borderStyle: 'solid', boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)', transition: 'transform 0.3s ease-in-out', transform: isExpanded ? 'translateX(-146px)' : 'translateX(0)' }, borderStyle), children: [showSecurityInfo && securityInfo ? ((0, jsx_runtime_1.jsx)(SecurityInfo, { securityInfo: securityInfo, showCloseDialog: handleShowCloseDialog, onClose: () => {
303
+ setIsExpanded(false);
304
+ setIsShowSecurityInfo(false);
305
+ } })) : ((0, jsx_runtime_1.jsx)(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && ((0, jsx_runtime_1.jsx)(CloseDialog, { onClose: () => {
306
+ setIsShowCloseDialog(false);
307
+ } }))] }));
308
+ }
309
+ function injectFloatingButton() {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ const { isShow, i18n: i18nResponse } = yield globalThis.$onekey.$private.request({
312
+ method: 'wallet_isShowFloatingButton',
313
+ params: { url: window.location.origin },
314
+ });
315
+ i18n = i18nResponse;
316
+ if (!isShow) {
317
+ return;
318
+ }
319
+ if (isInjected) {
320
+ return;
321
+ }
322
+ if (!document.body) {
323
+ return;
324
+ }
325
+ isInjected = true;
326
+ const div = document.createElement('div');
327
+ document.body.appendChild(div);
328
+ (0, preact_1.render)((0, jsx_runtime_1.jsx)(App, {}), document.body, div);
329
+ });
330
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EHostSecurityLevel = void 0;
4
+ var EHostSecurityLevel;
5
+ (function (EHostSecurityLevel) {
6
+ EHostSecurityLevel["High"] = "high";
7
+ EHostSecurityLevel["Medium"] = "medium";
8
+ EHostSecurityLevel["Security"] = "security";
9
+ EHostSecurityLevel["Unknown"] = "unknown";
10
+ })(EHostSecurityLevel || (exports.EHostSecurityLevel = EHostSecurityLevel = {}));
@@ -23,8 +23,9 @@ const onekey_btc_provider_1 = require("@onekeyfe/onekey-btc-provider");
23
23
  const onekey_algo_provider_1 = require("@onekeyfe/onekey-algo-provider");
24
24
  const connectButtonHack_1 = require("./connectButtonHack");
25
25
  const detectRiskWebsite_1 = require("./detectRiskWebsite");
26
+ const floatingButton_1 = require("./floatingButton");
26
27
  const consts_1 = require("./connectButtonHack/consts");
27
- function injectWeb3Provider() {
28
+ function injectWeb3Provider({ showFloatingButton = false } = {}) {
28
29
  var _a, _b;
29
30
  if (!((_a = window === null || window === void 0 ? void 0 : window.$onekey) === null || _a === void 0 ? void 0 : _a.jsBridge)) {
30
31
  throw new Error('OneKey jsBridge not found.');
@@ -215,6 +216,9 @@ function injectWeb3Provider() {
215
216
  }
216
217
  setTimeout(() => {
217
218
  void (0, detectRiskWebsite_1.detectWebsiteRiskLevel)();
219
+ if (showFloatingButton) {
220
+ void (0, floatingButton_1.injectFloatingButton)();
221
+ }
218
222
  void (0, connectButtonHack_1.hackAllConnectButtons)();
219
223
  void (0, detectRiskWebsite_1.listenPageFocus)();
220
224
  }, 1000);
@@ -0,0 +1,3 @@
1
+ export declare const Logo: ({ style }: {
2
+ style: any;
3
+ }) => import("preact").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "preact/jsx-runtime";
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ export const Logo = ({ style }) => (_jsx("img", { alt: "OneKey Logo", style: style, src: "data:image/webp;base64,UklGRswEAABXRUJQVlA4WAoAAAAQAAAALwAALwAAQUxQSCgDAAABoGTbtuq6OdLTNzPbxXCJoehehJlKbkKYmZMGMDPUmZmZOWaM3tN9axXuvVKaEBETEPXhvIhYdOw5Nz35xld//wf//f3Vm0/edO6xiyJi3jBmHsxFLD7poZ/9H39+6KRFEXODGZphLL/iN9WubbvUo/Spa8ed6m9XrohhM9Uo4oKtmtqut47FvmuTbj0/YjTFXMx7StuEIrnUVVKrT82LucooVnxqmwQBpCpI0dT6yYoYFZqY94kHEAEpioW6HPCTedFExGAYT3nAgiAguRRFBA/4VAwHEXNxgS1SFdQMC1O2XhBzMYwV20wCgswuCAImt66I4by4ylYyQRAsZ4CCgK1XxbxY8rsJEBAQLFMUkGLy9yURp5goSXkaC5ILyVMiHrGVXFGclrKiKLY+Ekt+tSuoACI1MxVAtPPXJSdor1QFhApSFdReT7jQTgRBM5lB0Ayw84LbbAXQkhkVQEsKtt72bEFUBMGaIiqCYPbsu04EECqIZQChAk589zuTIAioIDURBFQQk99ttS8IIgKiKIAIIgLau3UsqqCAgoIqqqCABXAMKAKCIGKdXBDEDGRKEcBZQAQkHwvmILnToyC5II632otK2VmkqoC9W783SVnyAgg1KarJH953UhIUVMGMgqAg4MQPXrQTpCiWcovkAoidL91rK3WhJAJTCWDrPVvsNBNrkltERDDr3LJZ+kI9M6NUFexx89q/nAiCYE2sgiC5E/9aE8/ZSq4gUKgDChZan4u4yAmAgBSnAgEpJy+K2LTVVJJcmElySW7dFKO421YARXEqBFAUsfXuGA3jkL32ggogoohQUMnt3XtIDKOJS+ykLCgIYKko2HpJNBGDmPeKYwXNchFLgiKOfWVeDCKiiYN+cawlZUYtOPaXg6KJvIljfrXrRRAEFEVEBfvOX4+JJspNHPGmdj0ouQgKoNB3+uYR0US9ieXX79fUJTAHsdinLun+65dHE9M2ESfev0tl0k1S6rM+TSbdBHXXfSdGNDH9YBhx1MUv77CK9R0vX3x0xHAQMw8HEYuOPOO6x1778redLbQ7f/vytceuPeOoRRGDYdQBVlA4IH4BAACQCACdASowADAAPpE2lkiloqIhMdZqALASCWkABRXm1xMlLv4/sMpVEDsQhAZmdBuj/t2DLLfSj9jeN2h/33kRqlO8uEYD82VJykmZgAD++u9Yi1iq75P1V2sgP+qtpKI6W2w+S89zFwU6NocVAgS4Ahpa8cwJdBVEzwmXPHuS+Bkf1jepfuaBisZjtz5k66v9TsX4ZHJ5vxopXrXVhzZQUpWcle5eRr0hlxA/4qZCdCu7tBQ5hgNercW+3c8xj+8Y/zuF1X58pDYUF3k54O/II2gG8Dqeo/A55jNiCpze2OAuo27ogApJXra1b+faewFXX38yPcZcdAUmJbAX3uojPiByizCXOCi4wxWsVeiO7lp3pZm8f0ZyYUdSt4Zp0OC1vqmHm6T91y+5ksk6nQ1HLhk4+cITpVoLHyAFiOAJR65xrUvCXEZkm4vPDlcD+/++gTsKJ77gEkOU8XBObUsURriu7kcnYOLmxbgVkhgyFKQgHakg1e2tS8mJzSAA" }));
@@ -0,0 +1 @@
1
+ export declare function injectFloatingButton(): Promise<void>;
@@ -0,0 +1,327 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
11
+ import { render } from 'preact';
12
+ import { useEffect, useMemo, useCallback, useRef, useState } from 'preact/hooks';
13
+ import { EHostSecurityLevel, } from './type';
14
+ import { Logo } from './images';
15
+ let isInjected = false;
16
+ let i18n = {};
17
+ const logoStyle = {
18
+ width: '28px',
19
+ height: '28px',
20
+ };
21
+ const textStyle = {
22
+ color: 'rgba(0, 0, 0, 0.61)',
23
+ fontSize: '13px',
24
+ marginLeft: '8px',
25
+ };
26
+ const containerId = 'onekey-floating-widget';
27
+ const removeApp = () => {
28
+ var _a;
29
+ (_a = document.getElementById(containerId)) === null || _a === void 0 ? void 0 : _a.remove();
30
+ };
31
+ const useOutsideClick = (ref, callback) => {
32
+ useEffect(() => {
33
+ const handleClickOutside = (event) => {
34
+ if (ref.current &&
35
+ !ref.current.contains(event.target)) {
36
+ callback();
37
+ }
38
+ };
39
+ document.addEventListener('mousedown', handleClickOutside);
40
+ return () => {
41
+ document.removeEventListener('mousedown', handleClickOutside);
42
+ };
43
+ }, [callback, ref]);
44
+ };
45
+ function CloseDialog({ onClose }) {
46
+ const dialogRef = useRef(null);
47
+ useOutsideClick(dialogRef, onClose);
48
+ const handleDisable = useCallback(() => {
49
+ void globalThis.$onekey.$private.request({
50
+ method: 'wallet_disableFloatingButton',
51
+ });
52
+ removeApp();
53
+ }, []);
54
+ const handleHideOnSite = useCallback(() => {
55
+ void globalThis.$onekey.$private.request({
56
+ method: 'wallet_hideFloatingButtonOnSite',
57
+ params: { url: window.location.origin },
58
+ });
59
+ removeApp();
60
+ }, []);
61
+ return (_jsxs("div", { style: {
62
+ background: 'rgba(255, 255, 255, 1)',
63
+ padding: '14px',
64
+ position: 'absolute',
65
+ right: '134px',
66
+ border: '1px rgba(0, 0, 0, 0.13) solid',
67
+ top: '60px',
68
+ width: '170px',
69
+ borderRadius: '15px',
70
+ }, ref: dialogRef, children: [_jsx("div", { style: {
71
+ color: 'rgba(0, 0, 0, 1)',
72
+ fontSize: '12px',
73
+ fontWeight: '400',
74
+ cursor: 'pointer',
75
+ }, onClick: handleHideOnSite, children: i18n.hideOnThisSite }), _jsx("div", { style: {
76
+ marginTop: '4px',
77
+ marginBottom: '8px',
78
+ color: 'rgba(0, 0, 0, 1)',
79
+ fontSize: '12px',
80
+ fontWeight: '400',
81
+ cursor: 'pointer',
82
+ }, onClick: handleDisable, children: i18n.disable }), _jsx("div", { style: {
83
+ color: 'rgb(156, 156, 156)',
84
+ fontSize: '10px',
85
+ fontWeight: '400',
86
+ }, children: i18n.canBeReEnabledInSettings })] }));
87
+ }
88
+ function IconButton({ isExpanded, onClick, dataLoaded, isShowCloseDialog, showCloseDialog, }) {
89
+ const [showCloseButton, setIsShowCloseButton] = useState(false);
90
+ return (_jsxs("div", { style: {
91
+ display: 'flex',
92
+ alignItems: 'center',
93
+ width: '184px',
94
+ position: 'relative',
95
+ cursor: 'pointer',
96
+ padding: '8px',
97
+ }, onMouseEnter: () => {
98
+ if (isExpanded || isShowCloseDialog) {
99
+ return;
100
+ }
101
+ setIsShowCloseButton(true);
102
+ }, onMouseLeave: () => setIsShowCloseButton(false), onClick: () => {
103
+ if (isShowCloseDialog) {
104
+ return;
105
+ }
106
+ setIsShowCloseButton(false);
107
+ onClick();
108
+ }, children: [_jsx(Logo, { style: logoStyle }), !dataLoaded && (_jsx("span", { style: textStyle, children: isExpanded ? i18n.fetchingDAppInfo : '' })), _jsx("div", { style: {
109
+ position: 'absolute',
110
+ left: '0px',
111
+ bottom: '-10px',
112
+ opacity: showCloseButton ? 1 : 0,
113
+ }, onClick: (event) => {
114
+ event.stopPropagation();
115
+ setIsShowCloseButton(false);
116
+ showCloseDialog();
117
+ }, children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5ZM0.25 6.5C0.25 3.04822 3.04822 0.25 6.5 0.25C9.95178 0.25 12.75 3.04822 12.75 6.5C12.75 9.95178 9.95178 12.75 6.5 12.75C3.04822 12.75 0.25 9.95178 0.25 6.5ZM4.18306 4.18306C4.42714 3.93898 4.82286 3.93898 5.06694 4.18306L6.5 5.61612L7.93306 4.18306C8.17714 3.93898 8.57286 3.93898 8.81694 4.18306C9.06102 4.42714 9.06102 4.82286 8.81694 5.06694L7.38388 6.5L8.81694 7.93306C9.06102 8.17714 9.06102 8.57286 8.81694 8.81694C8.57286 9.06102 8.17714 9.06102 7.93306 8.81694L6.5 7.38388L5.06694 8.81694C4.82286 9.06102 4.42714 9.06102 4.18306 8.81694C3.93898 8.57286 3.93898 8.17714 4.18306 7.93306L5.61612 6.5L4.18306 5.06694C3.93898 4.82286 3.93898 4.42714 4.18306 4.18306Z", fill: "#C8C8C8" }) }) })] }));
118
+ }
119
+ function SecurityInfoRow({ title, children, }) {
120
+ return (_jsxs("div", { style: {
121
+ display: 'flex',
122
+ height: '16px',
123
+ flexDirection: 'row',
124
+ justifyContent: 'space-between',
125
+ alignItems: 'center',
126
+ padding: '0 8px',
127
+ }, children: [_jsx("span", { style: {
128
+ color: 'rgba(0, 0, 0, 0.61)',
129
+ fontWeight: '500',
130
+ fontSize: '11.2px',
131
+ }, children: title }), children] }));
132
+ }
133
+ function SecurityRiskDetectionRow({ securityInfo, }) {
134
+ const { securityElement, securityStatus } = useMemo(() => {
135
+ const security = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.Security).map((item) => item.name).join(' & ')) || '';
136
+ if (security) {
137
+ return {
138
+ securityStatus: EHostSecurityLevel.Security,
139
+ securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
140
+ color: 'rgba(0, 0, 0, 0.88)',
141
+ fontWeight: '500',
142
+ fontSize: '11.2px',
143
+ }, children: i18n.verifiedSite }), _jsx("svg", { width: "13", height: "14", viewBox: "0 0 13 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.7827 2.03938C6.21439 1.54254 6.98582 1.54254 7.41751 2.03938L8.14191 2.87311C8.14557 2.87733 8.15115 2.87935 8.15666 2.87848L9.2475 2.70544C9.89755 2.60232 10.4885 3.09819 10.4998 3.75627L10.5188 4.86059C10.5189 4.86617 10.5219 4.8713 10.5267 4.87418L11.4735 5.4428C12.0378 5.78165 12.1718 6.54136 11.7574 7.05277L11.0622 7.91094C11.0586 7.91528 11.0576 7.92112 11.0594 7.9264L11.4193 8.97061C11.6337 9.59289 11.248 10.261 10.6019 10.3864L9.51762 10.5969C9.51214 10.5979 9.5076 10.6018 9.5056 10.607L9.11004 11.6382C8.87432 12.2527 8.14941 12.5166 7.57382 12.1973L6.60796 11.6616C6.60307 11.6589 6.59714 11.6589 6.59226 11.6616L5.62639 12.1973C5.05081 12.5166 4.3259 12.2527 4.09017 11.6382L3.69462 10.607C3.69262 10.6018 3.68807 10.5979 3.68259 10.5969L2.59836 10.3864C1.95224 10.261 1.56652 9.59289 1.78095 8.97061L2.14079 7.9264C2.14261 7.92112 2.14158 7.91528 2.13806 7.91094L1.44279 7.05277C1.02846 6.54137 1.16241 5.78165 1.72667 5.4428L2.67353 4.87418C2.67831 4.8713 2.68128 4.86617 2.68137 4.86059L2.70038 3.75628C2.71171 3.09819 3.30266 2.60232 3.95272 2.70544L5.04355 2.87848C5.04907 2.87935 5.05464 2.87733 5.0583 2.87311L5.7827 2.03938ZM8.31057 6.5772C8.51885 6.36893 8.51885 6.03124 8.31057 5.82296C8.10229 5.61468 7.76461 5.61468 7.55633 5.82296L6.06678 7.3125L5.6439 6.88962C5.43562 6.68134 5.09794 6.68134 4.88966 6.88962C4.68138 7.0979 4.68138 7.43559 4.88966 7.64387L5.5011 8.25531C5.81352 8.56773 6.32005 8.56773 6.63247 8.25531L8.31057 6.5772Z", fill: "#006B3B", fillOpacity: "0.906" }) })] })),
144
+ };
145
+ }
146
+ const highSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => item.riskLevel === EHostSecurityLevel.High).map((item) => item.name).join(' & ')) || '';
147
+ if (highSecurity) {
148
+ return {
149
+ securityStatus: EHostSecurityLevel.High,
150
+ securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
151
+ color: 'rgba(0, 0, 0, 0.88)',
152
+ fontWeight: '500',
153
+ fontSize: '11.2px',
154
+ }, children: i18n.maliciousSiteWarning }), _jsx("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.83981 2.21151C7.8045 0.557753 10.194 0.557748 11.1587 2.21151L17.007 12.2371C17.9792 13.9038 16.777 15.9968 14.8475 15.9968H3.15098C1.22151 15.9968 0.0193263 13.9038 0.991535 12.2371L6.83981 2.21151ZM9.00008 5.99683C9.46032 5.99683 9.83342 6.36992 9.83342 6.83016V9.33016C9.83342 9.7904 9.46032 10.1635 9.00008 10.1635C8.53984 10.1635 8.16675 9.7904 8.16675 9.33016V6.83016C8.16675 6.36992 8.53984 5.99683 9.00008 5.99683ZM7.95842 11.8302C7.95842 11.2549 8.42478 10.7885 9.00008 10.7885C9.57538 10.7885 10.0417 11.2549 10.0417 11.8302C10.0417 12.4055 9.57538 12.8718 9.00008 12.8718C8.42478 12.8718 7.95842 12.4055 7.95842 11.8302Z", fill: "#BB0007", fillOpacity: "0.836" }) })] })),
155
+ };
156
+ }
157
+ const mediumSecurity = (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources.filter((item) => EHostSecurityLevel.Medium == item.riskLevel).map((item) => item.name).join(' & ')) || '';
158
+ if (mediumSecurity) {
159
+ return {
160
+ securityStatus: EHostSecurityLevel.Medium,
161
+ securityElement: (_jsxs(_Fragment, { children: [_jsx("span", { style: {
162
+ color: 'rgba(0, 0, 0, 0.88)',
163
+ fontWeight: '500',
164
+ fontSize: '11.2px',
165
+ }, children: i18n.suspectedMaliciousBehavior }), _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.96786 0.159913C3.52858 0.159899 3.14962 0.159886 2.83748 0.185389C2.50802 0.212306 2.18034 0.271736 1.86503 0.432398C1.39462 0.672081 1.01217 1.05453 0.772486 1.52494C0.611824 1.84025 0.552394 2.16794 0.525477 2.49739C0.499974 2.80953 0.499986 3.18849 0.500001 3.62776V11.692C0.499986 12.1313 0.499974 12.5103 0.525477 12.8224C0.552394 13.1519 0.611824 13.4796 0.772486 13.7949C1.01217 14.2653 1.39462 14.6477 1.86503 14.8874C2.18034 15.0481 2.50802 15.1075 2.83748 15.1344C3.14962 15.1599 3.52858 15.1599 3.96786 15.1599H12.0321C12.4714 15.1599 12.8504 15.1599 13.1625 15.1344C13.492 15.1075 13.8197 15.0481 14.135 14.8874C14.6054 14.6477 14.9878 14.2653 15.2275 13.7949C15.3882 13.4796 15.4476 13.1519 15.4745 12.8224C15.5 12.5103 15.5 12.1313 15.5 11.6921V3.62778C15.5 3.18849 15.5 2.80953 15.4745 2.49739C15.4476 2.16794 15.3882 1.84025 15.2275 1.52494C14.9878 1.05453 14.6054 0.672081 14.135 0.432398C13.8197 0.271736 13.492 0.212306 13.1625 0.185389C12.8504 0.159886 12.4714 0.159899 12.0322 0.159913H3.96786ZM6.33333 6.82658C6.33333 6.36634 6.70643 5.99325 7.16667 5.99325H8C8.46024 5.99325 8.83333 6.36634 8.83333 6.82658V10.9932C8.83333 11.4535 8.46024 11.8266 8 11.8266C7.53976 11.8266 7.16667 11.4535 7.16667 10.9932V7.65991C6.70643 7.65991 6.33333 7.28682 6.33333 6.82658ZM8 3.49325C7.53976 3.49325 7.16667 3.86634 7.16667 4.32658C7.16667 4.78682 7.53976 5.15991 8 5.15991C8.46024 5.15991 8.83333 4.78682 8.83333 4.32658C8.83333 3.86634 8.46024 3.49325 8 3.49325Z", fill: "#5E4200", fillOpacity: "0.844" }) })] })),
166
+ };
167
+ }
168
+ return {
169
+ securityStatus: EHostSecurityLevel.Unknown,
170
+ securityElement: (_jsx("span", { style: {
171
+ color: 'rgba(0, 0, 0, 0.88)',
172
+ fontWeight: '500',
173
+ fontSize: '11.2px',
174
+ }, children: i18n.unknown })),
175
+ };
176
+ }, [securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.checkSources]);
177
+ return (_jsx(SecurityInfoRow, { title: i18n.riskDetection, children: _jsx("div", { style: {
178
+ display: 'flex',
179
+ alignItems: 'center',
180
+ gap: '3.2px',
181
+ }, children: securityElement }) }));
182
+ }
183
+ function SecurityInfo({ securityInfo, onClose, showCloseDialog, }) {
184
+ var _a, _b, _c, _d, _e, _f;
185
+ const viewRef = useRef(null);
186
+ useOutsideClick(viewRef, onClose);
187
+ return (_jsxs("div", { ref: viewRef, style: {
188
+ display: 'flex',
189
+ flexDirection: 'column',
190
+ width: '234px',
191
+ borderTopLeftRadius: '12px',
192
+ borderBottomLeftRadius: '12px',
193
+ paddingTop: '8px',
194
+ }, children: [_jsxs("div", { style: {
195
+ display: 'flex',
196
+ flexDirection: 'column',
197
+ gap: '8px',
198
+ }, children: [_jsxs("div", { style: {
199
+ padding: '0 8px',
200
+ display: 'flex',
201
+ alignItems: 'center',
202
+ flexDirection: 'row',
203
+ justifyContent: 'space-between',
204
+ }, children: [_jsxs("div", { style: {
205
+ display: 'flex',
206
+ flexDirection: 'row',
207
+ alignItems: 'center',
208
+ gap: '8px',
209
+ color: 'rgba(0, 0, 0, 0.88)',
210
+ fontSize: '13px',
211
+ fontWeight: '500',
212
+ }, children: [((_a = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _a === void 0 ? void 0 : _a.logo) ? (_jsx("img", { src: (_b = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _b === void 0 ? void 0 : _b.logo, style: {
213
+ height: '24px',
214
+ width: '24px',
215
+ borderRadius: '4px',
216
+ } })) : (_jsxs("svg", { width: "18", height: "19", viewBox: "0 0 18 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
217
+ width: '24px',
218
+ height: '24px',
219
+ }, children: [_jsx("path", { d: "M6.6234 6.17768C6.6234 4.79769 7.73338 3.66333 9.1234 3.66333C10.5134 3.66333 11.6234 4.79769 11.6234 6.17768C11.6234 7.30559 10.8798 7.89399 10.4435 8.19056C10.3054 8.28442 10.2138 8.36716 10.1499 8.45311C10.092 8.53086 10.0368 8.63774 10.0107 8.81185C9.92866 9.35801 9.41941 9.73426 8.87325 9.65224C8.3271 9.57021 7.95084 9.06096 8.03287 8.5148C8.19122 7.4605 8.81104 6.8819 9.31912 6.53656C9.47624 6.42975 9.54878 6.36136 9.58594 6.31084C9.60107 6.29027 9.60813 6.27529 9.61242 6.26261C9.61657 6.25036 9.6234 6.22488 9.6234 6.17768C9.6234 5.88426 9.39093 5.66333 9.1234 5.66333C8.85586 5.66333 8.6234 5.88426 8.6234 6.17768C8.6234 6.72996 8.17568 7.17768 7.6234 7.17768C7.07111 7.17768 6.6234 6.72996 6.6234 6.17768Z", fill: "#3C3C3C" }), _jsx("path", { d: "M7.74976 11.5C7.74976 12.1904 8.3094 12.75 8.99976 12.75C9.69011 12.75 10.2498 12.1904 10.2498 11.5C10.2498 10.8096 9.69011 10.25 8.99976 10.25C8.3094 10.25 7.74976 10.8096 7.74976 11.5Z", fill: "#3C3C3C" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.00195 2.00272e-05L15.0019 0C16.6588 -2.7418e-06 18.002 1.34314 18.002 3V13.0358C18.002 14.6926 16.6588 16.0357 15.002 16.0358L12.3757 16.0358L8.99393 18.8375L5.65157 16.0358H3.00195C1.3451 16.0358 0.00195312 14.6926 0.00195312 13.0358V3.00002C0.00195312 1.34317 1.34509 2.2769e-05 3.00195 2.00272e-05ZM15.002 2L3.00195 2.00002C2.44967 2.00002 2.00195 2.44774 2.00195 3.00002V13.0358C2.00195 13.5881 2.44967 14.0358 3.00195 14.0358H5.65157C6.12143 14.0358 6.57629 14.2012 6.93638 14.503L9.00143 16.2341L11.0997 14.4957C11.4585 14.1984 11.9098 14.0358 12.3757 14.0358L15.002 14.0358C15.5542 14.0358 16.002 13.588 16.002 13.0358V3C16.002 2.44772 15.5542 2 15.002 2Z", fill: "#3C3C3C" })] })), ((_c = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _c === void 0 ? void 0 : _c.name) || (securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.host)] }), _jsx("div", { style: {
220
+ width: "24",
221
+ height: "24",
222
+ cursor: "pointer"
223
+ }, onClick: () => {
224
+ onClose();
225
+ setTimeout(() => {
226
+ showCloseDialog();
227
+ }, 200);
228
+ }, children: _jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.29289 7.29289C7.68342 6.90237 8.31658 6.90237 8.70711 7.29289L12 10.5858L15.2929 7.29289C15.6834 6.90237 16.3166 6.90237 16.7071 7.29289C17.0976 7.68342 17.0976 8.31658 16.7071 8.70711L13.4142 12L16.7071 15.2929C17.0976 15.6834 17.0976 16.3166 16.7071 16.7071C16.3166 17.0976 15.6834 17.0976 15.2929 16.7071L12 13.4142L8.70711 16.7071C8.31658 17.0976 7.68342 17.0976 7.29289 16.7071C6.90237 16.3166 6.90237 15.6834 7.29289 15.2929L10.5858 12L7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289Z", fill: "#BABABA" }) }) })] }), _jsx("div", { style: {
229
+ background: 'rgba(0, 0, 0, 0.13)',
230
+ height: '0.33px',
231
+ width: '100%',
232
+ } }), ((_d = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _d === void 0 ? void 0 : _d.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.dappListedBy, children: _jsx("div", { style: {
233
+ display: 'flex',
234
+ alignItems: 'center',
235
+ gap: '2px',
236
+ }, children: (_e = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _e === void 0 ? void 0 : _e.origins.map((item) => (_jsx("img", { src: item.logo, style: {
237
+ width: '16px',
238
+ height: '16px',
239
+ } }))) }) })) : null, _jsx(SecurityRiskDetectionRow, { securityInfo: securityInfo }), ((_f = securityInfo === null || securityInfo === void 0 ? void 0 : securityInfo.dapp) === null || _f === void 0 ? void 0 : _f.origins.length) ? (_jsx(SecurityInfoRow, { title: i18n.lastVerifiedAt, children: _jsx("span", { style: {
240
+ fontWeight: '500',
241
+ fontSize: '11.2px',
242
+ color: 'rgba(0, 0, 0, 0.88)',
243
+ }, children: securityInfo.updatedAt }) })) : null] }), _jsxs("div", { style: {
244
+ marginTop: '8px',
245
+ textAlign: 'center',
246
+ padding: '8px 0',
247
+ background: 'rgba(249, 249, 249, 1)',
248
+ borderBottomLeftRadius: '12px',
249
+ display: "flex",
250
+ alignItems: "center",
251
+ justifyContent: "center",
252
+ }, children: [_jsx("span", { style: {
253
+ color: 'rgba(0, 0, 0, 0.61)',
254
+ fontWeight: '400',
255
+ fontSize: '11.2px',
256
+ }, children: "Powered by" }), _jsx(Logo, { style: {
257
+ width: '12.83px',
258
+ height: '12.83px',
259
+ marginLeft: '5.6px',
260
+ marginRight: '4.2px',
261
+ verticalAlign: 'middle',
262
+ } }), _jsx("span", { style: {
263
+ color: 'rgba(0, 0, 0, 0.88)',
264
+ fontWeight: '600',
265
+ fontSize: '11.2px',
266
+ }, children: "OneKey" })] })] }));
267
+ }
268
+ function App() {
269
+ const [isExpanded, setIsExpanded] = useState(false);
270
+ const [showSecurityInfo, setIsShowSecurityInfo] = useState(false);
271
+ const [securityInfo, setSecurityInfo] = useState(null);
272
+ const [showCloseDialog, setIsShowCloseDialog] = useState(false);
273
+ const handleShowCloseDialog = useCallback(() => {
274
+ setIsShowCloseDialog(true);
275
+ }, []);
276
+ const handleClick = useCallback(() => __awaiter(this, void 0, void 0, function* () {
277
+ setIsExpanded(!isExpanded);
278
+ setIsShowSecurityInfo(true);
279
+ if (!securityInfo) {
280
+ const result = yield window.$onekey.$private.request({
281
+ method: 'wallet_detectRiskLevel',
282
+ params: { url: window.location.origin },
283
+ });
284
+ setSecurityInfo(result.securityInfo);
285
+ }
286
+ }), [isExpanded, securityInfo]);
287
+ const borderStyle = useMemo(() => isExpanded
288
+ ? {
289
+ borderTopLeftRadius: '12px',
290
+ borderBottomLeftRadius: '12px',
291
+ borderTopRightRadius: '0px',
292
+ borderBottomRightRadius: '0px',
293
+ }
294
+ : {
295
+ boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)',
296
+ transition: 'transform 0.3s ease-in-out',
297
+ borderRadius: '100px',
298
+ }, [isExpanded]);
299
+ return (_jsxs("div", { id: containerId, style: Object.assign({ position: 'fixed', zIndex: 999999, top: '20%', right: '-146px', background: 'rgba(255, 255, 255, 1)', borderWidth: '0.33px', borderColor: 'rgba(0, 0, 0, 0.13)', borderStyle: 'solid', boxShadow: '0px 8.57px 17.14px 0px rgba(0, 0, 0, 0.09)', transition: 'transform 0.3s ease-in-out', transform: isExpanded ? 'translateX(-146px)' : 'translateX(0)' }, borderStyle), children: [showSecurityInfo && securityInfo ? (_jsx(SecurityInfo, { securityInfo: securityInfo, showCloseDialog: handleShowCloseDialog, onClose: () => {
300
+ setIsExpanded(false);
301
+ setIsShowSecurityInfo(false);
302
+ } })) : (_jsx(IconButton, { onClick: handleClick, isExpanded: isExpanded, isShowCloseDialog: showCloseDialog, showCloseDialog: handleShowCloseDialog, dataLoaded: !!securityInfo })), !isExpanded && showCloseDialog && (_jsx(CloseDialog, { onClose: () => {
303
+ setIsShowCloseDialog(false);
304
+ } }))] }));
305
+ }
306
+ export function injectFloatingButton() {
307
+ return __awaiter(this, void 0, void 0, function* () {
308
+ const { isShow, i18n: i18nResponse } = yield globalThis.$onekey.$private.request({
309
+ method: 'wallet_isShowFloatingButton',
310
+ params: { url: window.location.origin },
311
+ });
312
+ i18n = i18nResponse;
313
+ if (!isShow) {
314
+ return;
315
+ }
316
+ if (isInjected) {
317
+ return;
318
+ }
319
+ if (!document.body) {
320
+ return;
321
+ }
322
+ isInjected = true;
323
+ const div = document.createElement('div');
324
+ document.body.appendChild(div);
325
+ render(_jsx(App, {}), document.body, div);
326
+ });
327
+ }
@@ -0,0 +1,49 @@
1
+ export declare enum EHostSecurityLevel {
2
+ High = "high",
3
+ Medium = "medium",
4
+ Security = "security",
5
+ Unknown = "unknown"
6
+ }
7
+ export interface IAttackType {
8
+ name: string;
9
+ description: string;
10
+ }
11
+ export interface IHostSecurityCheckSources {
12
+ name: string;
13
+ riskLevel: EHostSecurityLevel;
14
+ }
15
+ export interface IHostSecurity {
16
+ host: string;
17
+ level: EHostSecurityLevel;
18
+ attackTypes: IAttackType[];
19
+ phishingSite: boolean;
20
+ checkSources: IHostSecurityCheckSources[];
21
+ alert: string;
22
+ detail?: {
23
+ title: string;
24
+ content: string;
25
+ };
26
+ projectName: string;
27
+ createdAt: string;
28
+ updatedAt?: string;
29
+ dapp?: {
30
+ name: string;
31
+ logo: string;
32
+ description: {
33
+ text: string;
34
+ };
35
+ tags: {
36
+ name: {
37
+ text: string;
38
+ lokaliseKey: string;
39
+ deleted: boolean;
40
+ };
41
+ tagId: string;
42
+ type: 'success' | 'info' | 'critical' | 'warning' | 'default' | undefined;
43
+ }[];
44
+ origins: {
45
+ name: string;
46
+ logo: string;
47
+ }[];
48
+ };
49
+ }
@@ -0,0 +1,7 @@
1
+ export var EHostSecurityLevel;
2
+ (function (EHostSecurityLevel) {
3
+ EHostSecurityLevel["High"] = "high";
4
+ EHostSecurityLevel["Medium"] = "medium";
5
+ EHostSecurityLevel["Security"] = "security";
6
+ EHostSecurityLevel["Unknown"] = "unknown";
7
+ })(EHostSecurityLevel || (EHostSecurityLevel = {}));
@@ -51,5 +51,7 @@ export type IWindowOneKeyHub = {
51
51
  };
52
52
  };
53
53
  };
54
- declare function injectWeb3Provider(): unknown;
54
+ declare function injectWeb3Provider({ showFloatingButton }?: {
55
+ showFloatingButton?: boolean;
56
+ }): unknown;
55
57
  export { injectWeb3Provider };
@@ -20,8 +20,9 @@ import { ProviderBtc, ProviderBtcWallet } from '@onekeyfe/onekey-btc-provider';
20
20
  import { ProviderAlgo } from '@onekeyfe/onekey-algo-provider';
21
21
  import { hackAllConnectButtons } from './connectButtonHack';
22
22
  import { detectWebsiteRiskLevel, listenPageFocus } from './detectRiskWebsite';
23
+ import { injectFloatingButton } from './floatingButton';
23
24
  import { WALLET_CONNECT_INFO } from './connectButtonHack/consts';
24
- function injectWeb3Provider() {
25
+ function injectWeb3Provider({ showFloatingButton = false } = {}) {
25
26
  var _a, _b;
26
27
  if (!((_a = window === null || window === void 0 ? void 0 : window.$onekey) === null || _a === void 0 ? void 0 : _a.jsBridge)) {
27
28
  throw new Error('OneKey jsBridge not found.');
@@ -212,6 +213,9 @@ function injectWeb3Provider() {
212
213
  }
213
214
  setTimeout(() => {
214
215
  void detectWebsiteRiskLevel();
216
+ if (showFloatingButton) {
217
+ void injectFloatingButton();
218
+ }
215
219
  void hackAllConnectButtons();
216
220
  void listenPageFocus();
217
221
  }, 1000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/inpage-providers-hub",
3
- "version": "2.1.22",
3
+ "version": "2.2.0",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -30,26 +30,27 @@
30
30
  "start": "tsc --watch"
31
31
  },
32
32
  "dependencies": {
33
- "@onekeyfe/cross-inpage-provider-core": "2.1.22",
34
- "@onekeyfe/cross-inpage-provider-types": "2.1.22",
35
- "@onekeyfe/onekey-algo-provider": "2.1.22",
36
- "@onekeyfe/onekey-alph-provider": "2.1.22",
37
- "@onekeyfe/onekey-aptos-provider": "2.1.22",
38
- "@onekeyfe/onekey-bfc-provider": "2.1.22",
39
- "@onekeyfe/onekey-btc-provider": "2.1.22",
40
- "@onekeyfe/onekey-cardano-provider": "2.1.22",
41
- "@onekeyfe/onekey-conflux-provider": "2.1.22",
42
- "@onekeyfe/onekey-cosmos-provider": "2.1.22",
43
- "@onekeyfe/onekey-eth-provider": "2.1.22",
44
- "@onekeyfe/onekey-nostr-provider": "2.1.22",
45
- "@onekeyfe/onekey-polkadot-provider": "2.1.22",
46
- "@onekeyfe/onekey-private-provider": "2.1.22",
47
- "@onekeyfe/onekey-scdo-provider": "2.1.22",
48
- "@onekeyfe/onekey-solana-provider": "2.1.22",
49
- "@onekeyfe/onekey-sui-provider": "2.1.22",
50
- "@onekeyfe/onekey-ton-provider": "2.1.22",
51
- "@onekeyfe/onekey-tron-provider": "2.1.22",
52
- "@onekeyfe/onekey-webln-provider": "2.1.22",
33
+ "@onekeyfe/cross-inpage-provider-core": "2.2.0",
34
+ "@onekeyfe/cross-inpage-provider-types": "2.2.0",
35
+ "@onekeyfe/onekey-algo-provider": "2.2.0",
36
+ "@onekeyfe/onekey-alph-provider": "2.2.0",
37
+ "@onekeyfe/onekey-aptos-provider": "2.2.0",
38
+ "@onekeyfe/onekey-bfc-provider": "2.2.0",
39
+ "@onekeyfe/onekey-btc-provider": "2.2.0",
40
+ "@onekeyfe/onekey-cardano-provider": "2.2.0",
41
+ "@onekeyfe/onekey-conflux-provider": "2.2.0",
42
+ "@onekeyfe/onekey-cosmos-provider": "2.2.0",
43
+ "@onekeyfe/onekey-eth-provider": "2.2.0",
44
+ "@onekeyfe/onekey-nostr-provider": "2.2.0",
45
+ "@onekeyfe/onekey-polkadot-provider": "2.2.0",
46
+ "@onekeyfe/onekey-private-provider": "2.2.0",
47
+ "@onekeyfe/onekey-scdo-provider": "2.2.0",
48
+ "@onekeyfe/onekey-solana-provider": "2.2.0",
49
+ "@onekeyfe/onekey-sui-provider": "2.2.0",
50
+ "@onekeyfe/onekey-ton-provider": "2.2.0",
51
+ "@onekeyfe/onekey-tron-provider": "2.2.0",
52
+ "@onekeyfe/onekey-webln-provider": "2.2.0",
53
+ "preact": "^10.25.1",
53
54
  "web3": "^1.7.3"
54
55
  },
55
56
  "devDependencies": {
@@ -57,5 +58,5 @@
57
58
  "@types/node": "^20.12.7",
58
59
  "playwright": "^1.43.1"
59
60
  },
60
- "gitHead": "b3d85c2d0ce4425abbedc33119e0b7dafe8d3872"
61
+ "gitHead": "13b468b24dc8c075cd088d152c11a4b6c7c20dd2"
61
62
  }