@dynamic-labs/waas-sui 4.19.1 → 4.19.3

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,18 @@
1
1
 
2
+ ### [4.19.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.2...v4.19.3) (2025-05-28)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * rerender issue with Slush wallet pop up appearing multiple times ([#8817](https://github.com/dynamic-labs/dynamic-auth/issues/8817)) ([bea0da6](https://github.com/dynamic-labs/dynamic-auth/commit/bea0da647bab983610ebbf18a6ca66ba0ac569bf))
8
+
9
+ ### [4.19.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.1...v4.19.2) (2025-05-27)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * always set the current wallet address when creating WalletClient for that wallet ([#8800](https://github.com/dynamic-labs/dynamic-auth/issues/8800)) ([3282902](https://github.com/dynamic-labs/dynamic-auth/commit/3282902581d429b66c91c533f5573964174e43d6))
15
+
2
16
  ### [4.19.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.19.0...v4.19.1) (2025-05-26)
3
17
 
4
18
 
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.1";
6
+ var version = "4.19.3";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.19.1";
2
+ var version = "4.19.3";
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.1",
3
+ "version": "4.19.3",
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",
@@ -21,14 +21,14 @@
21
21
  "@dynamic-labs-wallet/browser-wallet-client": "0.0.76",
22
22
  "@mysten/sui": "1.24.0",
23
23
  "@mysten/wallet-standard": "0.13.29",
24
- "@dynamic-labs/sui": "4.19.1",
25
- "@dynamic-labs/assert-package-version": "4.19.1",
26
- "@dynamic-labs/logger": "4.19.1",
27
- "@dynamic-labs/rpc-providers": "4.19.1",
28
- "@dynamic-labs/types": "4.19.1",
29
- "@dynamic-labs/utils": "4.19.1",
30
- "@dynamic-labs/wallet-book": "4.19.1",
31
- "@dynamic-labs/wallet-connector-core": "4.19.1"
24
+ "@dynamic-labs/sui": "4.19.3",
25
+ "@dynamic-labs/assert-package-version": "4.19.3",
26
+ "@dynamic-labs/logger": "4.19.3",
27
+ "@dynamic-labs/rpc-providers": "4.19.3",
28
+ "@dynamic-labs/types": "4.19.3",
29
+ "@dynamic-labs/utils": "4.19.3",
30
+ "@dynamic-labs/wallet-book": "4.19.3",
31
+ "@dynamic-labs/wallet-connector-core": "4.19.3"
32
32
  },
33
33
  "peerDependencies": {}
34
34
  }
@@ -11,6 +11,21 @@ var utils = require('@dynamic-labs/utils');
11
11
  var sui = require('@dynamic-labs/sui');
12
12
  var WaasSuiWallet = require('../wallet/WaasSuiWallet.cjs');
13
13
 
14
+ // This will need to be moved to a base class once we have base classes for waas connectors
15
+ class WaasExportHandler {
16
+ constructor() {
17
+ this.iframeStamper = null;
18
+ }
19
+ setIframeStamper(iframe) {
20
+ this.iframeStamper = iframe;
21
+ }
22
+ clear() {
23
+ if (this.iframeStamper) {
24
+ this.iframeStamper.remove();
25
+ this.iframeStamper = null;
26
+ }
27
+ }
28
+ }
14
29
  class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
15
30
  constructor(props) {
16
31
  super('Dynamic Waas', props);
@@ -19,6 +34,7 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
19
34
  this.name = 'Dynamic Waas';
20
35
  this.overrideKey = 'dynamicwaas';
21
36
  this.isEmbeddedWallet = true;
37
+ this.__exportHandler = new WaasExportHandler();
22
38
  }
23
39
  connect() {
24
40
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -223,10 +239,25 @@ class DynamicWaasSuiConnector extends sui.SuiWalletConnector {
223
239
  return this.getWaasWalletClient();
224
240
  }
225
241
  exportPrivateKey() {
226
- return _tslib.__awaiter(this, void 0, void 0, function* () {
227
- // TODO: implement
242
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, } = {}) {
243
+ const walletClient = this.getWaasWalletClient();
244
+ const targetAccountAddress = accountAddress || this.activeAccountAddress;
245
+ if (!targetAccountAddress) {
246
+ throw new Error('Account address is required');
247
+ }
248
+ if (!displayContainer) {
249
+ throw new Error('Missing display container for export private key');
250
+ }
251
+ this.__exportHandler.setIframeStamper(displayContainer);
252
+ yield walletClient.exportPrivateKey({
253
+ accountAddress: targetAccountAddress,
254
+ displayContainer,
255
+ });
228
256
  });
229
257
  }
258
+ getExportHandler() {
259
+ return this.__exportHandler;
260
+ }
230
261
  importPrivateKey() {
231
262
  return _tslib.__awaiter(this, void 0, void 0, function* () {
232
263
  // TODO: implement
@@ -23,6 +23,7 @@ export declare class DynamicWaasSuiConnector extends SuiWalletConnector implemen
23
23
  private environmentId?;
24
24
  private getAuthToken?;
25
25
  private dynamicWaasClient;
26
+ private __exportHandler;
26
27
  activeAccountAddress: string | undefined;
27
28
  private baseApiUrl?;
28
29
  private relayUrl?;
@@ -52,7 +53,13 @@ export declare class DynamicWaasSuiConnector extends SuiWalletConnector implemen
52
53
  accountAddress: string;
53
54
  }): DynamicWalletClient;
54
55
  getWalletClient(): DynamicWalletClient | undefined;
55
- exportPrivateKey(): Promise<void>;
56
+ exportPrivateKey({ accountAddress, displayContainer, }?: {
57
+ accountAddress?: string;
58
+ displayContainer?: HTMLIFrameElement;
59
+ }): Promise<void>;
60
+ getExportHandler(): {
61
+ clear: () => void;
62
+ };
56
63
  importPrivateKey(): Promise<void>;
57
64
  exportClientKeyshares({ accountAddress, }: {
58
65
  accountAddress: string;
@@ -7,6 +7,21 @@ import { DynamicError } from '@dynamic-labs/utils';
7
7
  import { SuiWalletConnector, SuiUiTransaction } from '@dynamic-labs/sui';
8
8
  import { WaasSuiWallet } from '../wallet/WaasSuiWallet.js';
9
9
 
10
+ // This will need to be moved to a base class once we have base classes for waas connectors
11
+ class WaasExportHandler {
12
+ constructor() {
13
+ this.iframeStamper = null;
14
+ }
15
+ setIframeStamper(iframe) {
16
+ this.iframeStamper = iframe;
17
+ }
18
+ clear() {
19
+ if (this.iframeStamper) {
20
+ this.iframeStamper.remove();
21
+ this.iframeStamper = null;
22
+ }
23
+ }
24
+ }
10
25
  class DynamicWaasSuiConnector extends SuiWalletConnector {
11
26
  constructor(props) {
12
27
  super('Dynamic Waas', props);
@@ -15,6 +30,7 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
15
30
  this.name = 'Dynamic Waas';
16
31
  this.overrideKey = 'dynamicwaas';
17
32
  this.isEmbeddedWallet = true;
33
+ this.__exportHandler = new WaasExportHandler();
18
34
  }
19
35
  connect() {
20
36
  return __awaiter(this, void 0, void 0, function* () {
@@ -219,10 +235,25 @@ class DynamicWaasSuiConnector extends SuiWalletConnector {
219
235
  return this.getWaasWalletClient();
220
236
  }
221
237
  exportPrivateKey() {
222
- return __awaiter(this, void 0, void 0, function* () {
223
- // TODO: implement
238
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, } = {}) {
239
+ const walletClient = this.getWaasWalletClient();
240
+ const targetAccountAddress = accountAddress || this.activeAccountAddress;
241
+ if (!targetAccountAddress) {
242
+ throw new Error('Account address is required');
243
+ }
244
+ if (!displayContainer) {
245
+ throw new Error('Missing display container for export private key');
246
+ }
247
+ this.__exportHandler.setIframeStamper(displayContainer);
248
+ yield walletClient.exportPrivateKey({
249
+ accountAddress: targetAccountAddress,
250
+ displayContainer,
251
+ });
224
252
  });
225
253
  }
254
+ getExportHandler() {
255
+ return this.__exportHandler;
256
+ }
226
257
  importPrivateKey() {
227
258
  return __awaiter(this, void 0, void 0, function* () {
228
259
  // TODO: implement