@subwallet/extension-inject 0.4.8-0 → 0.5.1
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 +8 -1
- package/cjs/bundle.js +8 -1
- package/cjs/packageInfo.js +1 -1
- package/package.json +8 -8
- package/packageInfo.js +1 -1
- package/types.d.ts +1 -0
package/bundle.js
CHANGED
|
@@ -23,7 +23,14 @@ export function injectEvmExtension(evmProvider) {
|
|
|
23
23
|
// small helper with the typescript types, just cast window
|
|
24
24
|
const windowInject = window; // add our enable function
|
|
25
25
|
|
|
26
|
-
windowInject.SubWallet
|
|
26
|
+
if (windowInject.SubWallet) {
|
|
27
|
+
// Provider has been initialized in proxy mode
|
|
28
|
+
windowInject.SubWallet.provider = evmProvider;
|
|
29
|
+
} else {
|
|
30
|
+
// Provider has been initialized in direct mode
|
|
31
|
+
windowInject.SubWallet = evmProvider;
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
windowInject.dispatchEvent(new Event('subwallet#initialized')); // Publish to global if window.ethereum is not available
|
|
28
35
|
|
|
29
36
|
windowInject.addEventListener('load', () => {
|
package/cjs/bundle.js
CHANGED
|
@@ -40,7 +40,14 @@ function injectEvmExtension(evmProvider) {
|
|
|
40
40
|
// small helper with the typescript types, just cast window
|
|
41
41
|
const windowInject = window; // add our enable function
|
|
42
42
|
|
|
43
|
-
windowInject.SubWallet
|
|
43
|
+
if (windowInject.SubWallet) {
|
|
44
|
+
// Provider has been initialized in proxy mode
|
|
45
|
+
windowInject.SubWallet.provider = evmProvider;
|
|
46
|
+
} else {
|
|
47
|
+
// Provider has been initialized in direct mode
|
|
48
|
+
windowInject.SubWallet = evmProvider;
|
|
49
|
+
}
|
|
50
|
+
|
|
44
51
|
windowInject.dispatchEvent(new Event('subwallet#initialized')); // Publish to global if window.ethereum is not available
|
|
45
52
|
|
|
46
53
|
windowInject.addEventListener('load', () => {
|
package/cjs/packageInfo.js
CHANGED
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": true,
|
|
16
16
|
"type": "module",
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.5.1",
|
|
18
18
|
"main": "./cjs/index.js",
|
|
19
19
|
"module": "./index.js",
|
|
20
20
|
"types": "./index.d.ts",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@babel/runtime": "^7.
|
|
73
|
-
"@polkadot/rpc-provider": "^
|
|
74
|
-
"@polkadot/types": "^
|
|
75
|
-
"@polkadot/util": "^
|
|
76
|
-
"@polkadot/util-crypto": "^
|
|
77
|
-
"@polkadot/x-global": "^
|
|
78
|
-
"web3-core": "^1.7.
|
|
72
|
+
"@babel/runtime": "^7.18.6",
|
|
73
|
+
"@polkadot/rpc-provider": "^8.11.3",
|
|
74
|
+
"@polkadot/types": "^8.11.3",
|
|
75
|
+
"@polkadot/util": "^9.7.2",
|
|
76
|
+
"@polkadot/util-crypto": "^9.7.2",
|
|
77
|
+
"@polkadot/x-global": "^9.7.2",
|
|
78
|
+
"web3-core": "^1.7.4"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@polkadot/api": "*"
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@subwallet/extension-inject',
|
|
6
6
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
7
7
|
type: 'esm',
|
|
8
|
-
version: '0.
|
|
8
|
+
version: '0.5.1'
|
|
9
9
|
};
|