@onekeyfe/inpage-providers-hub 1.0.2 → 1.0.4

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.
@@ -46,7 +46,15 @@ function injectWeb3Provider() {
46
46
  window.starcoin = starcoin;
47
47
  // ** Aptos
48
48
  window.aptos = martian;
49
- window.martian = martian;
49
+ window.martian = new Proxy(martian, {
50
+ get: (target, property, ...args) => {
51
+ if (property === 'aptosProviderType') {
52
+ return 'martian';
53
+ }
54
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
55
+ return Reflect.get(target, property, ...args);
56
+ },
57
+ });
50
58
  // ** shim or inject real web3
51
59
  //
52
60
  // if (!window.web3) {
@@ -43,7 +43,15 @@ function injectWeb3Provider() {
43
43
  window.starcoin = starcoin;
44
44
  // ** Aptos
45
45
  window.aptos = martian;
46
- window.martian = martian;
46
+ window.martian = new Proxy(martian, {
47
+ get: (target, property, ...args) => {
48
+ if (property === 'aptosProviderType') {
49
+ return 'martian';
50
+ }
51
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
52
+ return Reflect.get(target, property, ...args);
53
+ },
54
+ });
47
55
  // ** shim or inject real web3
48
56
  //
49
57
  // if (!window.web3) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/inpage-providers-hub",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,14 +28,14 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@onekeyfe/cross-inpage-provider-core": "1.0.2",
32
- "@onekeyfe/cross-inpage-provider-types": "1.0.2",
33
- "@onekeyfe/onekey-aptos-provider": "1.0.2",
34
- "@onekeyfe/onekey-eth-provider": "1.0.2",
35
- "@onekeyfe/onekey-private-provider": "1.0.2",
36
- "@onekeyfe/onekey-solana-provider": "1.0.2",
37
- "@onekeyfe/onekey-starcoin-provider": "1.0.2",
31
+ "@onekeyfe/cross-inpage-provider-core": "1.0.4",
32
+ "@onekeyfe/cross-inpage-provider-types": "1.0.4",
33
+ "@onekeyfe/onekey-aptos-provider": "1.0.4",
34
+ "@onekeyfe/onekey-eth-provider": "1.0.4",
35
+ "@onekeyfe/onekey-private-provider": "1.0.4",
36
+ "@onekeyfe/onekey-solana-provider": "1.0.4",
37
+ "@onekeyfe/onekey-starcoin-provider": "1.0.4",
38
38
  "web3": "^1.7.3"
39
39
  },
40
- "gitHead": "3d3af2ad5ed8ad82a22f6a80b162b26a85896fa0"
40
+ "gitHead": "181eadaef7b895a89080f26991170c6ec835ae35"
41
41
  }