@onekeyfe/inpage-providers-hub 2.2.60 → 2.2.62
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.
|
@@ -3645,4 +3645,19 @@ exports.sitesConfig = [
|
|
|
3645
3645
|
],
|
|
3646
3646
|
},
|
|
3647
3647
|
},
|
|
3648
|
+
{
|
|
3649
|
+
urls: ['app.based.one'],
|
|
3650
|
+
walletsForProvider: {
|
|
3651
|
+
[cross_inpage_provider_types_1.IInjectedProviderNames.ethereum]: [
|
|
3652
|
+
Object.assign(Object.assign({}, exports.basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
3653
|
+
var _a;
|
|
3654
|
+
const dialog = (_a = Array.from(document.querySelectorAll('[role="dialog"]')).filter((e) => (0, utils_1.isVisible)(e))) === null || _a === void 0 ? void 0 : _a[0];
|
|
3655
|
+
if (dialog) {
|
|
3656
|
+
return (0, findIconAndName_1.findIconAndNameByName)(dialog, name, 'auto-search-icon-first');
|
|
3657
|
+
}
|
|
3658
|
+
return null;
|
|
3659
|
+
} }),
|
|
3660
|
+
],
|
|
3661
|
+
},
|
|
3662
|
+
},
|
|
3648
3663
|
];
|
|
@@ -33,11 +33,17 @@ const consts_1 = require("./connectButtonHack/consts");
|
|
|
33
33
|
const detectRiskWebsite_1 = require("./detectRiskWebsite");
|
|
34
34
|
const floatingButton_1 = require("./floatingButton");
|
|
35
35
|
const hyperLiquidOneKeyWalletApi_1 = __importDefault(require("./builtInPerpInjected/hyperLiquidOneKeyWalletApi"));
|
|
36
|
+
function isMobileWeb() {
|
|
37
|
+
return (typeof navigator !== 'undefined' && /iPhone|iPad|iPod|Android|Mobi/i.test(navigator.userAgent));
|
|
38
|
+
}
|
|
36
39
|
function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
37
40
|
var _a, _b;
|
|
38
41
|
if (!((_a = window === null || window === void 0 ? void 0 : window.$onekey) === null || _a === void 0 ? void 0 : _a.jsBridge)) {
|
|
39
42
|
throw new Error('OneKey jsBridge not found.');
|
|
40
43
|
}
|
|
44
|
+
// https://github.com/Uniswap/interface/blob/55c403afe7f2f9e356d42c58180f455aa70f1a3c/apps/web/src/features/wallet/connection/hooks/useOrderedWalletConnectors.ts#L136
|
|
45
|
+
const strictInjectHostnames = isMobileWeb() ? ['app.uniswap.org'] : [];
|
|
46
|
+
const strictInjectMode = strictInjectHostnames.includes(window.location.hostname);
|
|
41
47
|
const bridge = (_b = window === null || window === void 0 ? void 0 : window.$onekey) === null || _b === void 0 ? void 0 : _b.jsBridge;
|
|
42
48
|
const builtInPerpInjectedInstance = builtInPerpInjected_1.default.createInstance();
|
|
43
49
|
if (builtInPerpInjectedInstance && (window === null || window === void 0 ? void 0 : window.$onekey)) {
|
|
@@ -120,7 +126,9 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
120
126
|
btc, btcwallet: btcWallet, algorand, neo: onekey_neo_provider_1.NEOLineN3, stellar });
|
|
121
127
|
(0, cross_inpage_provider_core_1.defineWindowProperty)('$onekey', $onekey, { enumerable: true, alwaysInject: true });
|
|
122
128
|
if (!(0, cross_inpage_provider_core_1.isOneKeyWebsite)()) {
|
|
123
|
-
(
|
|
129
|
+
if (!strictInjectMode) {
|
|
130
|
+
(0, cross_inpage_provider_core_1.defineWindowProperty)('ethereum', ethereum);
|
|
131
|
+
}
|
|
124
132
|
}
|
|
125
133
|
// OneKey Ethereum EIP6963 Provider
|
|
126
134
|
(0, onekey_eth_provider_1.registerEIP6963Provider)({
|
|
@@ -208,22 +216,24 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
208
216
|
(0, onekey_solana_provider_1.registerSolanaWallet)(solana, {
|
|
209
217
|
icon: consts_1.WALLET_CONNECT_INFO.onekey.icon,
|
|
210
218
|
});
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
if (!strictInjectMode) {
|
|
220
|
+
(0, onekey_solana_provider_1.registerSolanaWallet)(solana, {
|
|
221
|
+
icon: consts_1.WALLET_CONNECT_INFO.solflare.icon,
|
|
222
|
+
name: 'Solflare',
|
|
223
|
+
});
|
|
224
|
+
(0, onekey_solana_provider_1.registerSolanaWallet)(solana, {
|
|
225
|
+
icon: consts_1.WALLET_CONNECT_INFO.jupiter.icon,
|
|
226
|
+
name: 'Jupiter',
|
|
227
|
+
});
|
|
228
|
+
(0, onekey_solana_provider_1.registerSolanaWallet)(solana, {
|
|
229
|
+
icon: consts_1.WALLET_CONNECT_INFO.metamask.icon,
|
|
230
|
+
name: 'MetaMask',
|
|
231
|
+
});
|
|
232
|
+
(0, onekey_solana_provider_1.registerSolanaWallet)(solana, {
|
|
233
|
+
icon: consts_1.WALLET_CONNECT_INFO.backpack.icon,
|
|
234
|
+
name: 'Backpack',
|
|
235
|
+
});
|
|
236
|
+
}
|
|
227
237
|
// OneKey Sui Standard Wallet
|
|
228
238
|
(0, onekey_sui_provider_1.registerSuiWallet)(sui, {
|
|
229
239
|
logo: consts_1.WALLET_CONNECT_INFO.onekey.icon,
|
|
@@ -3639,4 +3639,19 @@ export const sitesConfig = [
|
|
|
3639
3639
|
],
|
|
3640
3640
|
},
|
|
3641
3641
|
},
|
|
3642
|
+
{
|
|
3643
|
+
urls: ['app.based.one'],
|
|
3644
|
+
walletsForProvider: {
|
|
3645
|
+
[IInjectedProviderNames.ethereum]: [
|
|
3646
|
+
Object.assign(Object.assign({}, basicWalletInfo['metamask']), { findIconAndName({ name }) {
|
|
3647
|
+
var _a;
|
|
3648
|
+
const dialog = (_a = Array.from(document.querySelectorAll('[role="dialog"]')).filter((e) => isVisible(e))) === null || _a === void 0 ? void 0 : _a[0];
|
|
3649
|
+
if (dialog) {
|
|
3650
|
+
return findIconAndNameByName(dialog, name, 'auto-search-icon-first');
|
|
3651
|
+
}
|
|
3652
|
+
return null;
|
|
3653
|
+
} }),
|
|
3654
|
+
],
|
|
3655
|
+
},
|
|
3656
|
+
},
|
|
3642
3657
|
];
|
|
@@ -27,11 +27,17 @@ import { WALLET_CONNECT_INFO } from './connectButtonHack/consts';
|
|
|
27
27
|
import { detectWebsiteRiskLevel, listenPageFocus } from './detectRiskWebsite';
|
|
28
28
|
import { injectFloatingButton } from './floatingButton';
|
|
29
29
|
import hyperLiquidOneKeyWalletApi from './builtInPerpInjected/hyperLiquidOneKeyWalletApi';
|
|
30
|
+
function isMobileWeb() {
|
|
31
|
+
return (typeof navigator !== 'undefined' && /iPhone|iPad|iPod|Android|Mobi/i.test(navigator.userAgent));
|
|
32
|
+
}
|
|
30
33
|
function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
31
34
|
var _a, _b;
|
|
32
35
|
if (!((_a = window === null || window === void 0 ? void 0 : window.$onekey) === null || _a === void 0 ? void 0 : _a.jsBridge)) {
|
|
33
36
|
throw new Error('OneKey jsBridge not found.');
|
|
34
37
|
}
|
|
38
|
+
// https://github.com/Uniswap/interface/blob/55c403afe7f2f9e356d42c58180f455aa70f1a3c/apps/web/src/features/wallet/connection/hooks/useOrderedWalletConnectors.ts#L136
|
|
39
|
+
const strictInjectHostnames = isMobileWeb() ? ['app.uniswap.org'] : [];
|
|
40
|
+
const strictInjectMode = strictInjectHostnames.includes(window.location.hostname);
|
|
35
41
|
const bridge = (_b = window === null || window === void 0 ? void 0 : window.$onekey) === null || _b === void 0 ? void 0 : _b.jsBridge;
|
|
36
42
|
const builtInPerpInjectedInstance = builtInPerpInjected.createInstance();
|
|
37
43
|
if (builtInPerpInjectedInstance && (window === null || window === void 0 ? void 0 : window.$onekey)) {
|
|
@@ -114,7 +120,9 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
114
120
|
btc, btcwallet: btcWallet, algorand, neo: NEOLineN3, stellar });
|
|
115
121
|
defineWindowProperty('$onekey', $onekey, { enumerable: true, alwaysInject: true });
|
|
116
122
|
if (!isOneKeyWebsite()) {
|
|
117
|
-
|
|
123
|
+
if (!strictInjectMode) {
|
|
124
|
+
defineWindowProperty('ethereum', ethereum);
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
127
|
// OneKey Ethereum EIP6963 Provider
|
|
120
128
|
registerEIP6963Provider({
|
|
@@ -202,22 +210,24 @@ function injectWeb3Provider({ showFloatingButton = false, } = {}) {
|
|
|
202
210
|
registerSolanaWallet(solana, {
|
|
203
211
|
icon: WALLET_CONNECT_INFO.onekey.icon,
|
|
204
212
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
if (!strictInjectMode) {
|
|
214
|
+
registerSolanaWallet(solana, {
|
|
215
|
+
icon: WALLET_CONNECT_INFO.solflare.icon,
|
|
216
|
+
name: 'Solflare',
|
|
217
|
+
});
|
|
218
|
+
registerSolanaWallet(solana, {
|
|
219
|
+
icon: WALLET_CONNECT_INFO.jupiter.icon,
|
|
220
|
+
name: 'Jupiter',
|
|
221
|
+
});
|
|
222
|
+
registerSolanaWallet(solana, {
|
|
223
|
+
icon: WALLET_CONNECT_INFO.metamask.icon,
|
|
224
|
+
name: 'MetaMask',
|
|
225
|
+
});
|
|
226
|
+
registerSolanaWallet(solana, {
|
|
227
|
+
icon: WALLET_CONNECT_INFO.backpack.icon,
|
|
228
|
+
name: 'Backpack',
|
|
229
|
+
});
|
|
230
|
+
}
|
|
221
231
|
// OneKey Sui Standard Wallet
|
|
222
232
|
registerSuiWallet(sui, {
|
|
223
233
|
logo: WALLET_CONNECT_INFO.onekey.icon,
|
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.62",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -27,28 +27,28 @@
|
|
|
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-stellar-provider": "2.2.
|
|
48
|
-
"@onekeyfe/onekey-sui-provider": "2.2.
|
|
49
|
-
"@onekeyfe/onekey-ton-provider": "2.2.
|
|
50
|
-
"@onekeyfe/onekey-tron-provider": "2.2.
|
|
51
|
-
"@onekeyfe/onekey-webln-provider": "2.2.
|
|
30
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.62",
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.62",
|
|
32
|
+
"@onekeyfe/onekey-algo-provider": "2.2.62",
|
|
33
|
+
"@onekeyfe/onekey-alph-provider": "2.2.62",
|
|
34
|
+
"@onekeyfe/onekey-aptos-provider": "2.2.62",
|
|
35
|
+
"@onekeyfe/onekey-bfc-provider": "2.2.62",
|
|
36
|
+
"@onekeyfe/onekey-btc-provider": "2.2.62",
|
|
37
|
+
"@onekeyfe/onekey-cardano-provider": "2.2.62",
|
|
38
|
+
"@onekeyfe/onekey-conflux-provider": "2.2.62",
|
|
39
|
+
"@onekeyfe/onekey-cosmos-provider": "2.2.62",
|
|
40
|
+
"@onekeyfe/onekey-eth-provider": "2.2.62",
|
|
41
|
+
"@onekeyfe/onekey-neo-provider": "2.2.62",
|
|
42
|
+
"@onekeyfe/onekey-nostr-provider": "2.2.62",
|
|
43
|
+
"@onekeyfe/onekey-polkadot-provider": "2.2.62",
|
|
44
|
+
"@onekeyfe/onekey-private-provider": "2.2.62",
|
|
45
|
+
"@onekeyfe/onekey-scdo-provider": "2.2.62",
|
|
46
|
+
"@onekeyfe/onekey-solana-provider": "2.2.62",
|
|
47
|
+
"@onekeyfe/onekey-stellar-provider": "2.2.62",
|
|
48
|
+
"@onekeyfe/onekey-sui-provider": "2.2.62",
|
|
49
|
+
"@onekeyfe/onekey-ton-provider": "2.2.62",
|
|
50
|
+
"@onekeyfe/onekey-tron-provider": "2.2.62",
|
|
51
|
+
"@onekeyfe/onekey-webln-provider": "2.2.62",
|
|
52
52
|
"cipher-base": "^1.0.6",
|
|
53
53
|
"lodash-es": "^4.17.21",
|
|
54
54
|
"preact": "^10.25.1"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"@types/lodash-es": "^4.17.12",
|
|
58
58
|
"@types/node": "^20.12.7"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "a4d24178035601f87fc68590bc83f8faab37a464"
|
|
61
61
|
}
|