@dynamic-labs/waas-sui 4.19.6 → 4.20.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,30 @@
1
1
 
2
+ ## [4.20.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.7...v4.20.0) (2025-06-09)
3
+
4
+
5
+ ### Features
6
+
7
+ * encapsulate waas connectors within main connectors ([#8878](https://github.com/dynamic-labs/dynamic-auth/issues/8878)) ([fd1b6ab](https://github.com/dynamic-labs/dynamic-auth/commit/fd1b6ab037ff7ce5c66b30d9611689e8cc03b97b))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * hide duplicate social connection logo on global wallets ([#8903](https://github.com/dynamic-labs/dynamic-auth/issues/8903)) ([c2f86e7](https://github.com/dynamic-labs/dynamic-auth/commit/c2f86e7aae91764b174abaa18439ffbdf7287475))
13
+
14
+ ### [4.19.7](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.6...v4.19.7) (2025-06-06)
15
+
16
+
17
+ ### Features
18
+
19
+ * add util to find waas wallets ([#8871](https://github.com/dynamic-labs/dynamic-auth/issues/8871)) ([2d7114e](https://github.com/dynamic-labs/dynamic-auth/commit/2d7114e51f5badf1d04600597f1fd9433fabf3d0))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * make sure smart account is deployed before creating sessions ([#8894](https://github.com/dynamic-labs/dynamic-auth/issues/8894)) ([5ba3d23](https://github.com/dynamic-labs/dynamic-auth/commit/5ba3d23bb8ef7c7438809128c8ef74c390ba1d48))
25
+ * only deploy zksync smart account if not deployed ([#8840](https://github.com/dynamic-labs/dynamic-auth/issues/8840)) ([66a306a](https://github.com/dynamic-labs/dynamic-auth/commit/66a306aaee25c58f685fa050a5d6aea79b196fce))
26
+ * primary wallet loading time when using React 19 ([#8896](https://github.com/dynamic-labs/dynamic-auth/issues/8896)) ([f5690f3](https://github.com/dynamic-labs/dynamic-auth/commit/f5690f31012e8fc6a5650423d4ece6c04f7c1811))
27
+
2
28
  ### [4.19.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.5...v4.19.6) (2025-06-04)
3
29
 
4
30
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.19.6";
6
+ var version = "4.20.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.19.6";
2
+ var version = "4.20.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/waas-sui",
3
- "version": "4.19.6",
3
+ "version": "4.20.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",
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs-wallet/browser-wallet-client": "0.0.84",
21
+ "@dynamic-labs-wallet/browser-wallet-client": "0.0.85",
22
22
  "@mysten/sui": "1.24.0",
23
23
  "@mysten/wallet-standard": "0.13.29",
24
- "@dynamic-labs/sui": "4.19.6",
25
- "@dynamic-labs/assert-package-version": "4.19.6",
26
- "@dynamic-labs/logger": "4.19.6",
27
- "@dynamic-labs/rpc-providers": "4.19.6",
28
- "@dynamic-labs/types": "4.19.6",
29
- "@dynamic-labs/utils": "4.19.6",
30
- "@dynamic-labs/wallet-book": "4.19.6",
31
- "@dynamic-labs/wallet-connector-core": "4.19.6"
24
+ "@dynamic-labs/assert-package-version": "4.20.0",
25
+ "@dynamic-labs/logger": "4.20.0",
26
+ "@dynamic-labs/rpc-providers": "4.20.0",
27
+ "@dynamic-labs/sui-core": "4.20.0",
28
+ "@dynamic-labs/types": "4.20.0",
29
+ "@dynamic-labs/utils": "4.20.0",
30
+ "@dynamic-labs/wallet-book": "4.20.0",
31
+ "@dynamic-labs/wallet-connector-core": "4.20.0"
32
32
  },
33
33
  "peerDependencies": {}
34
34
  }
@@ -6,9 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var browserWalletClient = require('@dynamic-labs-wallet/browser-wallet-client');
8
8
  var client = require('@mysten/sui/client');
9
- var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
+ var suiCore = require('@dynamic-labs/sui-core');
10
10
  var utils = require('@dynamic-labs/utils');
11
- var sui = require('@dynamic-labs/sui');
11
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
12
12
  var WaasSuiWallet = require('../wallet/WaasSuiWallet.cjs');
13
13
 
14
14
  // This will need to be moved to a base class once we have base classes for waas connectors
@@ -26,7 +26,7 @@ class WaasExportHandler {
26
26
  }
27
27
  }
28
28
  }
29
- class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
29
+ class DynamicWaasSuiConnector extends suiCore.SuiWalletConnector {
30
30
  constructor(props) {
31
31
  super('Dynamic Waas', props);
32
32
  this.ChainWallet = WaasSuiWallet.WaasSuiWallet;
@@ -160,6 +160,15 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
160
160
  return createdWallet;
161
161
  });
162
162
  }
163
+ importPrivateKey(_a) {
164
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
165
+ const walletClient = this.getWaasWalletClient();
166
+ yield walletClient.importPrivateKey({
167
+ privateKey,
168
+ thresholdSignatureScheme: thresholdSignatureScheme,
169
+ });
170
+ });
171
+ }
163
172
  signMessage(message) {
164
173
  return _tslib.__awaiter(this, void 0, void 0, function* () {
165
174
  const waasSuiClient = this.getWaasWalletClient();
@@ -239,7 +248,7 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
239
248
  return this.getWaasWalletClient();
240
249
  }
241
250
  exportPrivateKey() {
242
- return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, } = {}) {
251
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, password, } = {}) {
243
252
  const walletClient = this.getWaasWalletClient();
244
253
  const targetAccountAddress = accountAddress || this.activeAccountAddress;
245
254
  if (!targetAccountAddress) {
@@ -252,19 +261,15 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
252
261
  yield walletClient.exportPrivateKey({
253
262
  accountAddress: targetAccountAddress,
254
263
  displayContainer,
264
+ password,
255
265
  });
256
266
  });
257
267
  }
258
268
  getExportHandler() {
259
269
  return this.__exportHandler;
260
270
  }
261
- importPrivateKey() {
262
- return _tslib.__awaiter(this, void 0, void 0, function* () {
263
- // TODO: implement
264
- });
265
- }
266
271
  exportClientKeyshares(_a) {
267
- return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
272
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
268
273
  const waasSuiClient = this.getWaasWalletClient();
269
274
  const targetAccountAddress = accountAddress || this.activeAccountAddress;
270
275
  if (!targetAccountAddress) {
@@ -272,6 +277,60 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
272
277
  }
273
278
  yield waasSuiClient.exportClientKeyshares({
274
279
  accountAddress: targetAccountAddress,
280
+ password,
281
+ });
282
+ });
283
+ }
284
+ backupKeySharesToGoogleDrive(_a) {
285
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
286
+ if (!accountAddress) {
287
+ throw new Error('Account address is required');
288
+ }
289
+ const walletClient = this.getWaasWalletClient();
290
+ return walletClient.backupKeySharesToGoogleDrive({
291
+ accountAddress,
292
+ password,
293
+ });
294
+ });
295
+ }
296
+ refreshWalletAccountShares(_a) {
297
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
298
+ if (!accountAddress) {
299
+ throw new Error('Account address is required');
300
+ }
301
+ const walletClient = this.getWaasWalletClient();
302
+ return walletClient.refreshWalletAccountShares({
303
+ accountAddress,
304
+ password,
305
+ });
306
+ });
307
+ }
308
+ updatePassword(_a) {
309
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, existingPassword, newPassword, }) {
310
+ if (!accountAddress) {
311
+ throw new Error('Account address is required');
312
+ }
313
+ const walletClient = this.getWaasWalletClient();
314
+ return walletClient.updatePassword({
315
+ accountAddress,
316
+ existingPassword,
317
+ newPassword,
318
+ });
319
+ });
320
+ }
321
+ signRawMessage(_a) {
322
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, message, password, }) {
323
+ if (!accountAddress) {
324
+ throw new Error('Account address is required');
325
+ }
326
+ if (message.length !== 64) {
327
+ throw new Error('Message must be 64 characters long');
328
+ }
329
+ const walletClient = this.getWaasWalletClient();
330
+ return walletClient.signRawMessage({
331
+ accountAddress,
332
+ message,
333
+ password,
275
334
  });
276
335
  });
277
336
  }
@@ -283,7 +342,7 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
283
342
  if (!suiClient) {
284
343
  throw new utils.DynamicError('No Sui client available');
285
344
  }
286
- return new sui.SuiUiTransaction({
345
+ return new suiCore.SuiUiTransaction({
287
346
  client: suiClient,
288
347
  from,
289
348
  onSubmit: (transaction) => _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -2,9 +2,9 @@ import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client'
2
2
  import { SuiClient, SuiTransactionBlockResponse } from '@mysten/sui/client';
3
3
  import { Transaction } from '@mysten/sui/transactions';
4
4
  import { SignedTransaction } from '@mysten/wallet-standard';
5
+ import { SuiWalletConnector, SuiWalletConnectorProps } from '@dynamic-labs/sui-core';
5
6
  import { IUITransaction } from '@dynamic-labs/types';
6
7
  import { IDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
7
- import { SuiWalletConnector, SuiWalletConnectorProps } from '@dynamic-labs/sui';
8
8
  import { WaasSuiWallet } from '../wallet/WaasSuiWallet';
9
9
  export declare class DynamicWaasSuiConnector extends SuiWalletConnector implements IDynamicWaasConnector {
10
10
  ChainWallet: typeof WaasSuiWallet;
@@ -34,7 +34,7 @@ export declare class DynamicWaasSuiConnector extends SuiWalletConnector implemen
34
34
  private setActiveAccountAddress;
35
35
  getActiveAccountAddress(): Promise<string | undefined>;
36
36
  createDynamicWaasClient(): DynamicWalletClient;
37
- getWaasWalletClient(): DynamicWalletClient;
37
+ private getWaasWalletClient;
38
38
  validateActiveWallet(expectedAddress: string): Promise<void>;
39
39
  createWalletAccount({ thresholdSignatureScheme, }?: {
40
40
  thresholdSignatureScheme?: string;
@@ -44,6 +44,10 @@ export declare class DynamicWaasSuiConnector extends SuiWalletConnector implemen
44
44
  publicKeyHex: string;
45
45
  rawPublicKey: string | Uint8Array | undefined;
46
46
  }>;
47
+ importPrivateKey({ privateKey, thresholdSignatureScheme, }: {
48
+ privateKey: string;
49
+ thresholdSignatureScheme?: string;
50
+ }): Promise<void>;
47
51
  signMessage(message: string): Promise<string>;
48
52
  private createAndSignTransaction;
49
53
  signTransaction(transaction: Transaction): Promise<SignedTransaction>;
@@ -53,17 +57,36 @@ export declare class DynamicWaasSuiConnector extends SuiWalletConnector implemen
53
57
  accountAddress: string;
54
58
  }): DynamicWalletClient;
55
59
  getWalletClient(): DynamicWalletClient | undefined;
56
- exportPrivateKey({ accountAddress, displayContainer, }?: {
60
+ exportPrivateKey({ accountAddress, displayContainer, password, }?: {
57
61
  accountAddress?: string;
58
62
  displayContainer?: HTMLIFrameElement;
63
+ password?: string;
59
64
  }): Promise<void>;
60
65
  getExportHandler(): {
61
66
  clear: () => void;
62
67
  };
63
- importPrivateKey(): Promise<void>;
64
- exportClientKeyshares({ accountAddress, }: {
68
+ exportClientKeyshares({ accountAddress, password, }: {
65
69
  accountAddress: string;
70
+ password?: string;
66
71
  }): Promise<void>;
72
+ backupKeySharesToGoogleDrive({ accountAddress, password, }: {
73
+ accountAddress: string;
74
+ password?: string;
75
+ }): Promise<void>;
76
+ refreshWalletAccountShares({ accountAddress, password, }: {
77
+ accountAddress: string;
78
+ password?: string;
79
+ }): Promise<void>;
80
+ updatePassword({ accountAddress, existingPassword, newPassword, }: {
81
+ accountAddress: string;
82
+ existingPassword: string;
83
+ newPassword: string;
84
+ }): Promise<void>;
85
+ signRawMessage({ accountAddress, message, password, }: {
86
+ accountAddress: string;
87
+ message: string;
88
+ password?: string;
89
+ }): Promise<string>;
67
90
  /** Function used to create transactions in the SDK interface */
68
91
  createUiTransaction(from: string): Promise<IUITransaction>;
69
92
  endSession(): Promise<void>;
@@ -2,9 +2,9 @@
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { DynamicWalletClient } from '@dynamic-labs-wallet/browser-wallet-client';
4
4
  import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
5
- import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
5
+ import { SuiWalletConnector, SuiUiTransaction } from '@dynamic-labs/sui-core';
6
6
  import { DynamicError } from '@dynamic-labs/utils';
7
- import { SuiWalletConnector, SuiUiTransaction } from '@dynamic-labs/sui';
7
+ import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
8
8
  import { WaasSuiWallet } from '../wallet/WaasSuiWallet.js';
9
9
 
10
10
  // This will need to be moved to a base class once we have base classes for waas connectors
@@ -156,6 +156,15 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
156
156
  return createdWallet;
157
157
  });
158
158
  }
159
+ importPrivateKey(_a) {
160
+ return __awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
161
+ const walletClient = this.getWaasWalletClient();
162
+ yield walletClient.importPrivateKey({
163
+ privateKey,
164
+ thresholdSignatureScheme: thresholdSignatureScheme,
165
+ });
166
+ });
167
+ }
159
168
  signMessage(message) {
160
169
  return __awaiter(this, void 0, void 0, function* () {
161
170
  const waasSuiClient = this.getWaasWalletClient();
@@ -235,7 +244,7 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
235
244
  return this.getWaasWalletClient();
236
245
  }
237
246
  exportPrivateKey() {
238
- return __awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, } = {}) {
247
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, password, } = {}) {
239
248
  const walletClient = this.getWaasWalletClient();
240
249
  const targetAccountAddress = accountAddress || this.activeAccountAddress;
241
250
  if (!targetAccountAddress) {
@@ -248,19 +257,15 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
248
257
  yield walletClient.exportPrivateKey({
249
258
  accountAddress: targetAccountAddress,
250
259
  displayContainer,
260
+ password,
251
261
  });
252
262
  });
253
263
  }
254
264
  getExportHandler() {
255
265
  return this.__exportHandler;
256
266
  }
257
- importPrivateKey() {
258
- return __awaiter(this, void 0, void 0, function* () {
259
- // TODO: implement
260
- });
261
- }
262
267
  exportClientKeyshares(_a) {
263
- return __awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
268
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
264
269
  const waasSuiClient = this.getWaasWalletClient();
265
270
  const targetAccountAddress = accountAddress || this.activeAccountAddress;
266
271
  if (!targetAccountAddress) {
@@ -268,6 +273,60 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
268
273
  }
269
274
  yield waasSuiClient.exportClientKeyshares({
270
275
  accountAddress: targetAccountAddress,
276
+ password,
277
+ });
278
+ });
279
+ }
280
+ backupKeySharesToGoogleDrive(_a) {
281
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
282
+ if (!accountAddress) {
283
+ throw new Error('Account address is required');
284
+ }
285
+ const walletClient = this.getWaasWalletClient();
286
+ return walletClient.backupKeySharesToGoogleDrive({
287
+ accountAddress,
288
+ password,
289
+ });
290
+ });
291
+ }
292
+ refreshWalletAccountShares(_a) {
293
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
294
+ if (!accountAddress) {
295
+ throw new Error('Account address is required');
296
+ }
297
+ const walletClient = this.getWaasWalletClient();
298
+ return walletClient.refreshWalletAccountShares({
299
+ accountAddress,
300
+ password,
301
+ });
302
+ });
303
+ }
304
+ updatePassword(_a) {
305
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, existingPassword, newPassword, }) {
306
+ if (!accountAddress) {
307
+ throw new Error('Account address is required');
308
+ }
309
+ const walletClient = this.getWaasWalletClient();
310
+ return walletClient.updatePassword({
311
+ accountAddress,
312
+ existingPassword,
313
+ newPassword,
314
+ });
315
+ });
316
+ }
317
+ signRawMessage(_a) {
318
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, message, password, }) {
319
+ if (!accountAddress) {
320
+ throw new Error('Account address is required');
321
+ }
322
+ if (message.length !== 64) {
323
+ throw new Error('Message must be 64 characters long');
324
+ }
325
+ const walletClient = this.getWaasWalletClient();
326
+ return walletClient.signRawMessage({
327
+ accountAddress,
328
+ message,
329
+ password,
271
330
  });
272
331
  });
273
332
  }
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var transactions = require('@mysten/sui/transactions');
8
- var sui = require('@dynamic-labs/sui');
8
+ var suiCore = require('@dynamic-labs/sui-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
10
 
11
- class WaasSuiWallet extends sui.SuiWallet {
11
+ class WaasSuiWallet extends suiCore.SuiWallet {
12
12
  constructor(_a) {
13
13
  var { connector } = _a, props = _tslib.__rest(_a, ["connector"]);
14
14
  super(Object.assign({ connector }, props));
@@ -35,7 +35,7 @@ class WaasSuiWallet extends sui.SuiWallet {
35
35
  // Let the transaction calculate gas automatically
36
36
  // https://sdk.mystenlabs.com/typescript/transaction-building/gas#gas-price
37
37
  const [coin] = transactionRequest.splitCoins(transactionRequest.gas, [
38
- Number(value) * sui.MIST_PER_SUI,
38
+ Number(value) * suiCore.MIST_PER_SUI,
39
39
  ]);
40
40
  transactionRequest.transferObjects([coin], toAddress);
41
41
  // Execute transaction
@@ -1,7 +1,7 @@
1
1
  import { Transaction } from '@mysten/sui/transactions';
2
2
  import { SignedTransaction } from '@mysten/wallet-standard';
3
3
  import { WalletProps } from '@dynamic-labs/wallet-connector-core';
4
- import { SuiWallet, SuiSendBalanceProps } from '@dynamic-labs/sui';
4
+ import { SuiWallet, SuiSendBalanceProps } from '@dynamic-labs/sui-core';
5
5
  import { DynamicWaasSuiConnector } from '../connector/DynamicWaasSuiConnector';
6
6
  export declare class WaasSuiWallet extends SuiWallet {
7
7
  constructor({ connector, ...props }: WalletProps<DynamicWaasSuiConnector>);
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { Transaction } from '@mysten/sui/transactions';
4
- import { SuiWallet, MIST_PER_SUI } from '@dynamic-labs/sui';
4
+ import { SuiWallet, MIST_PER_SUI } from '@dynamic-labs/sui-core';
5
5
  import { DynamicError } from '@dynamic-labs/utils';
6
6
 
7
7
  class WaasSuiWallet extends SuiWallet {