@onekeyfe/inpage-providers-hub 2.2.15 → 2.2.18
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/consts.js +13 -13
- package/dist/cjs/connectButtonHack/index.js +0 -6
- package/dist/cjs/connectButtonHack/universal/config.js +323 -3
- package/dist/connectButtonHack/consts.js +13 -13
- package/dist/connectButtonHack/index.js +0 -6
- package/dist/connectButtonHack/universal/config.js +323 -3
- package/package.json +23 -23
- package/dist/cjs/connectButtonHack/sites/lidofi.js +0 -55
- package/dist/cjs/connectButtonHack/sites/rocketpool.js +0 -39
- package/dist/cjs/connectButtonHack/sites/solv.js +0 -45
- package/dist/connectButtonHack/sites/lidofi.d.ts +0 -2
- package/dist/connectButtonHack/sites/lidofi.js +0 -53
- package/dist/connectButtonHack/sites/rocketpool.d.ts +0 -2
- package/dist/connectButtonHack/sites/rocketpool.js +0 -37
- package/dist/connectButtonHack/sites/solv.d.ts +0 -2
- package/dist/connectButtonHack/sites/solv.js +0 -40
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { hackConnectButton } from '../hackConnectButton';
|
|
2
|
-
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
3
|
-
import { WALLET_CONNECT_INFO } from '../consts';
|
|
4
|
-
import domUtils from '../utils/utilsDomNodes';
|
|
5
|
-
export default () => hackConnectButton({
|
|
6
|
-
urls: ['app.solv.finance'],
|
|
7
|
-
providers: [IInjectedProviderNames.ethereum],
|
|
8
|
-
replaceMethod(options) {
|
|
9
|
-
var _a;
|
|
10
|
-
const replaceFunc = ({ findName, icon, text, }) => {
|
|
11
|
-
const walletBtnList = Array.from(document.querySelectorAll('[role="dialog"] > div:nth-child(2).overflow-y-overlay > div > div:nth-child(2) >div'));
|
|
12
|
-
for (const walletBtn of walletBtnList) {
|
|
13
|
-
if ((walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.innerText) === findName) {
|
|
14
|
-
const textNode = domUtils.findTextNode(walletBtn, findName);
|
|
15
|
-
textNode === null || textNode === void 0 ? void 0 : textNode.replaceWith(text);
|
|
16
|
-
const img = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector(':scope > div:nth-child(1) > span> img');
|
|
17
|
-
if (img) {
|
|
18
|
-
img.src = icon;
|
|
19
|
-
img.style.width = '32px';
|
|
20
|
-
img.style.height = '32px';
|
|
21
|
-
img.style.minWidth = 'auto';
|
|
22
|
-
img.style.minHeight = 'auto';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(IInjectedProviderNames.ethereum)) {
|
|
28
|
-
replaceFunc({
|
|
29
|
-
findName: 'MetaMask',
|
|
30
|
-
icon: WALLET_CONNECT_INFO.metamask.icon,
|
|
31
|
-
text: WALLET_CONNECT_INFO.metamask.text,
|
|
32
|
-
});
|
|
33
|
-
replaceFunc({
|
|
34
|
-
findName: 'Wallet Connect',
|
|
35
|
-
icon: WALLET_CONNECT_INFO.walletconnect.icon,
|
|
36
|
-
text: WALLET_CONNECT_INFO.walletconnect.text,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
});
|