@onekeyfe/inpage-providers-hub 2.1.21 → 2.1.22
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/dist/cjs/connectButtonHack/universal/config.js +294 -81
- package/dist/cjs/connectButtonHack/universal/findIconAndName.js +6 -6
- package/dist/cjs/connectButtonHack/universal/imgUtils.js +6 -6
- package/dist/cjs/connectButtonHack/universal/index.js +9 -3
- package/dist/connectButtonHack/universal/config.d.ts +1 -1
- package/dist/connectButtonHack/universal/config.js +295 -82
- package/dist/connectButtonHack/universal/findIconAndName.d.ts +1 -1
- package/dist/connectButtonHack/universal/findIconAndName.js +6 -6
- package/dist/connectButtonHack/universal/imgUtils.js +6 -6
- package/dist/connectButtonHack/universal/index.js +9 -3
- package/dist/connectButtonHack/universal/type.d.ts +1 -1
- package/package.json +22 -22
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
11
11
|
import { WALLET_CONNECT_INFO, WALLET_NAMES } from '../consts';
|
|
12
12
|
import { findIconAndNameByName, findIconAndNameByIcon } from './findIconAndName';
|
|
13
|
-
import { isWalletIconLessEqualThan, replaceIcon
|
|
13
|
+
import { isWalletIconLessEqualThan, replaceIcon } from './imgUtils';
|
|
14
14
|
import { findIconAndNameInShadowRoot } from './shadowRoot';
|
|
15
15
|
import { getConnectWalletModalByTitle, getMaxWithOfText, getWalletListByBtn, isClickable, isVisible, } from './utils';
|
|
16
16
|
import { findWalletTextByParent, makeTextAlignCenter, makeTextAlignLeft, makeTextEllipse, makeTextWordBreak, makeTextWrap, replaceText, } from './textUtils';
|
|
@@ -82,7 +82,7 @@ const metamaskForRainbowKit = Object.assign(Object.assign({}, basicWalletInfo['m
|
|
|
82
82
|
}
|
|
83
83
|
return document.querySelector('button[data-testid="rk-wallet-option-metaMask"]');
|
|
84
84
|
}, afterUpdate(textNode) {
|
|
85
|
-
if (textNode.parentElement) {
|
|
85
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
86
86
|
textNode.parentElement.style.whiteSpace = 'normal';
|
|
87
87
|
}
|
|
88
88
|
} });
|
|
@@ -92,7 +92,14 @@ const walletConnectForRainbowKit = Object.assign(Object.assign({}, basicWalletIn
|
|
|
92
92
|
}
|
|
93
93
|
return document.querySelector('button[data-testid="rk-wallet-option-walletConnect"]');
|
|
94
94
|
}, afterUpdate(textNode) {
|
|
95
|
-
if (textNode.parentElement) {
|
|
95
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
96
|
+
textNode.parentElement.style.whiteSpace = 'normal';
|
|
97
|
+
}
|
|
98
|
+
} });
|
|
99
|
+
const petraForRainbowKit = Object.assign(Object.assign({}, basicWalletInfo[WALLET_NAMES.petra]), { container: () => {
|
|
100
|
+
return document.querySelector('button[data-testid="rk-wallet-option-petra"]');
|
|
101
|
+
}, afterUpdate(textNode) {
|
|
102
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
96
103
|
textNode.parentElement.style.whiteSpace = 'normal';
|
|
97
104
|
}
|
|
98
105
|
} });
|
|
@@ -102,7 +109,7 @@ export const sitesConfig = [
|
|
|
102
109
|
testPath: [':text("I accept the")', ':text("Continue")', ':text("Connect Wallet")'],
|
|
103
110
|
walletsForProvider: {
|
|
104
111
|
[IInjectedProviderNames.sui]: [
|
|
105
|
-
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'] .rc-dialog-body
|
|
112
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'] .rc-dialog-body" }),
|
|
106
113
|
],
|
|
107
114
|
},
|
|
108
115
|
},
|
|
@@ -139,7 +146,8 @@ export const sitesConfig = [
|
|
|
139
146
|
const button = modal === null || modal === void 0 ? void 0 : modal.querySelector('[data-testid="connect-wallet"]');
|
|
140
147
|
return button ? button.parentElement : null;
|
|
141
148
|
}, afterUpdate: (text, img) => {
|
|
142
|
-
img
|
|
149
|
+
if (img)
|
|
150
|
+
img.style.marginRight = '12px';
|
|
143
151
|
} }),
|
|
144
152
|
],
|
|
145
153
|
},
|
|
@@ -172,7 +180,8 @@ export const sitesConfig = [
|
|
|
172
180
|
[IInjectedProviderNames.ethereum]: [
|
|
173
181
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getWalletListByBtn("div[role='dialog'] .v-card .c-list"), skip: { mobile: true } }),
|
|
174
182
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: () => getWalletListByBtn("div[role='dialog'] .v-card .c-list"), afterUpdate(textNode, img) {
|
|
175
|
-
img
|
|
183
|
+
if (img)
|
|
184
|
+
img.style.height = 'auto';
|
|
176
185
|
} }),
|
|
177
186
|
],
|
|
178
187
|
},
|
|
@@ -183,10 +192,10 @@ export const sitesConfig = [
|
|
|
183
192
|
walletsForProvider: {
|
|
184
193
|
[IInjectedProviderNames.ethereum]: [
|
|
185
194
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '#metamask', afterUpdate(textNode, img) {
|
|
186
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
195
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
187
196
|
} }),
|
|
188
197
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: '#wallet-connect', afterUpdate(textNode, img) {
|
|
189
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
198
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
190
199
|
} }),
|
|
191
200
|
],
|
|
192
201
|
},
|
|
@@ -352,7 +361,7 @@ export const sitesConfig = [
|
|
|
352
361
|
e.innerText.includes('BTC wallets'));
|
|
353
362
|
});
|
|
354
363
|
}, afterUpdate(textNode, img) {
|
|
355
|
-
textNode.parentElement && makeTextEllipse(textNode.parentElement);
|
|
364
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextEllipse(textNode.parentElement);
|
|
356
365
|
} }),
|
|
357
366
|
],
|
|
358
367
|
},
|
|
@@ -402,19 +411,23 @@ export const sitesConfig = [
|
|
|
402
411
|
],
|
|
403
412
|
},
|
|
404
413
|
},
|
|
405
|
-
{
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
},
|
|
414
|
+
// {
|
|
415
|
+
// urls: ['app.thala.fi'],
|
|
416
|
+
// testPath: [':text("I agree")', ':text("Connect")'],
|
|
417
|
+
// walletsForProvider: {
|
|
418
|
+
// [IInjectedProviderNames.aptos]: [
|
|
419
|
+
// {
|
|
420
|
+
// ...basicWalletInfo['petra'],
|
|
421
|
+
// container: () => {
|
|
422
|
+
// return getConnectWalletModalByTitle('div.chakra-modal__body', 'Welcome to Thala');
|
|
423
|
+
// },
|
|
424
|
+
// afterUpdate(textNode, img) {
|
|
425
|
+
// textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
426
|
+
// },
|
|
427
|
+
// },
|
|
428
|
+
// ],
|
|
429
|
+
// },
|
|
430
|
+
// },
|
|
418
431
|
{
|
|
419
432
|
urls: ['app.kinza.finance'],
|
|
420
433
|
testPath: {
|
|
@@ -636,7 +649,7 @@ export const sitesConfig = [
|
|
|
636
649
|
walletsForProvider: {
|
|
637
650
|
[IInjectedProviderNames.ethereum]: [
|
|
638
651
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('div[style*="opacity: 1"]', 'Connect your wallet'), afterUpdate(textNode, img) {
|
|
639
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'center');
|
|
652
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'center');
|
|
640
653
|
} }),
|
|
641
654
|
],
|
|
642
655
|
},
|
|
@@ -1013,10 +1026,10 @@ export const sitesConfig = [
|
|
|
1013
1026
|
walletsForProvider: {
|
|
1014
1027
|
[IInjectedProviderNames.ethereum]: [
|
|
1015
1028
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'button#wallet-connect-metamask', afterUpdate(textNode, updatedName) {
|
|
1016
|
-
textNode.parentElement && makeTextEllipse(textNode.parentElement);
|
|
1029
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextEllipse(textNode.parentElement);
|
|
1017
1030
|
} }),
|
|
1018
1031
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: 'button#wallet-connect-walletconnect', afterUpdate(textNode, updatedName) {
|
|
1019
|
-
textNode.parentElement && makeTextEllipse(textNode.parentElement);
|
|
1032
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextEllipse(textNode.parentElement);
|
|
1020
1033
|
} }),
|
|
1021
1034
|
],
|
|
1022
1035
|
},
|
|
@@ -1057,7 +1070,7 @@ export const sitesConfig = [
|
|
|
1057
1070
|
[IInjectedProviderNames.ethereum]: [
|
|
1058
1071
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '#wallet-dropdown-scroll-wrapper' }),
|
|
1059
1072
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: '#wallet-dropdown-scroll-wrapper', afterUpdate(textNode, img) {
|
|
1060
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
1073
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
1061
1074
|
} }),
|
|
1062
1075
|
],
|
|
1063
1076
|
},
|
|
@@ -1163,7 +1176,7 @@ export const sitesConfig = [
|
|
|
1163
1176
|
[IInjectedProviderNames.solana]: [
|
|
1164
1177
|
Object.assign(Object.assign({}, basicWalletInfo['phantom']), { container: '#connect_modal', afterUpdate(text) {
|
|
1165
1178
|
var _a;
|
|
1166
|
-
if ((_a = text.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
1179
|
+
if ((_a = text === null || text === void 0 ? void 0 : text.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
1167
1180
|
text.parentElement.parentElement.style.whiteSpace = 'noWrap';
|
|
1168
1181
|
makeTextEllipse(text.parentElement, { maxWidth: 'min(18vw,107px)' });
|
|
1169
1182
|
}
|
|
@@ -1220,11 +1233,7 @@ export const sitesConfig = [
|
|
|
1220
1233
|
walletsForProvider: {
|
|
1221
1234
|
[IInjectedProviderNames.aptos]: [
|
|
1222
1235
|
Object.assign(Object.assign({}, basicWalletInfo['martian']), { container: 'div.ant-modal.wallet-modal' }),
|
|
1223
|
-
|
|
1224
|
-
// {
|
|
1225
|
-
// ...basicWalletInfo['petra'],
|
|
1226
|
-
// container: 'div.ant-modal.wallet-modal',
|
|
1227
|
-
// },
|
|
1236
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.ant-modal.wallet-modal' }),
|
|
1228
1237
|
],
|
|
1229
1238
|
[IInjectedProviderNames.sui]: [
|
|
1230
1239
|
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { name: /^Sui Wallet$/i, container: 'div.ant-modal.wallet-modal' }),
|
|
@@ -1237,8 +1246,10 @@ export const sitesConfig = [
|
|
|
1237
1246
|
walletsForProvider: {
|
|
1238
1247
|
[IInjectedProviderNames.ethereum]: [
|
|
1239
1248
|
Object.assign(Object.assign({ container: '.connect-wallet-modal' }, basicWalletInfo['walletconnect']), { afterUpdate(textNode, img) {
|
|
1240
|
-
img
|
|
1241
|
-
|
|
1249
|
+
if (img) {
|
|
1250
|
+
img.style.height = '40px';
|
|
1251
|
+
img.style.width = '40px';
|
|
1252
|
+
}
|
|
1242
1253
|
} }),
|
|
1243
1254
|
],
|
|
1244
1255
|
},
|
|
@@ -1351,8 +1362,10 @@ export const sitesConfig = [
|
|
|
1351
1362
|
walletsForProvider: {
|
|
1352
1363
|
[IInjectedProviderNames.ethereum]: [
|
|
1353
1364
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('div.ant-modal-content', 'Select a Wallet'), afterUpdate(textNode, icon) {
|
|
1354
|
-
icon
|
|
1355
|
-
|
|
1365
|
+
if (icon) {
|
|
1366
|
+
icon.style.height = '28px';
|
|
1367
|
+
icon.style.width = 'auto';
|
|
1368
|
+
}
|
|
1356
1369
|
} }),
|
|
1357
1370
|
],
|
|
1358
1371
|
},
|
|
@@ -1403,7 +1416,7 @@ export const sitesConfig = [
|
|
|
1403
1416
|
findIconAndNameByIcon('img[src*="icon-metamask"]', 'auto-search-text', name, modal));
|
|
1404
1417
|
},
|
|
1405
1418
|
afterUpdate(textNode) {
|
|
1406
|
-
textNode.parentElement && makeTextWordBreak(textNode.parentElement);
|
|
1419
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextWordBreak(textNode.parentElement);
|
|
1407
1420
|
} }),
|
|
1408
1421
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { findIconAndName({ name }) {
|
|
1409
1422
|
const modal = getConnectWalletModalByTitle('div.dialog-container', 'Available Wallets');
|
|
@@ -1411,7 +1424,7 @@ export const sitesConfig = [
|
|
|
1411
1424
|
findIconAndNameByIcon('img[src*="icon-wallet-connect"]', 'auto-search-text', name, modal));
|
|
1412
1425
|
},
|
|
1413
1426
|
afterUpdate(textNode) {
|
|
1414
|
-
textNode.parentElement && makeTextWordBreak(textNode.parentElement);
|
|
1427
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextWordBreak(textNode.parentElement);
|
|
1415
1428
|
} }),
|
|
1416
1429
|
],
|
|
1417
1430
|
},
|
|
@@ -1521,12 +1534,14 @@ export const sitesConfig = [
|
|
|
1521
1534
|
walletsForProvider: {
|
|
1522
1535
|
[IInjectedProviderNames.ethereum]: [
|
|
1523
1536
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div.SelectWalletModal', afterUpdate(textNode, icon) {
|
|
1524
|
-
if (textNode.parentElement) {
|
|
1537
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1525
1538
|
makeTextEllipse(textNode.parentElement, { width: '100%' });
|
|
1526
1539
|
textNode.parentElement.style.flexShrink = '0';
|
|
1527
1540
|
// textNode.parentElement.style.width = '100%';
|
|
1528
1541
|
}
|
|
1529
|
-
icon
|
|
1542
|
+
if (icon) {
|
|
1543
|
+
icon.style.height = 'auto';
|
|
1544
|
+
}
|
|
1530
1545
|
} }),
|
|
1531
1546
|
],
|
|
1532
1547
|
},
|
|
@@ -1544,7 +1559,9 @@ export const sitesConfig = [
|
|
|
1544
1559
|
findIconAndNameByIcon('img[src*="metamask.svg"][alt="Metamask"]', 'auto-search-text', name, modal));
|
|
1545
1560
|
},
|
|
1546
1561
|
afterUpdate(textNode, icon) {
|
|
1547
|
-
icon
|
|
1562
|
+
if (icon) {
|
|
1563
|
+
icon.style.marginRight = '12px';
|
|
1564
|
+
}
|
|
1548
1565
|
} }),
|
|
1549
1566
|
],
|
|
1550
1567
|
[IInjectedProviderNames.cosmos]: [
|
|
@@ -1557,7 +1574,9 @@ export const sitesConfig = [
|
|
|
1557
1574
|
findIconAndNameByIcon('img[src*="keplr.svg"][alt="Keplr"]', 'auto-search-text', name, modal));
|
|
1558
1575
|
},
|
|
1559
1576
|
afterUpdate(textNode, icon) {
|
|
1560
|
-
icon
|
|
1577
|
+
if (icon) {
|
|
1578
|
+
icon.style.marginRight = '12px';
|
|
1579
|
+
}
|
|
1561
1580
|
} }),
|
|
1562
1581
|
],
|
|
1563
1582
|
},
|
|
@@ -1760,18 +1779,22 @@ export const sitesConfig = [
|
|
|
1760
1779
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
1761
1780
|
return findIconAndNameInShadowRoot('onboard-v2', container, name);
|
|
1762
1781
|
}, afterUpdate(textNode, img) {
|
|
1763
|
-
img
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1782
|
+
if (img) {
|
|
1783
|
+
img.style.width = '32px';
|
|
1784
|
+
img.style.height = '32px';
|
|
1785
|
+
img.style.maxWidth = '32px';
|
|
1786
|
+
img.style.maxHeight = '32px';
|
|
1787
|
+
}
|
|
1767
1788
|
} }),
|
|
1768
1789
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
1769
1790
|
return findIconAndNameInShadowRoot('onboard-v2', container, name);
|
|
1770
1791
|
}, afterUpdate(textNode, img) {
|
|
1771
|
-
img
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1792
|
+
if (img) {
|
|
1793
|
+
img.style.width = '32px';
|
|
1794
|
+
img.style.height = '32px';
|
|
1795
|
+
img.style.maxWidth = '32px';
|
|
1796
|
+
img.style.maxHeight = '32px';
|
|
1797
|
+
}
|
|
1775
1798
|
} }),
|
|
1776
1799
|
],
|
|
1777
1800
|
},
|
|
@@ -1797,7 +1820,7 @@ export const sitesConfig = [
|
|
|
1797
1820
|
: null;
|
|
1798
1821
|
},
|
|
1799
1822
|
afterUpdate(textNode, img) {
|
|
1800
|
-
if (textNode.parentElement) {
|
|
1823
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1801
1824
|
textNode.parentElement.style.overflow = 'visible';
|
|
1802
1825
|
}
|
|
1803
1826
|
} }),
|
|
@@ -1817,7 +1840,7 @@ export const sitesConfig = [
|
|
|
1817
1840
|
: null;
|
|
1818
1841
|
},
|
|
1819
1842
|
afterUpdate(textNode, img) {
|
|
1820
|
-
if (textNode.parentElement) {
|
|
1843
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1821
1844
|
textNode.parentElement.style.overflow = 'visible';
|
|
1822
1845
|
}
|
|
1823
1846
|
} }),
|
|
@@ -1855,8 +1878,10 @@ export const sitesConfig = [
|
|
|
1855
1878
|
findIconAndNameByIcon('img[src*="metamask-icon"][alt="Icon"]', 'auto-search-text', name, modal));
|
|
1856
1879
|
},
|
|
1857
1880
|
afterUpdate(textNode, iconNode) {
|
|
1858
|
-
iconNode
|
|
1859
|
-
|
|
1881
|
+
if (iconNode) {
|
|
1882
|
+
iconNode.style.aspectRatio = '1';
|
|
1883
|
+
iconNode.style.minWidth = '32px';
|
|
1884
|
+
}
|
|
1860
1885
|
} }),
|
|
1861
1886
|
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { findIconAndName({ name }) {
|
|
1862
1887
|
const modal = getConnectWalletModalByTitle('section.chakra-modal__content[role="dialog"]', 'Connect to a wallet');
|
|
@@ -1864,13 +1889,15 @@ export const sitesConfig = [
|
|
|
1864
1889
|
findIconAndNameByIcon('img[src*="wallet-connect-icon"][alt="Icon"]', 'auto-search-text', name, modal));
|
|
1865
1890
|
},
|
|
1866
1891
|
afterUpdate(textNode, iconNode) {
|
|
1867
|
-
iconNode
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1892
|
+
if (iconNode && textNode) {
|
|
1893
|
+
iconNode.style.aspectRatio = '1';
|
|
1894
|
+
iconNode.style.minWidth = '32px';
|
|
1895
|
+
const { defaultVal } = getMaxWithOfText(textNode, iconNode);
|
|
1896
|
+
textNode.parentElement &&
|
|
1897
|
+
makeTextEllipse(textNode.parentElement, {
|
|
1898
|
+
maxWidth: defaultVal,
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1874
1901
|
} }),
|
|
1875
1902
|
],
|
|
1876
1903
|
},
|
|
@@ -1907,14 +1934,6 @@ export const sitesConfig = [
|
|
|
1907
1934
|
[IInjectedProviderNames.ethereum]: [metamaskForRainbowKit, walletConnectForRainbowKit],
|
|
1908
1935
|
},
|
|
1909
1936
|
},
|
|
1910
|
-
{
|
|
1911
|
-
urls: ['app.cellana.finance'],
|
|
1912
|
-
walletsForProvider: {
|
|
1913
|
-
[IInjectedProviderNames.aptos]: [
|
|
1914
|
-
Object.assign(Object.assign({}, basicWalletInfo['petra']), { name: /^Petra Wallet$/, container: () => getConnectWalletModalByTitle('div.ant-modal[role="dialog"]', 'Connect a wallet') }),
|
|
1915
|
-
],
|
|
1916
|
-
},
|
|
1917
|
-
},
|
|
1918
1937
|
{
|
|
1919
1938
|
urls: ['www.vaultka.com'],
|
|
1920
1939
|
testPath: {
|
|
@@ -2005,12 +2024,12 @@ export const sitesConfig = [
|
|
|
2005
2024
|
walletsForProvider: {
|
|
2006
2025
|
[IInjectedProviderNames.ethereum]: [
|
|
2007
2026
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('div[role="dialog"]', 'Connect wallet to continue'), afterUpdate(textNode) {
|
|
2008
|
-
textNode.parentElement && makeTextAlignCenter(textNode.parentElement);
|
|
2027
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextAlignCenter(textNode.parentElement);
|
|
2009
2028
|
} }),
|
|
2010
2029
|
],
|
|
2011
2030
|
[IInjectedProviderNames.solana]: [
|
|
2012
2031
|
Object.assign(Object.assign({}, basicWalletInfo['phantom']), { container: () => getConnectWalletModalByTitle('div[role="dialog"]', 'Connect wallet to continue'), afterUpdate(textNode) {
|
|
2013
|
-
textNode.parentElement && makeTextAlignCenter(textNode.parentElement);
|
|
2032
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextAlignCenter(textNode.parentElement);
|
|
2014
2033
|
} }),
|
|
2015
2034
|
],
|
|
2016
2035
|
},
|
|
@@ -2129,7 +2148,7 @@ export const sitesConfig = [
|
|
|
2129
2148
|
}));
|
|
2130
2149
|
},
|
|
2131
2150
|
afterUpdate(textNode) {
|
|
2132
|
-
textNode.parentElement && makeTextAlignLeft(textNode.parentElement);
|
|
2151
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextAlignLeft(textNode.parentElement);
|
|
2133
2152
|
} }),
|
|
2134
2153
|
],
|
|
2135
2154
|
},
|
|
@@ -2177,7 +2196,7 @@ export const sitesConfig = [
|
|
|
2177
2196
|
walletsForProvider: {
|
|
2178
2197
|
[IInjectedProviderNames.ethereum]: [
|
|
2179
2198
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('#headlessui-portal-root div.relative[id*="headlessui-dialog"]', 'Connect your wallet'), afterUpdate(textNode) {
|
|
2180
|
-
textNode.parentElement && makeTextWrap(textNode.parentElement);
|
|
2199
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextWrap(textNode.parentElement);
|
|
2181
2200
|
} }),
|
|
2182
2201
|
],
|
|
2183
2202
|
},
|
|
@@ -2281,14 +2300,6 @@ export const sitesConfig = [
|
|
|
2281
2300
|
],
|
|
2282
2301
|
},
|
|
2283
2302
|
},
|
|
2284
|
-
{
|
|
2285
|
-
urls: ['app.aptin.io'],
|
|
2286
|
-
walletsForProvider: {
|
|
2287
|
-
[IInjectedProviderNames.aptos]: [
|
|
2288
|
-
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: () => getConnectWalletModalByTitle('div.MuiPaper-root.aptin-dialog', 'Connect a wallet') }),
|
|
2289
|
-
],
|
|
2290
|
-
},
|
|
2291
|
-
},
|
|
2292
2303
|
{
|
|
2293
2304
|
urls: ['juicebox.money'],
|
|
2294
2305
|
testPath: {
|
|
@@ -2539,7 +2550,7 @@ export const sitesConfig = [
|
|
|
2539
2550
|
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
2540
2551
|
return findIconAndNameInShadowRoot('onboard-v2', container, name);
|
|
2541
2552
|
}, afterUpdate(textNode) {
|
|
2542
|
-
textNode.parentElement && makeTextAlignLeft(textNode.parentElement);
|
|
2553
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && makeTextAlignLeft(textNode.parentElement);
|
|
2543
2554
|
} }),
|
|
2544
2555
|
],
|
|
2545
2556
|
},
|
|
@@ -2620,4 +2631,206 @@ export const sitesConfig = [
|
|
|
2620
2631
|
],
|
|
2621
2632
|
},
|
|
2622
2633
|
},
|
|
2634
|
+
{
|
|
2635
|
+
urls: ['typus.finance'],
|
|
2636
|
+
testUrls: ['typus.finance/safu'],
|
|
2637
|
+
testPath: [':text("CONNECT WALLET")'],
|
|
2638
|
+
walletsForProvider: {
|
|
2639
|
+
[IInjectedProviderNames.sui]: [
|
|
2640
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { findIconAndName() {
|
|
2641
|
+
var _a;
|
|
2642
|
+
const modal = getConnectWalletModalByTitle('section.chakra-modal__content', 'Connect a Wallet');
|
|
2643
|
+
const ele = modal === null || modal === void 0 ? void 0 : modal.querySelector('div');
|
|
2644
|
+
return (_a = (ele && findIconAndNameByName(ele, /^Sui$/i, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2645
|
+
} }),
|
|
2646
|
+
],
|
|
2647
|
+
},
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
urls: ['app.bucketprotocol.io'],
|
|
2651
|
+
walletsForProvider: {
|
|
2652
|
+
[IInjectedProviderNames.sui]: [
|
|
2653
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: 'div[role="dialog"]', findIconAndName({ name, container }) {
|
|
2654
|
+
var _a;
|
|
2655
|
+
const modal = getConnectWalletModalByTitle(container, 'Connect a Wallet from list');
|
|
2656
|
+
return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2657
|
+
} }),
|
|
2658
|
+
],
|
|
2659
|
+
},
|
|
2660
|
+
},
|
|
2661
|
+
{
|
|
2662
|
+
urls: ['mainnet.aux.exchange'],
|
|
2663
|
+
walletsForProvider: {
|
|
2664
|
+
[IInjectedProviderNames.aptos]: [
|
|
2665
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2666
|
+
var _a;
|
|
2667
|
+
const modal = getConnectWalletModalByTitle(container, 'Select Wallet');
|
|
2668
|
+
return ((_a = (modal &&
|
|
2669
|
+
findIconAndNameByName(modal, name, 'auto-search-icon', {
|
|
2670
|
+
icon: [isWalletIconLessEqualThan],
|
|
2671
|
+
text: [],
|
|
2672
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2673
|
+
} }),
|
|
2674
|
+
],
|
|
2675
|
+
},
|
|
2676
|
+
},
|
|
2677
|
+
{
|
|
2678
|
+
urls: ['aptoswap.net'],
|
|
2679
|
+
testUrls: ['aptoswap.net/app'],
|
|
2680
|
+
walletsForProvider: {
|
|
2681
|
+
[IInjectedProviderNames.aptos]: [
|
|
2682
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.modal-background-content-frame .modal-wallet-frame', findIconAndName({ name, container }) {
|
|
2683
|
+
var _a;
|
|
2684
|
+
const modal = getConnectWalletModalByTitle(container, 'Sellect Your Wallet');
|
|
2685
|
+
return ((_a = (modal &&
|
|
2686
|
+
findIconAndNameByName(modal, name, 'auto-search-icon', {
|
|
2687
|
+
icon: [
|
|
2688
|
+
isWalletIconLessEqualThan,
|
|
2689
|
+
(walletIcon) => walletIcon.getAttribute('aria-hidden') !== 'true',
|
|
2690
|
+
],
|
|
2691
|
+
text: [],
|
|
2692
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2693
|
+
} }),
|
|
2694
|
+
],
|
|
2695
|
+
},
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
urls: ['abelfinance.xyz'],
|
|
2699
|
+
constraintMap: {
|
|
2700
|
+
icon: [isWalletIconLessEqualThan],
|
|
2701
|
+
text: [],
|
|
2702
|
+
},
|
|
2703
|
+
walletsForProvider: {
|
|
2704
|
+
[IInjectedProviderNames.aptos]: [
|
|
2705
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.ant-modal .ant-modal-content .ant-modal-body' }),
|
|
2706
|
+
],
|
|
2707
|
+
},
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
urls: ['stake.dittofinance.io'],
|
|
2711
|
+
constraintMap: {
|
|
2712
|
+
icon: [isWalletIconLessEqualThan],
|
|
2713
|
+
text: [],
|
|
2714
|
+
},
|
|
2715
|
+
walletsForProvider: {
|
|
2716
|
+
[IInjectedProviderNames.aptos]: [
|
|
2717
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.modal-enter-done div[class*="WalletList"]' }),
|
|
2718
|
+
],
|
|
2719
|
+
},
|
|
2720
|
+
},
|
|
2721
|
+
{
|
|
2722
|
+
urls: ['www.emojicoin.fun'],
|
|
2723
|
+
walletsForProvider: {
|
|
2724
|
+
[IInjectedProviderNames.aptos]: [
|
|
2725
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2726
|
+
var _a;
|
|
2727
|
+
const modal = getConnectWalletModalByTitle(container, 'LOG IN OR SIGN UP');
|
|
2728
|
+
return ((_a = (modal &&
|
|
2729
|
+
findIconAndNameByName(modal, /^PETRA$/i, 'none', {
|
|
2730
|
+
icon: [isWalletIconLessEqualThan],
|
|
2731
|
+
text: [],
|
|
2732
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2733
|
+
} }),
|
|
2734
|
+
],
|
|
2735
|
+
},
|
|
2736
|
+
},
|
|
2737
|
+
{
|
|
2738
|
+
urls: ['app.tortuga.finance'],
|
|
2739
|
+
constraintMap: {
|
|
2740
|
+
icon: [isWalletIconLessEqualThan],
|
|
2741
|
+
text: [],
|
|
2742
|
+
},
|
|
2743
|
+
walletsForProvider: {
|
|
2744
|
+
[IInjectedProviderNames.aptos]: [
|
|
2745
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'dialog.dialog div.dialog-content' }),
|
|
2746
|
+
],
|
|
2747
|
+
},
|
|
2748
|
+
},
|
|
2749
|
+
{
|
|
2750
|
+
urls: ['app.merkle.trade'],
|
|
2751
|
+
walletsForProvider: {
|
|
2752
|
+
[IInjectedProviderNames.aptos]: [petraForRainbowKit],
|
|
2753
|
+
},
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
urls: ['app.panora.exchange'],
|
|
2757
|
+
walletsForProvider: {
|
|
2758
|
+
[IInjectedProviderNames.aptos]: [
|
|
2759
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div#full-width-tabpanel-0 .MuiBox-root' }),
|
|
2760
|
+
],
|
|
2761
|
+
},
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
urls: ['trade.echelon.market'],
|
|
2765
|
+
walletsForProvider: {
|
|
2766
|
+
[IInjectedProviderNames.aptos]: [
|
|
2767
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2768
|
+
var _a;
|
|
2769
|
+
const modal = getConnectWalletModalByTitle(container, 'Welcome to Echelon');
|
|
2770
|
+
return ((_a = (modal &&
|
|
2771
|
+
findIconAndNameByName(modal, name, 'none', {
|
|
2772
|
+
icon: [
|
|
2773
|
+
isWalletIconLessEqualThan,
|
|
2774
|
+
(walletIcon) => !walletIcon.classList.contains('arrow'),
|
|
2775
|
+
],
|
|
2776
|
+
text: [isClickable],
|
|
2777
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2778
|
+
} }),
|
|
2779
|
+
],
|
|
2780
|
+
},
|
|
2781
|
+
},
|
|
2782
|
+
{
|
|
2783
|
+
urls: ['trade.baptswap.com'],
|
|
2784
|
+
walletsForProvider: {
|
|
2785
|
+
[IInjectedProviderNames.aptos]: [
|
|
2786
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2787
|
+
var _a;
|
|
2788
|
+
const modal = getConnectWalletModalByTitle(container, 'Connect a Wallet');
|
|
2789
|
+
return ((_a = (modal &&
|
|
2790
|
+
findIconAndNameByName(modal, name, 'none', {
|
|
2791
|
+
icon: [
|
|
2792
|
+
isWalletIconLessEqualThan,
|
|
2793
|
+
(walletIcon) => !walletIcon.classList.contains('arrow'),
|
|
2794
|
+
],
|
|
2795
|
+
text: [isClickable],
|
|
2796
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2797
|
+
} }),
|
|
2798
|
+
],
|
|
2799
|
+
},
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
urls: ['app.superposition.finance'],
|
|
2803
|
+
walletsForProvider: {
|
|
2804
|
+
[IInjectedProviderNames.aptos]: [
|
|
2805
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.account-wallets-outer div.account-wallet-list' }),
|
|
2806
|
+
],
|
|
2807
|
+
},
|
|
2808
|
+
},
|
|
2809
|
+
{
|
|
2810
|
+
urls: ['app.trufin.io'],
|
|
2811
|
+
constraintMap: {
|
|
2812
|
+
icon: [isWalletIconLessEqualThan],
|
|
2813
|
+
text: [],
|
|
2814
|
+
},
|
|
2815
|
+
walletsForProvider: {
|
|
2816
|
+
[IInjectedProviderNames.aptos]: [
|
|
2817
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.MuiDialogContent-root div.MuiGrid-container' }),
|
|
2818
|
+
],
|
|
2819
|
+
},
|
|
2820
|
+
},
|
|
2821
|
+
{
|
|
2822
|
+
urls: ['app.mole.fi'],
|
|
2823
|
+
constraintMap: {
|
|
2824
|
+
icon: [isWalletIconLessEqualThan],
|
|
2825
|
+
text: [],
|
|
2826
|
+
},
|
|
2827
|
+
walletsForProvider: {
|
|
2828
|
+
[IInjectedProviderNames.aptos]: [
|
|
2829
|
+
Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div#connectWallet div.wallet-list' }),
|
|
2830
|
+
],
|
|
2831
|
+
[IInjectedProviderNames.sui]: [
|
|
2832
|
+
Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: 'div#connectWallet div.wallet-list' }),
|
|
2833
|
+
],
|
|
2834
|
+
},
|
|
2835
|
+
},
|
|
2623
2836
|
];
|
|
@@ -5,7 +5,7 @@ import { ConstraintFn, FindResultType, Selector } from './type';
|
|
|
5
5
|
* don't document to querySelector because it maybe not work in shadowRoot,
|
|
6
6
|
* instead of it, use the containerElement
|
|
7
7
|
*/
|
|
8
|
-
export declare function findIconAndNameByName(containerElement: HTMLElement, walletName: RegExp, icon?: 'auto-search-icon' | ((text: Text) => HTMLElement | null | undefined), constraints?: {
|
|
8
|
+
export declare function findIconAndNameByName(containerElement: HTMLElement, walletName: RegExp, icon?: 'none' | 'auto-search-icon' | ((text: Text) => HTMLElement | null | undefined), constraints?: {
|
|
9
9
|
text: ConstraintFn[];
|
|
10
10
|
icon: ConstraintFn[];
|
|
11
11
|
}): FindResultType | null;
|
|
@@ -14,11 +14,11 @@ export function findIconAndNameByName(containerElement, walletName, icon = 'auto
|
|
|
14
14
|
}) {
|
|
15
15
|
const textNode = findWalletTextByParent(containerElement, walletName, constraints.text);
|
|
16
16
|
if (!textNode || !textNode.parentElement) {
|
|
17
|
-
universalLog.
|
|
17
|
+
universalLog.debug(`no wallet name ${walletName.toString()} text node found`);
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
if (isInExternalLink(textNode.parentElement, containerElement)) {
|
|
21
|
-
universalLog.
|
|
21
|
+
universalLog.debug(`${walletName.toString()} is in external link`);
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
let iconNode = undefined;
|
|
@@ -38,16 +38,16 @@ export function findIconAndNameByName(containerElement, walletName, icon = 'auto
|
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
else {
|
|
41
|
+
else if (typeof icon === 'string' && icon !== 'none') {
|
|
42
42
|
universalLog.warn('icon paramter should be a function or auto-search-icon');
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
|
-
if (!iconNode) {
|
|
46
|
-
universalLog.
|
|
45
|
+
if (!iconNode && typeof icon === 'string' && icon !== 'none') {
|
|
46
|
+
universalLog.debug(`no wallet ${walletName.toString()} icon node found`);
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
49
|
// make sure the icon and text are both existed
|
|
50
|
-
return { iconNode, textNode };
|
|
50
|
+
return { iconNode: iconNode !== null && iconNode !== void 0 ? iconNode : null, textNode };
|
|
51
51
|
}
|
|
52
52
|
export function findIconAndNameByIcon(iconSelector, textSelector, name, container = document, constraints = { text: [], icon: [] }, searchLevel = MAX_SEARCH_LEVELS_By_IMG) {
|
|
53
53
|
const iconElements = typeof iconSelector === 'string'
|