@onekeyfe/inpage-providers-hub 0.0.8 → 0.0.11
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.
|
@@ -21,7 +21,13 @@ function injectWeb3Provider() {
|
|
|
21
21
|
window.$onekey = $onekey;
|
|
22
22
|
// TODO conflict with MetaMask
|
|
23
23
|
window.ethereum = ethereum;
|
|
24
|
-
//
|
|
24
|
+
// ** shim or inject real web3
|
|
25
|
+
//
|
|
26
|
+
// if (!window.web3) {
|
|
27
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument
|
|
28
|
+
// window.web3 = new Web3(ethereum as any);
|
|
29
|
+
// }
|
|
30
|
+
(0, onekey_eth_provider_1.shimWeb3)(ethereum);
|
|
25
31
|
// TODO use initializeInpageProvider.ts
|
|
26
32
|
window.dispatchEvent(new Event('ethereum#initialized'));
|
|
27
33
|
return $onekey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderEthereum } from '@onekeyfe/onekey-eth-provider';
|
|
1
|
+
import { ProviderEthereum, shimWeb3 } from '@onekeyfe/onekey-eth-provider';
|
|
2
2
|
import { ProviderPrivate } from '@onekeyfe/onekey-private-provider';
|
|
3
3
|
function injectWeb3Provider() {
|
|
4
4
|
var _a, _b;
|
|
@@ -18,7 +18,13 @@ function injectWeb3Provider() {
|
|
|
18
18
|
window.$onekey = $onekey;
|
|
19
19
|
// TODO conflict with MetaMask
|
|
20
20
|
window.ethereum = ethereum;
|
|
21
|
-
//
|
|
21
|
+
// ** shim or inject real web3
|
|
22
|
+
//
|
|
23
|
+
// if (!window.web3) {
|
|
24
|
+
// // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument
|
|
25
|
+
// window.web3 = new Web3(ethereum as any);
|
|
26
|
+
// }
|
|
27
|
+
shimWeb3(ethereum);
|
|
22
28
|
// TODO use initializeInpageProvider.ts
|
|
23
29
|
window.dispatchEvent(new Event('ethereum#initialized'));
|
|
24
30
|
return $onekey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
"start": "tsc --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@onekeyfe/cross-inpage-provider-core": "^0.0.
|
|
32
|
-
"@onekeyfe/cross-inpage-provider-types": "^0.0.
|
|
33
|
-
"@onekeyfe/onekey-eth-provider": "^0.0.
|
|
34
|
-
"@onekeyfe/onekey-private-provider": "^0.0.
|
|
31
|
+
"@onekeyfe/cross-inpage-provider-core": "^0.0.11",
|
|
32
|
+
"@onekeyfe/cross-inpage-provider-types": "^0.0.11",
|
|
33
|
+
"@onekeyfe/onekey-eth-provider": "^0.0.11",
|
|
34
|
+
"@onekeyfe/onekey-private-provider": "^0.0.11",
|
|
35
|
+
"web3": "^1.7.3"
|
|
35
36
|
},
|
|
36
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "683998581e441551f80819891e7866316fa6d383"
|
|
37
38
|
}
|