@onekeyfe/onekey-aptos-provider 2.1.13 → 2.1.14

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.
@@ -54,8 +54,10 @@ class ProviderAptos extends ProviderAptosBase {
54
54
  _handleConnected(account, options = { emit: true }) {
55
55
  var _a;
56
56
  this._account = account;
57
- if (options.emit && this.isConnectionStatusChanged('connected')) {
57
+ if (this.isConnectionStatusChanged('connected')) {
58
58
  this.connectionStatus = 'connected';
59
+ }
60
+ if (options.emit) {
59
61
  const address = (_a = account === null || account === void 0 ? void 0 : account.address) !== null && _a !== void 0 ? _a : null;
60
62
  this.emit('connect', address);
61
63
  this.emit('accountChanged', address);
@@ -63,8 +65,10 @@ class ProviderAptos extends ProviderAptosBase {
63
65
  }
64
66
  _handleDisconnected(options = { emit: true }) {
65
67
  this._account = null;
66
- if (options.emit && this.isConnectionStatusChanged('disconnected')) {
68
+ if (this.isConnectionStatusChanged('disconnected')) {
67
69
  this.connectionStatus = 'disconnected';
70
+ }
71
+ if (options.emit) {
68
72
  this.emit('disconnect');
69
73
  this.emit('accountChanged', null);
70
74
  }
@@ -111,7 +115,7 @@ class ProviderAptos extends ProviderAptosBase {
111
115
  });
112
116
  }
113
117
  isConnected() {
114
- return this._account !== null;
118
+ return this.isConnectionStatusChanged('connected');
115
119
  }
116
120
  account() {
117
121
  return __awaiter(this, void 0, void 0, function* () {
@@ -57,8 +57,10 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
57
57
  _handleConnected(account, options = { emit: true }) {
58
58
  var _a;
59
59
  this._account = account;
60
- if (options.emit && this.isConnectionStatusChanged('connected')) {
60
+ if (this.isConnectionStatusChanged('connected')) {
61
61
  this.connectionStatus = 'connected';
62
+ }
63
+ if (options.emit) {
62
64
  const address = (_a = account === null || account === void 0 ? void 0 : account.address) !== null && _a !== void 0 ? _a : null;
63
65
  this.emit('connect', address);
64
66
  this.emit('accountChanged', address);
@@ -66,8 +68,10 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
66
68
  }
67
69
  _handleDisconnected(options = { emit: true }) {
68
70
  this._account = null;
69
- if (options.emit && this.isConnectionStatusChanged('disconnected')) {
71
+ if (this.isConnectionStatusChanged('disconnected')) {
70
72
  this.connectionStatus = 'disconnected';
73
+ }
74
+ if (options.emit) {
71
75
  this.emit('disconnect');
72
76
  this.emit('accountChanged', null);
73
77
  }
@@ -114,7 +118,7 @@ class ProviderAptos extends ProviderAptosBase_1.ProviderAptosBase {
114
118
  });
115
119
  }
116
120
  isConnected() {
117
- return this._account !== null;
121
+ return this.isConnectionStatusChanged('connected');
118
122
  }
119
123
  account() {
120
124
  return __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-aptos-provider",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,12 +28,12 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@onekeyfe/cross-inpage-provider-core": "2.1.13",
32
- "@onekeyfe/cross-inpage-provider-errors": "2.1.13",
33
- "@onekeyfe/cross-inpage-provider-types": "2.1.13",
34
- "@onekeyfe/extension-bridge-injected": "2.1.13",
31
+ "@onekeyfe/cross-inpage-provider-core": "2.1.14",
32
+ "@onekeyfe/cross-inpage-provider-errors": "2.1.14",
33
+ "@onekeyfe/cross-inpage-provider-types": "2.1.14",
34
+ "@onekeyfe/extension-bridge-injected": "2.1.14",
35
35
  "aptos": "^1.3.17",
36
36
  "eth-rpc-errors": "^4.0.3"
37
37
  },
38
- "gitHead": "84a01657418560bc3254344067531e559cbb45f4"
38
+ "gitHead": "a834c7223890d2c153f04dafad9e7095cf9547dc"
39
39
  }