@dynamic-labs-wallet/browser-wallet-client 0.0.0-beta.232.7 → 0.0.0-beta.232.8

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/index.cjs.js CHANGED
@@ -48,13 +48,8 @@ class iframeMessageHandler {
48
48
  async getWallets(request) {
49
49
  return this.requestChannel.request('getWallets', request);
50
50
  }
51
- async getWallet({ chainName, accountAddress, walletOperation, signedSessionId }) {
52
- return this.requestChannel.request('getWallet', {
53
- chainName,
54
- accountAddress,
55
- walletOperation,
56
- signedSessionId
57
- });
51
+ async getWallet(request) {
52
+ return this.requestChannel.request('getWallet', request);
58
53
  }
59
54
  async createWalletAccount(request) {
60
55
  return this.requestChannel.request('createWalletAccount', request);
@@ -145,6 +140,10 @@ class DynamicWalletClient {
145
140
  /**
146
141
  * initialize the message transport after iframe is successfully loaded
147
142
  */ async initializeMessageTransport() {
143
+ if (this.messageTransport && this.iframeMessageHandler) {
144
+ this.logger.debug('Skipping initializeMessageTransport: transport and message handler already initialized');
145
+ return;
146
+ }
148
147
  await this.initializeIframeCommunication();
149
148
  const transport = messageTransport.applyDefaultMessageOrigin({
150
149
  defaultOrigin: 'host',
@@ -201,13 +200,14 @@ class DynamicWalletClient {
201
200
  iframe.style.height = '0';
202
201
  iframe.style.border = 'none';
203
202
  iframe.style.pointerEvents = 'none';
204
- var _this_instanceId;
203
+ var _this_instanceId, _this_sdkVersion;
205
204
  const params = new URLSearchParams({
206
205
  instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
207
206
  hostOrigin: window.location.origin,
208
207
  environmentId: this.environmentId,
209
208
  baseApiUrl: this.baseApiUrl,
210
- baseMPCRelayApiUrl: this.baseMPCRelayApiUrl
209
+ baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
210
+ sdkVersion: (_this_sdkVersion = this.sdkVersion) != null ? _this_sdkVersion : ''
211
211
  });
212
212
  iframe.src = `${this.iframeDomain}/waas-v1/${this.environmentId}?${params.toString()}`;
213
213
  this.logger.debug('Creating iframe with src:', iframe.src);
@@ -308,7 +308,7 @@ class DynamicWalletClient {
308
308
  chainName: this.chainName
309
309
  });
310
310
  }
311
- async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId }) {
311
+ async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
312
312
  await this.initializeMessageTransport();
313
313
  if (!this.iframeMessageHandler) {
314
314
  throw new Error('Iframe message handler not initialized');
@@ -317,10 +317,11 @@ class DynamicWalletClient {
317
317
  chainName: this.chainName,
318
318
  accountAddress,
319
319
  walletOperation,
320
- signedSessionId
320
+ signedSessionId,
321
+ authToken
321
322
  });
322
323
  }
323
- async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
324
+ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
324
325
  await this.initializeMessageTransport();
325
326
  if (!this.iframeMessageHandler) {
326
327
  throw new Error('Iframe message handler not initialized');
@@ -329,10 +330,11 @@ class DynamicWalletClient {
329
330
  chainName: this.chainName,
330
331
  thresholdSignatureScheme,
331
332
  password,
332
- signedSessionId
333
+ signedSessionId,
334
+ authToken
333
335
  });
334
336
  }
335
- async requiresPasswordForOperation({ accountAddress, walletOperation = core.WalletOperation.REACH_THRESHOLD }) {
337
+ async requiresPasswordForOperation({ accountAddress, walletOperation = core.WalletOperation.REACH_THRESHOLD, authToken }) {
336
338
  await this.initializeMessageTransport();
337
339
  if (!this.iframeMessageHandler) {
338
340
  throw new Error('Iframe message handler not initialized');
@@ -340,20 +342,22 @@ class DynamicWalletClient {
340
342
  return this.iframeMessageHandler.requiresPasswordForOperation({
341
343
  chainName: this.chainName,
342
344
  accountAddress,
343
- walletOperation
345
+ walletOperation,
346
+ authToken
344
347
  });
345
348
  }
346
- async isPasswordEncrypted({ accountAddress }) {
349
+ async isPasswordEncrypted({ accountAddress, authToken }) {
347
350
  await this.initializeMessageTransport();
348
351
  if (!this.iframeMessageHandler) {
349
352
  throw new Error('Iframe message handler not initialized');
350
353
  }
351
354
  return this.iframeMessageHandler.isPasswordEncrypted({
352
355
  chainName: this.chainName,
353
- accountAddress
356
+ accountAddress,
357
+ authToken
354
358
  });
355
359
  }
356
- async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
360
+ async signMessage({ message, accountAddress, password = undefined, signedSessionId, authToken }) {
357
361
  await this.initializeMessageTransport();
358
362
  if (!this.iframeMessageHandler) {
359
363
  throw new Error('Iframe message handler not initialized');
@@ -363,10 +367,11 @@ class DynamicWalletClient {
363
367
  message,
364
368
  accountAddress,
365
369
  password,
366
- signedSessionId
370
+ signedSessionId,
371
+ authToken
367
372
  });
368
373
  }
369
- async signRawMessage({ message, accountAddress, password = undefined, signedSessionId }) {
374
+ async signRawMessage({ message, accountAddress, password = undefined, signedSessionId, authToken }) {
370
375
  await this.initializeMessageTransport();
371
376
  if (!this.iframeMessageHandler) {
372
377
  throw new Error('Iframe message handler not initialized');
@@ -376,7 +381,8 @@ class DynamicWalletClient {
376
381
  message,
377
382
  accountAddress,
378
383
  password,
379
- signedSessionId
384
+ signedSessionId,
385
+ authToken
380
386
  });
381
387
  }
382
388
  /**
@@ -389,7 +395,7 @@ class DynamicWalletClient {
389
395
  * SUI:
390
396
  * const txBytes = await txb.build({ client });
391
397
  * const txString = Buffer.from(txBytes).toString("hex");
392
- */ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId }) {
398
+ */ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, authToken }) {
393
399
  await this.initializeMessageTransport();
394
400
  if (!this.iframeMessageHandler) {
395
401
  throw new Error('Iframe message handler not initialized');
@@ -399,10 +405,11 @@ class DynamicWalletClient {
399
405
  senderAddress,
400
406
  transaction,
401
407
  password,
402
- signedSessionId
408
+ signedSessionId,
409
+ authToken
403
410
  });
404
411
  }
405
- async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId }) {
412
+ async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
406
413
  await this.initializeMessageTransport();
407
414
  if (!this.iframeMessageHandler) {
408
415
  throw new Error('Iframe message handler not initialized');
@@ -411,10 +418,11 @@ class DynamicWalletClient {
411
418
  chainName: this.chainName,
412
419
  accountAddress,
413
420
  password,
414
- signedSessionId
421
+ signedSessionId,
422
+ authToken
415
423
  });
416
424
  }
417
- async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId }) {
425
+ async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
418
426
  const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
419
427
  container: displayContainer
420
428
  });
@@ -425,10 +433,11 @@ class DynamicWalletClient {
425
433
  chainName: this.chainName,
426
434
  accountAddress,
427
435
  password,
428
- signedSessionId
436
+ signedSessionId,
437
+ authToken
429
438
  });
430
439
  }
431
- async refreshWalletAccountShares({ accountAddress, password, signedSessionId }) {
440
+ async refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken }) {
432
441
  await this.initializeMessageTransport();
433
442
  if (!this.iframeMessageHandler) {
434
443
  throw new Error('Iframe message handler not initialized');
@@ -437,10 +446,11 @@ class DynamicWalletClient {
437
446
  chainName: this.chainName,
438
447
  accountAddress: accountAddress,
439
448
  password: password,
440
- signedSessionId
449
+ signedSessionId,
450
+ authToken
441
451
  });
442
452
  }
443
- async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId }) {
453
+ async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken }) {
444
454
  await this.initializeMessageTransport();
445
455
  if (!this.iframeMessageHandler) {
446
456
  throw new Error('Iframe message handler not initialized');
@@ -451,10 +461,11 @@ class DynamicWalletClient {
451
461
  oldThresholdSignatureScheme,
452
462
  newThresholdSignatureScheme,
453
463
  password,
454
- signedSessionId
464
+ signedSessionId,
465
+ authToken
455
466
  });
456
467
  }
457
- async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId }) {
468
+ async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
458
469
  const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
459
470
  container: displayContainer
460
471
  });
@@ -465,10 +476,11 @@ class DynamicWalletClient {
465
476
  chainName: this.chainName,
466
477
  accountAddress,
467
478
  password,
468
- signedSessionId
479
+ signedSessionId,
480
+ authToken
469
481
  });
470
482
  }
471
- async verifyPassword({ accountAddress, password, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId }) {
483
+ async verifyPassword({ accountAddress, password, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
472
484
  await this.initializeMessageTransport();
473
485
  if (!this.iframeMessageHandler) {
474
486
  throw new Error('Iframe message handler not initialized');
@@ -478,10 +490,11 @@ class DynamicWalletClient {
478
490
  accountAddress,
479
491
  password,
480
492
  walletOperation,
481
- signedSessionId
493
+ signedSessionId,
494
+ authToken
482
495
  });
483
496
  }
484
- async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
497
+ async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken }) {
485
498
  await this.initializeMessageTransport();
486
499
  if (!this.iframeMessageHandler) {
487
500
  throw new Error('Iframe message handler not initialized');
@@ -491,10 +504,11 @@ class DynamicWalletClient {
491
504
  accountAddress,
492
505
  existingPassword,
493
506
  newPassword,
494
- signedSessionId
507
+ signedSessionId,
508
+ authToken
495
509
  });
496
510
  }
497
- async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId }) {
511
+ async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, authToken }) {
498
512
  await this.initializeMessageTransport();
499
513
  if (!this.iframeMessageHandler) {
500
514
  throw new Error('Iframe message handler not initialized');
@@ -503,10 +517,11 @@ class DynamicWalletClient {
503
517
  chainName: this.chainName,
504
518
  privateKey,
505
519
  thresholdSignatureScheme,
506
- signedSessionId
520
+ signedSessionId,
521
+ authToken
507
522
  });
508
523
  }
509
- async exportClientKeyshares({ accountAddress, password, signedSessionId }) {
524
+ async exportClientKeyshares({ accountAddress, password, signedSessionId, authToken }) {
510
525
  await this.initializeMessageTransport();
511
526
  if (!this.iframeMessageHandler) {
512
527
  throw new Error('Iframe message handler not initialized');
@@ -515,7 +530,8 @@ class DynamicWalletClient {
515
530
  chainName: this.chainName,
516
531
  accountAddress,
517
532
  password,
518
- signedSessionId
533
+ signedSessionId,
534
+ authToken
519
535
  });
520
536
  }
521
537
  /**
@@ -554,7 +570,7 @@ class DynamicWalletClient {
554
570
  this.iframe = null;
555
571
  }
556
572
  }
557
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, debug }){
573
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, debug }){
558
574
  this.logger = logger;
559
575
  this.instanceId = null;
560
576
  this.iframeDomain = null;
@@ -566,6 +582,7 @@ class DynamicWalletClient {
566
582
  this.baseApiUrl = baseApiUrl;
567
583
  this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
568
584
  this.chainName = chainName;
585
+ this.sdkVersion = sdkVersion;
569
586
  const environment = core.getEnvironmentFromUrl(baseApiUrl);
570
587
  this.iframeDomain = core.IFRAME_DOMAIN_MAP[environment];
571
588
  // Generate unique instanceId when client is created
package/index.esm.js CHANGED
@@ -47,13 +47,8 @@ class iframeMessageHandler {
47
47
  async getWallets(request) {
48
48
  return this.requestChannel.request('getWallets', request);
49
49
  }
50
- async getWallet({ chainName, accountAddress, walletOperation, signedSessionId }) {
51
- return this.requestChannel.request('getWallet', {
52
- chainName,
53
- accountAddress,
54
- walletOperation,
55
- signedSessionId
56
- });
50
+ async getWallet(request) {
51
+ return this.requestChannel.request('getWallet', request);
57
52
  }
58
53
  async createWalletAccount(request) {
59
54
  return this.requestChannel.request('createWalletAccount', request);
@@ -144,6 +139,10 @@ class DynamicWalletClient {
144
139
  /**
145
140
  * initialize the message transport after iframe is successfully loaded
146
141
  */ async initializeMessageTransport() {
142
+ if (this.messageTransport && this.iframeMessageHandler) {
143
+ this.logger.debug('Skipping initializeMessageTransport: transport and message handler already initialized');
144
+ return;
145
+ }
147
146
  await this.initializeIframeCommunication();
148
147
  const transport = applyDefaultMessageOrigin({
149
148
  defaultOrigin: 'host',
@@ -200,13 +199,14 @@ class DynamicWalletClient {
200
199
  iframe.style.height = '0';
201
200
  iframe.style.border = 'none';
202
201
  iframe.style.pointerEvents = 'none';
203
- var _this_instanceId;
202
+ var _this_instanceId, _this_sdkVersion;
204
203
  const params = new URLSearchParams({
205
204
  instanceId: (_this_instanceId = this.instanceId) != null ? _this_instanceId : '',
206
205
  hostOrigin: window.location.origin,
207
206
  environmentId: this.environmentId,
208
207
  baseApiUrl: this.baseApiUrl,
209
- baseMPCRelayApiUrl: this.baseMPCRelayApiUrl
208
+ baseMPCRelayApiUrl: this.baseMPCRelayApiUrl,
209
+ sdkVersion: (_this_sdkVersion = this.sdkVersion) != null ? _this_sdkVersion : ''
210
210
  });
211
211
  iframe.src = `${this.iframeDomain}/waas-v1/${this.environmentId}?${params.toString()}`;
212
212
  this.logger.debug('Creating iframe with src:', iframe.src);
@@ -307,7 +307,7 @@ class DynamicWalletClient {
307
307
  chainName: this.chainName
308
308
  });
309
309
  }
310
- async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
310
+ async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
311
311
  await this.initializeMessageTransport();
312
312
  if (!this.iframeMessageHandler) {
313
313
  throw new Error('Iframe message handler not initialized');
@@ -316,10 +316,11 @@ class DynamicWalletClient {
316
316
  chainName: this.chainName,
317
317
  accountAddress,
318
318
  walletOperation,
319
- signedSessionId
319
+ signedSessionId,
320
+ authToken
320
321
  });
321
322
  }
322
- async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
323
+ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
323
324
  await this.initializeMessageTransport();
324
325
  if (!this.iframeMessageHandler) {
325
326
  throw new Error('Iframe message handler not initialized');
@@ -328,10 +329,11 @@ class DynamicWalletClient {
328
329
  chainName: this.chainName,
329
330
  thresholdSignatureScheme,
330
331
  password,
331
- signedSessionId
332
+ signedSessionId,
333
+ authToken
332
334
  });
333
335
  }
334
- async requiresPasswordForOperation({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD }) {
336
+ async requiresPasswordForOperation({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD, authToken }) {
335
337
  await this.initializeMessageTransport();
336
338
  if (!this.iframeMessageHandler) {
337
339
  throw new Error('Iframe message handler not initialized');
@@ -339,20 +341,22 @@ class DynamicWalletClient {
339
341
  return this.iframeMessageHandler.requiresPasswordForOperation({
340
342
  chainName: this.chainName,
341
343
  accountAddress,
342
- walletOperation
344
+ walletOperation,
345
+ authToken
343
346
  });
344
347
  }
345
- async isPasswordEncrypted({ accountAddress }) {
348
+ async isPasswordEncrypted({ accountAddress, authToken }) {
346
349
  await this.initializeMessageTransport();
347
350
  if (!this.iframeMessageHandler) {
348
351
  throw new Error('Iframe message handler not initialized');
349
352
  }
350
353
  return this.iframeMessageHandler.isPasswordEncrypted({
351
354
  chainName: this.chainName,
352
- accountAddress
355
+ accountAddress,
356
+ authToken
353
357
  });
354
358
  }
355
- async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
359
+ async signMessage({ message, accountAddress, password = undefined, signedSessionId, authToken }) {
356
360
  await this.initializeMessageTransport();
357
361
  if (!this.iframeMessageHandler) {
358
362
  throw new Error('Iframe message handler not initialized');
@@ -362,10 +366,11 @@ class DynamicWalletClient {
362
366
  message,
363
367
  accountAddress,
364
368
  password,
365
- signedSessionId
369
+ signedSessionId,
370
+ authToken
366
371
  });
367
372
  }
368
- async signRawMessage({ message, accountAddress, password = undefined, signedSessionId }) {
373
+ async signRawMessage({ message, accountAddress, password = undefined, signedSessionId, authToken }) {
369
374
  await this.initializeMessageTransport();
370
375
  if (!this.iframeMessageHandler) {
371
376
  throw new Error('Iframe message handler not initialized');
@@ -375,7 +380,8 @@ class DynamicWalletClient {
375
380
  message,
376
381
  accountAddress,
377
382
  password,
378
- signedSessionId
383
+ signedSessionId,
384
+ authToken
379
385
  });
380
386
  }
381
387
  /**
@@ -388,7 +394,7 @@ class DynamicWalletClient {
388
394
  * SUI:
389
395
  * const txBytes = await txb.build({ client });
390
396
  * const txString = Buffer.from(txBytes).toString("hex");
391
- */ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId }) {
397
+ */ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, authToken }) {
392
398
  await this.initializeMessageTransport();
393
399
  if (!this.iframeMessageHandler) {
394
400
  throw new Error('Iframe message handler not initialized');
@@ -398,10 +404,11 @@ class DynamicWalletClient {
398
404
  senderAddress,
399
405
  transaction,
400
406
  password,
401
- signedSessionId
407
+ signedSessionId,
408
+ authToken
402
409
  });
403
410
  }
404
- async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId }) {
411
+ async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
405
412
  await this.initializeMessageTransport();
406
413
  if (!this.iframeMessageHandler) {
407
414
  throw new Error('Iframe message handler not initialized');
@@ -410,10 +417,11 @@ class DynamicWalletClient {
410
417
  chainName: this.chainName,
411
418
  accountAddress,
412
419
  password,
413
- signedSessionId
420
+ signedSessionId,
421
+ authToken
414
422
  });
415
423
  }
416
- async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId }) {
424
+ async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
417
425
  const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
418
426
  container: displayContainer
419
427
  });
@@ -424,10 +432,11 @@ class DynamicWalletClient {
424
432
  chainName: this.chainName,
425
433
  accountAddress,
426
434
  password,
427
- signedSessionId
435
+ signedSessionId,
436
+ authToken
428
437
  });
429
438
  }
430
- async refreshWalletAccountShares({ accountAddress, password, signedSessionId }) {
439
+ async refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken }) {
431
440
  await this.initializeMessageTransport();
432
441
  if (!this.iframeMessageHandler) {
433
442
  throw new Error('Iframe message handler not initialized');
@@ -436,10 +445,11 @@ class DynamicWalletClient {
436
445
  chainName: this.chainName,
437
446
  accountAddress: accountAddress,
438
447
  password: password,
439
- signedSessionId
448
+ signedSessionId,
449
+ authToken
440
450
  });
441
451
  }
442
- async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId }) {
452
+ async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken }) {
443
453
  await this.initializeMessageTransport();
444
454
  if (!this.iframeMessageHandler) {
445
455
  throw new Error('Iframe message handler not initialized');
@@ -450,10 +460,11 @@ class DynamicWalletClient {
450
460
  oldThresholdSignatureScheme,
451
461
  newThresholdSignatureScheme,
452
462
  password,
453
- signedSessionId
463
+ signedSessionId,
464
+ authToken
454
465
  });
455
466
  }
456
- async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId }) {
467
+ async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
457
468
  const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
458
469
  container: displayContainer
459
470
  });
@@ -464,10 +475,11 @@ class DynamicWalletClient {
464
475
  chainName: this.chainName,
465
476
  accountAddress,
466
477
  password,
467
- signedSessionId
478
+ signedSessionId,
479
+ authToken
468
480
  });
469
481
  }
470
- async verifyPassword({ accountAddress, password, walletOperation = WalletOperation.NO_OPERATION, signedSessionId }) {
482
+ async verifyPassword({ accountAddress, password, walletOperation = WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
471
483
  await this.initializeMessageTransport();
472
484
  if (!this.iframeMessageHandler) {
473
485
  throw new Error('Iframe message handler not initialized');
@@ -477,10 +489,11 @@ class DynamicWalletClient {
477
489
  accountAddress,
478
490
  password,
479
491
  walletOperation,
480
- signedSessionId
492
+ signedSessionId,
493
+ authToken
481
494
  });
482
495
  }
483
- async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId }) {
496
+ async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken }) {
484
497
  await this.initializeMessageTransport();
485
498
  if (!this.iframeMessageHandler) {
486
499
  throw new Error('Iframe message handler not initialized');
@@ -490,10 +503,11 @@ class DynamicWalletClient {
490
503
  accountAddress,
491
504
  existingPassword,
492
505
  newPassword,
493
- signedSessionId
506
+ signedSessionId,
507
+ authToken
494
508
  });
495
509
  }
496
- async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId }) {
510
+ async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, authToken }) {
497
511
  await this.initializeMessageTransport();
498
512
  if (!this.iframeMessageHandler) {
499
513
  throw new Error('Iframe message handler not initialized');
@@ -502,10 +516,11 @@ class DynamicWalletClient {
502
516
  chainName: this.chainName,
503
517
  privateKey,
504
518
  thresholdSignatureScheme,
505
- signedSessionId
519
+ signedSessionId,
520
+ authToken
506
521
  });
507
522
  }
508
- async exportClientKeyshares({ accountAddress, password, signedSessionId }) {
523
+ async exportClientKeyshares({ accountAddress, password, signedSessionId, authToken }) {
509
524
  await this.initializeMessageTransport();
510
525
  if (!this.iframeMessageHandler) {
511
526
  throw new Error('Iframe message handler not initialized');
@@ -514,7 +529,8 @@ class DynamicWalletClient {
514
529
  chainName: this.chainName,
515
530
  accountAddress,
516
531
  password,
517
- signedSessionId
532
+ signedSessionId,
533
+ authToken
518
534
  });
519
535
  }
520
536
  /**
@@ -553,7 +569,7 @@ class DynamicWalletClient {
553
569
  this.iframe = null;
554
570
  }
555
571
  }
556
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, debug }){
572
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, debug }){
557
573
  this.logger = logger;
558
574
  this.instanceId = null;
559
575
  this.iframeDomain = null;
@@ -565,6 +581,7 @@ class DynamicWalletClient {
565
581
  this.baseApiUrl = baseApiUrl;
566
582
  this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
567
583
  this.chainName = chainName;
584
+ this.sdkVersion = sdkVersion;
568
585
  const environment = getEnvironmentFromUrl(baseApiUrl);
569
586
  this.iframeDomain = IFRAME_DOMAIN_MAP[environment];
570
587
  // Generate unique instanceId when client is created
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser-wallet-client",
3
- "version": "0.0.0-beta.232.7",
3
+ "version": "0.0.0-beta.232.8",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
- "@dynamic-labs-wallet/core": "0.0.0-beta.232.7",
6
+ "@dynamic-labs-wallet/core": "0.0.0-beta.232.8",
7
7
  "@dynamic-labs/message-transport": "^4.9.9",
8
8
  "@dynamic-labs/logger": "^4.9.9"
9
9
  },
@@ -8,7 +8,7 @@ export declare class DynamicWalletClient {
8
8
  instanceId: string | null;
9
9
  iframeDomain: string | null;
10
10
  environmentId: string;
11
- private readonly authToken;
11
+ private authToken;
12
12
  baseApiUrl: string;
13
13
  baseMPCRelayApiUrl: string;
14
14
  protected messageTransport: MessageTransportWithDefaultOrigin | null;
@@ -18,12 +18,14 @@ export declare class DynamicWalletClient {
18
18
  private debug;
19
19
  private static sharedIframe;
20
20
  private static iframeInstanceCount;
21
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, debug, }: {
21
+ sdkVersion: string | undefined;
22
+ constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, debug, }: {
22
23
  environmentId: string;
23
24
  authToken: string;
24
25
  baseApiUrl: string;
25
26
  baseMPCRelayApiUrl: string;
26
27
  chainName: string;
28
+ sdkVersion?: string;
27
29
  debug?: boolean;
28
30
  });
29
31
  initialize(): Promise<void>;
@@ -69,16 +71,17 @@ export declare class DynamicWalletClient {
69
71
  cleanup: () => void;
70
72
  }>;
71
73
  getWallets(): Promise<GetWalletResponse[]>;
72
- getWallet({ accountAddress, walletOperation, signedSessionId, }: {
74
+ getWallet({ accountAddress, walletOperation, signedSessionId, authToken, }: {
73
75
  accountAddress: string;
74
76
  walletOperation?: WalletOperation;
75
77
  signedSessionId?: string;
78
+ authToken?: string;
76
79
  }): Promise<GetWalletResponse>;
77
- createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, }: Omit<CreateWalletAccountRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
78
- requiresPasswordForOperation({ accountAddress, walletOperation, }: Omit<RequiresPasswordForOperationRequest, 'chainName'>): Promise<boolean>;
79
- isPasswordEncrypted({ accountAddress, }: Omit<IsPasswordEncryptedRequest, 'chainName'>): Promise<boolean>;
80
- signMessage({ message, accountAddress, password, signedSessionId, }: Omit<SignMessageRequest, 'chainName'>): Promise<string>;
81
- signRawMessage({ message, accountAddress, password, signedSessionId, }: Omit<SignRawMessageRequest, 'chainName'>): Promise<string>;
80
+ createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, authToken, }: Omit<CreateWalletAccountRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
81
+ requiresPasswordForOperation({ accountAddress, walletOperation, authToken, }: Omit<RequiresPasswordForOperationRequest, 'chainName'>): Promise<boolean>;
82
+ isPasswordEncrypted({ accountAddress, authToken, }: Omit<IsPasswordEncryptedRequest, 'chainName'>): Promise<boolean>;
83
+ signMessage({ message, accountAddress, password, signedSessionId, authToken, }: Omit<SignMessageRequest, 'chainName'>): Promise<string>;
84
+ signRawMessage({ message, accountAddress, password, signedSessionId, authToken, }: Omit<SignRawMessageRequest, 'chainName'>): Promise<string>;
82
85
  /**
83
86
  * Signs a transaction and returns the signature, @transaction is a string of the serialized transaction
84
87
  * EVM:
@@ -90,26 +93,28 @@ export declare class DynamicWalletClient {
90
93
  * const txBytes = await txb.build({ client });
91
94
  * const txString = Buffer.from(txBytes).toString("hex");
92
95
  */
93
- signTransaction({ senderAddress, transaction, password, signedSessionId, }: Omit<SignTransactionRequest, 'chainName'>): Promise<string>;
94
- backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, }: Omit<BackupKeySharesToGoogleDriveRequest, 'chainName'>): Promise<void>;
95
- restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, }: {
96
+ signTransaction({ senderAddress, transaction, password, signedSessionId, authToken, }: Omit<SignTransactionRequest, 'chainName'>): Promise<string>;
97
+ backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, authToken, }: Omit<BackupKeySharesToGoogleDriveRequest, 'chainName'>): Promise<void>;
98
+ restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken, }: {
96
99
  accountAddress: string;
97
100
  displayContainer: HTMLElement;
98
101
  password?: string;
99
102
  signedSessionId?: string;
103
+ authToken?: string;
100
104
  }): Promise<void>;
101
- refreshWalletAccountShares({ accountAddress, password, signedSessionId, }: Omit<RefreshWalletAccountSharesRequest, 'chainName'>): Promise<void>;
102
- reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, }: Omit<ReshareRequest, 'chainName'>): Promise<void>;
103
- exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, }: {
105
+ refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken, }: Omit<RefreshWalletAccountSharesRequest, 'chainName'>): Promise<void>;
106
+ reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken, }: Omit<ReshareRequest, 'chainName'>): Promise<void>;
107
+ exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, authToken, }: {
104
108
  accountAddress: string;
105
109
  displayContainer: HTMLElement;
106
110
  password?: string;
107
111
  signedSessionId?: string;
112
+ authToken?: string;
108
113
  }): Promise<void>;
109
- verifyPassword({ accountAddress, password, walletOperation, signedSessionId, }: Omit<VerifyPasswordRequest, 'chainName'>): Promise<void>;
110
- updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, }: Omit<UpdatePasswordRequest, 'chainName'>): Promise<void>;
111
- importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, }: Omit<ImportPrivateKeyRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
112
- exportClientKeyshares({ accountAddress, password, signedSessionId, }: Omit<ExportClientKeysharesRequest, 'chainName'>): Promise<void>;
114
+ verifyPassword({ accountAddress, password, walletOperation, signedSessionId, authToken, }: Omit<VerifyPasswordRequest, 'chainName'>): Promise<void>;
115
+ updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken, }: Omit<UpdatePasswordRequest, 'chainName'>): Promise<void>;
116
+ importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, authToken, }: Omit<ImportPrivateKeyRequest, 'chainName'>): Promise<CreateWalletAccountResponse>;
117
+ exportClientKeyshares({ accountAddress, password, signedSessionId, authToken, }: Omit<ExportClientKeysharesRequest, 'chainName'>): Promise<void>;
113
118
  /**
114
119
  * keyShares is stringified list of EcdsaKeygenResult[] and Ed25519KeygenResult[]
115
120
  */
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC3B,mCAAmC,EACnC,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,+BAA+B,EAC/B,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,cAAc,EACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,mBAAmB;IAC9B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GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrD,gBAAgB,CAAC,EACrB,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CACL,uBAAuB,EACvB,WAAW,CACZ,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAelC,qBAAqB,CAAC,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAelE;;OAEG;IACG,uBAAuB,CAAC,EAC5B,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAqB/B,OAAO;CAqBrB"}
@@ -1,15 +1,10 @@
1
1
  import { type MessageTransportWithDefaultOrigin, type RequestChannel } from '@dynamic-labs/message-transport';
2
- import type { IframeRequestMessages, WalletOperation, GetWalletResponse, CreateWalletAccountResponse, SignMessageRequest, RequiresPasswordForOperationRequest, SignTransactionRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RestoreBackupFromGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, ExportPrivateKeyRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, GetWalletsRequest, CreateWalletAccountRequest } from '@dynamic-labs-wallet/core';
2
+ import type { IframeRequestMessages, GetWalletResponse, CreateWalletAccountResponse, SignMessageRequest, RequiresPasswordForOperationRequest, SignTransactionRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RestoreBackupFromGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, ExportPrivateKeyRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, GetWalletsRequest, CreateWalletAccountRequest, GetWalletRequest } from '@dynamic-labs-wallet/core';
3
3
  export declare class iframeMessageHandler {
4
4
  requestChannel: RequestChannel<IframeRequestMessages>;
5
5
  constructor(messageTransport: MessageTransportWithDefaultOrigin);
6
6
  getWallets(request: GetWalletsRequest): Promise<GetWalletResponse[]>;
7
- getWallet({ chainName, accountAddress, walletOperation, signedSessionId, }: {
8
- chainName: string;
9
- accountAddress: string;
10
- walletOperation: WalletOperation;
11
- signedSessionId?: string;
12
- }): Promise<GetWalletResponse>;
7
+ getWallet(request: GetWalletRequest): Promise<GetWalletResponse>;
13
8
  createWalletAccount(request: CreateWalletAccountRequest): Promise<CreateWalletAccountResponse>;
14
9
  requiresPasswordForOperation(request: RequiresPasswordForOperationRequest): Promise<boolean>;
15
10
  signMessage(request: SignMessageRequest): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,mCAAmC,EACnC,sBAAsB,EACtB,0BAA0B,EAC1B,mCAAmC,EACnC,mCAAmC,EACnC,iCAAiC,EACjC,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,oBAAoB;IAC/B,cAAc,EAAE,cAA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qB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D,gBAAgB,CACpB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,2BAA2B,CAAC;IAIjC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,qBAAqB,CACzB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,IAAI,CAAC;IAIV,uBAAuB,CAC3B,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,+BAA+B,CAAC;IAIrC,OAAO;CAGd"}
1
+ {"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,kBAAkB,EAClB,mCAAmC,EACnC,sBAAsB,EACtB,0BAA0B,EAC1B,mCAAmC,EACnC,mCAAmC,EACnC,iCAAiC,EACjC,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,oBAAoB;IAC/B,cAAc,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;gBAE1C,gBAAgB,EAAE,iCAAiC;IAKzD,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIpE,SAAS,CAAC,OAAO,EAAE,gBAAgB;IAInC,mBAAmB,CACvB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAIjC,4BAA4B,CAChC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC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