@subwallet/extension-inject 1.2.14-0 → 1.2.16-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/bundle.js CHANGED
@@ -36,15 +36,20 @@ export function injectEvmExtension(evmProvider) {
36
36
  // Provider has been initialized in direct mode
37
37
  windowInject.SubWallet = evmProvider;
38
38
  }
39
+ if (!windowInject.ethereum) {
40
+ windowInject.ethereum = evmProvider;
41
+ windowInject.dispatchEvent(new Event('ethereum#initialized'));
42
+ }
39
43
  windowInject.dispatchEvent(new Event('subwallet#initialized'));
40
44
 
41
- // Publish to global if window.ethereum is not available
42
- windowInject.addEventListener('load', () => {
43
- if (!windowInject.ethereum) {
44
- windowInject.ethereum = evmProvider;
45
- windowInject.dispatchEvent(new Event('ethereum#initialized'));
46
- }
47
- });
45
+ // // Publish to global if window.ethereum is not available
46
+ // windowInject.addEventListener('load', () => {
47
+ // if (!windowInject.ethereum) {
48
+ // windowInject.ethereum = evmProvider;
49
+ // windowInject.dispatchEvent(new Event('ethereum#initialized'));
50
+ // }
51
+ // });
52
+
48
53
  inject6963EIP(evmProvider);
49
54
  }
50
55
  export const eip6963ProviderInfo = {
package/cjs/bundle.js CHANGED
@@ -50,15 +50,20 @@ function injectEvmExtension(evmProvider) {
50
50
  // Provider has been initialized in direct mode
51
51
  windowInject.SubWallet = evmProvider;
52
52
  }
53
+ if (!windowInject.ethereum) {
54
+ windowInject.ethereum = evmProvider;
55
+ windowInject.dispatchEvent(new Event('ethereum#initialized'));
56
+ }
53
57
  windowInject.dispatchEvent(new Event('subwallet#initialized'));
54
58
 
55
- // Publish to global if window.ethereum is not available
56
- windowInject.addEventListener('load', () => {
57
- if (!windowInject.ethereum) {
58
- windowInject.ethereum = evmProvider;
59
- windowInject.dispatchEvent(new Event('ethereum#initialized'));
60
- }
61
- });
59
+ // // Publish to global if window.ethereum is not available
60
+ // windowInject.addEventListener('load', () => {
61
+ // if (!windowInject.ethereum) {
62
+ // windowInject.ethereum = evmProvider;
63
+ // windowInject.dispatchEvent(new Event('ethereum#initialized'));
64
+ // }
65
+ // });
66
+
62
67
  inject6963EIP(evmProvider);
63
68
  }
64
69
  const eip6963ProviderInfo = {
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-inject',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.2.14-0'
16
+ version: '1.2.16-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "sideEffects": true,
16
16
  "type": "module",
17
- "version": "1.2.14-0",
17
+ "version": "1.2.16-0",
18
18
  "main": "./cjs/index.js",
19
19
  "module": "./index.js",
20
20
  "types": "./index.d.ts",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-inject',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.2.14-0'
10
+ version: '1.2.16-0'
11
11
  };