@dynamic-labs/starknet 0.18.11 → 0.18.12

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/CHANGELOG.md CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ ### [0.18.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.11...v0.18.12) (2023-08-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * add deepLinkPreference prop ([#3174](https://github.com/dynamic-labs/DynamicAuth/issues/3174)) ([#3176](https://github.com/dynamic-labs/DynamicAuth/issues/3176)) ([8a6e389](https://github.com/dynamic-labs/DynamicAuth/commit/8a6e389e84bd74e80dc9df37ba6df5d46e6ba831))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * end connector session when unlinking from bridge ([#3120](https://github.com/dynamic-labs/DynamicAuth/issues/3120)) ([#3178](https://github.com/dynamic-labs/DynamicAuth/issues/3178)) ([0a69e21](https://github.com/dynamic-labs/DynamicAuth/commit/0a69e218dc9a9a0709bb74b901ed0ca08c7f463c))
13
+ * **bridge:** update address when switching networks ([#3171](https://github.com/dynamic-labs/DynamicAuth/issues/3171)) ([#3180](https://github.com/dynamic-labs/DynamicAuth/issues/3180)) ([8ab5ce4](https://github.com/dynamic-labs/DynamicAuth/commit/8ab5ce4add675ae326c052fc1510d54d56d0d665))
14
+
2
15
  ### [0.18.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.10...v0.18.11) (2023-08-29)
3
16
 
4
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/starknet",
3
- "version": "0.18.11",
3
+ "version": "0.18.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -30,9 +30,9 @@
30
30
  "get-starknet-core": "3.0.1",
31
31
  "text-encoding": "0.7.0",
32
32
  "@dynamic-labs/sdk-api": "0.0.270",
33
- "@dynamic-labs/utils": "0.18.11",
34
- "@dynamic-labs/wallet-book": "0.18.11",
35
- "@dynamic-labs/wallet-connector-core": "0.18.11"
33
+ "@dynamic-labs/utils": "0.18.12",
34
+ "@dynamic-labs/wallet-book": "0.18.12",
35
+ "@dynamic-labs/wallet-connector-core": "0.18.12"
36
36
  },
37
37
  "peerDependencies": {}
38
38
  }
@@ -149,10 +149,16 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
149
149
  return (starknetWindowInstance === null || starknetWindowInstance === void 0 ? void 0 : starknetWindowInstance.name) === this.name;
150
150
  }
151
151
  getConnectedAccounts() {
152
- var _a;
153
152
  return _tslib.__awaiter(this, void 0, void 0, function* () {
154
153
  const wallet = yield this.getWallet();
155
- return ((_a = wallet === null || wallet === void 0 ? void 0 : wallet.account) === null || _a === void 0 ? void 0 : _a.address) ? [wallet.account.address] : [];
154
+ if (!wallet) {
155
+ return [];
156
+ }
157
+ const needsReconnection = !wallet.isConnected && (yield wallet.isPreauthorized());
158
+ if (needsReconnection) {
159
+ yield this.connect();
160
+ }
161
+ return wallet.selectedAddress ? [wallet.selectedAddress] : [];
156
162
  });
157
163
  }
158
164
  setupEventListeners(listeners) {
@@ -147,10 +147,16 @@ class StarknetWalletConnector extends WalletConnectorBase {
147
147
  return (starknetWindowInstance === null || starknetWindowInstance === void 0 ? void 0 : starknetWindowInstance.name) === this.name;
148
148
  }
149
149
  getConnectedAccounts() {
150
- var _a;
151
150
  return __awaiter(this, void 0, void 0, function* () {
152
151
  const wallet = yield this.getWallet();
153
- return ((_a = wallet === null || wallet === void 0 ? void 0 : wallet.account) === null || _a === void 0 ? void 0 : _a.address) ? [wallet.account.address] : [];
152
+ if (!wallet) {
153
+ return [];
154
+ }
155
+ const needsReconnection = !wallet.isConnected && (yield wallet.isPreauthorized());
156
+ if (needsReconnection) {
157
+ yield this.connect();
158
+ }
159
+ return wallet.selectedAddress ? [wallet.selectedAddress] : [];
154
160
  });
155
161
  }
156
162
  setupEventListeners(listeners) {