@dynamic-labs-wallet/browser-wallet-client 0.0.177 → 0.0.178
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 +152 -203
- package/index.esm.js +152 -203
- package/package.json +2 -2
- package/src/client/client.d.ts +3 -1
- package/src/client/client.d.ts.map +1 -1
- package/src/services/iframeMessageHandler.d.ts +2 -1
- package/src/services/iframeMessageHandler.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -71,6 +71,10 @@ class iframeMessageHandler {
|
|
|
71
71
|
const response = await this.requestChannel.request('delegateKeyShares', request);
|
|
72
72
|
this.handleIframeMessageResponseError(response);
|
|
73
73
|
}
|
|
74
|
+
async revokeDelegation(request) {
|
|
75
|
+
const response = await this.requestChannel.request('revokeDelegation', request);
|
|
76
|
+
this.handleIframeMessageResponseError(response);
|
|
77
|
+
}
|
|
74
78
|
async restoreBackupFromGoogleDrive(request) {
|
|
75
79
|
const response = await this.requestChannel.request('restoreBackupFromGoogleDrive', request);
|
|
76
80
|
this.handleIframeMessageResponseError(response);
|
|
@@ -527,96 +531,75 @@ IframeManager.sharedIframe = null;
|
|
|
527
531
|
IframeManager.iframeInstanceCount = 0;
|
|
528
532
|
|
|
529
533
|
class DynamicWalletClient extends IframeManager {
|
|
530
|
-
async
|
|
534
|
+
async withHandler(operation) {
|
|
531
535
|
await this.initializeMessageTransport();
|
|
532
536
|
if (!this.iframeMessageHandler) {
|
|
533
537
|
throw new Error('Iframe message handler not initialized');
|
|
534
538
|
}
|
|
535
|
-
return this.iframeMessageHandler
|
|
536
|
-
|
|
537
|
-
|
|
539
|
+
return operation(this.iframeMessageHandler);
|
|
540
|
+
}
|
|
541
|
+
async getWallets() {
|
|
542
|
+
return this.withHandler((handler)=>handler.getWallets({
|
|
543
|
+
chainName: this.chainName
|
|
544
|
+
}));
|
|
538
545
|
}
|
|
539
546
|
async getWallet({ accountAddress, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
walletOperation,
|
|
548
|
-
signedSessionId,
|
|
549
|
-
authToken
|
|
550
|
-
});
|
|
547
|
+
return this.withHandler((handler)=>handler.getWallet({
|
|
548
|
+
chainName: this.chainName,
|
|
549
|
+
accountAddress,
|
|
550
|
+
walletOperation,
|
|
551
|
+
signedSessionId,
|
|
552
|
+
authToken
|
|
553
|
+
}));
|
|
551
554
|
}
|
|
552
555
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
password,
|
|
561
|
-
signedSessionId,
|
|
562
|
-
authToken
|
|
563
|
-
});
|
|
556
|
+
return this.withHandler((handler)=>handler.createWalletAccount({
|
|
557
|
+
chainName: this.chainName,
|
|
558
|
+
thresholdSignatureScheme,
|
|
559
|
+
password,
|
|
560
|
+
signedSessionId,
|
|
561
|
+
authToken
|
|
562
|
+
}));
|
|
564
563
|
}
|
|
565
564
|
async requiresPasswordForOperation({ accountAddress, walletOperation = core.WalletOperation.REACH_THRESHOLD, authToken }) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
accountAddress,
|
|
573
|
-
walletOperation,
|
|
574
|
-
authToken
|
|
575
|
-
});
|
|
565
|
+
return this.withHandler((handler)=>handler.requiresPasswordForOperation({
|
|
566
|
+
chainName: this.chainName,
|
|
567
|
+
accountAddress,
|
|
568
|
+
walletOperation,
|
|
569
|
+
authToken
|
|
570
|
+
}));
|
|
576
571
|
}
|
|
577
572
|
async isPasswordEncrypted({ accountAddress, authToken }) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
chainName: this.chainName,
|
|
584
|
-
accountAddress,
|
|
585
|
-
authToken
|
|
586
|
-
});
|
|
573
|
+
return this.withHandler((handler)=>handler.isPasswordEncrypted({
|
|
574
|
+
chainName: this.chainName,
|
|
575
|
+
accountAddress,
|
|
576
|
+
authToken
|
|
577
|
+
}));
|
|
587
578
|
}
|
|
588
579
|
async signMessage({ message, accountAddress, password = undefined, signedSessionId, authToken, mfaToken, context }) {
|
|
589
|
-
await this.initializeMessageTransport();
|
|
590
|
-
if (!this.iframeMessageHandler) {
|
|
591
|
-
throw new Error('Iframe message handler not initialized');
|
|
592
|
-
}
|
|
593
580
|
const contextString = JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value);
|
|
594
|
-
return this.
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
581
|
+
return this.withHandler((handler)=>handler.signMessage({
|
|
582
|
+
chainName: this.chainName,
|
|
583
|
+
message,
|
|
584
|
+
accountAddress,
|
|
585
|
+
password,
|
|
586
|
+
signedSessionId,
|
|
587
|
+
authToken,
|
|
588
|
+
mfaToken,
|
|
589
|
+
context: contextString
|
|
590
|
+
}));
|
|
604
591
|
}
|
|
605
592
|
async signRawMessage({ message, accountAddress, password = undefined, signedSessionId, authToken, mfaToken, context }) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
authToken,
|
|
617
|
-
mfaToken,
|
|
618
|
-
context
|
|
619
|
-
});
|
|
593
|
+
return this.withHandler((handler)=>handler.signRawMessage({
|
|
594
|
+
chainName: this.chainName,
|
|
595
|
+
message,
|
|
596
|
+
accountAddress,
|
|
597
|
+
password,
|
|
598
|
+
signedSessionId,
|
|
599
|
+
authToken,
|
|
600
|
+
mfaToken,
|
|
601
|
+
context
|
|
602
|
+
}));
|
|
620
603
|
}
|
|
621
604
|
/**
|
|
622
605
|
* Signs a transaction and returns the signature, @transaction is a string of the serialized transaction
|
|
@@ -629,62 +612,56 @@ class DynamicWalletClient extends IframeManager {
|
|
|
629
612
|
* const txBytes = await txb.build({ client });
|
|
630
613
|
* const txString = Buffer.from(txBytes).toString("hex");
|
|
631
614
|
*/ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, authToken, mfaToken, chainId }) {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
authToken,
|
|
643
|
-
mfaToken,
|
|
644
|
-
chainId
|
|
645
|
-
});
|
|
615
|
+
return this.withHandler((handler)=>handler.signTransaction({
|
|
616
|
+
chainName: this.chainName,
|
|
617
|
+
senderAddress,
|
|
618
|
+
transaction,
|
|
619
|
+
password,
|
|
620
|
+
signedSessionId,
|
|
621
|
+
authToken,
|
|
622
|
+
mfaToken,
|
|
623
|
+
chainId
|
|
624
|
+
}));
|
|
646
625
|
}
|
|
647
626
|
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, authToken, mfaToken }) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
signedSessionId,
|
|
658
|
-
authToken,
|
|
659
|
-
mfaToken
|
|
660
|
-
});
|
|
627
|
+
return this.withHandler((handler)=>handler.signTypedData({
|
|
628
|
+
chainName: this.chainName,
|
|
629
|
+
accountAddress,
|
|
630
|
+
typedData: JSON.stringify(typedData),
|
|
631
|
+
password,
|
|
632
|
+
signedSessionId,
|
|
633
|
+
authToken,
|
|
634
|
+
mfaToken
|
|
635
|
+
}));
|
|
661
636
|
}
|
|
662
637
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
password,
|
|
671
|
-
signedSessionId,
|
|
672
|
-
authToken
|
|
673
|
-
});
|
|
638
|
+
return this.withHandler((handler)=>handler.backupKeySharesToGoogleDrive({
|
|
639
|
+
chainName: this.chainName,
|
|
640
|
+
accountAddress,
|
|
641
|
+
password,
|
|
642
|
+
signedSessionId,
|
|
643
|
+
authToken
|
|
644
|
+
}));
|
|
674
645
|
}
|
|
675
646
|
async delegateKeyShares({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
647
|
+
return this.withHandler((handler)=>handler.delegateKeyShares({
|
|
648
|
+
chainName: this.chainName,
|
|
649
|
+
accountAddress,
|
|
650
|
+
password,
|
|
651
|
+
signedSessionId,
|
|
652
|
+
authToken,
|
|
653
|
+
mfaToken
|
|
654
|
+
}));
|
|
655
|
+
}
|
|
656
|
+
async revokeDelegation({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
657
|
+
return this.withHandler((handler)=>handler.revokeDelegation({
|
|
658
|
+
chainName: this.chainName,
|
|
659
|
+
accountAddress,
|
|
660
|
+
password,
|
|
661
|
+
signedSessionId,
|
|
662
|
+
authToken,
|
|
663
|
+
mfaToken
|
|
664
|
+
}));
|
|
688
665
|
}
|
|
689
666
|
async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
|
|
690
667
|
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
@@ -702,34 +679,26 @@ class DynamicWalletClient extends IframeManager {
|
|
|
702
679
|
});
|
|
703
680
|
}
|
|
704
681
|
async refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
signedSessionId,
|
|
714
|
-
authToken,
|
|
715
|
-
mfaToken
|
|
716
|
-
});
|
|
682
|
+
return this.withHandler((handler)=>handler.refreshWalletAccountShares({
|
|
683
|
+
chainName: this.chainName,
|
|
684
|
+
accountAddress,
|
|
685
|
+
password,
|
|
686
|
+
signedSessionId,
|
|
687
|
+
authToken,
|
|
688
|
+
mfaToken
|
|
689
|
+
}));
|
|
717
690
|
}
|
|
718
691
|
async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken, mfaToken }) {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
signedSessionId,
|
|
730
|
-
authToken,
|
|
731
|
-
mfaToken
|
|
732
|
-
});
|
|
692
|
+
return this.withHandler((handler)=>handler.reshare({
|
|
693
|
+
chainName: this.chainName,
|
|
694
|
+
accountAddress,
|
|
695
|
+
oldThresholdSignatureScheme,
|
|
696
|
+
newThresholdSignatureScheme,
|
|
697
|
+
password,
|
|
698
|
+
signedSessionId,
|
|
699
|
+
authToken,
|
|
700
|
+
mfaToken
|
|
701
|
+
}));
|
|
733
702
|
}
|
|
734
703
|
async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, authToken, mfaToken }) {
|
|
735
704
|
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
@@ -748,66 +717,46 @@ class DynamicWalletClient extends IframeManager {
|
|
|
748
717
|
});
|
|
749
718
|
}
|
|
750
719
|
async verifyPassword({ accountAddress, password, walletOperation = core.WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
walletOperation,
|
|
760
|
-
signedSessionId,
|
|
761
|
-
authToken
|
|
762
|
-
});
|
|
720
|
+
return this.withHandler((handler)=>handler.verifyPassword({
|
|
721
|
+
chainName: this.chainName,
|
|
722
|
+
accountAddress,
|
|
723
|
+
password,
|
|
724
|
+
walletOperation,
|
|
725
|
+
signedSessionId,
|
|
726
|
+
authToken
|
|
727
|
+
}));
|
|
763
728
|
}
|
|
764
729
|
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken }) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
newPassword,
|
|
774
|
-
signedSessionId,
|
|
775
|
-
authToken
|
|
776
|
-
});
|
|
730
|
+
return this.withHandler((handler)=>handler.updatePassword({
|
|
731
|
+
chainName: this.chainName,
|
|
732
|
+
accountAddress,
|
|
733
|
+
existingPassword,
|
|
734
|
+
newPassword,
|
|
735
|
+
signedSessionId,
|
|
736
|
+
authToken
|
|
737
|
+
}));
|
|
777
738
|
}
|
|
778
739
|
async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, authToken }) {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
thresholdSignatureScheme,
|
|
787
|
-
signedSessionId,
|
|
788
|
-
authToken
|
|
789
|
-
});
|
|
740
|
+
return this.withHandler((handler)=>handler.importPrivateKey({
|
|
741
|
+
chainName: this.chainName,
|
|
742
|
+
privateKey,
|
|
743
|
+
thresholdSignatureScheme,
|
|
744
|
+
signedSessionId,
|
|
745
|
+
authToken
|
|
746
|
+
}));
|
|
790
747
|
}
|
|
791
748
|
async exportClientKeyshares({ accountAddress, password, signedSessionId, authToken }) {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
password,
|
|
800
|
-
signedSessionId,
|
|
801
|
-
authToken
|
|
802
|
-
});
|
|
749
|
+
return this.withHandler((handler)=>handler.exportClientKeyshares({
|
|
750
|
+
chainName: this.chainName,
|
|
751
|
+
accountAddress,
|
|
752
|
+
password,
|
|
753
|
+
signedSessionId,
|
|
754
|
+
authToken
|
|
755
|
+
}));
|
|
803
756
|
}
|
|
804
757
|
/**
|
|
805
758
|
* keyShares is stringified list of EcdsaKeygenResult[] and Ed25519KeygenResult[]
|
|
806
759
|
*/ async offlineExportPrivateKey({ keyShares, derivationPath }) {
|
|
807
|
-
await this.initializeMessageTransport();
|
|
808
|
-
if (!this.iframeMessageHandler) {
|
|
809
|
-
throw new Error('Iframe message handler not initialized');
|
|
810
|
-
}
|
|
811
760
|
const args = {
|
|
812
761
|
chainName: this.chainName,
|
|
813
762
|
keyShares,
|
|
@@ -816,10 +765,10 @@ class DynamicWalletClient extends IframeManager {
|
|
|
816
765
|
const serializedArgs = JSON.stringify(args);
|
|
817
766
|
const argsBuffer = new TextEncoder().encode(serializedArgs);
|
|
818
767
|
const base64Args = Buffer.from(argsBuffer).toString('base64');
|
|
819
|
-
return this.
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
768
|
+
return this.withHandler((handler)=>handler.offlineExportPrivateKey({
|
|
769
|
+
chainName: this.chainName,
|
|
770
|
+
base64Args
|
|
771
|
+
}));
|
|
823
772
|
}
|
|
824
773
|
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, debug, authMode = core.AuthMode.HEADER }){
|
|
825
774
|
super({
|
package/index.esm.js
CHANGED
|
@@ -70,6 +70,10 @@ class iframeMessageHandler {
|
|
|
70
70
|
const response = await this.requestChannel.request('delegateKeyShares', request);
|
|
71
71
|
this.handleIframeMessageResponseError(response);
|
|
72
72
|
}
|
|
73
|
+
async revokeDelegation(request) {
|
|
74
|
+
const response = await this.requestChannel.request('revokeDelegation', request);
|
|
75
|
+
this.handleIframeMessageResponseError(response);
|
|
76
|
+
}
|
|
73
77
|
async restoreBackupFromGoogleDrive(request) {
|
|
74
78
|
const response = await this.requestChannel.request('restoreBackupFromGoogleDrive', request);
|
|
75
79
|
this.handleIframeMessageResponseError(response);
|
|
@@ -526,96 +530,75 @@ IframeManager.sharedIframe = null;
|
|
|
526
530
|
IframeManager.iframeInstanceCount = 0;
|
|
527
531
|
|
|
528
532
|
class DynamicWalletClient extends IframeManager {
|
|
529
|
-
async
|
|
533
|
+
async withHandler(operation) {
|
|
530
534
|
await this.initializeMessageTransport();
|
|
531
535
|
if (!this.iframeMessageHandler) {
|
|
532
536
|
throw new Error('Iframe message handler not initialized');
|
|
533
537
|
}
|
|
534
|
-
return this.iframeMessageHandler
|
|
535
|
-
|
|
536
|
-
|
|
538
|
+
return operation(this.iframeMessageHandler);
|
|
539
|
+
}
|
|
540
|
+
async getWallets() {
|
|
541
|
+
return this.withHandler((handler)=>handler.getWallets({
|
|
542
|
+
chainName: this.chainName
|
|
543
|
+
}));
|
|
537
544
|
}
|
|
538
545
|
async getWallet({ accountAddress, walletOperation = WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
walletOperation,
|
|
547
|
-
signedSessionId,
|
|
548
|
-
authToken
|
|
549
|
-
});
|
|
546
|
+
return this.withHandler((handler)=>handler.getWallet({
|
|
547
|
+
chainName: this.chainName,
|
|
548
|
+
accountAddress,
|
|
549
|
+
walletOperation,
|
|
550
|
+
signedSessionId,
|
|
551
|
+
authToken
|
|
552
|
+
}));
|
|
550
553
|
}
|
|
551
554
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, authToken }) {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
password,
|
|
560
|
-
signedSessionId,
|
|
561
|
-
authToken
|
|
562
|
-
});
|
|
555
|
+
return this.withHandler((handler)=>handler.createWalletAccount({
|
|
556
|
+
chainName: this.chainName,
|
|
557
|
+
thresholdSignatureScheme,
|
|
558
|
+
password,
|
|
559
|
+
signedSessionId,
|
|
560
|
+
authToken
|
|
561
|
+
}));
|
|
563
562
|
}
|
|
564
563
|
async requiresPasswordForOperation({ accountAddress, walletOperation = WalletOperation.REACH_THRESHOLD, authToken }) {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
accountAddress,
|
|
572
|
-
walletOperation,
|
|
573
|
-
authToken
|
|
574
|
-
});
|
|
564
|
+
return this.withHandler((handler)=>handler.requiresPasswordForOperation({
|
|
565
|
+
chainName: this.chainName,
|
|
566
|
+
accountAddress,
|
|
567
|
+
walletOperation,
|
|
568
|
+
authToken
|
|
569
|
+
}));
|
|
575
570
|
}
|
|
576
571
|
async isPasswordEncrypted({ accountAddress, authToken }) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
chainName: this.chainName,
|
|
583
|
-
accountAddress,
|
|
584
|
-
authToken
|
|
585
|
-
});
|
|
572
|
+
return this.withHandler((handler)=>handler.isPasswordEncrypted({
|
|
573
|
+
chainName: this.chainName,
|
|
574
|
+
accountAddress,
|
|
575
|
+
authToken
|
|
576
|
+
}));
|
|
586
577
|
}
|
|
587
578
|
async signMessage({ message, accountAddress, password = undefined, signedSessionId, authToken, mfaToken, context }) {
|
|
588
|
-
await this.initializeMessageTransport();
|
|
589
|
-
if (!this.iframeMessageHandler) {
|
|
590
|
-
throw new Error('Iframe message handler not initialized');
|
|
591
|
-
}
|
|
592
579
|
const contextString = JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value);
|
|
593
|
-
return this.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
580
|
+
return this.withHandler((handler)=>handler.signMessage({
|
|
581
|
+
chainName: this.chainName,
|
|
582
|
+
message,
|
|
583
|
+
accountAddress,
|
|
584
|
+
password,
|
|
585
|
+
signedSessionId,
|
|
586
|
+
authToken,
|
|
587
|
+
mfaToken,
|
|
588
|
+
context: contextString
|
|
589
|
+
}));
|
|
603
590
|
}
|
|
604
591
|
async signRawMessage({ message, accountAddress, password = undefined, signedSessionId, authToken, mfaToken, context }) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
authToken,
|
|
616
|
-
mfaToken,
|
|
617
|
-
context
|
|
618
|
-
});
|
|
592
|
+
return this.withHandler((handler)=>handler.signRawMessage({
|
|
593
|
+
chainName: this.chainName,
|
|
594
|
+
message,
|
|
595
|
+
accountAddress,
|
|
596
|
+
password,
|
|
597
|
+
signedSessionId,
|
|
598
|
+
authToken,
|
|
599
|
+
mfaToken,
|
|
600
|
+
context
|
|
601
|
+
}));
|
|
619
602
|
}
|
|
620
603
|
/**
|
|
621
604
|
* Signs a transaction and returns the signature, @transaction is a string of the serialized transaction
|
|
@@ -628,62 +611,56 @@ class DynamicWalletClient extends IframeManager {
|
|
|
628
611
|
* const txBytes = await txb.build({ client });
|
|
629
612
|
* const txString = Buffer.from(txBytes).toString("hex");
|
|
630
613
|
*/ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, authToken, mfaToken, chainId }) {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
authToken,
|
|
642
|
-
mfaToken,
|
|
643
|
-
chainId
|
|
644
|
-
});
|
|
614
|
+
return this.withHandler((handler)=>handler.signTransaction({
|
|
615
|
+
chainName: this.chainName,
|
|
616
|
+
senderAddress,
|
|
617
|
+
transaction,
|
|
618
|
+
password,
|
|
619
|
+
signedSessionId,
|
|
620
|
+
authToken,
|
|
621
|
+
mfaToken,
|
|
622
|
+
chainId
|
|
623
|
+
}));
|
|
645
624
|
}
|
|
646
625
|
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, authToken, mfaToken }) {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
signedSessionId,
|
|
657
|
-
authToken,
|
|
658
|
-
mfaToken
|
|
659
|
-
});
|
|
626
|
+
return this.withHandler((handler)=>handler.signTypedData({
|
|
627
|
+
chainName: this.chainName,
|
|
628
|
+
accountAddress,
|
|
629
|
+
typedData: JSON.stringify(typedData),
|
|
630
|
+
password,
|
|
631
|
+
signedSessionId,
|
|
632
|
+
authToken,
|
|
633
|
+
mfaToken
|
|
634
|
+
}));
|
|
660
635
|
}
|
|
661
636
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId, authToken }) {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
password,
|
|
670
|
-
signedSessionId,
|
|
671
|
-
authToken
|
|
672
|
-
});
|
|
637
|
+
return this.withHandler((handler)=>handler.backupKeySharesToGoogleDrive({
|
|
638
|
+
chainName: this.chainName,
|
|
639
|
+
accountAddress,
|
|
640
|
+
password,
|
|
641
|
+
signedSessionId,
|
|
642
|
+
authToken
|
|
643
|
+
}));
|
|
673
644
|
}
|
|
674
645
|
async delegateKeyShares({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
646
|
+
return this.withHandler((handler)=>handler.delegateKeyShares({
|
|
647
|
+
chainName: this.chainName,
|
|
648
|
+
accountAddress,
|
|
649
|
+
password,
|
|
650
|
+
signedSessionId,
|
|
651
|
+
authToken,
|
|
652
|
+
mfaToken
|
|
653
|
+
}));
|
|
654
|
+
}
|
|
655
|
+
async revokeDelegation({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
656
|
+
return this.withHandler((handler)=>handler.revokeDelegation({
|
|
657
|
+
chainName: this.chainName,
|
|
658
|
+
accountAddress,
|
|
659
|
+
password,
|
|
660
|
+
signedSessionId,
|
|
661
|
+
authToken,
|
|
662
|
+
mfaToken
|
|
663
|
+
}));
|
|
687
664
|
}
|
|
688
665
|
async restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken }) {
|
|
689
666
|
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
@@ -701,34 +678,26 @@ class DynamicWalletClient extends IframeManager {
|
|
|
701
678
|
});
|
|
702
679
|
}
|
|
703
680
|
async refreshWalletAccountShares({ accountAddress, password, signedSessionId, authToken, mfaToken }) {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
signedSessionId,
|
|
713
|
-
authToken,
|
|
714
|
-
mfaToken
|
|
715
|
-
});
|
|
681
|
+
return this.withHandler((handler)=>handler.refreshWalletAccountShares({
|
|
682
|
+
chainName: this.chainName,
|
|
683
|
+
accountAddress,
|
|
684
|
+
password,
|
|
685
|
+
signedSessionId,
|
|
686
|
+
authToken,
|
|
687
|
+
mfaToken
|
|
688
|
+
}));
|
|
716
689
|
}
|
|
717
690
|
async reshare({ accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, signedSessionId, authToken, mfaToken }) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
signedSessionId,
|
|
729
|
-
authToken,
|
|
730
|
-
mfaToken
|
|
731
|
-
});
|
|
691
|
+
return this.withHandler((handler)=>handler.reshare({
|
|
692
|
+
chainName: this.chainName,
|
|
693
|
+
accountAddress,
|
|
694
|
+
oldThresholdSignatureScheme,
|
|
695
|
+
newThresholdSignatureScheme,
|
|
696
|
+
password,
|
|
697
|
+
signedSessionId,
|
|
698
|
+
authToken,
|
|
699
|
+
mfaToken
|
|
700
|
+
}));
|
|
732
701
|
}
|
|
733
702
|
async exportPrivateKey({ accountAddress, displayContainer, password, signedSessionId, authToken, mfaToken }) {
|
|
734
703
|
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
@@ -747,66 +716,46 @@ class DynamicWalletClient extends IframeManager {
|
|
|
747
716
|
});
|
|
748
717
|
}
|
|
749
718
|
async verifyPassword({ accountAddress, password, walletOperation = WalletOperation.NO_OPERATION, signedSessionId, authToken }) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
walletOperation,
|
|
759
|
-
signedSessionId,
|
|
760
|
-
authToken
|
|
761
|
-
});
|
|
719
|
+
return this.withHandler((handler)=>handler.verifyPassword({
|
|
720
|
+
chainName: this.chainName,
|
|
721
|
+
accountAddress,
|
|
722
|
+
password,
|
|
723
|
+
walletOperation,
|
|
724
|
+
signedSessionId,
|
|
725
|
+
authToken
|
|
726
|
+
}));
|
|
762
727
|
}
|
|
763
728
|
async updatePassword({ accountAddress, existingPassword, newPassword, signedSessionId, authToken }) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
newPassword,
|
|
773
|
-
signedSessionId,
|
|
774
|
-
authToken
|
|
775
|
-
});
|
|
729
|
+
return this.withHandler((handler)=>handler.updatePassword({
|
|
730
|
+
chainName: this.chainName,
|
|
731
|
+
accountAddress,
|
|
732
|
+
existingPassword,
|
|
733
|
+
newPassword,
|
|
734
|
+
signedSessionId,
|
|
735
|
+
authToken
|
|
736
|
+
}));
|
|
776
737
|
}
|
|
777
738
|
async importPrivateKey({ privateKey, thresholdSignatureScheme, signedSessionId, authToken }) {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
thresholdSignatureScheme,
|
|
786
|
-
signedSessionId,
|
|
787
|
-
authToken
|
|
788
|
-
});
|
|
739
|
+
return this.withHandler((handler)=>handler.importPrivateKey({
|
|
740
|
+
chainName: this.chainName,
|
|
741
|
+
privateKey,
|
|
742
|
+
thresholdSignatureScheme,
|
|
743
|
+
signedSessionId,
|
|
744
|
+
authToken
|
|
745
|
+
}));
|
|
789
746
|
}
|
|
790
747
|
async exportClientKeyshares({ accountAddress, password, signedSessionId, authToken }) {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
password,
|
|
799
|
-
signedSessionId,
|
|
800
|
-
authToken
|
|
801
|
-
});
|
|
748
|
+
return this.withHandler((handler)=>handler.exportClientKeyshares({
|
|
749
|
+
chainName: this.chainName,
|
|
750
|
+
accountAddress,
|
|
751
|
+
password,
|
|
752
|
+
signedSessionId,
|
|
753
|
+
authToken
|
|
754
|
+
}));
|
|
802
755
|
}
|
|
803
756
|
/**
|
|
804
757
|
* keyShares is stringified list of EcdsaKeygenResult[] and Ed25519KeygenResult[]
|
|
805
758
|
*/ async offlineExportPrivateKey({ keyShares, derivationPath }) {
|
|
806
|
-
await this.initializeMessageTransport();
|
|
807
|
-
if (!this.iframeMessageHandler) {
|
|
808
|
-
throw new Error('Iframe message handler not initialized');
|
|
809
|
-
}
|
|
810
759
|
const args = {
|
|
811
760
|
chainName: this.chainName,
|
|
812
761
|
keyShares,
|
|
@@ -815,10 +764,10 @@ class DynamicWalletClient extends IframeManager {
|
|
|
815
764
|
const serializedArgs = JSON.stringify(args);
|
|
816
765
|
const argsBuffer = new TextEncoder().encode(serializedArgs);
|
|
817
766
|
const base64Args = Buffer.from(argsBuffer).toString('base64');
|
|
818
|
-
return this.
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
767
|
+
return this.withHandler((handler)=>handler.offlineExportPrivateKey({
|
|
768
|
+
chainName: this.chainName,
|
|
769
|
+
base64Args
|
|
770
|
+
}));
|
|
822
771
|
}
|
|
823
772
|
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, chainName, sdkVersion, debug, authMode = AuthMode.HEADER }){
|
|
824
773
|
super({
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.178",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.178",
|
|
8
8
|
"@dynamic-labs/logger": "^4.25.3",
|
|
9
9
|
"@dynamic-labs/message-transport": "^4.25.3",
|
|
10
10
|
"uuid": "11.1.0"
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, DelegateKeySharesRequest, ExportClientKeysharesRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, SignMessageRequestBrowser, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest } from '@dynamic-labs-wallet/core';
|
|
1
|
+
import type { BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, DelegateKeySharesRequest, ExportClientKeysharesRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, RevokeDelegationRequest, SignMessageRequestBrowser, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest } from '@dynamic-labs-wallet/core';
|
|
2
2
|
import { AuthMode, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
3
3
|
import { IframeManager } from './iframeManager/index.js';
|
|
4
4
|
export declare class DynamicWalletClient extends IframeManager {
|
|
@@ -12,6 +12,7 @@ export declare class DynamicWalletClient extends IframeManager {
|
|
|
12
12
|
debug?: boolean;
|
|
13
13
|
authMode?: AuthMode;
|
|
14
14
|
});
|
|
15
|
+
private withHandler;
|
|
15
16
|
getWallets(): Promise<GetWalletResponse[]>;
|
|
16
17
|
getWallet({ accountAddress, walletOperation, signedSessionId, authToken, }: {
|
|
17
18
|
accountAddress: string;
|
|
@@ -39,6 +40,7 @@ export declare class DynamicWalletClient extends IframeManager {
|
|
|
39
40
|
signTypedData({ accountAddress, typedData, password, signedSessionId, authToken, mfaToken, }: Omit<SignTypedDataRequest, 'chainName'>): Promise<string>;
|
|
40
41
|
backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, authToken, }: Omit<BackupKeySharesToGoogleDriveRequest, 'chainName'>): Promise<void>;
|
|
41
42
|
delegateKeyShares({ accountAddress, password, signedSessionId, authToken, mfaToken, }: Omit<DelegateKeySharesRequest, 'chainName'>): Promise<void>;
|
|
43
|
+
revokeDelegation({ accountAddress, password, signedSessionId, authToken, mfaToken, }: Omit<RevokeDelegationRequest, 'chainName'>): Promise<void>;
|
|
42
44
|
restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, authToken, }: {
|
|
43
45
|
accountAddress: string;
|
|
44
46
|
displayContainer: HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,mCAAmC,EACnC,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,qBAAa,mBAAoB,SAAQ,aAAa;gBACxC,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAA0B,GAC3B,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,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EACd,QAAQ,EACR,eAA8C,EAC9C,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAarD,cAAc,CAAC,EACnB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAarD,gBAAgB,CAAC,EACrB,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CACL,uBAAuB,EACvB,WAAW,CACZ,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAYlC,qBAAqB,CAAC,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,SAAS,GACV,EAAE,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYlE;;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;CAkB7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AuthMode, BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, DelegateKeySharesRequest, ExportClientKeysharesRequest, ExportPrivateKeyRequest, GetWalletRequest, GetWalletResponse, GetWalletsRequest, IframeRequestMessages, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, MessageTransportErrorResponse, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, RestoreBackupFromGoogleDriveRequest, RevokeDelegationRequest, SignMessageRequest, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest } from '@dynamic-labs-wallet/core';
|
|
1
2
|
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, GetWalletRequest, SignTypedDataRequest, DelegateKeySharesRequest, AuthMode, MessageTransportErrorResponse } from '@dynamic-labs-wallet/core';
|
|
3
3
|
export declare class iframeMessageHandler {
|
|
4
4
|
requestChannel: RequestChannel<IframeRequestMessages>;
|
|
5
5
|
constructor(messageTransport: MessageTransportWithDefaultOrigin);
|
|
@@ -14,6 +14,7 @@ export declare class iframeMessageHandler {
|
|
|
14
14
|
isPasswordEncrypted(request: IsPasswordEncryptedRequest): Promise<boolean>;
|
|
15
15
|
backupKeySharesToGoogleDrive(request: BackupKeySharesToGoogleDriveRequest): Promise<void>;
|
|
16
16
|
delegateKeyShares(request: DelegateKeySharesRequest): Promise<void>;
|
|
17
|
+
revokeDelegation(request: RevokeDelegationRequest): Promise<void>;
|
|
17
18
|
restoreBackupFromGoogleDrive(request: RestoreBackupFromGoogleDriveRequest): Promise<void>;
|
|
18
19
|
refreshWalletAccountShares(request: RefreshWalletAccountSharesRequest): Promise<void>;
|
|
19
20
|
reshare(request: ReshareRequest): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"iframeMess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