@dynamic-labs-wallet/browser 0.0.83 → 0.0.85
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 +184 -83
- package/index.esm.js +177 -84
- package/package.json +2 -2
- package/src/client.d.ts.map +1 -1
- package/src/errorConstants.d.ts +9 -0
- package/src/errorConstants.d.ts.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -520,6 +520,7 @@ class DynamicWalletClient {
|
|
|
520
520
|
onError,
|
|
521
521
|
onCeremonyComplete
|
|
522
522
|
});
|
|
523
|
+
this.logger.debug(`[DynamicWaasWalletClient] Initialized client key generation with IDs: ${clientKeygenIds.join(', ')} for chain: ${chainName} using scheme: ${thresholdSignatureScheme}`);
|
|
523
524
|
return data;
|
|
524
525
|
}
|
|
525
526
|
async clientInitializeKeyGen({ chainName, thresholdSignatureScheme }) {
|
|
@@ -591,12 +592,23 @@ class DynamicWalletClient {
|
|
|
591
592
|
thresholdSignatureScheme
|
|
592
593
|
});
|
|
593
594
|
const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
|
|
595
|
+
this.logger.debug('[DynamicWaasWalletClient] Initialized client key generation', {
|
|
596
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
597
|
+
chainName,
|
|
598
|
+
thresholdSignatureScheme
|
|
599
|
+
});
|
|
594
600
|
const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
|
|
595
601
|
chainName,
|
|
596
602
|
clientKeygenIds,
|
|
597
603
|
thresholdSignatureScheme,
|
|
598
604
|
onCeremonyComplete
|
|
599
605
|
});
|
|
606
|
+
this.logger.debug('[DynamicWaasWalletClient] Server key generation initialized', {
|
|
607
|
+
roomId,
|
|
608
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
609
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
610
|
+
chainName
|
|
611
|
+
});
|
|
600
612
|
const { rawPublicKey, clientKeygenResults: clientKeyShares } = await this.clientKeyGen({
|
|
601
613
|
chainName,
|
|
602
614
|
roomId,
|
|
@@ -604,60 +616,93 @@ class DynamicWalletClient {
|
|
|
604
616
|
clientKeygenInitResults,
|
|
605
617
|
thresholdSignatureScheme
|
|
606
618
|
});
|
|
619
|
+
this.logger.debug('[DynamicWaasWalletClient] Client key generation completed', {
|
|
620
|
+
roomId,
|
|
621
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
622
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
623
|
+
chainName,
|
|
624
|
+
thresholdSignatureScheme,
|
|
625
|
+
rawPublicKey,
|
|
626
|
+
clientKeySharesCount: clientKeyShares.length
|
|
627
|
+
});
|
|
607
628
|
return {
|
|
608
629
|
rawPublicKey,
|
|
609
630
|
clientKeyShares
|
|
610
631
|
};
|
|
611
632
|
} catch (error) {
|
|
612
|
-
this.logger.error('Error keygen', error);
|
|
633
|
+
this.logger.error('[DynamicWaasWalletClient]: Error keygen', error);
|
|
613
634
|
throw error;
|
|
614
635
|
}
|
|
615
636
|
}
|
|
616
637
|
async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, onError, onCeremonyComplete }) {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
638
|
+
try {
|
|
639
|
+
const mpcSigner = getMPCSigner({
|
|
640
|
+
chainName,
|
|
641
|
+
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
642
|
+
});
|
|
643
|
+
const clientKeygenInitResults = await this.clientInitializeKeyGen({
|
|
644
|
+
chainName,
|
|
645
|
+
thresholdSignatureScheme
|
|
646
|
+
});
|
|
647
|
+
const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
|
|
648
|
+
this.logger.debug('[DynamicWaasWalletClient] Client key generation initialized', {
|
|
649
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
650
|
+
chainName,
|
|
651
|
+
thresholdSignatureScheme
|
|
652
|
+
});
|
|
653
|
+
const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
|
|
654
|
+
chainName,
|
|
655
|
+
clientKeygenIds,
|
|
656
|
+
thresholdSignatureScheme,
|
|
657
|
+
onError,
|
|
658
|
+
onCeremonyComplete
|
|
659
|
+
});
|
|
660
|
+
this.logger.debug('[DynamicWaasWalletClient] Server key generation initialized', {
|
|
661
|
+
roomId,
|
|
662
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
663
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
664
|
+
chainName
|
|
665
|
+
});
|
|
666
|
+
const { threshold } = core.getTSSConfig(thresholdSignatureScheme);
|
|
667
|
+
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map(async (currentInit, index)=>{
|
|
668
|
+
const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
|
|
669
|
+
if (index === 0) {
|
|
670
|
+
const otherKeyGenIds = [
|
|
671
|
+
...serverKeygenIds,
|
|
672
|
+
...otherClientKeygenIds
|
|
673
|
+
];
|
|
674
|
+
const importerKeygenResult = await mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, otherKeyGenIds);
|
|
675
|
+
return importerKeygenResult;
|
|
676
|
+
} else {
|
|
677
|
+
const recipientKeygenResult = await mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
|
|
678
|
+
...serverKeygenIds,
|
|
679
|
+
...otherClientKeygenIds
|
|
680
|
+
]);
|
|
681
|
+
return recipientKeygenResult;
|
|
682
|
+
}
|
|
683
|
+
}));
|
|
684
|
+
const [clientKeygenResult] = clientKeygenResults;
|
|
685
|
+
const rawPublicKey = await this.derivePublicKey({
|
|
686
|
+
chainName,
|
|
687
|
+
keyShare: clientKeygenResult,
|
|
688
|
+
derivationPath: undefined
|
|
689
|
+
});
|
|
690
|
+
this.logger.debug('[DynamicWaasWalletClient] Completed import of raw private key', {
|
|
691
|
+
rawPublicKey,
|
|
692
|
+
chainName,
|
|
693
|
+
thresholdSignatureScheme,
|
|
694
|
+
roomId,
|
|
695
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
696
|
+
clientKeygenIds: clientKeygenIds.join(', ')
|
|
697
|
+
});
|
|
698
|
+
return {
|
|
699
|
+
rawPublicKey,
|
|
700
|
+
clientKeyShares: clientKeygenResults
|
|
701
|
+
};
|
|
702
|
+
} catch (error) {
|
|
703
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in importRawPrivateKey', error);
|
|
704
|
+
throw error;
|
|
705
|
+
}
|
|
661
706
|
}
|
|
662
707
|
async serverSign({ walletId, message, isFormatted }) {
|
|
663
708
|
// Create the room and sign the message
|
|
@@ -678,10 +723,17 @@ class DynamicWalletClient {
|
|
|
678
723
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
679
724
|
});
|
|
680
725
|
const formattedMessage = isFormatted ? new web.MessageHash(message) : formatMessage(chainName, message);
|
|
726
|
+
this.logger.debug('[DynamicWaasWalletClient] Starting client sign', {
|
|
727
|
+
chainName,
|
|
728
|
+
message,
|
|
729
|
+
roomId,
|
|
730
|
+
derivationPath,
|
|
731
|
+
isFormatted
|
|
732
|
+
});
|
|
681
733
|
const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
682
734
|
return signature;
|
|
683
735
|
} catch (error) {
|
|
684
|
-
this.logger.error('Error in clientSign
|
|
736
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in clientSign', error);
|
|
685
737
|
throw error;
|
|
686
738
|
}
|
|
687
739
|
}
|
|
@@ -705,6 +757,12 @@ class DynamicWalletClient {
|
|
|
705
757
|
message,
|
|
706
758
|
isFormatted
|
|
707
759
|
});
|
|
760
|
+
this.logger.debug('[DynamicWaasWalletClient] Server sign completed', {
|
|
761
|
+
message,
|
|
762
|
+
accountAddress,
|
|
763
|
+
walletId: wallet.walletId,
|
|
764
|
+
roomId: data.roomId
|
|
765
|
+
});
|
|
708
766
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
709
767
|
// Perform the client sign and return the signature
|
|
710
768
|
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
@@ -718,6 +776,13 @@ class DynamicWalletClient {
|
|
|
718
776
|
derivationPath,
|
|
719
777
|
isFormatted
|
|
720
778
|
});
|
|
779
|
+
this.logger.debug('[DynamicWaasWalletClient] Client sign completed', {
|
|
780
|
+
chainName,
|
|
781
|
+
message,
|
|
782
|
+
roomId: data.roomId,
|
|
783
|
+
derivationPath,
|
|
784
|
+
isFormatted
|
|
785
|
+
});
|
|
721
786
|
return signature;
|
|
722
787
|
}
|
|
723
788
|
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
@@ -876,43 +941,62 @@ class DynamicWalletClient {
|
|
|
876
941
|
});
|
|
877
942
|
}
|
|
878
943
|
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
944
|
+
try {
|
|
945
|
+
const wallet = await this.getWallet({
|
|
946
|
+
accountAddress,
|
|
947
|
+
password,
|
|
948
|
+
walletOperation: core.WalletOperation.EXPORT_PRIVATE_KEY,
|
|
949
|
+
signedSessionId
|
|
950
|
+
});
|
|
951
|
+
const mpcSigner = getMPCSigner({
|
|
952
|
+
chainName,
|
|
953
|
+
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
954
|
+
});
|
|
955
|
+
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
956
|
+
accountAddress
|
|
957
|
+
});
|
|
958
|
+
const exportId = await this.getExportId({
|
|
959
|
+
chainName,
|
|
960
|
+
clientKeyShare: clientKeyShares[0]
|
|
961
|
+
});
|
|
962
|
+
const data = await this.apiClient.exportKey({
|
|
963
|
+
walletId: wallet.walletId,
|
|
964
|
+
exportId
|
|
965
|
+
});
|
|
966
|
+
this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
|
|
967
|
+
accountAddress,
|
|
968
|
+
chainName,
|
|
969
|
+
walletId: wallet.walletId,
|
|
970
|
+
exportId,
|
|
971
|
+
roomId: data.roomId
|
|
972
|
+
});
|
|
973
|
+
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId, clientKeyShares[0], exportId);
|
|
974
|
+
if (!keyExportRaw) {
|
|
975
|
+
throw new Error('Error exporting private key');
|
|
976
|
+
}
|
|
977
|
+
this.logger.debug('[DynamicWaasWalletClient] Completed export of private key', {
|
|
978
|
+
accountAddress,
|
|
979
|
+
chainName,
|
|
980
|
+
walletId: wallet.walletId,
|
|
981
|
+
exportId,
|
|
982
|
+
roomId: data.roomId
|
|
983
|
+
});
|
|
984
|
+
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
985
|
+
let derivedPrivateKey;
|
|
986
|
+
if (mpcSigner instanceof web.Ecdsa) {
|
|
987
|
+
derivedPrivateKey = await mpcSigner.derivePrivateKeyFromXpriv(keyExportRaw, derivationPath);
|
|
988
|
+
} else if (mpcSigner instanceof web.ExportableEd25519) {
|
|
989
|
+
derivedPrivateKey = keyExportRaw;
|
|
990
|
+
} else if (mpcSigner instanceof web.BIP340) {
|
|
991
|
+
derivedPrivateKey = await mpcSigner.derivePrivateKeyFromXpriv(keyExportRaw, derivationPath);
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
derivedPrivateKey
|
|
995
|
+
};
|
|
996
|
+
} catch (error) {
|
|
997
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in exportKey', error);
|
|
998
|
+
throw error;
|
|
912
999
|
}
|
|
913
|
-
return {
|
|
914
|
-
derivedPrivateKey
|
|
915
|
-
};
|
|
916
1000
|
}
|
|
917
1001
|
async offlineExportKey({ chainName, keyShares, derivationPath }) {
|
|
918
1002
|
try {
|
|
@@ -950,7 +1034,7 @@ class DynamicWalletClient {
|
|
|
950
1034
|
rawPublicKey
|
|
951
1035
|
};
|
|
952
1036
|
} catch (error) {
|
|
953
|
-
this.logger.error('Error in offlineExportKey
|
|
1037
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in offlineExportKey', error);
|
|
954
1038
|
throw error;
|
|
955
1039
|
}
|
|
956
1040
|
}
|
|
@@ -1584,6 +1668,15 @@ class DynamicWalletClient {
|
|
|
1584
1668
|
}
|
|
1585
1669
|
}
|
|
1586
1670
|
|
|
1671
|
+
const ERROR_KEYGEN_FAILED = '[DynamicWaasWalletClient]: Error with keygen';
|
|
1672
|
+
const ERROR_CREATE_WALLET_ACCOUNT = '[DynamicWaasWalletClient]: Error creating evm wallet account';
|
|
1673
|
+
const ERROR_SIGN_MESSAGE = '[DynamicWaasWalletClient]: Error signing message';
|
|
1674
|
+
const ERROR_ACCOUNT_ADDRESS_REQUIRED = '[DynamicWaasWalletClient]: Account address is required';
|
|
1675
|
+
const ERROR_VERIFY_MESSAGE_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying message signature';
|
|
1676
|
+
const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying transaction signature';
|
|
1677
|
+
const ERROR_EXPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error exporting private key';
|
|
1678
|
+
const ERROR_IMPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error importing private key';
|
|
1679
|
+
|
|
1587
1680
|
Object.defineProperty(exports, "BIP340", {
|
|
1588
1681
|
enumerable: true,
|
|
1589
1682
|
get: function () { return web.BIP340; }
|
|
@@ -1633,6 +1726,14 @@ Object.defineProperty(exports, "MessageHash", {
|
|
|
1633
1726
|
get: function () { return web.MessageHash; }
|
|
1634
1727
|
});
|
|
1635
1728
|
exports.DynamicWalletClient = DynamicWalletClient;
|
|
1729
|
+
exports.ERROR_ACCOUNT_ADDRESS_REQUIRED = ERROR_ACCOUNT_ADDRESS_REQUIRED;
|
|
1730
|
+
exports.ERROR_CREATE_WALLET_ACCOUNT = ERROR_CREATE_WALLET_ACCOUNT;
|
|
1731
|
+
exports.ERROR_EXPORT_PRIVATE_KEY = ERROR_EXPORT_PRIVATE_KEY;
|
|
1732
|
+
exports.ERROR_IMPORT_PRIVATE_KEY = ERROR_IMPORT_PRIVATE_KEY;
|
|
1733
|
+
exports.ERROR_KEYGEN_FAILED = ERROR_KEYGEN_FAILED;
|
|
1734
|
+
exports.ERROR_SIGN_MESSAGE = ERROR_SIGN_MESSAGE;
|
|
1735
|
+
exports.ERROR_VERIFY_MESSAGE_SIGNATURE = ERROR_VERIFY_MESSAGE_SIGNATURE;
|
|
1736
|
+
exports.ERROR_VERIFY_TRANSACTION_SIGNATURE = ERROR_VERIFY_TRANSACTION_SIGNATURE;
|
|
1636
1737
|
exports.base64ToBytes = base64ToBytes;
|
|
1637
1738
|
exports.bytesToBase64 = bytesToBase64;
|
|
1638
1739
|
exports.createBackupData = createBackupData;
|
package/index.esm.js
CHANGED
|
@@ -520,6 +520,7 @@ class DynamicWalletClient {
|
|
|
520
520
|
onError,
|
|
521
521
|
onCeremonyComplete
|
|
522
522
|
});
|
|
523
|
+
this.logger.debug(`[DynamicWaasWalletClient] Initialized client key generation with IDs: ${clientKeygenIds.join(', ')} for chain: ${chainName} using scheme: ${thresholdSignatureScheme}`);
|
|
523
524
|
return data;
|
|
524
525
|
}
|
|
525
526
|
async clientInitializeKeyGen({ chainName, thresholdSignatureScheme }) {
|
|
@@ -591,12 +592,23 @@ class DynamicWalletClient {
|
|
|
591
592
|
thresholdSignatureScheme
|
|
592
593
|
});
|
|
593
594
|
const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
|
|
595
|
+
this.logger.debug('[DynamicWaasWalletClient] Initialized client key generation', {
|
|
596
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
597
|
+
chainName,
|
|
598
|
+
thresholdSignatureScheme
|
|
599
|
+
});
|
|
594
600
|
const { roomId, serverKeygenIds } = await this.serverInitializeKeyGen({
|
|
595
601
|
chainName,
|
|
596
602
|
clientKeygenIds,
|
|
597
603
|
thresholdSignatureScheme,
|
|
598
604
|
onCeremonyComplete
|
|
599
605
|
});
|
|
606
|
+
this.logger.debug('[DynamicWaasWalletClient] Server key generation initialized', {
|
|
607
|
+
roomId,
|
|
608
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
609
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
610
|
+
chainName
|
|
611
|
+
});
|
|
600
612
|
const { rawPublicKey, clientKeygenResults: clientKeyShares } = await this.clientKeyGen({
|
|
601
613
|
chainName,
|
|
602
614
|
roomId,
|
|
@@ -604,60 +616,93 @@ class DynamicWalletClient {
|
|
|
604
616
|
clientKeygenInitResults,
|
|
605
617
|
thresholdSignatureScheme
|
|
606
618
|
});
|
|
619
|
+
this.logger.debug('[DynamicWaasWalletClient] Client key generation completed', {
|
|
620
|
+
roomId,
|
|
621
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
622
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
623
|
+
chainName,
|
|
624
|
+
thresholdSignatureScheme,
|
|
625
|
+
rawPublicKey,
|
|
626
|
+
clientKeySharesCount: clientKeyShares.length
|
|
627
|
+
});
|
|
607
628
|
return {
|
|
608
629
|
rawPublicKey,
|
|
609
630
|
clientKeyShares
|
|
610
631
|
};
|
|
611
632
|
} catch (error) {
|
|
612
|
-
this.logger.error('Error keygen', error);
|
|
633
|
+
this.logger.error('[DynamicWaasWalletClient]: Error keygen', error);
|
|
613
634
|
throw error;
|
|
614
635
|
}
|
|
615
636
|
}
|
|
616
637
|
async importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, onError, onCeremonyComplete }) {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
638
|
+
try {
|
|
639
|
+
const mpcSigner = getMPCSigner({
|
|
640
|
+
chainName,
|
|
641
|
+
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
642
|
+
});
|
|
643
|
+
const clientKeygenInitResults = await this.clientInitializeKeyGen({
|
|
644
|
+
chainName,
|
|
645
|
+
thresholdSignatureScheme
|
|
646
|
+
});
|
|
647
|
+
const clientKeygenIds = clientKeygenInitResults.map((result)=>result.keygenId);
|
|
648
|
+
this.logger.debug('[DynamicWaasWalletClient] Client key generation initialized', {
|
|
649
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
650
|
+
chainName,
|
|
651
|
+
thresholdSignatureScheme
|
|
652
|
+
});
|
|
653
|
+
const { roomId, serverKeygenIds } = await this.apiClient.importPrivateKey({
|
|
654
|
+
chainName,
|
|
655
|
+
clientKeygenIds,
|
|
656
|
+
thresholdSignatureScheme,
|
|
657
|
+
onError,
|
|
658
|
+
onCeremonyComplete
|
|
659
|
+
});
|
|
660
|
+
this.logger.debug('[DynamicWaasWalletClient] Server key generation initialized', {
|
|
661
|
+
roomId,
|
|
662
|
+
clientKeygenIds: clientKeygenIds.join(', '),
|
|
663
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
664
|
+
chainName
|
|
665
|
+
});
|
|
666
|
+
const { threshold } = getTSSConfig(thresholdSignatureScheme);
|
|
667
|
+
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map(async (currentInit, index)=>{
|
|
668
|
+
const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
|
|
669
|
+
if (index === 0) {
|
|
670
|
+
const otherKeyGenIds = [
|
|
671
|
+
...serverKeygenIds,
|
|
672
|
+
...otherClientKeygenIds
|
|
673
|
+
];
|
|
674
|
+
const importerKeygenResult = await mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, otherKeyGenIds);
|
|
675
|
+
return importerKeygenResult;
|
|
676
|
+
} else {
|
|
677
|
+
const recipientKeygenResult = await mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
|
|
678
|
+
...serverKeygenIds,
|
|
679
|
+
...otherClientKeygenIds
|
|
680
|
+
]);
|
|
681
|
+
return recipientKeygenResult;
|
|
682
|
+
}
|
|
683
|
+
}));
|
|
684
|
+
const [clientKeygenResult] = clientKeygenResults;
|
|
685
|
+
const rawPublicKey = await this.derivePublicKey({
|
|
686
|
+
chainName,
|
|
687
|
+
keyShare: clientKeygenResult,
|
|
688
|
+
derivationPath: undefined
|
|
689
|
+
});
|
|
690
|
+
this.logger.debug('[DynamicWaasWalletClient] Completed import of raw private key', {
|
|
691
|
+
rawPublicKey,
|
|
692
|
+
chainName,
|
|
693
|
+
thresholdSignatureScheme,
|
|
694
|
+
roomId,
|
|
695
|
+
serverKeygenIds: serverKeygenIds.join(', '),
|
|
696
|
+
clientKeygenIds: clientKeygenIds.join(', ')
|
|
697
|
+
});
|
|
698
|
+
return {
|
|
699
|
+
rawPublicKey,
|
|
700
|
+
clientKeyShares: clientKeygenResults
|
|
701
|
+
};
|
|
702
|
+
} catch (error) {
|
|
703
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in importRawPrivateKey', error);
|
|
704
|
+
throw error;
|
|
705
|
+
}
|
|
661
706
|
}
|
|
662
707
|
async serverSign({ walletId, message, isFormatted }) {
|
|
663
708
|
// Create the room and sign the message
|
|
@@ -678,10 +723,17 @@ class DynamicWalletClient {
|
|
|
678
723
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
679
724
|
});
|
|
680
725
|
const formattedMessage = isFormatted ? new MessageHash(message) : formatMessage(chainName, message);
|
|
726
|
+
this.logger.debug('[DynamicWaasWalletClient] Starting client sign', {
|
|
727
|
+
chainName,
|
|
728
|
+
message,
|
|
729
|
+
roomId,
|
|
730
|
+
derivationPath,
|
|
731
|
+
isFormatted
|
|
732
|
+
});
|
|
681
733
|
const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
|
|
682
734
|
return signature;
|
|
683
735
|
} catch (error) {
|
|
684
|
-
this.logger.error('Error in clientSign
|
|
736
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in clientSign', error);
|
|
685
737
|
throw error;
|
|
686
738
|
}
|
|
687
739
|
}
|
|
@@ -705,6 +757,12 @@ class DynamicWalletClient {
|
|
|
705
757
|
message,
|
|
706
758
|
isFormatted
|
|
707
759
|
});
|
|
760
|
+
this.logger.debug('[DynamicWaasWalletClient] Server sign completed', {
|
|
761
|
+
message,
|
|
762
|
+
accountAddress,
|
|
763
|
+
walletId: wallet.walletId,
|
|
764
|
+
roomId: data.roomId
|
|
765
|
+
});
|
|
708
766
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
709
767
|
// Perform the client sign and return the signature
|
|
710
768
|
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
@@ -718,6 +776,13 @@ class DynamicWalletClient {
|
|
|
718
776
|
derivationPath,
|
|
719
777
|
isFormatted
|
|
720
778
|
});
|
|
779
|
+
this.logger.debug('[DynamicWaasWalletClient] Client sign completed', {
|
|
780
|
+
chainName,
|
|
781
|
+
message,
|
|
782
|
+
roomId: data.roomId,
|
|
783
|
+
derivationPath,
|
|
784
|
+
isFormatted
|
|
785
|
+
});
|
|
721
786
|
return signature;
|
|
722
787
|
}
|
|
723
788
|
async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
@@ -876,43 +941,62 @@ class DynamicWalletClient {
|
|
|
876
941
|
});
|
|
877
942
|
}
|
|
878
943
|
async exportKey({ accountAddress, chainName, password = undefined, signedSessionId }) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
944
|
+
try {
|
|
945
|
+
const wallet = await this.getWallet({
|
|
946
|
+
accountAddress,
|
|
947
|
+
password,
|
|
948
|
+
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY,
|
|
949
|
+
signedSessionId
|
|
950
|
+
});
|
|
951
|
+
const mpcSigner = getMPCSigner({
|
|
952
|
+
chainName,
|
|
953
|
+
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
954
|
+
});
|
|
955
|
+
const clientKeyShares = await this.getClientKeySharesFromLocalStorage({
|
|
956
|
+
accountAddress
|
|
957
|
+
});
|
|
958
|
+
const exportId = await this.getExportId({
|
|
959
|
+
chainName,
|
|
960
|
+
clientKeyShare: clientKeyShares[0]
|
|
961
|
+
});
|
|
962
|
+
const data = await this.apiClient.exportKey({
|
|
963
|
+
walletId: wallet.walletId,
|
|
964
|
+
exportId
|
|
965
|
+
});
|
|
966
|
+
this.logger.debug('[DynamicWaasWalletClient] Starting export of private key', {
|
|
967
|
+
accountAddress,
|
|
968
|
+
chainName,
|
|
969
|
+
walletId: wallet.walletId,
|
|
970
|
+
exportId,
|
|
971
|
+
roomId: data.roomId
|
|
972
|
+
});
|
|
973
|
+
const keyExportRaw = await mpcSigner.exportFullPrivateKey(data.roomId, clientKeyShares[0], exportId);
|
|
974
|
+
if (!keyExportRaw) {
|
|
975
|
+
throw new Error('Error exporting private key');
|
|
976
|
+
}
|
|
977
|
+
this.logger.debug('[DynamicWaasWalletClient] Completed export of private key', {
|
|
978
|
+
accountAddress,
|
|
979
|
+
chainName,
|
|
980
|
+
walletId: wallet.walletId,
|
|
981
|
+
exportId,
|
|
982
|
+
roomId: data.roomId
|
|
983
|
+
});
|
|
984
|
+
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
985
|
+
let derivedPrivateKey;
|
|
986
|
+
if (mpcSigner instanceof Ecdsa) {
|
|
987
|
+
derivedPrivateKey = await mpcSigner.derivePrivateKeyFromXpriv(keyExportRaw, derivationPath);
|
|
988
|
+
} else if (mpcSigner instanceof ExportableEd25519) {
|
|
989
|
+
derivedPrivateKey = keyExportRaw;
|
|
990
|
+
} else if (mpcSigner instanceof BIP340) {
|
|
991
|
+
derivedPrivateKey = await mpcSigner.derivePrivateKeyFromXpriv(keyExportRaw, derivationPath);
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
derivedPrivateKey
|
|
995
|
+
};
|
|
996
|
+
} catch (error) {
|
|
997
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in exportKey', error);
|
|
998
|
+
throw error;
|
|
912
999
|
}
|
|
913
|
-
return {
|
|
914
|
-
derivedPrivateKey
|
|
915
|
-
};
|
|
916
1000
|
}
|
|
917
1001
|
async offlineExportKey({ chainName, keyShares, derivationPath }) {
|
|
918
1002
|
try {
|
|
@@ -950,7 +1034,7 @@ class DynamicWalletClient {
|
|
|
950
1034
|
rawPublicKey
|
|
951
1035
|
};
|
|
952
1036
|
} catch (error) {
|
|
953
|
-
this.logger.error('Error in offlineExportKey
|
|
1037
|
+
this.logger.error('[DynamicWaasWalletClient]: Error in offlineExportKey', error);
|
|
954
1038
|
throw error;
|
|
955
1039
|
}
|
|
956
1040
|
}
|
|
@@ -1584,4 +1668,13 @@ class DynamicWalletClient {
|
|
|
1584
1668
|
}
|
|
1585
1669
|
}
|
|
1586
1670
|
|
|
1587
|
-
|
|
1671
|
+
const ERROR_KEYGEN_FAILED = '[DynamicWaasWalletClient]: Error with keygen';
|
|
1672
|
+
const ERROR_CREATE_WALLET_ACCOUNT = '[DynamicWaasWalletClient]: Error creating evm wallet account';
|
|
1673
|
+
const ERROR_SIGN_MESSAGE = '[DynamicWaasWalletClient]: Error signing message';
|
|
1674
|
+
const ERROR_ACCOUNT_ADDRESS_REQUIRED = '[DynamicWaasWalletClient]: Account address is required';
|
|
1675
|
+
const ERROR_VERIFY_MESSAGE_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying message signature';
|
|
1676
|
+
const ERROR_VERIFY_TRANSACTION_SIGNATURE = '[DynamicWaasWalletClient]: Error verifying transaction signature';
|
|
1677
|
+
const ERROR_EXPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error exporting private key';
|
|
1678
|
+
const ERROR_IMPORT_PRIVATE_KEY = '[DynamicWaasWalletClient]: Error importing private key';
|
|
1679
|
+
|
|
1680
|
+
export { DynamicWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, ERROR_VERIFY_MESSAGE_SIGNATURE, ERROR_VERIFY_TRANSACTION_SIGNATURE, base64ToBytes, bytesToBase64, createBackupData, ensureBase64Padding, formatEvmMessage, formatMessage, getClientKeyShareBackupInfo, getClientKeyShareExportFileName, getGoogleOAuthAccountId, getMPCSignatureScheme, getMPCSigner, isBrowser, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes, timeoutPromise };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.85",
|
|
4
4
|
"license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.85",
|
|
7
7
|
"@dynamic-labs/logger": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.663",
|
|
9
9
|
"@noble/hashes": "1.7.1"
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,gBAAgB,EAIhB,cAAc,EAEd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,eAAe,EAGhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAEL,iBAAiB,EAEjB,KAAK,cAAc,EACnB,iBAAiB,EAEjB,kBAAkB,EAClB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQ1E,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAQ;IACrE,SAAS,CAAC,MAAM,wCAAU;IAC1B,SAAS,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACtC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAC3D,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAQ;IACjE,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,MAAM,E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B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IAgDK,mBAAmB,CAAC,EACxB,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpB;;OAEG;IACG,4BAA4B,CAAC,EACjC,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB;;OAEG;IACG,uCAAuC,CAAC,EAC5C,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCd,iCAAiC,CAAC,EACtC,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoBzB,SAAS,CAAC,EACd,cAAc,EACd,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,EACpB,eAAe,GAChB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IA6EK,UAAU;CAkCjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const ERROR_KEYGEN_FAILED = "[DynamicWaasWalletClient]: Error with keygen";
|
|
2
|
+
export declare const ERROR_CREATE_WALLET_ACCOUNT = "[DynamicWaasWalletClient]: Error creating evm wallet account";
|
|
3
|
+
export declare const ERROR_SIGN_MESSAGE = "[DynamicWaasWalletClient]: Error signing message";
|
|
4
|
+
export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "[DynamicWaasWalletClient]: Account address is required";
|
|
5
|
+
export declare const ERROR_VERIFY_MESSAGE_SIGNATURE = "[DynamicWaasWalletClient]: Error verifying message signature";
|
|
6
|
+
export declare const ERROR_VERIFY_TRANSACTION_SIGNATURE = "[DynamicWaasWalletClient]: Error verifying transaction signature";
|
|
7
|
+
export declare const ERROR_EXPORT_PRIVATE_KEY = "[DynamicWaasWalletClient]: Error exporting private key";
|
|
8
|
+
export declare const ERROR_IMPORT_PRIVATE_KEY = "[DynamicWaasWalletClient]: Error importing private key";
|
|
9
|
+
//# sourceMappingURL=errorConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorConstants.d.ts","sourceRoot":"","sources":["../../packages/src/errorConstants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iDACgB,CAAC;AAEjD,eAAO,MAAM,2BAA2B,iEACwB,CAAC;AAEjE,eAAO,MAAM,kBAAkB,qDACqB,CAAC;AAErD,eAAO,MAAM,8BAA8B,2DACe,CAAC;AAE3D,eAAO,MAAM,8BAA8B,iEACqB,CAAC;AAEjE,eAAO,MAAM,kCAAkC,qEACqB,CAAC;AAErE,eAAO,MAAM,wBAAwB,2DACqB,CAAC;AAE3D,eAAO,MAAM,wBAAwB,2DACqB,CAAC"}
|
package/src/index.d.ts
CHANGED
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|