@onekeyfe/onekey-private-provider 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
@@ -33,12 +33,12 @@ class ProviderPrivate extends ProviderBase {
33
33
  const walletInfoLocalStr = localStorage.getItem(WALLET_INFO_LOACAL_KEY_V5);
34
34
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
35
35
  const walletInfoLocal = walletInfoLocalStr ? JSON.parse(walletInfoLocalStr) : null;
36
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
37
- if (!walletInfoLocal || (walletInfoLocal && walletInfoLocal.platformEnv.isExtension)) {
38
- this.on(PROVIDER_EVENTS.message_low_level, (payload) => {
39
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
40
- const { method, params } = payload;
41
- if (method === METHODS.wallet_events_ext_switch_changed) {
36
+ this.on(PROVIDER_EVENTS.message_low_level, (payload) => {
37
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
38
+ const { method, params } = payload;
39
+ if (method === METHODS.wallet_events_ext_switch_changed) {
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
41
+ if (!walletInfoLocal || (walletInfoLocal && walletInfoLocal.platformEnv.isExtension)) {
42
42
  try {
43
43
  localStorage.setItem(WALLET_INFO_LOACAL_KEY_V5, JSON.stringify(params));
44
44
  this.notifyDefaultWalletChanged(params);
@@ -47,12 +47,11 @@ class ProviderPrivate extends ProviderBase {
47
47
  console.error(e);
48
48
  }
49
49
  }
50
- else if (method === METHODS.wallet_events_dapp_network_changed) {
51
- console.log('=====>METHODS.wallet_events_dapp_network_changed');
52
- this.notifyNetworkChanged(params);
53
- }
54
- });
55
- }
50
+ }
51
+ else if (method === METHODS.wallet_events_dapp_network_changed) {
52
+ this.notifyNetworkChanged(params);
53
+ }
54
+ });
56
55
  }
57
56
  catch (e) {
58
57
  console.error(e);
@@ -36,12 +36,12 @@ class ProviderPrivate extends cross_inpage_provider_core_1.ProviderBase {
36
36
  const walletInfoLocalStr = localStorage.getItem(WALLET_INFO_LOACAL_KEY_V5);
37
37
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
38
38
  const walletInfoLocal = walletInfoLocalStr ? JSON.parse(walletInfoLocalStr) : null;
39
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
40
- if (!walletInfoLocal || (walletInfoLocal && walletInfoLocal.platformEnv.isExtension)) {
41
- this.on(PROVIDER_EVENTS.message_low_level, (payload) => {
42
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
43
- const { method, params } = payload;
44
- if (method === METHODS.wallet_events_ext_switch_changed) {
39
+ this.on(PROVIDER_EVENTS.message_low_level, (payload) => {
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
41
+ const { method, params } = payload;
42
+ if (method === METHODS.wallet_events_ext_switch_changed) {
43
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
44
+ if (!walletInfoLocal || (walletInfoLocal && walletInfoLocal.platformEnv.isExtension)) {
45
45
  try {
46
46
  localStorage.setItem(WALLET_INFO_LOACAL_KEY_V5, JSON.stringify(params));
47
47
  this.notifyDefaultWalletChanged(params);
@@ -50,12 +50,11 @@ class ProviderPrivate extends cross_inpage_provider_core_1.ProviderBase {
50
50
  console.error(e);
51
51
  }
52
52
  }
53
- else if (method === METHODS.wallet_events_dapp_network_changed) {
54
- console.log('=====>METHODS.wallet_events_dapp_network_changed');
55
- this.notifyNetworkChanged(params);
56
- }
57
- });
58
- }
53
+ }
54
+ else if (method === METHODS.wallet_events_dapp_network_changed) {
55
+ this.notifyNetworkChanged(params);
56
+ }
57
+ });
59
58
  }
60
59
  catch (e) {
61
60
  console.error(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-private-provider",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.13",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,10 +28,10 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@onekeyfe/cross-inpage-provider-core": "2.0.0-alpha.12",
32
- "@onekeyfe/cross-inpage-provider-errors": "2.0.0-alpha.12",
33
- "@onekeyfe/cross-inpage-provider-types": "2.0.0-alpha.12",
34
- "@onekeyfe/extension-bridge-injected": "2.0.0-alpha.12"
31
+ "@onekeyfe/cross-inpage-provider-core": "2.0.0-alpha.13",
32
+ "@onekeyfe/cross-inpage-provider-errors": "2.0.0-alpha.13",
33
+ "@onekeyfe/cross-inpage-provider-types": "2.0.0-alpha.13",
34
+ "@onekeyfe/extension-bridge-injected": "2.0.0-alpha.13"
35
35
  },
36
- "gitHead": "cac152562e94842da458c2c9a8bafc3652aa1fcd"
36
+ "gitHead": "db8004374a15e1434a86aad7224d4bd8a35774e2"
37
37
  }