@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
|
@@ -88,7 +88,7 @@ const metamaskForRainbowKit = Object.assign(Object.assign({}, exports.basicWalle
|
|
|
88
88
|
}
|
|
89
89
|
return document.querySelector('button[data-testid="rk-wallet-option-metaMask"]');
|
|
90
90
|
}, afterUpdate(textNode) {
|
|
91
|
-
if (textNode.parentElement) {
|
|
91
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
92
92
|
textNode.parentElement.style.whiteSpace = 'normal';
|
|
93
93
|
}
|
|
94
94
|
} });
|
|
@@ -98,7 +98,14 @@ const walletConnectForRainbowKit = Object.assign(Object.assign({}, exports.basic
|
|
|
98
98
|
}
|
|
99
99
|
return document.querySelector('button[data-testid="rk-wallet-option-walletConnect"]');
|
|
100
100
|
}, afterUpdate(textNode) {
|
|
101
|
-
if (textNode.parentElement) {
|
|
101
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
102
|
+
textNode.parentElement.style.whiteSpace = 'normal';
|
|
103
|
+
}
|
|
104
|
+
} });
|
|
105
|
+
const petraForRainbowKit = Object.assign(Object.assign({}, exports.basicWalletInfo[consts_1.WALLET_NAMES.petra]), { container: () => {
|
|
106
|
+
return document.querySelector('button[data-testid="rk-wallet-option-petra"]');
|
|
107
|
+
}, afterUpdate(textNode) {
|
|
108
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
102
109
|
textNode.parentElement.style.whiteSpace = 'normal';
|
|
103
110
|
}
|
|
104
111
|
} });
|
|
@@ -108,7 +115,7 @@ exports.sitesConfig = [
|
|
|
108
115
|
testPath: [':text("I accept the")', ':text("Continue")', ':text("Connect Wallet")'],
|
|
109
116
|
walletsForProvider: {
|
|
110
117
|
[cross_inpage_provider_types_1.IInjectedProviderNames.sui]: [
|
|
111
|
-
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { container: "div[role='dialog'] .rc-dialog-body
|
|
118
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { container: "div[role='dialog'] .rc-dialog-body" }),
|
|
112
119
|
],
|
|
113
120
|
},
|
|
114
121
|
},
|
|
@@ -145,7 +152,8 @@ exports.sitesConfig = [
|
|
|
145
152
|
const button = modal === null || modal === void 0 ? void 0 : modal.querySelector('[data-testid="connect-wallet"]');
|
|
146
153
|
return button ? button.parentElement : null;
|
|
147
154
|
}, afterUpdate: (text, img) => {
|
|
148
|
-
img
|
|
155
|
+
if (img)
|
|
156
|
+
img.style.marginRight = '12px';
|
|
149
157
|
} }),
|
|
150
158
|
],
|
|
151
159
|
},
|
|
@@ -178,7 +186,8 @@ exports.sitesConfig = [
|
|
|
178
186
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
179
187
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getWalletListByBtn)("div[role='dialog'] .v-card .c-list"), skip: { mobile: true } }),
|
|
180
188
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: () => (0, utils_1.getWalletListByBtn)("div[role='dialog'] .v-card .c-list"), afterUpdate(textNode, img) {
|
|
181
|
-
img
|
|
189
|
+
if (img)
|
|
190
|
+
img.style.height = 'auto';
|
|
182
191
|
} }),
|
|
183
192
|
],
|
|
184
193
|
},
|
|
@@ -189,10 +198,10 @@ exports.sitesConfig = [
|
|
|
189
198
|
walletsForProvider: {
|
|
190
199
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
191
200
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: '#metamask', afterUpdate(textNode, img) {
|
|
192
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
201
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
193
202
|
} }),
|
|
194
203
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: '#wallet-connect', afterUpdate(textNode, img) {
|
|
195
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
204
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
196
205
|
} }),
|
|
197
206
|
],
|
|
198
207
|
},
|
|
@@ -358,7 +367,7 @@ exports.sitesConfig = [
|
|
|
358
367
|
e.innerText.includes('BTC wallets'));
|
|
359
368
|
});
|
|
360
369
|
}, afterUpdate(textNode, img) {
|
|
361
|
-
textNode.parentElement && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
370
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
362
371
|
} }),
|
|
363
372
|
],
|
|
364
373
|
},
|
|
@@ -408,19 +417,23 @@ exports.sitesConfig = [
|
|
|
408
417
|
],
|
|
409
418
|
},
|
|
410
419
|
},
|
|
411
|
-
{
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
},
|
|
420
|
+
// {
|
|
421
|
+
// urls: ['app.thala.fi'],
|
|
422
|
+
// testPath: [':text("I agree")', ':text("Connect")'],
|
|
423
|
+
// walletsForProvider: {
|
|
424
|
+
// [IInjectedProviderNames.aptos]: [
|
|
425
|
+
// {
|
|
426
|
+
// ...basicWalletInfo['petra'],
|
|
427
|
+
// container: () => {
|
|
428
|
+
// return getConnectWalletModalByTitle('div.chakra-modal__body', 'Welcome to Thala');
|
|
429
|
+
// },
|
|
430
|
+
// afterUpdate(textNode, img) {
|
|
431
|
+
// textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
432
|
+
// },
|
|
433
|
+
// },
|
|
434
|
+
// ],
|
|
435
|
+
// },
|
|
436
|
+
// },
|
|
424
437
|
{
|
|
425
438
|
urls: ['app.kinza.finance'],
|
|
426
439
|
testPath: {
|
|
@@ -642,7 +655,7 @@ exports.sitesConfig = [
|
|
|
642
655
|
walletsForProvider: {
|
|
643
656
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
644
657
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div[style*="opacity: 1"]', 'Connect your wallet'), afterUpdate(textNode, img) {
|
|
645
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'center');
|
|
658
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'center');
|
|
646
659
|
} }),
|
|
647
660
|
],
|
|
648
661
|
},
|
|
@@ -1019,10 +1032,10 @@ exports.sitesConfig = [
|
|
|
1019
1032
|
walletsForProvider: {
|
|
1020
1033
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
1021
1034
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: 'button#wallet-connect-metamask', afterUpdate(textNode, updatedName) {
|
|
1022
|
-
textNode.parentElement && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
1035
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
1023
1036
|
} }),
|
|
1024
1037
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: 'button#wallet-connect-walletconnect', afterUpdate(textNode, updatedName) {
|
|
1025
|
-
textNode.parentElement && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
1038
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextEllipse)(textNode.parentElement);
|
|
1026
1039
|
} }),
|
|
1027
1040
|
],
|
|
1028
1041
|
},
|
|
@@ -1063,7 +1076,7 @@ exports.sitesConfig = [
|
|
|
1063
1076
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
1064
1077
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: '#wallet-dropdown-scroll-wrapper' }),
|
|
1065
1078
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: '#wallet-dropdown-scroll-wrapper', afterUpdate(textNode, img) {
|
|
1066
|
-
textNode.parentElement && (textNode.parentElement.style.textAlign = 'left');
|
|
1079
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (textNode.parentElement.style.textAlign = 'left');
|
|
1067
1080
|
} }),
|
|
1068
1081
|
],
|
|
1069
1082
|
},
|
|
@@ -1169,7 +1182,7 @@ exports.sitesConfig = [
|
|
|
1169
1182
|
[cross_inpage_provider_types_1.IInjectedProviderNames.solana]: [
|
|
1170
1183
|
Object.assign(Object.assign({}, exports.basicWalletInfo['phantom']), { container: '#connect_modal', afterUpdate(text) {
|
|
1171
1184
|
var _a;
|
|
1172
|
-
if ((_a = text.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
1185
|
+
if ((_a = text === null || text === void 0 ? void 0 : text.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) {
|
|
1173
1186
|
text.parentElement.parentElement.style.whiteSpace = 'noWrap';
|
|
1174
1187
|
(0, textUtils_1.makeTextEllipse)(text.parentElement, { maxWidth: 'min(18vw,107px)' });
|
|
1175
1188
|
}
|
|
@@ -1226,11 +1239,7 @@ exports.sitesConfig = [
|
|
|
1226
1239
|
walletsForProvider: {
|
|
1227
1240
|
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
1228
1241
|
Object.assign(Object.assign({}, exports.basicWalletInfo['martian']), { container: 'div.ant-modal.wallet-modal' }),
|
|
1229
|
-
|
|
1230
|
-
// {
|
|
1231
|
-
// ...basicWalletInfo['petra'],
|
|
1232
|
-
// container: 'div.ant-modal.wallet-modal',
|
|
1233
|
-
// },
|
|
1242
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.ant-modal.wallet-modal' }),
|
|
1234
1243
|
],
|
|
1235
1244
|
[cross_inpage_provider_types_1.IInjectedProviderNames.sui]: [
|
|
1236
1245
|
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { name: /^Sui Wallet$/i, container: 'div.ant-modal.wallet-modal' }),
|
|
@@ -1243,8 +1252,10 @@ exports.sitesConfig = [
|
|
|
1243
1252
|
walletsForProvider: {
|
|
1244
1253
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
1245
1254
|
Object.assign(Object.assign({ container: '.connect-wallet-modal' }, exports.basicWalletInfo['walletconnect']), { afterUpdate(textNode, img) {
|
|
1246
|
-
img
|
|
1247
|
-
|
|
1255
|
+
if (img) {
|
|
1256
|
+
img.style.height = '40px';
|
|
1257
|
+
img.style.width = '40px';
|
|
1258
|
+
}
|
|
1248
1259
|
} }),
|
|
1249
1260
|
],
|
|
1250
1261
|
},
|
|
@@ -1357,8 +1368,10 @@ exports.sitesConfig = [
|
|
|
1357
1368
|
walletsForProvider: {
|
|
1358
1369
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
1359
1370
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div.ant-modal-content', 'Select a Wallet'), afterUpdate(textNode, icon) {
|
|
1360
|
-
icon
|
|
1361
|
-
|
|
1371
|
+
if (icon) {
|
|
1372
|
+
icon.style.height = '28px';
|
|
1373
|
+
icon.style.width = 'auto';
|
|
1374
|
+
}
|
|
1362
1375
|
} }),
|
|
1363
1376
|
],
|
|
1364
1377
|
},
|
|
@@ -1409,7 +1422,7 @@ exports.sitesConfig = [
|
|
|
1409
1422
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="icon-metamask"]', 'auto-search-text', name, modal));
|
|
1410
1423
|
},
|
|
1411
1424
|
afterUpdate(textNode) {
|
|
1412
|
-
textNode.parentElement && (0, textUtils_1.makeTextWordBreak)(textNode.parentElement);
|
|
1425
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextWordBreak)(textNode.parentElement);
|
|
1413
1426
|
} }),
|
|
1414
1427
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { findIconAndName({ name }) {
|
|
1415
1428
|
const modal = (0, utils_1.getConnectWalletModalByTitle)('div.dialog-container', 'Available Wallets');
|
|
@@ -1417,7 +1430,7 @@ exports.sitesConfig = [
|
|
|
1417
1430
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="icon-wallet-connect"]', 'auto-search-text', name, modal));
|
|
1418
1431
|
},
|
|
1419
1432
|
afterUpdate(textNode) {
|
|
1420
|
-
textNode.parentElement && (0, textUtils_1.makeTextWordBreak)(textNode.parentElement);
|
|
1433
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextWordBreak)(textNode.parentElement);
|
|
1421
1434
|
} }),
|
|
1422
1435
|
],
|
|
1423
1436
|
},
|
|
@@ -1527,12 +1540,14 @@ exports.sitesConfig = [
|
|
|
1527
1540
|
walletsForProvider: {
|
|
1528
1541
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
1529
1542
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: 'div.SelectWalletModal', afterUpdate(textNode, icon) {
|
|
1530
|
-
if (textNode.parentElement) {
|
|
1543
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1531
1544
|
(0, textUtils_1.makeTextEllipse)(textNode.parentElement, { width: '100%' });
|
|
1532
1545
|
textNode.parentElement.style.flexShrink = '0';
|
|
1533
1546
|
// textNode.parentElement.style.width = '100%';
|
|
1534
1547
|
}
|
|
1535
|
-
icon
|
|
1548
|
+
if (icon) {
|
|
1549
|
+
icon.style.height = 'auto';
|
|
1550
|
+
}
|
|
1536
1551
|
} }),
|
|
1537
1552
|
],
|
|
1538
1553
|
},
|
|
@@ -1550,7 +1565,9 @@ exports.sitesConfig = [
|
|
|
1550
1565
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="metamask.svg"][alt="Metamask"]', 'auto-search-text', name, modal));
|
|
1551
1566
|
},
|
|
1552
1567
|
afterUpdate(textNode, icon) {
|
|
1553
|
-
icon
|
|
1568
|
+
if (icon) {
|
|
1569
|
+
icon.style.marginRight = '12px';
|
|
1570
|
+
}
|
|
1554
1571
|
} }),
|
|
1555
1572
|
],
|
|
1556
1573
|
[cross_inpage_provider_types_1.IInjectedProviderNames.cosmos]: [
|
|
@@ -1563,7 +1580,9 @@ exports.sitesConfig = [
|
|
|
1563
1580
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="keplr.svg"][alt="Keplr"]', 'auto-search-text', name, modal));
|
|
1564
1581
|
},
|
|
1565
1582
|
afterUpdate(textNode, icon) {
|
|
1566
|
-
icon
|
|
1583
|
+
if (icon) {
|
|
1584
|
+
icon.style.marginRight = '12px';
|
|
1585
|
+
}
|
|
1567
1586
|
} }),
|
|
1568
1587
|
],
|
|
1569
1588
|
},
|
|
@@ -1766,18 +1785,22 @@ exports.sitesConfig = [
|
|
|
1766
1785
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
1767
1786
|
return (0, shadowRoot_1.findIconAndNameInShadowRoot)('onboard-v2', container, name);
|
|
1768
1787
|
}, afterUpdate(textNode, img) {
|
|
1769
|
-
img
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1788
|
+
if (img) {
|
|
1789
|
+
img.style.width = '32px';
|
|
1790
|
+
img.style.height = '32px';
|
|
1791
|
+
img.style.maxWidth = '32px';
|
|
1792
|
+
img.style.maxHeight = '32px';
|
|
1793
|
+
}
|
|
1773
1794
|
} }),
|
|
1774
1795
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
1775
1796
|
return (0, shadowRoot_1.findIconAndNameInShadowRoot)('onboard-v2', container, name);
|
|
1776
1797
|
}, afterUpdate(textNode, img) {
|
|
1777
|
-
img
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1798
|
+
if (img) {
|
|
1799
|
+
img.style.width = '32px';
|
|
1800
|
+
img.style.height = '32px';
|
|
1801
|
+
img.style.maxWidth = '32px';
|
|
1802
|
+
img.style.maxHeight = '32px';
|
|
1803
|
+
}
|
|
1781
1804
|
} }),
|
|
1782
1805
|
],
|
|
1783
1806
|
},
|
|
@@ -1803,7 +1826,7 @@ exports.sitesConfig = [
|
|
|
1803
1826
|
: null;
|
|
1804
1827
|
},
|
|
1805
1828
|
afterUpdate(textNode, img) {
|
|
1806
|
-
if (textNode.parentElement) {
|
|
1829
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1807
1830
|
textNode.parentElement.style.overflow = 'visible';
|
|
1808
1831
|
}
|
|
1809
1832
|
} }),
|
|
@@ -1823,7 +1846,7 @@ exports.sitesConfig = [
|
|
|
1823
1846
|
: null;
|
|
1824
1847
|
},
|
|
1825
1848
|
afterUpdate(textNode, img) {
|
|
1826
|
-
if (textNode.parentElement) {
|
|
1849
|
+
if (textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) {
|
|
1827
1850
|
textNode.parentElement.style.overflow = 'visible';
|
|
1828
1851
|
}
|
|
1829
1852
|
} }),
|
|
@@ -1861,8 +1884,10 @@ exports.sitesConfig = [
|
|
|
1861
1884
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="metamask-icon"][alt="Icon"]', 'auto-search-text', name, modal));
|
|
1862
1885
|
},
|
|
1863
1886
|
afterUpdate(textNode, iconNode) {
|
|
1864
|
-
iconNode
|
|
1865
|
-
|
|
1887
|
+
if (iconNode) {
|
|
1888
|
+
iconNode.style.aspectRatio = '1';
|
|
1889
|
+
iconNode.style.minWidth = '32px';
|
|
1890
|
+
}
|
|
1866
1891
|
} }),
|
|
1867
1892
|
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { findIconAndName({ name }) {
|
|
1868
1893
|
const modal = (0, utils_1.getConnectWalletModalByTitle)('section.chakra-modal__content[role="dialog"]', 'Connect to a wallet');
|
|
@@ -1870,13 +1895,15 @@ exports.sitesConfig = [
|
|
|
1870
1895
|
(0, findIconAndName_1.findIconAndNameByIcon)('img[src*="wallet-connect-icon"][alt="Icon"]', 'auto-search-text', name, modal));
|
|
1871
1896
|
},
|
|
1872
1897
|
afterUpdate(textNode, iconNode) {
|
|
1873
|
-
iconNode
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1898
|
+
if (iconNode && textNode) {
|
|
1899
|
+
iconNode.style.aspectRatio = '1';
|
|
1900
|
+
iconNode.style.minWidth = '32px';
|
|
1901
|
+
const { defaultVal } = (0, utils_1.getMaxWithOfText)(textNode, iconNode);
|
|
1902
|
+
textNode.parentElement &&
|
|
1903
|
+
(0, textUtils_1.makeTextEllipse)(textNode.parentElement, {
|
|
1904
|
+
maxWidth: defaultVal,
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1880
1907
|
} }),
|
|
1881
1908
|
],
|
|
1882
1909
|
},
|
|
@@ -1913,14 +1940,6 @@ exports.sitesConfig = [
|
|
|
1913
1940
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [metamaskForRainbowKit, walletConnectForRainbowKit],
|
|
1914
1941
|
},
|
|
1915
1942
|
},
|
|
1916
|
-
{
|
|
1917
|
-
urls: ['app.cellana.finance'],
|
|
1918
|
-
walletsForProvider: {
|
|
1919
|
-
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
1920
|
-
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { name: /^Petra Wallet$/, container: () => (0, utils_1.getConnectWalletModalByTitle)('div.ant-modal[role="dialog"]', 'Connect a wallet') }),
|
|
1921
|
-
],
|
|
1922
|
-
},
|
|
1923
|
-
},
|
|
1924
1943
|
{
|
|
1925
1944
|
urls: ['www.vaultka.com'],
|
|
1926
1945
|
testPath: {
|
|
@@ -2011,12 +2030,12 @@ exports.sitesConfig = [
|
|
|
2011
2030
|
walletsForProvider: {
|
|
2012
2031
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
2013
2032
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div[role="dialog"]', 'Connect wallet to continue'), afterUpdate(textNode) {
|
|
2014
|
-
textNode.parentElement && (0, textUtils_1.makeTextAlignCenter)(textNode.parentElement);
|
|
2033
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextAlignCenter)(textNode.parentElement);
|
|
2015
2034
|
} }),
|
|
2016
2035
|
],
|
|
2017
2036
|
[cross_inpage_provider_types_1.IInjectedProviderNames.solana]: [
|
|
2018
2037
|
Object.assign(Object.assign({}, exports.basicWalletInfo['phantom']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div[role="dialog"]', 'Connect wallet to continue'), afterUpdate(textNode) {
|
|
2019
|
-
textNode.parentElement && (0, textUtils_1.makeTextAlignCenter)(textNode.parentElement);
|
|
2038
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextAlignCenter)(textNode.parentElement);
|
|
2020
2039
|
} }),
|
|
2021
2040
|
],
|
|
2022
2041
|
},
|
|
@@ -2135,7 +2154,7 @@ exports.sitesConfig = [
|
|
|
2135
2154
|
}));
|
|
2136
2155
|
},
|
|
2137
2156
|
afterUpdate(textNode) {
|
|
2138
|
-
textNode.parentElement && (0, textUtils_1.makeTextAlignLeft)(textNode.parentElement);
|
|
2157
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextAlignLeft)(textNode.parentElement);
|
|
2139
2158
|
} }),
|
|
2140
2159
|
],
|
|
2141
2160
|
},
|
|
@@ -2183,7 +2202,7 @@ exports.sitesConfig = [
|
|
|
2183
2202
|
walletsForProvider: {
|
|
2184
2203
|
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
2185
2204
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('#headlessui-portal-root div.relative[id*="headlessui-dialog"]', 'Connect your wallet'), afterUpdate(textNode) {
|
|
2186
|
-
textNode.parentElement && (0, textUtils_1.makeTextWrap)(textNode.parentElement);
|
|
2205
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextWrap)(textNode.parentElement);
|
|
2187
2206
|
} }),
|
|
2188
2207
|
],
|
|
2189
2208
|
},
|
|
@@ -2287,14 +2306,6 @@ exports.sitesConfig = [
|
|
|
2287
2306
|
],
|
|
2288
2307
|
},
|
|
2289
2308
|
},
|
|
2290
|
-
{
|
|
2291
|
-
urls: ['app.aptin.io'],
|
|
2292
|
-
walletsForProvider: {
|
|
2293
|
-
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2294
|
-
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div.MuiPaper-root.aptin-dialog', 'Connect a wallet') }),
|
|
2295
|
-
],
|
|
2296
|
-
},
|
|
2297
|
-
},
|
|
2298
2309
|
{
|
|
2299
2310
|
urls: ['juicebox.money'],
|
|
2300
2311
|
testPath: {
|
|
@@ -2545,7 +2556,7 @@ exports.sitesConfig = [
|
|
|
2545
2556
|
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: '.modal .outer-container div.wallets-container ', findIconAndName: ({ container, name }) => {
|
|
2546
2557
|
return (0, shadowRoot_1.findIconAndNameInShadowRoot)('onboard-v2', container, name);
|
|
2547
2558
|
}, afterUpdate(textNode) {
|
|
2548
|
-
textNode.parentElement && (0, textUtils_1.makeTextAlignLeft)(textNode.parentElement);
|
|
2559
|
+
(textNode === null || textNode === void 0 ? void 0 : textNode.parentElement) && (0, textUtils_1.makeTextAlignLeft)(textNode.parentElement);
|
|
2549
2560
|
} }),
|
|
2550
2561
|
],
|
|
2551
2562
|
},
|
|
@@ -2626,4 +2637,206 @@ exports.sitesConfig = [
|
|
|
2626
2637
|
],
|
|
2627
2638
|
},
|
|
2628
2639
|
},
|
|
2640
|
+
{
|
|
2641
|
+
urls: ['typus.finance'],
|
|
2642
|
+
testUrls: ['typus.finance/safu'],
|
|
2643
|
+
testPath: [':text("CONNECT WALLET")'],
|
|
2644
|
+
walletsForProvider: {
|
|
2645
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.sui]: [
|
|
2646
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { findIconAndName() {
|
|
2647
|
+
var _a;
|
|
2648
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)('section.chakra-modal__content', 'Connect a Wallet');
|
|
2649
|
+
const ele = modal === null || modal === void 0 ? void 0 : modal.querySelector('div');
|
|
2650
|
+
return (_a = (ele && (0, findIconAndName_1.findIconAndNameByName)(ele, /^Sui$/i, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2651
|
+
} }),
|
|
2652
|
+
],
|
|
2653
|
+
},
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
urls: ['app.bucketprotocol.io'],
|
|
2657
|
+
walletsForProvider: {
|
|
2658
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.sui]: [
|
|
2659
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { container: 'div[role="dialog"]', findIconAndName({ name, container }) {
|
|
2660
|
+
var _a;
|
|
2661
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'Connect a Wallet from list');
|
|
2662
|
+
return (_a = (modal && (0, findIconAndName_1.findIconAndNameByName)(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
|
|
2663
|
+
} }),
|
|
2664
|
+
],
|
|
2665
|
+
},
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
urls: ['mainnet.aux.exchange'],
|
|
2669
|
+
walletsForProvider: {
|
|
2670
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2671
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2672
|
+
var _a;
|
|
2673
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'Select Wallet');
|
|
2674
|
+
return ((_a = (modal &&
|
|
2675
|
+
(0, findIconAndName_1.findIconAndNameByName)(modal, name, 'auto-search-icon', {
|
|
2676
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2677
|
+
text: [],
|
|
2678
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2679
|
+
} }),
|
|
2680
|
+
],
|
|
2681
|
+
},
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
urls: ['aptoswap.net'],
|
|
2685
|
+
testUrls: ['aptoswap.net/app'],
|
|
2686
|
+
walletsForProvider: {
|
|
2687
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2688
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.modal-background-content-frame .modal-wallet-frame', findIconAndName({ name, container }) {
|
|
2689
|
+
var _a;
|
|
2690
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'Sellect Your Wallet');
|
|
2691
|
+
return ((_a = (modal &&
|
|
2692
|
+
(0, findIconAndName_1.findIconAndNameByName)(modal, name, 'auto-search-icon', {
|
|
2693
|
+
icon: [
|
|
2694
|
+
imgUtils_1.isWalletIconLessEqualThan,
|
|
2695
|
+
(walletIcon) => walletIcon.getAttribute('aria-hidden') !== 'true',
|
|
2696
|
+
],
|
|
2697
|
+
text: [],
|
|
2698
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2699
|
+
} }),
|
|
2700
|
+
],
|
|
2701
|
+
},
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
urls: ['abelfinance.xyz'],
|
|
2705
|
+
constraintMap: {
|
|
2706
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2707
|
+
text: [],
|
|
2708
|
+
},
|
|
2709
|
+
walletsForProvider: {
|
|
2710
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2711
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.ant-modal .ant-modal-content .ant-modal-body' }),
|
|
2712
|
+
],
|
|
2713
|
+
},
|
|
2714
|
+
},
|
|
2715
|
+
{
|
|
2716
|
+
urls: ['stake.dittofinance.io'],
|
|
2717
|
+
constraintMap: {
|
|
2718
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2719
|
+
text: [],
|
|
2720
|
+
},
|
|
2721
|
+
walletsForProvider: {
|
|
2722
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2723
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.modal-enter-done div[class*="WalletList"]' }),
|
|
2724
|
+
],
|
|
2725
|
+
},
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
urls: ['www.emojicoin.fun'],
|
|
2729
|
+
walletsForProvider: {
|
|
2730
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2731
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2732
|
+
var _a;
|
|
2733
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'LOG IN OR SIGN UP');
|
|
2734
|
+
return ((_a = (modal &&
|
|
2735
|
+
(0, findIconAndName_1.findIconAndNameByName)(modal, /^PETRA$/i, 'none', {
|
|
2736
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2737
|
+
text: [],
|
|
2738
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2739
|
+
} }),
|
|
2740
|
+
],
|
|
2741
|
+
},
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
urls: ['app.tortuga.finance'],
|
|
2745
|
+
constraintMap: {
|
|
2746
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2747
|
+
text: [],
|
|
2748
|
+
},
|
|
2749
|
+
walletsForProvider: {
|
|
2750
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2751
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'dialog.dialog div.dialog-content' }),
|
|
2752
|
+
],
|
|
2753
|
+
},
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
urls: ['app.merkle.trade'],
|
|
2757
|
+
walletsForProvider: {
|
|
2758
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [petraForRainbowKit],
|
|
2759
|
+
},
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
urls: ['app.panora.exchange'],
|
|
2763
|
+
walletsForProvider: {
|
|
2764
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2765
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div#full-width-tabpanel-0 .MuiBox-root' }),
|
|
2766
|
+
],
|
|
2767
|
+
},
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
urls: ['trade.echelon.market'],
|
|
2771
|
+
walletsForProvider: {
|
|
2772
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2773
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2774
|
+
var _a;
|
|
2775
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'Welcome to Echelon');
|
|
2776
|
+
return ((_a = (modal &&
|
|
2777
|
+
(0, findIconAndName_1.findIconAndNameByName)(modal, name, 'none', {
|
|
2778
|
+
icon: [
|
|
2779
|
+
imgUtils_1.isWalletIconLessEqualThan,
|
|
2780
|
+
(walletIcon) => !walletIcon.classList.contains('arrow'),
|
|
2781
|
+
],
|
|
2782
|
+
text: [utils_1.isClickable],
|
|
2783
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2784
|
+
} }),
|
|
2785
|
+
],
|
|
2786
|
+
},
|
|
2787
|
+
},
|
|
2788
|
+
{
|
|
2789
|
+
urls: ['trade.baptswap.com'],
|
|
2790
|
+
walletsForProvider: {
|
|
2791
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2792
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: '[id^="headlessui-dialog-panel-"]', findIconAndName({ name, container }) {
|
|
2793
|
+
var _a;
|
|
2794
|
+
const modal = (0, utils_1.getConnectWalletModalByTitle)(container, 'Connect a Wallet');
|
|
2795
|
+
return ((_a = (modal &&
|
|
2796
|
+
(0, findIconAndName_1.findIconAndNameByName)(modal, name, 'none', {
|
|
2797
|
+
icon: [
|
|
2798
|
+
imgUtils_1.isWalletIconLessEqualThan,
|
|
2799
|
+
(walletIcon) => !walletIcon.classList.contains('arrow'),
|
|
2800
|
+
],
|
|
2801
|
+
text: [utils_1.isClickable],
|
|
2802
|
+
}))) !== null && _a !== void 0 ? _a : null);
|
|
2803
|
+
} }),
|
|
2804
|
+
],
|
|
2805
|
+
},
|
|
2806
|
+
},
|
|
2807
|
+
{
|
|
2808
|
+
urls: ['app.superposition.finance'],
|
|
2809
|
+
walletsForProvider: {
|
|
2810
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2811
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.account-wallets-outer div.account-wallet-list' }),
|
|
2812
|
+
],
|
|
2813
|
+
},
|
|
2814
|
+
},
|
|
2815
|
+
{
|
|
2816
|
+
urls: ['app.trufin.io'],
|
|
2817
|
+
constraintMap: {
|
|
2818
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2819
|
+
text: [],
|
|
2820
|
+
},
|
|
2821
|
+
walletsForProvider: {
|
|
2822
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2823
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div.MuiDialogContent-root div.MuiGrid-container' }),
|
|
2824
|
+
],
|
|
2825
|
+
},
|
|
2826
|
+
},
|
|
2827
|
+
{
|
|
2828
|
+
urls: ['app.mole.fi'],
|
|
2829
|
+
constraintMap: {
|
|
2830
|
+
icon: [imgUtils_1.isWalletIconLessEqualThan],
|
|
2831
|
+
text: [],
|
|
2832
|
+
},
|
|
2833
|
+
walletsForProvider: {
|
|
2834
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.aptos]: [
|
|
2835
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['petra']), { container: 'div#connectWallet div.wallet-list' }),
|
|
2836
|
+
],
|
|
2837
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.sui]: [
|
|
2838
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['suiwallet']), { container: 'div#connectWallet div.wallet-list' }),
|
|
2839
|
+
],
|
|
2840
|
+
},
|
|
2841
|
+
},
|
|
2629
2842
|
];
|
|
@@ -19,11 +19,11 @@ function findIconAndNameByName(containerElement, walletName, icon = 'auto-search
|
|
|
19
19
|
}) {
|
|
20
20
|
const textNode = (0, textUtils_1.findWalletTextByParent)(containerElement, walletName, constraints.text);
|
|
21
21
|
if (!textNode || !textNode.parentElement) {
|
|
22
|
-
utils_1.universalLog.
|
|
22
|
+
utils_1.universalLog.debug(`no wallet name ${walletName.toString()} text node found`);
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
if ((0, utils_1.isInExternalLink)(textNode.parentElement, containerElement)) {
|
|
26
|
-
utils_1.universalLog.
|
|
26
|
+
utils_1.universalLog.debug(`${walletName.toString()} is in external link`);
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
let iconNode = undefined;
|
|
@@ -43,16 +43,16 @@ function findIconAndNameByName(containerElement, walletName, icon = 'auto-search
|
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
else {
|
|
46
|
+
else if (typeof icon === 'string' && icon !== 'none') {
|
|
47
47
|
utils_1.universalLog.warn('icon paramter should be a function or auto-search-icon');
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
if (!iconNode) {
|
|
51
|
-
utils_1.universalLog.
|
|
50
|
+
if (!iconNode && typeof icon === 'string' && icon !== 'none') {
|
|
51
|
+
utils_1.universalLog.debug(`no wallet ${walletName.toString()} icon node found`);
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
// make sure the icon and text are both existed
|
|
55
|
-
return { iconNode, textNode };
|
|
55
|
+
return { iconNode: iconNode !== null && iconNode !== void 0 ? iconNode : null, textNode };
|
|
56
56
|
}
|
|
57
57
|
function findIconAndNameByIcon(iconSelector, textSelector, name, container = document, constraints = { text: [], icon: [] }, searchLevel = consts_1.MAX_SEARCH_LEVELS_By_IMG) {
|
|
58
58
|
const iconElements = typeof iconSelector === 'string'
|