@dynamic-labs-wallet/node 0.0.317 → 0.0.319-beta.1

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.
Files changed (37) hide show
  1. package/index.cjs.js +22 -6
  2. package/index.esm.js +22 -6
  3. package/package.json +2 -2
  4. package/src/backup/encryption.d.ts +0 -62
  5. package/src/backup/encryption.d.ts.map +0 -1
  6. package/src/backup/utils.d.ts +0 -4
  7. package/src/backup/utils.d.ts.map +0 -1
  8. package/src/client.d.ts +0 -341
  9. package/src/client.d.ts.map +0 -1
  10. package/src/constants.d.ts +0 -2
  11. package/src/constants.d.ts.map +0 -1
  12. package/src/core/createCore.d.ts +0 -43
  13. package/src/core/createCore.d.ts.map +0 -1
  14. package/src/core/types.d.ts +0 -7
  15. package/src/core/types.d.ts.map +0 -1
  16. package/src/delegatedClient/createDelegatedClient.d.ts +0 -23
  17. package/src/delegatedClient/createDelegatedClient.d.ts.map +0 -1
  18. package/src/delegatedClient/index.d.ts +0 -7
  19. package/src/delegatedClient/index.d.ts.map +0 -1
  20. package/src/delegatedClient/modules/decryptWebhookData.d.ts +0 -18
  21. package/src/delegatedClient/modules/decryptWebhookData.d.ts.map +0 -1
  22. package/src/delegatedClient/modules/revokeDelegation.d.ts +0 -3
  23. package/src/delegatedClient/modules/revokeDelegation.d.ts.map +0 -1
  24. package/src/delegatedClient/modules/sign.d.ts +0 -31
  25. package/src/delegatedClient/modules/sign.d.ts.map +0 -1
  26. package/src/index.d.ts +0 -12
  27. package/src/index.d.ts.map +0 -1
  28. package/src/mpc/index.d.ts +0 -3
  29. package/src/mpc/index.d.ts.map +0 -1
  30. package/src/mpc/mpc.d.ts +0 -12
  31. package/src/mpc/mpc.d.ts.map +0 -1
  32. package/src/mpc/types.d.ts +0 -5
  33. package/src/mpc/types.d.ts.map +0 -1
  34. package/src/types.d.ts +0 -41
  35. package/src/types.d.ts.map +0 -1
  36. package/src/utils.d.ts +0 -48
  37. package/src/utils.d.ts.map +0 -1
package/index.cjs.js CHANGED
@@ -1023,11 +1023,17 @@ class DynamicWalletClient {
1023
1023
  const bitcoinConfig = walletData.chainName === 'BTC' && walletData.addressType ? {
1024
1024
  addressType: walletData.addressType
1025
1025
  } : undefined;
1026
+ // Build locations + result for all shares
1026
1027
  const locations = [];
1028
+ const result = [];
1029
+ // Upload first share to Dynamic if requested
1027
1030
  if (backUpToClientShareService) {
1031
+ const keyShareToBackupToDynamic = keySharesToBackup[0];
1028
1032
  const data = await this.apiClient.storeEncryptedBackupByWallet({
1029
1033
  walletId: this.walletMap[accountAddress].walletId,
1030
- encryptedKeyShares: encryptedKeyShares,
1034
+ encryptedKeyShares: [
1035
+ encryptedKeyShares[0]
1036
+ ],
1031
1037
  passwordEncrypted: passwordEncryptedFlag,
1032
1038
  encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1033
1039
  requiresSignedSessionId: false,
@@ -1035,7 +1041,7 @@ class DynamicWalletClient {
1035
1041
  });
1036
1042
  const keygenId = await this.getExportId({
1037
1043
  chainName: walletData.chainName,
1038
- serverKeyShare: keySharesToBackup[0],
1044
+ serverKeyShare: keyShareToBackupToDynamic,
1039
1045
  bitcoinConfig
1040
1046
  });
1041
1047
  locations.push({
@@ -1044,10 +1050,16 @@ class DynamicWalletClient {
1044
1050
  passwordEncrypted: passwordEncryptedFlag,
1045
1051
  keygenId
1046
1052
  });
1047
- } else {
1053
+ result.push({
1054
+ share: keyShareToBackupToDynamic,
1055
+ backedUpToClientKeyShareService: true
1056
+ });
1057
+ }
1058
+ const keySharesNotToBackupToDynamic = backUpToClientShareService ? keySharesToBackup.slice(1) : keySharesToBackup;
1059
+ for (const keyShare of keySharesNotToBackupToDynamic){
1048
1060
  const keygenId = await this.getExportId({
1049
1061
  chainName: walletData.chainName,
1050
- serverKeyShare: keySharesToBackup[0],
1062
+ serverKeyShare: keyShare,
1051
1063
  bitcoinConfig
1052
1064
  });
1053
1065
  locations.push({
@@ -1055,6 +1067,10 @@ class DynamicWalletClient {
1055
1067
  passwordEncrypted: passwordEncryptedFlag,
1056
1068
  keygenId
1057
1069
  });
1070
+ result.push({
1071
+ share: keyShare,
1072
+ backedUpToClientKeyShareService: false
1073
+ });
1058
1074
  }
1059
1075
  const backupData = await this.apiClient.markKeySharesAsBackedUp({
1060
1076
  walletId: this.walletMap[accountAddress].walletId,
@@ -1077,7 +1093,7 @@ class DynamicWalletClient {
1077
1093
  this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
1078
1094
  externalServerKeySharesBackupInfo: updatedBackupInfo
1079
1095
  });
1080
- return encryptedKeyShares;
1096
+ return result;
1081
1097
  } catch (error) {
1082
1098
  this.logger.error('Error in storeEncryptedBackupByWallet:', {
1083
1099
  accountAddress,
@@ -1088,7 +1104,7 @@ class DynamicWalletClient {
1088
1104
  }
1089
1105
  }
1090
1106
  async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, backUpToClientShareService }) {
1091
- await retryPromise(()=>this.storeEncryptedBackupByWallet({
1107
+ return retryPromise(()=>this.storeEncryptedBackupByWallet({
1092
1108
  accountAddress,
1093
1109
  externalServerKeyShares,
1094
1110
  password,
package/index.esm.js CHANGED
@@ -1022,11 +1022,17 @@ class DynamicWalletClient {
1022
1022
  const bitcoinConfig = walletData.chainName === 'BTC' && walletData.addressType ? {
1023
1023
  addressType: walletData.addressType
1024
1024
  } : undefined;
1025
+ // Build locations + result for all shares
1025
1026
  const locations = [];
1027
+ const result = [];
1028
+ // Upload first share to Dynamic if requested
1026
1029
  if (backUpToClientShareService) {
1030
+ const keyShareToBackupToDynamic = keySharesToBackup[0];
1027
1031
  const data = await this.apiClient.storeEncryptedBackupByWallet({
1028
1032
  walletId: this.walletMap[accountAddress].walletId,
1029
- encryptedKeyShares: encryptedKeyShares,
1033
+ encryptedKeyShares: [
1034
+ encryptedKeyShares[0]
1035
+ ],
1030
1036
  passwordEncrypted: passwordEncryptedFlag,
1031
1037
  encryptionVersion: ENCRYPTION_VERSION_CURRENT,
1032
1038
  requiresSignedSessionId: false,
@@ -1034,7 +1040,7 @@ class DynamicWalletClient {
1034
1040
  });
1035
1041
  const keygenId = await this.getExportId({
1036
1042
  chainName: walletData.chainName,
1037
- serverKeyShare: keySharesToBackup[0],
1043
+ serverKeyShare: keyShareToBackupToDynamic,
1038
1044
  bitcoinConfig
1039
1045
  });
1040
1046
  locations.push({
@@ -1043,10 +1049,16 @@ class DynamicWalletClient {
1043
1049
  passwordEncrypted: passwordEncryptedFlag,
1044
1050
  keygenId
1045
1051
  });
1046
- } else {
1052
+ result.push({
1053
+ share: keyShareToBackupToDynamic,
1054
+ backedUpToClientKeyShareService: true
1055
+ });
1056
+ }
1057
+ const keySharesNotToBackupToDynamic = backUpToClientShareService ? keySharesToBackup.slice(1) : keySharesToBackup;
1058
+ for (const keyShare of keySharesNotToBackupToDynamic){
1047
1059
  const keygenId = await this.getExportId({
1048
1060
  chainName: walletData.chainName,
1049
- serverKeyShare: keySharesToBackup[0],
1061
+ serverKeyShare: keyShare,
1050
1062
  bitcoinConfig
1051
1063
  });
1052
1064
  locations.push({
@@ -1054,6 +1066,10 @@ class DynamicWalletClient {
1054
1066
  passwordEncrypted: passwordEncryptedFlag,
1055
1067
  keygenId
1056
1068
  });
1069
+ result.push({
1070
+ share: keyShare,
1071
+ backedUpToClientKeyShareService: false
1072
+ });
1057
1073
  }
1058
1074
  const backupData = await this.apiClient.markKeySharesAsBackedUp({
1059
1075
  walletId: this.walletMap[accountAddress].walletId,
@@ -1076,7 +1092,7 @@ class DynamicWalletClient {
1076
1092
  this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress], {
1077
1093
  externalServerKeySharesBackupInfo: updatedBackupInfo
1078
1094
  });
1079
- return encryptedKeyShares;
1095
+ return result;
1080
1096
  } catch (error) {
1081
1097
  this.logger.error('Error in storeEncryptedBackupByWallet:', {
1082
1098
  accountAddress,
@@ -1087,7 +1103,7 @@ class DynamicWalletClient {
1087
1103
  }
1088
1104
  }
1089
1105
  async storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, backUpToClientShareService }) {
1090
- await retryPromise(()=>this.storeEncryptedBackupByWallet({
1106
+ return retryPromise(()=>this.storeEncryptedBackupByWallet({
1091
1107
  accountAddress,
1092
1108
  externalServerKeyShares,
1093
1109
  password,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/node",
3
- "version": "0.0.317",
3
+ "version": "0.0.319-beta.1",
4
4
  "license": "Licensed under the Dynamic Labs, Inc. Terms Of Service (https://www.dynamic.xyz/terms-conditions)",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "0.0.317",
7
+ "@dynamic-labs-wallet/core": "0.0.319-beta.1",
8
8
  "@dynamic-labs-wallet/forward-mpc-client": "0.5.5",
9
9
  "@dynamic-labs/logger": "^4.45.2",
10
10
  "@dynamic-labs/sdk-api-core": "^0.0.900",
@@ -1,62 +0,0 @@
1
- import type { EncryptionMetadata } from '@dynamic-labs-wallet/core';
2
- export declare const ENCRYPTION_VERSION_LEGACY = "v1";
3
- export declare const ENCRYPTION_VERSION_CURRENT = "v2";
4
- export declare const PBKDF2_ALGORITHM = "PBKDF2";
5
- export declare const PBKDF2_HASH_ALGORITHM = "SHA-256";
6
- export declare const AES_GCM_ALGORITHM = "AES-GCM";
7
- export declare const AES_GCM_LENGTH = 256;
8
- export declare const ENCRYPTION_VERSIONS: {
9
- readonly v1: {
10
- readonly version: "v1";
11
- readonly algorithm: "AES-GCM";
12
- readonly keyDerivation: "PBKDF2";
13
- readonly iterations: 100000;
14
- readonly hashAlgorithm: "SHA-256";
15
- readonly algorithmLength: 256;
16
- };
17
- readonly v2: {
18
- readonly version: "v2";
19
- readonly algorithm: "AES-GCM";
20
- readonly keyDerivation: "PBKDF2";
21
- readonly iterations: 1000000;
22
- readonly hashAlgorithm: "SHA-256";
23
- readonly algorithmLength: 256;
24
- };
25
- };
26
- export declare const PBKDF2_ITERATIONS: 1000000;
27
- export declare const PBKDF2_ITERATIONS_LEGACY: 100000;
28
- export type EncryptionVersion = (typeof ENCRYPTION_VERSIONS)[keyof typeof ENCRYPTION_VERSIONS];
29
- /**
30
- * Encrypts data using the specified encryption version.
31
- * Always uses the latest encryption configuration for new encryptions by default.
32
- */
33
- export declare const encryptData: ({ data, password, version, }: {
34
- data: string;
35
- password: string;
36
- version?: string;
37
- }) => Promise<{
38
- salt: string;
39
- iv: string;
40
- cipher: string;
41
- version: string;
42
- }>;
43
- /**
44
- * Decrypts data with version-based configuration.
45
- * Uses the version field from the data to determine encryption parameters.
46
- * Falls back to legacy version for backward compatibility if no version is specified.
47
- */
48
- export declare const decryptData: ({ data, password, }: {
49
- data: {
50
- salt: string;
51
- iv: string;
52
- cipher: string;
53
- version?: string;
54
- };
55
- password: string;
56
- }) => Promise<string>;
57
- /**
58
- * Gets encryption metadata for a specific version.
59
- * Used when we need to include metadata in legacy systems or APIs that require it.
60
- */
61
- export declare const getEncryptionMetadataForVersion: (version: string) => EncryptionMetadata;
62
- //# sourceMappingURL=encryption.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/backup/encryption.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAiBtB,CAAC;AAEX,eAAO,MAAM,iBAAiB,SAA6D,CAAC;AAC5F,eAAO,MAAM,wBAAwB,QAA4D,CAAC;AAElG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAgC/F;;;GAGG;AACH,eAAO,MAAM,WAAW,iCAIrB;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;EA6BA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB,oBAmCA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,kBAajE,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { ServerKeyShare } from '../mpc/types.js';
2
- import type { WalletProperties } from '../types.js';
3
- export declare const checkIfExternalServerKeySharesAreRequired: (wallet: WalletProperties, externalServerKeyShares?: ServerKeyShare[]) => void;
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/backup/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,yCAAyC,WAC5C,gBAAgB,4BACE,cAAc,EAAE,SAW3C,CAAC"}
package/src/client.d.ts DELETED
@@ -1,341 +0,0 @@
1
- import { BIP340KeygenResult, EcdsaKeygenResult, EcdsaSignature, MessageHash, type EcdsaPublicKey } from '#internal/node';
2
- import { BackupLocation, DynamicApiClient, ThresholdSignatureScheme, type ILogger, WalletOperation, type BitcoinConfig, type KeyShareBackupInfo, type RequestWithElevatedAccessToken } from '@dynamic-labs-wallet/core';
3
- import { ForwardMPCClientV2 } from '@dynamic-labs-wallet/forward-mpc-client';
4
- import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
5
- import type { ServerKeyShare } from './mpc/index.js';
6
- import type { ServerInitKeygenResult } from './mpc/types.js';
7
- import type { DynamicWalletClientProps, WalletProperties } from './types.js';
8
- export declare class DynamicWalletClient {
9
- environmentId: string;
10
- debug: boolean;
11
- protected logger: ILogger;
12
- protected apiClient: DynamicApiClient;
13
- protected walletMap: Record<string, WalletProperties>;
14
- protected baseMPCRelayApiUrl?: string;
15
- protected baseJWTAuthToken?: string;
16
- protected baseApiUrl?: string;
17
- protected isApiClientAuthenticated: boolean;
18
- protected forwardMPCEnabled: boolean;
19
- protected resolvedForwardMPCClient: ForwardMPCClientV2 | undefined;
20
- constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator, logger, }: DynamicWalletClientProps);
21
- private ensureApiClientAuthenticated;
22
- authenticateApiToken(authToken: string): Promise<void>;
23
- dynamicServerInitializeKeyGen({ chainName, externalServerKeygenIds, thresholdSignatureScheme, dynamicRequestId, skipLock, bitcoinConfig, onError, onCeremonyComplete, }: {
24
- chainName: string;
25
- externalServerKeygenIds: string[];
26
- thresholdSignatureScheme: ThresholdSignatureScheme;
27
- dynamicRequestId: string;
28
- skipLock?: boolean;
29
- bitcoinConfig?: BitcoinConfig;
30
- onError?: (error: Error) => void;
31
- onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
32
- }): Promise<import("@dynamic-labs-wallet/core").KeygenCompleteResponse>;
33
- externalServerInitializeKeyGen({ chainName, thresholdSignatureScheme, bitcoinConfig, }: {
34
- chainName: string;
35
- thresholdSignatureScheme: ThresholdSignatureScheme;
36
- bitcoinConfig?: BitcoinConfig;
37
- }): Promise<ServerInitKeygenResult[]>;
38
- derivePublicKey({ chainName, keyShare, derivationPath, bitcoinConfig, }: {
39
- chainName: string;
40
- keyShare: ServerKeyShare;
41
- derivationPath: Uint32Array | undefined;
42
- bitcoinConfig?: BitcoinConfig;
43
- }): Promise<string | EcdsaPublicKey | Uint8Array | undefined>;
44
- forwardMPCExternalServerKeyGen({ chainName, roomId, dynamicServerKeygenIds, externalServerInitKeygenResults, thresholdSignatureScheme, bitcoinConfig, }: {
45
- chainName: string;
46
- roomId: string;
47
- dynamicServerKeygenIds: string[];
48
- externalServerInitKeygenResults: ServerInitKeygenResult[];
49
- thresholdSignatureScheme: ThresholdSignatureScheme;
50
- bitcoinConfig?: BitcoinConfig;
51
- }): Promise<{
52
- rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
53
- externalServerKeyGenResults: ServerKeyShare[];
54
- }>;
55
- externalServerKeyGen({ chainName, roomId, dynamicServerKeygenIds, externalServerInitKeygenResults, thresholdSignatureScheme, bitcoinConfig, }: {
56
- chainName: string;
57
- roomId: string;
58
- dynamicServerKeygenIds: string[];
59
- externalServerInitKeygenResults: ServerInitKeygenResult[];
60
- thresholdSignatureScheme: ThresholdSignatureScheme;
61
- bitcoinConfig?: BitcoinConfig;
62
- }): Promise<{
63
- rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
64
- externalServerKeyGenResults: ServerKeyShare[];
65
- }>;
66
- keyGen({ chainName, thresholdSignatureScheme, skipLock, bitcoinConfig, onError, onCeremonyComplete, }: {
67
- chainName: string;
68
- thresholdSignatureScheme: ThresholdSignatureScheme;
69
- skipLock?: boolean;
70
- bitcoinConfig?: BitcoinConfig;
71
- onError?: (error: Error) => void;
72
- onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
73
- }): Promise<{
74
- rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
75
- externalServerKeyShares: ServerKeyShare[];
76
- }>;
77
- importRawPrivateKey({ chainName, privateKey, thresholdSignatureScheme, bitcoinConfig, onError, onCeremonyComplete, }: {
78
- chainName: string;
79
- privateKey: string;
80
- thresholdSignatureScheme: ThresholdSignatureScheme;
81
- bitcoinConfig?: BitcoinConfig;
82
- onError?: (error: Error) => void;
83
- onCeremonyComplete?: (accountAddress: string, walletId: string) => void;
84
- }): Promise<{
85
- rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
86
- externalServerKeyShares: ServerKeyShare[];
87
- }>;
88
- dynamicServerSign({ walletId, message, isFormatted, context, bitcoinConfig, onError, }: {
89
- walletId: string;
90
- message: string | Uint8Array;
91
- isFormatted?: boolean;
92
- context?: SignMessageContext;
93
- bitcoinConfig?: BitcoinConfig;
94
- onError?: (error: Error) => void;
95
- }): Promise<import("@dynamic-labs-wallet/core").OpenRoomResponse>;
96
- externalServerSign({ chainName, message, roomId, keyShare, derivationPath, isFormatted, bitcoinConfig, }: {
97
- chainName: string;
98
- message: string | Uint8Array;
99
- roomId: string;
100
- keyShare: ServerKeyShare;
101
- derivationPath: Uint32Array | undefined;
102
- isFormatted?: boolean;
103
- bitcoinConfig?: BitcoinConfig;
104
- }): Promise<Uint8Array | EcdsaSignature>;
105
- forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId, isFormatted, }: {
106
- chainName: string;
107
- message: string | Uint8Array;
108
- roomId: string;
109
- keyShare: ServerKeyShare;
110
- derivationPath: Uint32Array | undefined;
111
- formattedMessage: string | Uint8Array | MessageHash;
112
- dynamicRequestId: string;
113
- isFormatted?: boolean;
114
- }): Promise<Uint8Array | EcdsaSignature>;
115
- sign({ accountAddress, externalServerKeyShares, message, chainName, password, isFormatted, context, onError, bitcoinConfig, }: {
116
- accountAddress: string;
117
- externalServerKeyShares?: ServerKeyShare[];
118
- message: string | Uint8Array;
119
- chainName: string;
120
- password?: string;
121
- isFormatted?: boolean;
122
- context?: SignMessageContext;
123
- bitcoinConfig?: BitcoinConfig;
124
- onError?: (error: Error) => void;
125
- }): Promise<Uint8Array | EcdsaSignature>;
126
- refreshWalletAccountShares({ accountAddress, chainName, password, externalServerKeyShares, backUpToClientShareService, }: {
127
- accountAddress: string;
128
- chainName: string;
129
- password?: string;
130
- externalServerKeyShares?: ServerKeyShare[];
131
- backUpToClientShareService?: boolean;
132
- }): Promise<(EcdsaKeygenResult | BIP340KeygenResult)[]>;
133
- getExportId({ chainName, serverKeyShare, bitcoinConfig, }: {
134
- chainName: string;
135
- serverKeyShare: ServerKeyShare;
136
- bitcoinConfig?: BitcoinConfig;
137
- }): Promise<string>;
138
- /**
139
- * Helper function to create client shares required to complete a reshare ceremony.
140
- * @param {string} chainName - The chain to create shares for
141
- * @param {WalletProperties} wallet - The wallet to reshare
142
- * @param {ThresholdSignatureScheme} oldThresholdSignatureScheme - The current threshold signature scheme
143
- * @param {ThresholdSignatureScheme} newThresholdSignatureScheme - The target threshold signature scheme
144
- * @returns {Promise<{
145
- * newClientInitKeygenResults: ClientInitKeygenResult[],
146
- * newClientKeygenIds: string[],
147
- * existingClientKeygenIds: string[],
148
- * existingClientKeyShares: ClientKeyShare[]
149
- * }>} Object containing new and existing client keygen results, IDs and shares
150
- * @todo Support higher to lower reshare strategies
151
- */
152
- reshareStrategy({ chainName, wallet, oldThresholdSignatureScheme, newThresholdSignatureScheme, }: {
153
- chainName: string;
154
- wallet: WalletProperties;
155
- oldThresholdSignatureScheme: ThresholdSignatureScheme;
156
- newThresholdSignatureScheme: ThresholdSignatureScheme;
157
- }): Promise<{
158
- newExternalServerInitKeygenResults: ServerInitKeygenResult[];
159
- newExternalServerKeygenIds: string[];
160
- existingExternalServerKeygenIds: string[];
161
- existingExternalServerKeyShares: ServerKeyShare[];
162
- }>;
163
- reshare({ chainName, accountAddress, oldThresholdSignatureScheme, newThresholdSignatureScheme, password, externalServerKeyShares, backUpToClientShareService, }: {
164
- chainName: string;
165
- accountAddress: string;
166
- oldThresholdSignatureScheme: ThresholdSignatureScheme;
167
- newThresholdSignatureScheme: ThresholdSignatureScheme;
168
- password?: string;
169
- externalServerKeyShares?: ServerKeyShare[];
170
- backUpToClientShareService?: boolean;
171
- }): Promise<(EcdsaKeygenResult | BIP340KeygenResult)[]>;
172
- exportKey({ accountAddress, chainName, password, externalServerKeyShares, bitcoinConfig, elevatedAccessToken, }: RequestWithElevatedAccessToken<{
173
- accountAddress: string;
174
- chainName: string;
175
- password?: string;
176
- externalServerKeyShares?: ServerKeyShare[];
177
- bitcoinConfig?: BitcoinConfig;
178
- }>): Promise<{
179
- derivedPrivateKey: string | undefined;
180
- }>;
181
- offlineExportKey({ chainName, keyShares, derivationPath, }: {
182
- chainName: string;
183
- keyShares: ServerKeyShare[];
184
- derivationPath?: string;
185
- }): Promise<{
186
- derivedPrivateKey: string | undefined;
187
- }>;
188
- encryptKeyShare({ keyShare, password }: {
189
- keyShare: ServerKeyShare;
190
- password?: string;
191
- }): Promise<string>;
192
- ensureCeremonyCompletionBeforeBackup({ accountAddress }: {
193
- accountAddress: string;
194
- }): Promise<void>;
195
- storeEncryptedBackupByWallet({ accountAddress, externalServerKeyShares, password, backUpToClientShareService, }: {
196
- accountAddress: string;
197
- externalServerKeyShares?: ServerKeyShare[];
198
- password?: string;
199
- backUpToClientShareService: boolean;
200
- }): Promise<string[]>;
201
- storeEncryptedBackupByWalletWithRetry({ accountAddress, externalServerKeyShares, password, backUpToClientShareService, }: {
202
- accountAddress: string;
203
- externalServerKeyShares?: ServerKeyShare[];
204
- password?: string;
205
- backUpToClientShareService: boolean;
206
- }): Promise<void>;
207
- getExternalServerKeyShares({ accountAddress, password }: {
208
- accountAddress: string;
209
- password?: string;
210
- }): Promise<any[]>;
211
- updatePassword({ accountAddress, existingPassword, newPassword, backUpToClientShareService, }: {
212
- accountAddress: string;
213
- existingPassword?: string;
214
- newPassword?: string;
215
- backUpToClientShareService: boolean;
216
- }): Promise<void>;
217
- decryptKeyShare({ keyShare, password }: {
218
- keyShare: string;
219
- password?: string;
220
- }): Promise<ServerKeyShare>;
221
- /**
222
- * Helper function to determine keyshare recovery strategy for dynamic shares.
223
- * For REFRESH operations, retrieves enough shares to meet the client threshold.
224
- * For all other operations, retrieves just 1 share.
225
- *
226
- * @param clientKeyShareBackupInfo - Information about backed up key shares
227
- * @param thresholdSignatureScheme - The signature scheme being used (2-of-2, 2-of-3, etc)
228
- * @param walletOperation - The operation being performed (REFRESH, SIGN_MESSAGE, etc)
229
- * @param shareCount - The number of shares to recover if specified for reshare operations
230
- * @returns @shares: Object mapping backup locations to arrays of share IDs to recover
231
- * @returns @requiredShareCount: The number of shares required to recover
232
- */
233
- recoverStrategy({ externalServerKeySharesBackupInfo, thresholdSignatureScheme, walletOperation, shareCount, }: {
234
- externalServerKeySharesBackupInfo: KeyShareBackupInfo;
235
- thresholdSignatureScheme: ThresholdSignatureScheme;
236
- walletOperation: WalletOperation;
237
- shareCount?: number;
238
- }): {
239
- shares: Partial<Record<BackupLocation, string[]>>;
240
- requiredShareCount: number;
241
- };
242
- /**
243
- * Attempts to recover key shares from backup if they are not provided.
244
- * The recovered shares will be stored in the wallet map for use in signing operations.
245
- * @param accountAddress - The account address to recover shares for
246
- * @param password - The password to decrypt the shares
247
- * @param walletOperation - The wallet operation being performed
248
- * @param externalServerKeyShares - The provided key shares (if any)
249
- * @param errorMessage - The error message to throw if recovery fails
250
- * @throws Error if recovery is needed but fails
251
- */
252
- protected ensureKeySharesRecovered({ accountAddress, password, walletOperation, externalServerKeyShares, errorMessage, }: {
253
- accountAddress: string;
254
- password?: string;
255
- walletOperation: WalletOperation;
256
- externalServerKeyShares?: ServerKeyShare[];
257
- errorMessage: string;
258
- }): Promise<void>;
259
- recoverEncryptedBackupByWallet({ accountAddress, password, walletOperation, shareCount, storeRecoveredShares, }: {
260
- accountAddress: string;
261
- password?: string;
262
- walletOperation: WalletOperation;
263
- shareCount?: number;
264
- storeRecoveredShares?: boolean;
265
- }): Promise<any[]>;
266
- exportExternalServerKeyShares({ accountAddress, password }: {
267
- accountAddress: string;
268
- password?: string;
269
- }): Promise<any[]>;
270
- /**
271
- * Helper function to check if the required wallet fields are present and valid
272
- * @param accountAddress - The account address of the wallet to check
273
- * @param walletOperation - The wallet operation that determines required fields
274
- * @returns boolean indicating if wallet needs to be re-fetched and restored from server
275
- */
276
- private checkWalletFields;
277
- /**
278
- * verifyPassword attempts to recover and decrypt a single client key share using the provided password.
279
- * If successful, the key share is encrypted with the new password. This method solely performs the recovery
280
- * and decryption without storing the restored key shares. If unsuccessful, it throws an error.
281
- */
282
- verifyPassword({ accountAddress, password }: {
283
- accountAddress: string;
284
- password?: string;
285
- }): Promise<void>;
286
- isPasswordEncrypted({ accountAddress }: {
287
- accountAddress: string;
288
- }): Promise<boolean>;
289
- /**
290
- * check if the operation requires a password
291
- */
292
- requiresPasswordForOperation({ accountAddress, walletOperation, }: {
293
- accountAddress: string;
294
- walletOperation?: WalletOperation;
295
- }): Promise<boolean>;
296
- /**
297
- * check if the operation requires restoring backup shares
298
- */
299
- requiresRestoreBackupSharesForOperation({ accountAddress, walletOperation, }: {
300
- accountAddress: string;
301
- walletOperation?: WalletOperation;
302
- }): Promise<boolean>;
303
- getWalletExternalServerKeyShareBackupInfo({ accountAddress, }: {
304
- accountAddress: string;
305
- }): Promise<KeyShareBackupInfo>;
306
- getWallet({ accountAddress, walletOperation, shareCount, password, }: {
307
- accountAddress: string;
308
- walletOperation?: WalletOperation;
309
- shareCount?: number;
310
- password?: string;
311
- }): Promise<WalletProperties>;
312
- /**
313
- * Get a single wallet by address
314
- * First tries the efficient getWaasWalletByAddress endpoint, falls back to getUser() if not available
315
- */
316
- getWalletByAddress(accountAddress: string): Promise<WalletProperties | null>;
317
- /**
318
- * Get all wallets (kept for backward compatibility but now uses lazy loading)
319
- * @deprecated Consider using getWalletByAddress for better performance with large wallet counts
320
- */
321
- getWallets(): Promise<WalletProperties[]>;
322
- /**
323
- * Helper method to initialize or update a wallet entry in the walletMap.
324
- * This provides a consistent way to set up wallet properties across different operations.
325
- * @param accountAddress - The account address for the wallet
326
- * @param walletId - The wallet ID
327
- * @param chainName - The chain name (e.g., 'BTC', 'EVM')
328
- * @param thresholdSignatureScheme - The threshold signature scheme
329
- * @param derivationPath - Optional derivation path for the wallet
330
- * @param additionalProps - Optional additional properties to merge into the wallet entry
331
- */
332
- protected initializeWalletMapEntry({ accountAddress, walletId, chainName, thresholdSignatureScheme, derivationPath, additionalProps, }: {
333
- accountAddress: string;
334
- walletId: string;
335
- chainName: string;
336
- thresholdSignatureScheme: ThresholdSignatureScheme;
337
- derivationPath?: string;
338
- additionalProps?: Record<string, unknown>;
339
- }): void;
340
- }
341
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,iBAAiB,EACjB,cAAc,EAGd,WAAW,EACX,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EAGd,gBAAgB,EAIhB,wBAAwB,EACxB,KAAK,OAAO,EAEZ,eAAe,EAUf,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,8BAA8B,EAEpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAyB,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG7E,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAE1B,SAAS,CAAC,SAAS,EAAG,gBAAgB,CAAC;IACvC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAM;IAC3D,SAAS,CAAC,kBAAkB,CAAC,EAAE,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OAAO,CAAC,OAAO,CAAC;IAmCd,yCAAyC,CAAC,EAC9C,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2BzB,SAAS,CAAC,EACd,cAAc,EACd,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,GACrB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IA2DD;;;OAGG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAqElF;;;OAGG;IACG,UAAU;IAgChB;;;;;;;;;OASG;IACH,SAAS,CAAC,wBAAwB,CAAC,EACjC,cAAc,EACd,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,cAAc,EACd,eAAoB,GACrB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3C,GAAG,IAAI;CAqBT"}
@@ -1,2 +0,0 @@
1
- export declare const DEFAULT_LOG_LEVEL = "INFO";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,SAAS,CAAC"}
@@ -1,43 +0,0 @@
1
- import { DynamicApiClient, type ILogger } from '@dynamic-labs-wallet/core';
2
- export type CoreConfig = {
3
- environmentId: string;
4
- baseApiUrl?: string;
5
- baseMPCRelayApiUrl?: string;
6
- /**
7
- * Enables verbose debug-level logging when `true`.
8
- *
9
- * Only applies to the built-in default logger. If you provide a custom
10
- * `logger`, configure its verbosity directly — this flag has no effect on it.
11
- *
12
- * @default false
13
- */
14
- debug?: boolean;
15
- /**
16
- * Custom logger for SDK diagnostic output.
17
- *
18
- * Accepts any object that implements `ILogger` (`debug`, `info`, `warn`, `error`).
19
- * When provided, the SDK routes all internal logging through this instance.
20
- * You are responsible for configuring its log level — the `debug` flag has
21
- * no effect on custom loggers.
22
- *
23
- * When omitted, a built-in logger is used with verbosity controlled by `debug`.
24
- */
25
- logger?: ILogger;
26
- };
27
- export type Core = {
28
- environmentId: string;
29
- createApiClient: (options?: Partial<DynamicApiClientConfig>) => DynamicApiClient;
30
- logger: ILogger;
31
- baseMPCRelayApiUrl?: string;
32
- baseApiUrl?: string;
33
- debug: boolean;
34
- apiKey?: string;
35
- };
36
- export type DynamicApiClientConfig = {
37
- environmentId: string;
38
- authToken?: string;
39
- baseApiUrl?: string;
40
- sdkVersion?: string;
41
- };
42
- export declare const createCore: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, logger, }: CoreConfig) => Core;
43
- //# sourceMappingURL=createCore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createCore.d.ts","sourceRoot":"","sources":["../../src/core/createCore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAU,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGnF,MAAM,MAAM,UAAU,GAAG;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,gBAAgB,CAAC;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,sEAMpB,UAAU,KAAG,IA4Bf,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { Core } from './createCore.js';
2
- export type WithCore<T> = T & {
3
- _core: Core;
4
- };
5
- export declare const assignCore: <T extends object>(target: T, core: Core) => T;
6
- export declare const getCore: <T extends object>(obj: WithCore<T>) => Core;
7
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAC5B,KAAK,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,UAAU,CAAC,QAAQ,IAAI,KAAG,CAOpE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,MAAM,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAG,IAE5D,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { DynamicApiClient } from '@dynamic-labs-wallet/core';
2
- import type { WalletProperties } from '../types.js';
3
- export type DelegatedClientConfig = {
4
- environmentId: string;
5
- baseApiUrl?: string;
6
- baseMPCRelayApiUrl?: string;
7
- apiKey: string;
8
- debug?: boolean;
9
- };
10
- export type DelegatedWalletClient = {
11
- get environmentId(): string;
12
- get debug(): boolean;
13
- get apiUrl(): string | undefined;
14
- get wallets(): Record<string, WalletProperties>;
15
- createApiClient: (options?: Record<string, any>) => DynamicApiClient;
16
- logger: any;
17
- apiKey: string;
18
- baseMPCRelayApiUrl?: string;
19
- };
20
- export declare const createDelegatedApiClient: (client: DelegatedWalletClient, options?: Record<string, any>) => DynamicApiClient;
21
- export declare const createDelegatedApiClientWithWalletKey: (client: DelegatedWalletClient, walletApiKey: string) => DynamicApiClient;
22
- export declare const createDelegatedWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, }: DelegatedClientConfig) => DelegatedWalletClient;
23
- //# sourceMappingURL=createDelegatedClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDelegatedClient.d.ts","sourceRoot":"","sources":["../../src/delegatedClient/createDelegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,aAAa,IAAI,MAAM,CAAC;IAC5B,IAAI,KAAK,IAAI,OAAO,CAAC;IACrB,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAChD,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,gBAAgB,CAAC;IACrE,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAGF,eAAO,MAAM,wBAAwB,WAC3B,qBAAqB,YACpB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAC3B,gBAEF,CAAC;AAGF,eAAO,MAAM,qCAAqC,WACxC,qBAAqB,gBACf,MAAM,KACnB,gBAOF,CAAC;AAEF,eAAO,MAAM,2BAA2B,sEAMrC,qBAAqB,0BAsCvB,CAAC"}
@@ -1,7 +0,0 @@
1
- export { createDelegatedWalletClient } from './createDelegatedClient.js';
2
- export type { DelegatedWalletClient, DelegatedClientConfig } from './createDelegatedClient.js';
3
- export { delegatedSignMessage } from './modules/sign.js';
4
- export { revokeDelegation } from './modules/revokeDelegation.js';
5
- export { decryptDelegatedWebhookData } from './modules/decryptWebhookData.js';
6
- export type { EncryptedDelegatedPayload } from './modules/decryptWebhookData.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegatedClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAG/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { ServerKeyShare } from '../../mpc/types.js';
2
- export type EncryptedDelegatedPayload = {
3
- alg: string;
4
- iv: string;
5
- ct: string;
6
- tag: string;
7
- ek: string;
8
- kid?: string;
9
- };
10
- export declare function decryptDelegatedWebhookData({ privateKeyPem, encryptedDelegatedKeyShare, encryptedWalletApiKey, }: {
11
- privateKeyPem: string;
12
- encryptedDelegatedKeyShare: EncryptedDelegatedPayload;
13
- encryptedWalletApiKey: EncryptedDelegatedPayload;
14
- }): {
15
- decryptedDelegatedShare: ServerKeyShare;
16
- decryptedWalletApiKey: string;
17
- };
18
- //# sourceMappingURL=decryptWebhookData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decryptWebhookData.d.ts","sourceRoot":"","sources":["../../../src/delegatedClient/modules/decryptWebhookData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAyBF,wBAAgB,2BAA2B,CAAC,EAC1C,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,GACtB,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,0BAA0B,EAAE,yBAAyB,CAAC;IACtD,qBAAqB,EAAE,yBAAyB,CAAC;CAClD,GAAG;IACF,uBAAuB,EAAE,cAAc,CAAC;IACxC,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAkCA"}
@@ -1,3 +0,0 @@
1
- import type { DelegatedWalletClient } from '../createDelegatedClient.js';
2
- export declare const revokeDelegation: (client: DelegatedWalletClient, walletId: string) => Promise<void>;
3
- //# sourceMappingURL=revokeDelegation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revokeDelegation.d.ts","sourceRoot":"","sources":["../../../src/delegatedClient/modules/revokeDelegation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,gBAAgB,WAAkB,qBAAqB,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CAapG,CAAC"}
@@ -1,31 +0,0 @@
1
- import type { EcdsaSignature } from '#internal/node';
2
- import type { ServerKeyShare } from '../../mpc/types.js';
3
- import type { DelegatedWalletClient } from '../createDelegatedClient.js';
4
- import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
5
- export declare const dynamicDelegatedSign: (client: DelegatedWalletClient, { walletId, message, isFormatted, walletApiKey, onError, context, }: {
6
- walletId: string;
7
- message: string | Uint8Array;
8
- isFormatted?: boolean;
9
- walletApiKey: string;
10
- onError?: (error: Error) => void;
11
- context?: SignMessageContext;
12
- }) => Promise<import("@dynamic-labs-wallet/core").OpenRoomResponse>;
13
- export declare const delegatedSign: (client: DelegatedWalletClient, { chainName, message, roomId, keyShare, derivationPath, isFormatted, }: {
14
- chainName: string;
15
- message: string | Uint8Array;
16
- roomId: string;
17
- keyShare: ServerKeyShare;
18
- derivationPath: Uint32Array | undefined;
19
- isFormatted?: boolean;
20
- }) => Promise<Uint8Array | EcdsaSignature>;
21
- export declare const delegatedSignMessage: (client: DelegatedWalletClient, { walletId, walletApiKey, keyShare, message, chainName, isFormatted, onError, context, }: {
22
- walletId: string;
23
- walletApiKey: string;
24
- keyShare: ServerKeyShare;
25
- message: string | Uint8Array;
26
- chainName: string;
27
- isFormatted?: boolean;
28
- onError?: (error: Error) => void;
29
- context?: SignMessageContext;
30
- }) => Promise<Uint8Array | EcdsaSignature>;
31
- //# sourceMappingURL=sign.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/delegatedClient/modules/sign.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,KAAK,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0,0 @@
1
- export * from '#internal/core';
2
- export { ThresholdSignatureScheme } from '@dynamic-labs-wallet/core';
3
- export { WalletOperation, SOLANA_RPC_URL, getMPCChainConfig } from '@dynamic-labs-wallet/core';
4
- export { getMPCSignatureScheme, getMPCSigner } from './mpc/index.js';
5
- export type { ServerInitKeygenResult, ServerKeyShare, SignMessage } from './mpc/index.js';
6
- export * from './client.js';
7
- export * from './types.js';
8
- export * from './utils.js';
9
- export * from './mpc/index.js';
10
- export { createDelegatedWalletClient, delegatedSignMessage, revokeDelegation } from './delegatedClient/index.js';
11
- export type { DelegatedWalletClient, DelegatedClientConfig } from './delegatedClient/index.js';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG/F,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG1F,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjH,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1,3 +0,0 @@
1
- export { getMPCSignatureScheme, getMPCSigner } from './mpc.js';
2
- export type { ServerInitKeygenResult, ServerKeyShare, SignMessage } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mpc/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
package/src/mpc/mpc.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { type BitcoinConfig, SigningAlgorithm } from '@dynamic-labs-wallet/core';
2
- import { Ecdsa, ExportableEd25519, BIP340 } from '#internal/node';
3
- export declare const getMPCSignatureScheme: ({ signingAlgorithm, baseRelayUrl, }: {
4
- signingAlgorithm: SigningAlgorithm;
5
- baseRelayUrl?: string;
6
- }) => Ecdsa | ExportableEd25519 | BIP340;
7
- export declare const getMPCSigner: ({ chainName, baseRelayUrl, bitcoinConfig, }: {
8
- chainName: string;
9
- baseRelayUrl?: string;
10
- bitcoinConfig?: BitcoinConfig;
11
- }) => Ecdsa | ExportableEd25519 | BIP340;
12
- //# sourceMappingURL=mpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mpc.d.ts","sourceRoot":"","sources":["../../src/mpc/mpc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIlE,eAAO,MAAM,qBAAqB,wCAG/B;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,uCAWA,CAAC;AAEF,eAAO,MAAM,YAAY,gDAItB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,uCAOA,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { BIP340InitKeygenResult, BIP340KeygenResult, EcdsaInitKeygenResult, EcdsaKeygenResult, Ed25519InitKeygenResult, Ed25519KeygenResult, MessageHash } from '#internal/node';
2
- export type ServerInitKeygenResult = EcdsaInitKeygenResult | Ed25519InitKeygenResult | BIP340InitKeygenResult;
3
- export type ServerKeyShare = EcdsaKeygenResult | Ed25519KeygenResult | BIP340KeygenResult;
4
- export type SignMessage = MessageHash | Uint8Array;
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAE9G,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAE1F,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC"}
package/src/types.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import type { ThresholdSignatureScheme, KeyShareBackupInfo, ILogger } from '@dynamic-labs-wallet/core';
2
- import type { ForwardMPCClientV2 } from '@dynamic-labs-wallet/forward-mpc-client';
3
- import type { ServerKeyShare } from './mpc/types.js';
4
- export interface DynamicWalletClientProps {
5
- environmentId: string;
6
- baseApiUrl?: string;
7
- baseMPCRelayApiUrl?: string;
8
- /**
9
- * Enables verbose debug-level logging when `true`.
10
- *
11
- * Only applies to the built-in default logger. If you provide a custom
12
- * `logger`, configure its verbosity directly — this flag has no effect on it.
13
- *
14
- * @default false
15
- */
16
- debug?: boolean;
17
- forwardMPCClient?: ForwardMPCClientV2;
18
- enableMPCAccelerator?: boolean;
19
- /**
20
- * Custom logger for SDK diagnostic output.
21
- *
22
- * Accepts any object that implements `ILogger` (`debug`, `info`, `warn`, `error`).
23
- * When provided, the SDK routes all internal logging through this instance.
24
- * You are responsible for configuring its log level — the `debug` flag has
25
- * no effect on custom loggers.
26
- *
27
- * When omitted, a built-in logger is used with verbosity controlled by `debug`.
28
- */
29
- logger?: ILogger;
30
- }
31
- export interface WalletProperties {
32
- chainName: string;
33
- walletId: string;
34
- accountAddress: string;
35
- externalServerKeyShares: ServerKeyShare[];
36
- thresholdSignatureScheme: ThresholdSignatureScheme;
37
- derivationPath?: string;
38
- addressType?: string;
39
- externalServerKeySharesBackupInfo: KeyShareBackupInfo;
40
- }
41
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,cAAc,EAAE,CAAC;IAC1C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC,EAAE,kBAAkB,CAAC;CACvD"}
package/src/utils.d.ts DELETED
@@ -1,48 +0,0 @@
1
- import { MessageHash } from '#internal/node';
2
- import { type KeyShareBackupInfo, type WaasWalletProperties } from '@dynamic-labs-wallet/core';
3
- import type { ServerKeyShare } from './mpc/types.js';
4
- export declare const createLogError: (clientTag: string) => ({ message, error, context }: {
5
- message: string;
6
- error: Error;
7
- context: Record<string, unknown>;
8
- }) => void;
9
- export declare const logError: ({ message, error, context, clientTag, }: {
10
- message: string;
11
- error: Error;
12
- context: Record<string, unknown>;
13
- clientTag?: string;
14
- }) => void;
15
- export declare const bytesToBase64: (arr: Uint8Array) => string;
16
- export declare const stringToBytes: (str: string) => Uint8Array;
17
- export declare const base64ToBytes: (base64: string) => Uint8Array;
18
- export declare const ensureBase64Padding: (str: string) => string;
19
- export declare const isHexString: (str: string) => boolean;
20
- export declare const getExternalServerKeyShareBackupInfo: (params?: {
21
- walletProperties: WaasWalletProperties;
22
- }) => KeyShareBackupInfo;
23
- /**
24
- * Helper function to merge keyshares and remove duplicates based on pubkey and secretShare
25
- * @param existingKeyShares - Array of existing keyshares
26
- * @param newKeyShares - Array of new keyshares to merge
27
- * @returns Array of merged unique keyshares
28
- */
29
- export declare const mergeUniqueKeyShares: (existingKeyShares: ServerKeyShare[], newKeyShares: ServerKeyShare[]) => ServerKeyShare[];
30
- interface RetryConfig {
31
- maxAttempts?: number;
32
- retryInterval?: number;
33
- operationName?: string;
34
- logContext?: Record<string, unknown>;
35
- }
36
- /**
37
- * Generic helper function to retry a promise-based operations
38
- *
39
- * @param operation - The async operation to retry
40
- * @param config - Configuration options for retry behavior
41
- * @returns Promise with the operation result
42
- * @throws Last error encountered after all retries are exhausted
43
- */
44
- export declare function retryPromise<T>(operation: () => Promise<T>, { maxAttempts, retryInterval, operationName, logContext }?: RetryConfig): Promise<T>;
45
- export declare const formatEvmMessage: (message: string | Uint8Array) => MessageHash;
46
- export declare const formatMessage: (chainName: string, message: string | Uint8Array) => string | Uint8Array | MessageHash;
47
- export {};
48
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAI1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,cAAc,cACb,MAAM,mCACY;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,KAAG,IAClD,CAAC;AAErD,eAAO,MAAM,QAAQ,4CAKlB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAG,IAUH,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,mCAAmC,YAAa;IAC3D,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBA2CH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sBACZ,cAAc,EAAE,gBACrB,cAAc,EAAE,KAC7B,cAAc,EAchB,CAAC;A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