@onekeyfe/inpage-providers-hub 2.2.48 → 2.2.50
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/index.js +0 -2
- package/dist/cjs/connectButtonHack/universal/config.js +16 -0
- package/dist/cjs/injectWeb3Provider.js +1 -1
- package/dist/connectButtonHack/index.js +0 -2
- package/dist/connectButtonHack/universal/config.js +16 -0
- package/dist/injectWeb3Provider.js +1 -1
- package/package.json +23 -23
- package/dist/cjs/connectButtonHack/sites/uniswap.js +0 -37
- package/dist/connectButtonHack/sites/uniswap.d.ts +0 -2
- package/dist/connectButtonHack/sites/uniswap.js +0 -35
|
@@ -10,7 +10,6 @@ const opensea_1 = __importDefault(require("./sites/opensea"));
|
|
|
10
10
|
const magiceden_1 = __importDefault(require("./sites/magiceden"));
|
|
11
11
|
const gem_1 = __importDefault(require("./sites/gem"));
|
|
12
12
|
const rarible_1 = __importDefault(require("./sites/rarible"));
|
|
13
|
-
const uniswap_1 = __importDefault(require("./sites/uniswap"));
|
|
14
13
|
const sushi_1 = __importDefault(require("./sites/sushi"));
|
|
15
14
|
const _1inch_1 = __importDefault(require("./sites/1inch"));
|
|
16
15
|
const dydx_1 = __importDefault(require("./sites/dydx"));
|
|
@@ -49,7 +48,6 @@ function hackAllConnectButtons() {
|
|
|
49
48
|
(0, magiceden_1.default)();
|
|
50
49
|
(0, gem_1.default)();
|
|
51
50
|
(0, rarible_1.default)();
|
|
52
|
-
(0, uniswap_1.default)();
|
|
53
51
|
(0, sushi_1.default)();
|
|
54
52
|
(0, _1inch_1.default)();
|
|
55
53
|
(0, dydx_1.default)();
|
|
@@ -3553,4 +3553,20 @@ exports.sitesConfig = [
|
|
|
3553
3553
|
],
|
|
3554
3554
|
},
|
|
3555
3555
|
},
|
|
3556
|
+
{
|
|
3557
|
+
urls: ['app.uniswap.org'],
|
|
3558
|
+
walletsForProvider: {
|
|
3559
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
3560
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['walletconnect']), { container: 'div[data-testid="option-grid"]' }),
|
|
3561
|
+
],
|
|
3562
|
+
},
|
|
3563
|
+
},
|
|
3564
|
+
{
|
|
3565
|
+
urls: ['monadvision.com'],
|
|
3566
|
+
walletsForProvider: {
|
|
3567
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
3568
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { container: () => (0, utils_1.getConnectWalletModalByTitle)('div section', 'Connect Wallet') }),
|
|
3569
|
+
],
|
|
3570
|
+
},
|
|
3571
|
+
},
|
|
3556
3572
|
];
|
|
@@ -244,7 +244,7 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
244
244
|
if ((0, cross_inpage_provider_core_1.checkWalletSwitchEnable)()) {
|
|
245
245
|
(0, onekey_sui_provider_1.registerSuiWallet)(sui, {
|
|
246
246
|
name: 'Sui Wallet',
|
|
247
|
-
logo: consts_1.WALLET_CONNECT_INFO.
|
|
247
|
+
logo: consts_1.WALLET_CONNECT_INFO.suiwallet.icon,
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
if ((0, cross_inpage_provider_core_1.checkWalletSwitchEnable)()) {
|
|
@@ -4,7 +4,6 @@ import openSea from './sites/opensea';
|
|
|
4
4
|
import magiceden from './sites/magiceden';
|
|
5
5
|
import gem from './sites/gem';
|
|
6
6
|
import rarible from './sites/rarible';
|
|
7
|
-
import uniswap from './sites/uniswap';
|
|
8
7
|
import sushi from './sites/sushi';
|
|
9
8
|
import _1inch from './sites/1inch';
|
|
10
9
|
import dydx from './sites/dydx';
|
|
@@ -43,7 +42,6 @@ function hackAllConnectButtons() {
|
|
|
43
42
|
magiceden();
|
|
44
43
|
gem();
|
|
45
44
|
rarible();
|
|
46
|
-
uniswap();
|
|
47
45
|
sushi();
|
|
48
46
|
_1inch();
|
|
49
47
|
dydx();
|
|
@@ -3547,4 +3547,20 @@ export const sitesConfig = [
|
|
|
3547
3547
|
],
|
|
3548
3548
|
},
|
|
3549
3549
|
},
|
|
3550
|
+
{
|
|
3551
|
+
urls: ['app.uniswap.org'],
|
|
3552
|
+
walletsForProvider: {
|
|
3553
|
+
[IInjectedProviderNames.ethereum]: [
|
|
3554
|
+
Object.assign(Object.assign({}, basicWalletInfo['walletconnect']), { container: 'div[data-testid="option-grid"]' }),
|
|
3555
|
+
],
|
|
3556
|
+
},
|
|
3557
|
+
},
|
|
3558
|
+
{
|
|
3559
|
+
urls: ['monadvision.com'],
|
|
3560
|
+
walletsForProvider: {
|
|
3561
|
+
[IInjectedProviderNames.ethereum]: [
|
|
3562
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { container: () => getConnectWalletModalByTitle('div section', 'Connect Wallet') }),
|
|
3563
|
+
],
|
|
3564
|
+
},
|
|
3565
|
+
},
|
|
3550
3566
|
];
|
|
@@ -238,7 +238,7 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
238
238
|
if (checkWalletSwitchEnable()) {
|
|
239
239
|
registerSuiWallet(sui, {
|
|
240
240
|
name: 'Sui Wallet',
|
|
241
|
-
logo: WALLET_CONNECT_INFO.
|
|
241
|
+
logo: WALLET_CONNECT_INFO.suiwallet.icon,
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
if (checkWalletSwitchEnable()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.50",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -27,27 +27,27 @@
|
|
|
27
27
|
"start": "tsc --watch"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@onekeyfe/cross-inpage-provider-core": "2.2.
|
|
31
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
32
|
-
"@onekeyfe/onekey-algo-provider": "2.2.
|
|
33
|
-
"@onekeyfe/onekey-alph-provider": "2.2.
|
|
34
|
-
"@onekeyfe/onekey-aptos-provider": "2.2.
|
|
35
|
-
"@onekeyfe/onekey-bfc-provider": "2.2.
|
|
36
|
-
"@onekeyfe/onekey-btc-provider": "2.2.
|
|
37
|
-
"@onekeyfe/onekey-cardano-provider": "2.2.
|
|
38
|
-
"@onekeyfe/onekey-conflux-provider": "2.2.
|
|
39
|
-
"@onekeyfe/onekey-cosmos-provider": "2.2.
|
|
40
|
-
"@onekeyfe/onekey-eth-provider": "2.2.
|
|
41
|
-
"@onekeyfe/onekey-neo-provider": "2.2.
|
|
42
|
-
"@onekeyfe/onekey-nostr-provider": "2.2.
|
|
43
|
-
"@onekeyfe/onekey-polkadot-provider": "2.2.
|
|
44
|
-
"@onekeyfe/onekey-private-provider": "2.2.
|
|
45
|
-
"@onekeyfe/onekey-scdo-provider": "2.2.
|
|
46
|
-
"@onekeyfe/onekey-solana-provider": "2.2.
|
|
47
|
-
"@onekeyfe/onekey-sui-provider": "2.2.
|
|
48
|
-
"@onekeyfe/onekey-ton-provider": "2.2.
|
|
49
|
-
"@onekeyfe/onekey-tron-provider": "2.2.
|
|
50
|
-
"@onekeyfe/onekey-webln-provider": "2.2.
|
|
30
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.50",
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.50",
|
|
32
|
+
"@onekeyfe/onekey-algo-provider": "2.2.50",
|
|
33
|
+
"@onekeyfe/onekey-alph-provider": "2.2.50",
|
|
34
|
+
"@onekeyfe/onekey-aptos-provider": "2.2.50",
|
|
35
|
+
"@onekeyfe/onekey-bfc-provider": "2.2.50",
|
|
36
|
+
"@onekeyfe/onekey-btc-provider": "2.2.50",
|
|
37
|
+
"@onekeyfe/onekey-cardano-provider": "2.2.50",
|
|
38
|
+
"@onekeyfe/onekey-conflux-provider": "2.2.50",
|
|
39
|
+
"@onekeyfe/onekey-cosmos-provider": "2.2.50",
|
|
40
|
+
"@onekeyfe/onekey-eth-provider": "2.2.50",
|
|
41
|
+
"@onekeyfe/onekey-neo-provider": "2.2.50",
|
|
42
|
+
"@onekeyfe/onekey-nostr-provider": "2.2.50",
|
|
43
|
+
"@onekeyfe/onekey-polkadot-provider": "2.2.50",
|
|
44
|
+
"@onekeyfe/onekey-private-provider": "2.2.50",
|
|
45
|
+
"@onekeyfe/onekey-scdo-provider": "2.2.50",
|
|
46
|
+
"@onekeyfe/onekey-solana-provider": "2.2.50",
|
|
47
|
+
"@onekeyfe/onekey-sui-provider": "2.2.50",
|
|
48
|
+
"@onekeyfe/onekey-ton-provider": "2.2.50",
|
|
49
|
+
"@onekeyfe/onekey-tron-provider": "2.2.50",
|
|
50
|
+
"@onekeyfe/onekey-webln-provider": "2.2.50",
|
|
51
51
|
"cipher-base": "^1.0.6",
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
53
53
|
"preact": "^10.25.1"
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@types/lodash-es": "^4.17.12",
|
|
57
57
|
"@types/node": "^20.12.7"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "b398f35fa81e8203d81f8cfc6f01323ba1c2f0ce"
|
|
60
60
|
}
|
|
@@ -1,37 +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: ['uniswap.org', 'app.uniswap.org', 'www.uniswap.org'],
|
|
8
|
-
providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
|
|
9
|
-
replaceMethod() {
|
|
10
|
-
const replaceFunc = ({ findName, icon, text, }) => {
|
|
11
|
-
const buttonList = Array.from(document.querySelectorAll('div[data-testid=wallet-modal] div[data-testid=option-grid] button'));
|
|
12
|
-
const btn = buttonList.find((item) => item.innerHTML.includes(findName));
|
|
13
|
-
const span = btn === null || btn === void 0 ? void 0 : btn.querySelector('div > div');
|
|
14
|
-
const textNode = Array.from((span === null || span === void 0 ? void 0 : span.childNodes) || []).find((item) => {
|
|
15
|
-
var _a;
|
|
16
|
-
return (_a = item === null || item === void 0 ? void 0 : item.nodeValue) === null || _a === void 0 ? void 0 : _a.includes(findName);
|
|
17
|
-
});
|
|
18
|
-
if (textNode) {
|
|
19
|
-
textNode.nodeValue = text;
|
|
20
|
-
}
|
|
21
|
-
const img = btn === null || btn === void 0 ? void 0 : btn.querySelector('img');
|
|
22
|
-
if (img && img.src) {
|
|
23
|
-
img.src = icon;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
replaceFunc({
|
|
27
|
-
findName: 'MetaMask',
|
|
28
|
-
icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
|
|
29
|
-
text: consts_1.WALLET_CONNECT_INFO.metamask.text,
|
|
30
|
-
});
|
|
31
|
-
replaceFunc({
|
|
32
|
-
findName: 'WalletConnect',
|
|
33
|
-
icon: consts_1.WALLET_CONNECT_INFO.walletconnect.icon,
|
|
34
|
-
text: consts_1.WALLET_CONNECT_INFO.walletconnect.text,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
});
|
|
@@ -1,35 +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: ['uniswap.org', 'app.uniswap.org', 'www.uniswap.org'],
|
|
6
|
-
providers: [IInjectedProviderNames.ethereum],
|
|
7
|
-
replaceMethod() {
|
|
8
|
-
const replaceFunc = ({ findName, icon, text, }) => {
|
|
9
|
-
const buttonList = Array.from(document.querySelectorAll('div[data-testid=wallet-modal] div[data-testid=option-grid] button'));
|
|
10
|
-
const btn = buttonList.find((item) => item.innerHTML.includes(findName));
|
|
11
|
-
const span = btn === null || btn === void 0 ? void 0 : btn.querySelector('div > div');
|
|
12
|
-
const textNode = Array.from((span === null || span === void 0 ? void 0 : span.childNodes) || []).find((item) => {
|
|
13
|
-
var _a;
|
|
14
|
-
return (_a = item === null || item === void 0 ? void 0 : item.nodeValue) === null || _a === void 0 ? void 0 : _a.includes(findName);
|
|
15
|
-
});
|
|
16
|
-
if (textNode) {
|
|
17
|
-
textNode.nodeValue = text;
|
|
18
|
-
}
|
|
19
|
-
const img = btn === null || btn === void 0 ? void 0 : btn.querySelector('img');
|
|
20
|
-
if (img && img.src) {
|
|
21
|
-
img.src = icon;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
replaceFunc({
|
|
25
|
-
findName: 'MetaMask',
|
|
26
|
-
icon: WALLET_CONNECT_INFO.metamask.icon,
|
|
27
|
-
text: WALLET_CONNECT_INFO.metamask.text,
|
|
28
|
-
});
|
|
29
|
-
replaceFunc({
|
|
30
|
-
findName: 'WalletConnect',
|
|
31
|
-
icon: WALLET_CONNECT_INFO.walletconnect.icon,
|
|
32
|
-
text: WALLET_CONNECT_INFO.walletconnect.text,
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
});
|