@dynamic-labs/sui 4.10.4 → 4.11.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/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
1
 
2
+ ## [4.11.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.4...v4.11.0) (2025-04-08)
3
+
4
+
5
+ ### Features
6
+
7
+ * Method `removeWallet` from `useDynamicContext` is now able to unlink primary wallets — as long as the wallet is not the only remaining log in method for the user.
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **QNTM-3113:** fix network switcher fallback logic ([#8478](https://github.com/dynamic-labs/dynamic-auth/issues/8478)) ([173c4f7](https://github.com/dynamic-labs/dynamic-auth/commit/173c4f7a66e130dd8d5f9726596807489609bf14))
13
+
2
14
  ### [4.10.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.3...v4.10.4) (2025-04-04)
3
15
 
4
16
  ### [4.10.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.10.2...v4.10.3) (2025-04-04)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.10.4";
6
+ var version = "4.11.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.10.4";
2
+ var version = "4.11.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sui",
3
- "version": "4.10.4",
3
+ "version": "4.11.0",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -22,13 +22,13 @@
22
22
  "@mysten/wallet-standard": "0.13.29",
23
23
  "@mysten/sui": "1.24.0",
24
24
  "text-encoding": "0.7.0",
25
- "@dynamic-labs/assert-package-version": "4.10.4",
26
- "@dynamic-labs/logger": "4.10.4",
27
- "@dynamic-labs/rpc-providers": "4.10.4",
28
- "@dynamic-labs/types": "4.10.4",
29
- "@dynamic-labs/utils": "4.10.4",
30
- "@dynamic-labs/wallet-book": "4.10.4",
31
- "@dynamic-labs/wallet-connector-core": "4.10.4"
25
+ "@dynamic-labs/assert-package-version": "4.11.0",
26
+ "@dynamic-labs/logger": "4.11.0",
27
+ "@dynamic-labs/rpc-providers": "4.11.0",
28
+ "@dynamic-labs/types": "4.11.0",
29
+ "@dynamic-labs/utils": "4.11.0",
30
+ "@dynamic-labs/wallet-book": "4.11.0",
31
+ "@dynamic-labs/wallet-connector-core": "4.11.0"
32
32
  },
33
33
  "peerDependencies": {}
34
34
  }
@@ -162,11 +162,11 @@ class SuiWalletConnector extends walletConnectorCore.WalletConnectorBase {
162
162
  *
163
163
  * The client will prefer the private customer rpc url if available.
164
164
  */
165
- getWalletClient(networkId) {
165
+ getSuiClient(networkId) {
166
166
  return _tslib.__awaiter(this, void 0, void 0, function* () {
167
167
  const clientNetworkId = networkId !== null && networkId !== void 0 ? networkId : (yield this.getNetwork());
168
168
  if (!clientNetworkId) {
169
- this.logger.error('[getWalletClient] Failed to get network id');
169
+ this.logger.error('[getSuiClient] Failed to get network id');
170
170
  return undefined;
171
171
  }
172
172
  // Default to an existing client if available
@@ -176,7 +176,7 @@ class SuiWalletConnector extends walletConnectorCore.WalletConnectorBase {
176
176
  const network = this.getEnabledNetworks().find((network) => network.networkId === clientNetworkId);
177
177
  const url = network ? networkHelpers.getPreferredRpcUrl(network) : undefined;
178
178
  if (!url) {
179
- this.logger.error('[getWalletClient] Failed to get network url');
179
+ this.logger.error('[getSuiClient] Failed to get network url');
180
180
  return undefined;
181
181
  }
182
182
  this.suiClients[clientNetworkId] = new client.SuiClient({
@@ -187,7 +187,7 @@ class SuiWalletConnector extends walletConnectorCore.WalletConnectorBase {
187
187
  }
188
188
  getBalance(address) {
189
189
  return _tslib.__awaiter(this, void 0, void 0, function* () {
190
- const client = yield this.getWalletClient();
190
+ const client = yield this.getSuiClient();
191
191
  if (!client) {
192
192
  this.logger.error('[getBalance] Failed to get Sui client');
193
193
  return undefined;
@@ -60,7 +60,7 @@ export declare abstract class SuiWalletConnector extends WalletConnectorBase<typ
60
60
  *
61
61
  * The client will prefer the private customer rpc url if available.
62
62
  */
63
- getWalletClient(networkId?: string): Promise<SuiClient | undefined>;
63
+ getSuiClient(networkId?: string): Promise<SuiClient | undefined>;
64
64
  getBalance(address: string): Promise<string | undefined>;
65
65
  signMessage(messageToSign: string): Promise<string | undefined>;
66
66
  getWalletAccount(): Promise<WalletAccount | undefined>;
@@ -158,11 +158,11 @@ class SuiWalletConnector extends WalletConnectorBase {
158
158
  *
159
159
  * The client will prefer the private customer rpc url if available.
160
160
  */
161
- getWalletClient(networkId) {
161
+ getSuiClient(networkId) {
162
162
  return __awaiter(this, void 0, void 0, function* () {
163
163
  const clientNetworkId = networkId !== null && networkId !== void 0 ? networkId : (yield this.getNetwork());
164
164
  if (!clientNetworkId) {
165
- this.logger.error('[getWalletClient] Failed to get network id');
165
+ this.logger.error('[getSuiClient] Failed to get network id');
166
166
  return undefined;
167
167
  }
168
168
  // Default to an existing client if available
@@ -172,7 +172,7 @@ class SuiWalletConnector extends WalletConnectorBase {
172
172
  const network = this.getEnabledNetworks().find((network) => network.networkId === clientNetworkId);
173
173
  const url = network ? getPreferredRpcUrl(network) : undefined;
174
174
  if (!url) {
175
- this.logger.error('[getWalletClient] Failed to get network url');
175
+ this.logger.error('[getSuiClient] Failed to get network url');
176
176
  return undefined;
177
177
  }
178
178
  this.suiClients[clientNetworkId] = new SuiClient({
@@ -183,7 +183,7 @@ class SuiWalletConnector extends WalletConnectorBase {
183
183
  }
184
184
  getBalance(address) {
185
185
  return __awaiter(this, void 0, void 0, function* () {
186
- const client = yield this.getWalletClient();
186
+ const client = yield this.getSuiClient();
187
187
  if (!client) {
188
188
  this.logger.error('[getBalance] Failed to get Sui client');
189
189
  return undefined;
@@ -50,9 +50,17 @@ class SuiWallet extends walletConnectorCore.Wallet {
50
50
  * Returns the Sui Client object initialized for the wallet's current network.
51
51
  * @returns The [SuiClient] object.
52
52
  */
53
+ getSuiClient() {
54
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
55
+ return this._connector.getSuiClient();
56
+ });
57
+ }
58
+ /**
59
+ * @deprecated Use `getSuiClient` instead
60
+ */
53
61
  getWalletClient() {
54
62
  return _tslib.__awaiter(this, void 0, void 0, function* () {
55
- return this._connector.getWalletClient();
63
+ return this._connector.getSuiClient();
56
64
  });
57
65
  }
58
66
  /**
@@ -16,6 +16,10 @@ export declare class SuiWallet extends Wallet<SuiWalletConnector> {
16
16
  * Returns the Sui Client object initialized for the wallet's current network.
17
17
  * @returns The [SuiClient] object.
18
18
  */
19
+ getSuiClient(): Promise<SuiClient | undefined>;
20
+ /**
21
+ * @deprecated Use `getSuiClient` instead
22
+ */
19
23
  getWalletClient(): Promise<SuiClient | undefined>;
20
24
  /**
21
25
  * Returns the wallet's current active account.
@@ -46,9 +46,17 @@ class SuiWallet extends Wallet {
46
46
  * Returns the Sui Client object initialized for the wallet's current network.
47
47
  * @returns The [SuiClient] object.
48
48
  */
49
+ getSuiClient() {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ return this._connector.getSuiClient();
52
+ });
53
+ }
54
+ /**
55
+ * @deprecated Use `getSuiClient` instead
56
+ */
49
57
  getWalletClient() {
50
58
  return __awaiter(this, void 0, void 0, function* () {
51
- return this._connector.getWalletClient();
59
+ return this._connector.getSuiClient();
52
60
  });
53
61
  }
54
62
  /**