@onekeyfe/inpage-providers-hub 2.2.6 → 2.2.7-alpha.0
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/hackConnectButton.js +2 -2
- package/dist/cjs/connectButtonHack/sites/aave.js +2 -2
- package/dist/cjs/connectButtonHack/universal/config.js +3 -0
- package/dist/cjs/connectButtonHack/universal/utils.js +1 -0
- package/dist/cjs/index.js +7 -0
- package/dist/connectButtonHack/hackConnectButton.d.ts +1 -1
- package/dist/connectButtonHack/hackConnectButton.js +1 -1
- package/dist/connectButtonHack/sites/aave.js +1 -1
- package/dist/connectButtonHack/universal/config.js +3 -0
- package/dist/connectButtonHack/universal/utils.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/package.json +25 -27
|
@@ -14,7 +14,7 @@ exports.createWalletConnectToButton = createWalletConnectToButton;
|
|
|
14
14
|
exports.createNewImageToContainer = createNewImageToContainer;
|
|
15
15
|
exports.hackConnectButton = hackConnectButton;
|
|
16
16
|
const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
|
|
17
|
-
const
|
|
17
|
+
const lodash_es_1 = require("lodash-es");
|
|
18
18
|
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
19
19
|
const hackButtonLogger = new cross_inpage_provider_core_1.Logger('hackButton');
|
|
20
20
|
function checkIfInjectedProviderConnected({ providerName, }) {
|
|
@@ -268,7 +268,7 @@ function hackConnectButton({ urls, replaceMethod, providers, mutationObserverOpt
|
|
|
268
268
|
// Options for the observer (which mutations to observe)
|
|
269
269
|
const config = mutationObserverOptions;
|
|
270
270
|
// Callback function to execute when mutations are observed
|
|
271
|
-
const callback = (0,
|
|
271
|
+
const callback = (0, lodash_es_1.throttle)((mutationList, observer) => {
|
|
272
272
|
setTimeout(() => {
|
|
273
273
|
var _a, _b;
|
|
274
274
|
try {
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const hackConnectButton_1 = require("../hackConnectButton");
|
|
4
4
|
const cross_inpage_provider_types_1 = require("@onekeyfe/cross-inpage-provider-types");
|
|
5
5
|
const consts_1 = require("../consts");
|
|
6
|
-
const
|
|
6
|
+
const lodash_es_1 = require("lodash-es");
|
|
7
7
|
exports.default = () => (0, hackConnectButton_1.hackConnectButton)({
|
|
8
8
|
urls: ['aave.com', 'app.aave.com', 'www.aave.com'],
|
|
9
9
|
providers: [cross_inpage_provider_types_1.IInjectedProviderNames.ethereum],
|
|
10
10
|
replaceMethod() {
|
|
11
11
|
const replaceFunc = ({ findName, findIcon, icon, text, }) => {
|
|
12
12
|
var _a;
|
|
13
|
-
const img = (0,
|
|
13
|
+
const img = (0, lodash_es_1.last)(Array.from(document.querySelectorAll(`.MuiModal-root button>span>img[src="${findIcon || ''}"]`)));
|
|
14
14
|
if (img && img.src) {
|
|
15
15
|
img.src = icon;
|
|
16
16
|
const span = (_a = img === null || img === void 0 ? void 0 : img.parentNode) === null || _a === void 0 ? void 0 : _a.previousSibling;
|
|
@@ -111,6 +111,7 @@ const petraForRainbowKit = Object.assign(Object.assign({}, exports.basicWalletIn
|
|
|
111
111
|
} });
|
|
112
112
|
exports.sitesConfig = [
|
|
113
113
|
{
|
|
114
|
+
// only: true,
|
|
114
115
|
urls: ['app.turbos.finance'],
|
|
115
116
|
testPath: [':text("I accept the")', ':text("Continue")', ':text("Connect Wallet")'],
|
|
116
117
|
walletsForProvider: {
|
|
@@ -120,6 +121,7 @@ exports.sitesConfig = [
|
|
|
120
121
|
},
|
|
121
122
|
},
|
|
122
123
|
{
|
|
124
|
+
// only: true,
|
|
123
125
|
urls: ['app.defisaver.com'],
|
|
124
126
|
testPath: ['button:text("ACCEPT")'],
|
|
125
127
|
walletsForProvider: {
|
|
@@ -134,6 +136,7 @@ exports.sitesConfig = [
|
|
|
134
136
|
},
|
|
135
137
|
},
|
|
136
138
|
{
|
|
139
|
+
// only: true,
|
|
137
140
|
urls: ['haedal.xyz'],
|
|
138
141
|
testPath: [':text("Stake Now")', ':text("Connect Wallet")'],
|
|
139
142
|
walletsForProvider: {
|
|
@@ -62,6 +62,7 @@ function isVisible(ele) {
|
|
|
62
62
|
}
|
|
63
63
|
function createWalletId(provider, updatedName) {
|
|
64
64
|
const walletId = `${provider}-${updatedName.replace(/[\s&.]/g, '').toLowerCase()}`.replace(/onekey/i, 'onekey-');
|
|
65
|
+
// data-wallet-id="ethereum-onekey-metamask"
|
|
65
66
|
const walletIdSelector = `[data-wallet-id="${walletId}"]`;
|
|
66
67
|
return {
|
|
67
68
|
walletId,
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,4 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.connectButtonData = void 0;
|
|
18
|
+
const config_1 = require("./connectButtonHack/universal/config");
|
|
19
|
+
const utils_1 = require("./connectButtonHack/universal/utils");
|
|
20
|
+
exports.connectButtonData = {
|
|
21
|
+
sitesConfig: config_1.sitesConfig,
|
|
22
|
+
createWalletId: utils_1.createWalletId,
|
|
23
|
+
};
|
|
17
24
|
__exportStar(require("./injectWeb3Provider"), exports);
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { ISpecialPropertyProviderNamesReflection, Logger, checkWalletSwitchEnable, } from '@onekeyfe/cross-inpage-provider-core';
|
|
11
|
-
import { throttle } from 'lodash';
|
|
11
|
+
import { throttle } from 'lodash-es';
|
|
12
12
|
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
13
13
|
const hackButtonLogger = new Logger('hackButton');
|
|
14
14
|
function checkIfInjectedProviderConnected({ providerName, }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hackConnectButton } from '../hackConnectButton';
|
|
2
2
|
import { IInjectedProviderNames } from '@onekeyfe/cross-inpage-provider-types';
|
|
3
3
|
import { WALLET_CONNECT_INFO } from '../consts';
|
|
4
|
-
import { last } from 'lodash';
|
|
4
|
+
import { last } from 'lodash-es';
|
|
5
5
|
export default () => hackConnectButton({
|
|
6
6
|
urls: ['aave.com', 'app.aave.com', 'www.aave.com'],
|
|
7
7
|
providers: [IInjectedProviderNames.ethereum],
|
|
@@ -105,6 +105,7 @@ const petraForRainbowKit = Object.assign(Object.assign({}, basicWalletInfo[WALLE
|
|
|
105
105
|
} });
|
|
106
106
|
export const sitesConfig = [
|
|
107
107
|
{
|
|
108
|
+
// only: true,
|
|
108
109
|
urls: ['app.turbos.finance'],
|
|
109
110
|
testPath: [':text("I accept the")', ':text("Continue")', ':text("Connect Wallet")'],
|
|
110
111
|
walletsForProvider: {
|
|
@@ -114,6 +115,7 @@ export const sitesConfig = [
|
|
|
114
115
|
},
|
|
115
116
|
},
|
|
116
117
|
{
|
|
118
|
+
// only: true,
|
|
117
119
|
urls: ['app.defisaver.com'],
|
|
118
120
|
testPath: ['button:text("ACCEPT")'],
|
|
119
121
|
walletsForProvider: {
|
|
@@ -128,6 +130,7 @@ export const sitesConfig = [
|
|
|
128
130
|
},
|
|
129
131
|
},
|
|
130
132
|
{
|
|
133
|
+
// only: true,
|
|
131
134
|
urls: ['haedal.xyz'],
|
|
132
135
|
testPath: [':text("Stake Now")', ':text("Connect Wallet")'],
|
|
133
136
|
walletsForProvider: {
|
|
@@ -50,6 +50,7 @@ export function isVisible(ele) {
|
|
|
50
50
|
}
|
|
51
51
|
export function createWalletId(provider, updatedName) {
|
|
52
52
|
const walletId = `${provider}-${updatedName.replace(/[\s&.]/g, '').toLowerCase()}`.replace(/onekey/i, 'onekey-');
|
|
53
|
+
// data-wallet-id="ethereum-onekey-metamask"
|
|
53
54
|
const walletIdSelector = `[data-wallet-id="${walletId}"]`;
|
|
54
55
|
return {
|
|
55
56
|
walletId,
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
import { createWalletId } from './connectButtonHack/universal/utils';
|
|
2
|
+
export declare const connectButtonData: {
|
|
3
|
+
sitesConfig: import("./connectButtonHack/universal/config").SitesInfo[];
|
|
4
|
+
createWalletId: typeof createWalletId;
|
|
5
|
+
};
|
|
1
6
|
export * from './injectWeb3Provider';
|
package/dist/index.js
CHANGED
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.7-alpha.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -25,38 +25,36 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prebuild": "rm -rf dist",
|
|
27
27
|
"build": "tsc && tsc --project tsconfig.cjs.json",
|
|
28
|
-
"test": "npx playwright test",
|
|
29
|
-
"test:report": "npx playwright show-report reports",
|
|
30
28
|
"start": "tsc --watch"
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {
|
|
33
|
-
"@onekeyfe/cross-inpage-provider-core": "2.2.
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-types": "2.2.
|
|
35
|
-
"@onekeyfe/onekey-algo-provider": "2.2.
|
|
36
|
-
"@onekeyfe/onekey-alph-provider": "2.2.
|
|
37
|
-
"@onekeyfe/onekey-aptos-provider": "2.2.
|
|
38
|
-
"@onekeyfe/onekey-bfc-provider": "2.2.
|
|
39
|
-
"@onekeyfe/onekey-btc-provider": "2.2.
|
|
40
|
-
"@onekeyfe/onekey-cardano-provider": "2.2.
|
|
41
|
-
"@onekeyfe/onekey-conflux-provider": "2.2.
|
|
42
|
-
"@onekeyfe/onekey-cosmos-provider": "2.2.
|
|
43
|
-
"@onekeyfe/onekey-eth-provider": "2.2.
|
|
44
|
-
"@onekeyfe/onekey-nostr-provider": "2.2.
|
|
45
|
-
"@onekeyfe/onekey-polkadot-provider": "2.2.
|
|
46
|
-
"@onekeyfe/onekey-private-provider": "2.2.
|
|
47
|
-
"@onekeyfe/onekey-scdo-provider": "2.2.
|
|
48
|
-
"@onekeyfe/onekey-solana-provider": "2.2.
|
|
49
|
-
"@onekeyfe/onekey-sui-provider": "2.2.
|
|
50
|
-
"@onekeyfe/onekey-ton-provider": "2.2.
|
|
51
|
-
"@onekeyfe/onekey-tron-provider": "2.2.
|
|
52
|
-
"@onekeyfe/onekey-webln-provider": "2.2.
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.7-alpha.0",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.7-alpha.0",
|
|
33
|
+
"@onekeyfe/onekey-algo-provider": "2.2.7-alpha.0",
|
|
34
|
+
"@onekeyfe/onekey-alph-provider": "2.2.7-alpha.0",
|
|
35
|
+
"@onekeyfe/onekey-aptos-provider": "2.2.7-alpha.0",
|
|
36
|
+
"@onekeyfe/onekey-bfc-provider": "2.2.7-alpha.0",
|
|
37
|
+
"@onekeyfe/onekey-btc-provider": "2.2.7-alpha.0",
|
|
38
|
+
"@onekeyfe/onekey-cardano-provider": "2.2.7-alpha.0",
|
|
39
|
+
"@onekeyfe/onekey-conflux-provider": "2.2.7-alpha.0",
|
|
40
|
+
"@onekeyfe/onekey-cosmos-provider": "2.2.7-alpha.0",
|
|
41
|
+
"@onekeyfe/onekey-eth-provider": "2.2.7-alpha.0",
|
|
42
|
+
"@onekeyfe/onekey-nostr-provider": "2.2.7-alpha.0",
|
|
43
|
+
"@onekeyfe/onekey-polkadot-provider": "2.2.7-alpha.0",
|
|
44
|
+
"@onekeyfe/onekey-private-provider": "2.2.7-alpha.0",
|
|
45
|
+
"@onekeyfe/onekey-scdo-provider": "2.2.7-alpha.0",
|
|
46
|
+
"@onekeyfe/onekey-solana-provider": "2.2.7-alpha.0",
|
|
47
|
+
"@onekeyfe/onekey-sui-provider": "2.2.7-alpha.0",
|
|
48
|
+
"@onekeyfe/onekey-ton-provider": "2.2.7-alpha.0",
|
|
49
|
+
"@onekeyfe/onekey-tron-provider": "2.2.7-alpha.0",
|
|
50
|
+
"@onekeyfe/onekey-webln-provider": "2.2.7-alpha.0",
|
|
51
|
+
"lodash-es": "^4.17.21",
|
|
53
52
|
"preact": "^10.25.1",
|
|
54
53
|
"web3": "^1.7.3"
|
|
55
54
|
},
|
|
56
55
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@types/node": "^20.12.7"
|
|
59
|
-
"playwright": "^1.43.1"
|
|
56
|
+
"@types/lodash-es": "^4.17.12",
|
|
57
|
+
"@types/node": "^20.12.7"
|
|
60
58
|
},
|
|
61
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "17cb98edd79ff2809b6736d253f85daa3aa8a066"
|
|
62
60
|
}
|