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