@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.
@@ -2852,9 +2852,18 @@ export const sitesConfig = [
2852
2852
  [IInjectedProviderNames.solana]: [
2853
2853
  Object.assign(Object.assign({}, basicWalletInfo['phantom']), { container: 'div.wallet-list', afterUpdate(textNode) {
2854
2854
  const ledgerInput = document.getElementById('connect-ledger-wallet-with-phantom');
2855
- const ledgerText = ledgerInput === null || ledgerInput === void 0 ? void 0 : ledgerInput.nextElementSibling;
2856
- if (ledgerText) {
2857
- ledgerText.textContent = 'I am using my ledger/onekey with one of these wallets';
2855
+ if (textNode) {
2856
+ textNode.textContent = 'OneKey Hardware & Phantom';
2857
+ }
2858
+ const label = ledgerInput === null || ledgerInput === void 0 ? void 0 : ledgerInput.parentElement;
2859
+ if (label) {
2860
+ const span = label.querySelector('span');
2861
+ if (span) {
2862
+ span.textContent = 'I am using my ledger/onekey hardware with one of these wallets';
2863
+ }
2864
+ label.style.padding = '20px';
2865
+ label.style.display = 'flex';
2866
+ label.style.alignItems = 'center';
2858
2867
  }
2859
2868
  } }),
2860
2869
  ],
@@ -2877,4 +2886,315 @@ export const sitesConfig = [
2877
2886
  ],
2878
2887
  },
2879
2888
  },
2889
+ {
2890
+ urls: ['stake.lido.fi'],
2891
+ walletsForProvider: {
2892
+ [IInjectedProviderNames.ethereum]: [
2893
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: '#reef-knot-modal-root' }),
2894
+ ],
2895
+ },
2896
+ },
2897
+ {
2898
+ urls: ['bridge.arbitrum.io'],
2899
+ walletsForProvider: {
2900
+ [IInjectedProviderNames.ethereum]: [
2901
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="document"]', findIconAndName({ name, container }) {
2902
+ var _a;
2903
+ const modal = getConnectWalletModalByTitle(container, 'Connect a Wallet');
2904
+ return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
2905
+ } }),
2906
+ ],
2907
+ },
2908
+ },
2909
+ {
2910
+ urls: ['app.optimism.io'],
2911
+ walletsForProvider: {
2912
+ [IInjectedProviderNames.ethereum]: [
2913
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="document"]' }),
2914
+ ],
2915
+ },
2916
+ },
2917
+ {
2918
+ urls: ['stake.rocketpool.net'],
2919
+ walletsForProvider: {
2920
+ [IInjectedProviderNames.ethereum]: [
2921
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
2922
+ const modal = document.querySelector('div[role="dialog"].fixed.inset-0');
2923
+ return modal && findIconAndNameByIcon('img[alt="MetaMask"]', 'auto-search-text', name, modal);
2924
+ } }),
2925
+ ],
2926
+ },
2927
+ },
2928
+ {
2929
+ urls: ['app.solv.finance'],
2930
+ walletsForProvider: {
2931
+ [IInjectedProviderNames.ethereum]: [
2932
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[role="dialog"]', findIconAndName({ name }) {
2933
+ var _a;
2934
+ const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect your wallet');
2935
+ return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon', {
2936
+ icon: [
2937
+ isWalletIconLessEqualThan,
2938
+ (icon) => icon.getAttribute('aria-hidden') !== 'true'
2939
+ ],
2940
+ text: []
2941
+ }))) !== null && _a !== void 0 ? _a : null;
2942
+ } }),
2943
+ ],
2944
+ },
2945
+ },
2946
+ {
2947
+ urls: ['app.symbiotic.fi'],
2948
+ walletsForProvider: {
2949
+ [IInjectedProviderNames.ethereum]: [
2950
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: 'div[data-dialog-wrapper="true"]', findIconAndName({ name, container }) {
2951
+ var _a;
2952
+ const modal = getConnectWalletModalByTitle(container, 'CONNECT WALLET');
2953
+ return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
2954
+ } }),
2955
+ ],
2956
+ },
2957
+ },
2958
+ {
2959
+ urls: ['app.free.tech', 'core.app', 'blast.io'],
2960
+ walletsForProvider: {
2961
+ [IInjectedProviderNames.ethereum]: [
2962
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
2963
+ var _a;
2964
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
2965
+ } }),
2966
+ ],
2967
+ },
2968
+ },
2969
+ {
2970
+ urls: ['yieldlayer.cian.app'],
2971
+ walletsForProvider: {
2972
+ [IInjectedProviderNames.ethereum]: [
2973
+ Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: () => getConnectWalletModalByTitle('div[role="dialog"]', 'Connect Wallet') }),
2974
+ ],
2975
+ },
2976
+ },
2977
+ {
2978
+ urls: ['app.unirouter.io'],
2979
+ walletsForProvider: {
2980
+ [IInjectedProviderNames.btc]: [
2981
+ Object.assign(Object.assign({}, basicWalletInfo['unisat']), { findIconAndName({ name }) {
2982
+ const modal = getConnectWalletModalByTitle('div.dropdown.dropdown-end', 'Connect Wallet');
2983
+ return modal && findIconAndNameByIcon('img[alt="Unisat Wallet"]', 'auto-search-text', name, modal);
2984
+ },
2985
+ afterUpdate(textNode, iconNode) {
2986
+ if (textNode) {
2987
+ textNode.textContent = 'OneKey&UniSat';
2988
+ }
2989
+ if (iconNode) {
2990
+ iconNode.style.width = '28px';
2991
+ iconNode.style.height = '28px';
2992
+ }
2993
+ } }),
2994
+ ],
2995
+ },
2996
+ },
2997
+ {
2998
+ urls: ['sunswap.com'],
2999
+ walletsForProvider: {
3000
+ [IInjectedProviderNames.tron]: [
3001
+ Object.assign(Object.assign({}, basicWalletInfo['tronlink']), { container: () => {
3002
+ return getConnectWalletModalByTitle('div.ant-modal-content', 'Connect to Wallet');
3003
+ } }),
3004
+ ],
3005
+ },
3006
+ },
3007
+ {
3008
+ urls: ['dashboard.threshold.network'],
3009
+ walletsForProvider: {
3010
+ [IInjectedProviderNames.ethereum]: [
3011
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
3012
+ var _a;
3013
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon', {
3014
+ icon: [
3015
+ (icon) => icon.classList.contains('chakra-icon')
3016
+ ],
3017
+ text: []
3018
+ })) !== null && _a !== void 0 ? _a : null;
3019
+ } }),
3020
+ ],
3021
+ },
3022
+ },
3023
+ {
3024
+ urls: ['app.pell.network'],
3025
+ walletsForProvider: {
3026
+ [IInjectedProviderNames.ethereum]: [
3027
+ Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
3028
+ var _a;
3029
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
3030
+ } }),
3031
+ ],
3032
+ },
3033
+ },
3034
+ {
3035
+ urls: ['www.bitlayer.org'],
3036
+ walletsForProvider: {
3037
+ [IInjectedProviderNames.btc]: [
3038
+ Object.assign(Object.assign({}, basicWalletInfo['unisat']), { findIconAndName({ name }) {
3039
+ var _a;
3040
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
3041
+ },
3042
+ afterUpdate(textNode, iconNode) {
3043
+ if (iconNode) {
3044
+ iconNode.style.width = '26px';
3045
+ iconNode.style.height = '26px';
3046
+ }
3047
+ } }),
3048
+ ],
3049
+ },
3050
+ },
3051
+ {
3052
+ urls: ['app.abex.fi'],
3053
+ walletsForProvider: {
3054
+ [IInjectedProviderNames.sui]: [
3055
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
3056
+ ],
3057
+ },
3058
+ },
3059
+ {
3060
+ urls: ['dex.bluemove.net'],
3061
+ walletsForProvider: {
3062
+ [IInjectedProviderNames.sui]: [
3063
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { findIconAndName({ name }) {
3064
+ var _a;
3065
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
3066
+ },
3067
+ afterUpdate(textNode, iconNode) {
3068
+ if (iconNode) {
3069
+ iconNode.style.width = '32px';
3070
+ iconNode.style.height = '32px';
3071
+ }
3072
+ } }),
3073
+ ],
3074
+ },
3075
+ },
3076
+ {
3077
+ urls: ['app.sudo.finance'],
3078
+ walletsForProvider: {
3079
+ [IInjectedProviderNames.sui]: [
3080
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
3081
+ ],
3082
+ },
3083
+ },
3084
+ {
3085
+ urls: ['app.streamflow.finance'],
3086
+ walletsForProvider: {
3087
+ [IInjectedProviderNames.sui]: [
3088
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div.w-full.sm\\:w-100" }),
3089
+ ],
3090
+ },
3091
+ },
3092
+ {
3093
+ urls: ['farm.bucketprotocol.io'],
3094
+ walletsForProvider: {
3095
+ [IInjectedProviderNames.sui]: [
3096
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { findIconAndName({ name }) {
3097
+ const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect a Wallet from list');
3098
+ return modal && findIconAndNameByIcon('img[alt="Sui Wallet"]', 'auto-search-text', name, modal);
3099
+ } }),
3100
+ ],
3101
+ },
3102
+ },
3103
+ {
3104
+ urls: ['stake.volosui.com'],
3105
+ walletsForProvider: {
3106
+ [IInjectedProviderNames.sui]: [
3107
+ Object.assign(Object.assign({}, basicWalletInfo['suiwallet']), { container: "div[role='dialog'].wkit-dialog__content" }),
3108
+ ],
3109
+ },
3110
+ },
3111
+ {
3112
+ urls: ['app.houstonswap.io'],
3113
+ walletsForProvider: {
3114
+ [IInjectedProviderNames.aptos]: [
3115
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.relative.rounded-lg.bg-white.shadow' }),
3116
+ ],
3117
+ },
3118
+ },
3119
+ {
3120
+ urls: ['app.eternalfinance.io'],
3121
+ walletsForProvider: {
3122
+ [IInjectedProviderNames.aptos]: [
3123
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { container: 'div.relative.rounded-lg.bg-white.shadow' }),
3124
+ ],
3125
+ },
3126
+ },
3127
+ {
3128
+ urls: ['launchpad.movegpt.io'],
3129
+ walletsForProvider: {
3130
+ [IInjectedProviderNames.aptos]: [
3131
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName({ name }) {
3132
+ var _a;
3133
+ const modal = getConnectWalletModalByTitle('div[role="dialog"]', 'Connect wallet');
3134
+ return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
3135
+ } }),
3136
+ ],
3137
+ },
3138
+ },
3139
+ {
3140
+ urls: ['tsunami.finance'],
3141
+ walletsForProvider: {
3142
+ [IInjectedProviderNames.ethereum]: [metamaskForRainbowKit, walletConnectForRainbowKit],
3143
+ },
3144
+ },
3145
+ {
3146
+ urls: ['portalbridge.com'],
3147
+ walletsForProvider: {
3148
+ [IInjectedProviderNames.aptos]: [
3149
+ Object.assign(Object.assign({}, basicWalletInfo['martian']), { findIconAndName({ name }) {
3150
+ var _a;
3151
+ const modal = getConnectWalletModalByTitle('div.MuiTypography-root.MuiTypography-body1.css-jeyoma-MuiTypography-root', 'Connect a wallet');
3152
+ return (_a = (modal && findIconAndNameByName(modal, name, 'auto-search-icon'))) !== null && _a !== void 0 ? _a : null;
3153
+ } }),
3154
+ ],
3155
+ },
3156
+ },
3157
+ {
3158
+ urls: ['app.aptoslaunch.io'],
3159
+ walletsForProvider: {
3160
+ [IInjectedProviderNames.aptos]: [
3161
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName(wallet) {
3162
+ return findIconAndNameByIcon(() => {
3163
+ var _a;
3164
+ return (_a = Array.from(document.querySelectorAll('img[alt="Petra icon"]')).filter((e) => isVisible(e))) === null || _a === void 0 ? void 0 : _a[0];
3165
+ }, 'auto-search-text', wallet.name);
3166
+ } }),
3167
+ ],
3168
+ },
3169
+ },
3170
+ {
3171
+ urls: ['app.animeswap.org'],
3172
+ walletsForProvider: {
3173
+ [IInjectedProviderNames.aptos]: [
3174
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName(wallet) {
3175
+ return findIconAndNameByIcon(() => {
3176
+ var _a;
3177
+ return (_a = Array.from(document.querySelectorAll('img[src*="./static/media/petra"]')).filter((e) => isVisible(e))) === null || _a === void 0 ? void 0 : _a[0];
3178
+ }, 'auto-search-text', wallet.name);
3179
+ } }),
3180
+ ],
3181
+ },
3182
+ },
3183
+ {
3184
+ urls: ['bluemove.net'],
3185
+ walletsForProvider: {
3186
+ [IInjectedProviderNames.aptos]: [
3187
+ Object.assign(Object.assign({}, basicWalletInfo['petra']), { findIconAndName({ name }) {
3188
+ var _a;
3189
+ return (_a = findIconAndNameByName(document.body, name, 'auto-search-icon')) !== null && _a !== void 0 ? _a : null;
3190
+ },
3191
+ afterUpdate(textNode, iconNode) {
3192
+ if (iconNode) {
3193
+ iconNode.style.width = '28px';
3194
+ iconNode.style.height = '28px';
3195
+ }
3196
+ } }),
3197
+ ],
3198
+ },
3199
+ },
2880
3200
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/inpage-providers-hub",
3
- "version": "2.2.15",
3
+ "version": "2.2.18",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,27 +28,27 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@onekeyfe/cross-inpage-provider-core": "2.2.15",
32
- "@onekeyfe/cross-inpage-provider-types": "2.2.15",
33
- "@onekeyfe/onekey-algo-provider": "2.2.15",
34
- "@onekeyfe/onekey-alph-provider": "2.2.15",
35
- "@onekeyfe/onekey-aptos-provider": "2.2.15",
36
- "@onekeyfe/onekey-bfc-provider": "2.2.15",
37
- "@onekeyfe/onekey-btc-provider": "2.2.15",
38
- "@onekeyfe/onekey-cardano-provider": "2.2.15",
39
- "@onekeyfe/onekey-conflux-provider": "2.2.15",
40
- "@onekeyfe/onekey-cosmos-provider": "2.2.15",
41
- "@onekeyfe/onekey-eth-provider": "2.2.15",
42
- "@onekeyfe/onekey-neo-provider": "2.2.15",
43
- "@onekeyfe/onekey-nostr-provider": "2.2.15",
44
- "@onekeyfe/onekey-polkadot-provider": "2.2.15",
45
- "@onekeyfe/onekey-private-provider": "2.2.15",
46
- "@onekeyfe/onekey-scdo-provider": "2.2.15",
47
- "@onekeyfe/onekey-solana-provider": "2.2.15",
48
- "@onekeyfe/onekey-sui-provider": "2.2.15",
49
- "@onekeyfe/onekey-ton-provider": "2.2.15",
50
- "@onekeyfe/onekey-tron-provider": "2.2.15",
51
- "@onekeyfe/onekey-webln-provider": "2.2.15",
31
+ "@onekeyfe/cross-inpage-provider-core": "2.2.18",
32
+ "@onekeyfe/cross-inpage-provider-types": "2.2.18",
33
+ "@onekeyfe/onekey-algo-provider": "2.2.18",
34
+ "@onekeyfe/onekey-alph-provider": "2.2.18",
35
+ "@onekeyfe/onekey-aptos-provider": "2.2.18",
36
+ "@onekeyfe/onekey-bfc-provider": "2.2.18",
37
+ "@onekeyfe/onekey-btc-provider": "2.2.18",
38
+ "@onekeyfe/onekey-cardano-provider": "2.2.18",
39
+ "@onekeyfe/onekey-conflux-provider": "2.2.18",
40
+ "@onekeyfe/onekey-cosmos-provider": "2.2.18",
41
+ "@onekeyfe/onekey-eth-provider": "2.2.18",
42
+ "@onekeyfe/onekey-neo-provider": "2.2.18",
43
+ "@onekeyfe/onekey-nostr-provider": "2.2.18",
44
+ "@onekeyfe/onekey-polkadot-provider": "2.2.18",
45
+ "@onekeyfe/onekey-private-provider": "2.2.18",
46
+ "@onekeyfe/onekey-scdo-provider": "2.2.18",
47
+ "@onekeyfe/onekey-solana-provider": "2.2.18",
48
+ "@onekeyfe/onekey-sui-provider": "2.2.18",
49
+ "@onekeyfe/onekey-ton-provider": "2.2.18",
50
+ "@onekeyfe/onekey-tron-provider": "2.2.18",
51
+ "@onekeyfe/onekey-webln-provider": "2.2.18",
52
52
  "lodash-es": "^4.17.21",
53
53
  "preact": "^10.25.1",
54
54
  "web3": "^1.7.3"
@@ -57,5 +57,5 @@
57
57
  "@types/lodash-es": "^4.17.12",
58
58
  "@types/node": "^20.12.7"
59
59
  },
60
- "gitHead": "4b2fffea66eb0e243ec7687dbde92758718e638c"
60
+ "gitHead": "1ce046ee55868c9e7cbaa5d22f6cfc5fbed7d1aa"
61
61
  }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const hackConnectButton_1 = require("../hackConnectButton");
4
- const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
5
- const consts_1 = require("../consts");
6
- exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
7
- urls: ['stake.lido.fi'],
8
- providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
9
- replaceMethod(options) {
10
- var _a;
11
- const replaceFunc = ({ findName, icon, text, }) => {
12
- var _a, _b;
13
- const buttons = Array.from((_b = (_a = document.querySelector('div.idjqeC')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button')) !== null && _b !== void 0 ? _b : []);
14
- const findButton = buttons.find((button) => {
15
- const span = button.querySelector('span > span > div');
16
- if (span && span.innerText === findName) {
17
- return button;
18
- }
19
- return undefined;
20
- });
21
- if (findButton) {
22
- // change button text
23
- const span = findButton.querySelector('div');
24
- if (span) {
25
- span.innerText = text;
26
- }
27
- // change icon
28
- const imgContainer = findButton.querySelector('span > span >span');
29
- if (imgContainer) {
30
- (0, hackConnectButton_1.createNewImageToContainer)({
31
- container: imgContainer,
32
- icon: icon,
33
- removeSvg: true,
34
- onCreated(img) {
35
- img.style.maxWidth = '48px';
36
- img.style.maxHeight = '48px';
37
- },
38
- });
39
- }
40
- }
41
- };
42
- if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(cross_inpage_provider_types_1.IInjectedProviderNames.ethereum)) {
43
- replaceFunc({
44
- findName: 'MetaMask',
45
- icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
46
- text: consts_1.WALLET_CONNECT_INFO.metamask.text,
47
- });
48
- replaceFunc({
49
- findName: 'WalletConnect',
50
- icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
51
- text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
52
- });
53
- }
54
- },
55
- });
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const hackConnectButton_1 = require("../hackConnectButton");
4
- const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
5
- const consts_1 = require("../consts");
6
- exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
7
- urls: ['stake.rocketpool.net'],
8
- providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
9
- replaceMethod(options) {
10
- var _a;
11
- const replaceFunc = ({ findName, icon, text, }) => {
12
- const walletBtnList = Array.from(document.querySelectorAll(`#headlessui-portal-root [role="dialog"] ul li`));
13
- for (const walletBtn of walletBtnList) {
14
- if ((walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.innerText) === findName) {
15
- const textNode = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('div span');
16
- if (textNode) {
17
- textNode.innerText = text;
18
- }
19
- const img = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('img');
20
- if (img) {
21
- img.src = icon; //keep the original size and style
22
- }
23
- }
24
- }
25
- };
26
- if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(cross_inpage_provider_types_1.IInjectedProviderNames.ethereum)) {
27
- replaceFunc({
28
- findName: 'Metamask',
29
- icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
30
- text: consts_1.WALLET_CONNECT_INFO.metamask.text,
31
- });
32
- replaceFunc({
33
- findName: 'Wallet Connect',
34
- icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
35
- text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
36
- });
37
- }
38
- },
39
- });
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const hackConnectButton_1 = require("../hackConnectButton");
7
- const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
8
- const consts_1 = require("../consts");
9
- const utilsDomNodes_1 = __importDefault(require("../utils/utilsDomNodes"));
10
- exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
11
- urls: ['app.solv.finance'],
12
- providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
13
- replaceMethod(options) {
14
- var _a;
15
- const replaceFunc = ({ findName, icon, text, }) => {
16
- const walletBtnList = Array.from(document.querySelectorAll('[role="dialog"] > div:nth-child(2).overflow-y-overlay > div > div:nth-child(2) >div'));
17
- for (const walletBtn of walletBtnList) {
18
- if ((walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.innerText) === findName) {
19
- const textNode = utilsDomNodes_1.default.findTextNode(walletBtn, findName);
20
- textNode === null || textNode === void 0 ? void 0 : textNode.replaceWith(text);
21
- const img = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector(':scope > div:nth-child(1) > span> img');
22
- if (img) {
23
- img.src = icon;
24
- img.style.width = '32px';
25
- img.style.height = '32px';
26
- img.style.minWidth = 'auto';
27
- img.style.minHeight = 'auto';
28
- }
29
- }
30
- }
31
- };
32
- if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(cross_inpage_provider_types_1.IInjectedProviderNames.ethereum)) {
33
- replaceFunc({
34
- findName: 'MetaMask',
35
- icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
36
- text: consts_1.WALLET_CONNECT_INFO.metamask.text,
37
- });
38
- replaceFunc({
39
- findName: 'Wallet Connect',
40
- icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
41
- text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
42
- });
43
- }
44
- },
45
- });
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;
@@ -1,53 +0,0 @@
1
- import { createNewImageToContainer, hackConnectButton } from '../hackConnectButton';
2
- import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
3
- import { WALLET_CONNECT_INFO } from '../consts';
4
- export default () => hackConnectButton({
5
- urls: ['stake.lido.fi'],
6
- providers: [IInjectedProviderNames.ethereum],
7
- replaceMethod(options) {
8
- var _a;
9
- const replaceFunc = ({ findName, icon, text, }) => {
10
- var _a, _b;
11
- const buttons = Array.from((_b = (_a = document.querySelector('div.idjqeC')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button')) !== null && _b !== void 0 ? _b : []);
12
- const findButton = buttons.find((button) => {
13
- const span = button.querySelector('span > span > div');
14
- if (span && span.innerText === findName) {
15
- return button;
16
- }
17
- return undefined;
18
- });
19
- if (findButton) {
20
- // change button text
21
- const span = findButton.querySelector('div');
22
- if (span) {
23
- span.innerText = text;
24
- }
25
- // change icon
26
- const imgContainer = findButton.querySelector('span > span >span');
27
- if (imgContainer) {
28
- createNewImageToContainer({
29
- container: imgContainer,
30
- icon: icon,
31
- removeSvg: true,
32
- onCreated(img) {
33
- img.style.maxWidth = '48px';
34
- img.style.maxHeight = '48px';
35
- },
36
- });
37
- }
38
- }
39
- };
40
- if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(IInjectedProviderNames.ethereum)) {
41
- replaceFunc({
42
- findName: 'MetaMask',
43
- icon: WALLET_CONNECT_INFO.metamask.icon,
44
- text: WALLET_CONNECT_INFO.metamask.text,
45
- });
46
- replaceFunc({
47
- findName: 'WalletConnect',
48
- icon: WALLET_CONNECT_INFO.walletconnect.icon,
49
- text: WALLET_CONNECT_INFO.walletconnect.text,
50
- });
51
- }
52
- },
53
- });
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;
@@ -1,37 +0,0 @@
1
- import { hackConnectButton } from '../hackConnectButton';
2
- import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
3
- import { WALLET_CONNECT_INFO } from '../consts';
4
- export default () => hackConnectButton({
5
- urls: ['stake.rocketpool.net'],
6
- providers: [IInjectedProviderNames.ethereum],
7
- replaceMethod(options) {
8
- var _a;
9
- const replaceFunc = ({ findName, icon, text, }) => {
10
- const walletBtnList = Array.from(document.querySelectorAll(`#headlessui-portal-root [role="dialog"] ul li`));
11
- for (const walletBtn of walletBtnList) {
12
- if ((walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.innerText) === findName) {
13
- const textNode = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('div span');
14
- if (textNode) {
15
- textNode.innerText = text;
16
- }
17
- const img = walletBtn === null || walletBtn === void 0 ? void 0 : walletBtn.querySelector('img');
18
- if (img) {
19
- img.src = icon; //keep the original size and style
20
- }
21
- }
22
- }
23
- };
24
- if ((_a = options === null || options === void 0 ? void 0 : options.providers) === null || _a === void 0 ? void 0 : _a.includes(IInjectedProviderNames.ethereum)) {
25
- replaceFunc({
26
- findName: 'Metamask',
27
- icon: WALLET_CONNECT_INFO.metamask.icon,
28
- text: WALLET_CONNECT_INFO.metamask.text,
29
- });
30
- replaceFunc({
31
- findName: 'Wallet Connect',
32
- icon: WALLET_CONNECT_INFO.walletconnect.icon,
33
- text: WALLET_CONNECT_INFO.walletconnect.text,
34
- });
35
- }
36
- },
37
- });
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;