@dynamic-labs-wallet/core 0.0.47 → 0.0.49
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 +155 -19
- package/index.esm.js +149 -20
- package/package.json +2 -3
- package/src/api/api.d.ts +3 -0
- package/src/api/api.d.ts.map +1 -1
- package/src/api/client.d.ts +1 -1
- package/src/api/client.d.ts.map +1 -1
- package/src/constants.d.ts +33 -0
- package/src/constants.d.ts.map +1 -1
- package/src/eventStream/utils.d.ts.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/mpc/constants.d.ts +0 -7
- package/src/mpc/constants.d.ts.map +1 -1
- package/src/mpc/utils.d.ts +20 -0
- package/src/mpc/utils.d.ts.map +1 -1
- package/src/types.d.ts +44 -0
- package/src/types.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var viem = require('viem');
|
|
5
4
|
|
|
6
5
|
const DYNAMIC_AUTH_PROD_BASE_API_URL = 'https://app.dynamicauth.com';
|
|
7
6
|
const DYNAMIC_AUTH_PREPROD_BASE_API_URL = 'https://app.dynamic-preprod.xyz';
|
|
@@ -10,6 +9,46 @@ const DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = 'https://app-dynamic-preprod-x
|
|
|
10
9
|
const MPC_RELAY_PROD_API_URL = 'relay.dynamicauth.com';
|
|
11
10
|
const MPC_RELAY_PREPROD_API_URL = 'relay.dynamic-preprod.xyz';
|
|
12
11
|
const SOLANA_RPC_URL = 'https://api.devnet.solana.com';
|
|
12
|
+
const chain = {
|
|
13
|
+
EVM: 'EVM',
|
|
14
|
+
SOL: 'SOL',
|
|
15
|
+
COSMOS: 'COSMOS',
|
|
16
|
+
BTC: 'BTC',
|
|
17
|
+
FLOW: 'FLOW',
|
|
18
|
+
SUI: 'SUI'
|
|
19
|
+
};
|
|
20
|
+
var WalletOperation = /*#__PURE__*/ function(WalletOperation) {
|
|
21
|
+
WalletOperation["REACH_THRESHOLD"] = "REACH_THRESHOLD";
|
|
22
|
+
WalletOperation["REACH_ALL_PARTIES"] = "REACH_ALL_PARTIES";
|
|
23
|
+
WalletOperation["SIGN_MESSAGE"] = "SIGN_MESSAGE";
|
|
24
|
+
WalletOperation["SIGN_TRANSACTION"] = "SIGN_TRANSACTION";
|
|
25
|
+
WalletOperation["REFRESH"] = "REFRESH";
|
|
26
|
+
WalletOperation["RESHARE"] = "RESHARE";
|
|
27
|
+
WalletOperation["EXPORT_PRIVATE_KEY"] = "EXPORT_PRIVATE_KEY";
|
|
28
|
+
WalletOperation["NO_OPERATION"] = "NO_OPERATION";
|
|
29
|
+
return WalletOperation;
|
|
30
|
+
}({});
|
|
31
|
+
var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
|
|
32
|
+
BackupLocation["DYNAMIC"] = "dynamic";
|
|
33
|
+
BackupLocation["GOOGLE_DRIVE"] = "googleDrive";
|
|
34
|
+
BackupLocation["ICLOUD"] = "iCloud";
|
|
35
|
+
BackupLocation["USER"] = "user";
|
|
36
|
+
BackupLocation["EXTERNAL"] = "external";
|
|
37
|
+
return BackupLocation;
|
|
38
|
+
}({});
|
|
39
|
+
// TODO: replace with apiClient proxy and move this to apiClient when ready
|
|
40
|
+
const IFRAME_DOMAIN = 'http://localhost:8090';
|
|
41
|
+
const ChainEnumToVerifiedCredentialName = {
|
|
42
|
+
BTC: 'bip122',
|
|
43
|
+
EVM: 'eip155',
|
|
44
|
+
FLOW: 'flow',
|
|
45
|
+
SOL: 'solana'
|
|
46
|
+
};
|
|
47
|
+
const VerifiedCredentialNameToChainEnum = {
|
|
48
|
+
bip122: 'BTC',
|
|
49
|
+
eip155: 'EVM',
|
|
50
|
+
solana: 'SOL'
|
|
51
|
+
};
|
|
13
52
|
|
|
14
53
|
var SigningAlgorithm = /*#__PURE__*/ function(SigningAlgorithm) {
|
|
15
54
|
SigningAlgorithm["ECDSA"] = "ECDSA";
|
|
@@ -124,14 +163,6 @@ var CreateRoomPartiesOptions = /*#__PURE__*/ function(CreateRoomPartiesOptions)
|
|
|
124
163
|
CreateRoomPartiesOptions["FULL"] = "full";
|
|
125
164
|
return CreateRoomPartiesOptions;
|
|
126
165
|
}({});
|
|
127
|
-
var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
|
|
128
|
-
BackupLocation["DYNAMIC"] = "dynamic";
|
|
129
|
-
BackupLocation["GOOGLE_DRIVE"] = "googleDrive";
|
|
130
|
-
BackupLocation["ICLOUD"] = "iCloud";
|
|
131
|
-
BackupLocation["USER"] = "user";
|
|
132
|
-
BackupLocation["EXTERNAL"] = "external";
|
|
133
|
-
return BackupLocation;
|
|
134
|
-
}({});
|
|
135
166
|
|
|
136
167
|
const getMPCChainConfig = (chainName)=>{
|
|
137
168
|
const chainConfig = MPC_CHAIN_CONFIG[chainName];
|
|
@@ -166,7 +197,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
166
197
|
*/ const getReshareConfig = ({ oldThresholdSignatureScheme, newThresholdSignatureScheme })=>{
|
|
167
198
|
switch(true){
|
|
168
199
|
// 2-of-2 -> 2-of-2:
|
|
169
|
-
// -- server shares: 1 existing, 0 new
|
|
200
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
170
201
|
// -- client shares: 1 existing, 0 new
|
|
171
202
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
172
203
|
return {
|
|
@@ -176,7 +207,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
176
207
|
newServerShareCount: 0
|
|
177
208
|
};
|
|
178
209
|
// 2-of-3 -> 2-of-3:
|
|
179
|
-
// -- server shares: 1 existing, 0 new
|
|
210
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
180
211
|
// -- client shares: 1 existing, 1 new
|
|
181
212
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
182
213
|
return {
|
|
@@ -186,7 +217,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
186
217
|
newServerShareCount: 0
|
|
187
218
|
};
|
|
188
219
|
// 3-of-5 -> 3-of-5:
|
|
189
|
-
// -- server shares: 2 existing, 0 new
|
|
220
|
+
// -- dynamic server shares: 2 existing, 0 new
|
|
190
221
|
// -- client shares: 1 existing, 2 new
|
|
191
222
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
192
223
|
return {
|
|
@@ -196,7 +227,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
196
227
|
newServerShareCount: 0
|
|
197
228
|
};
|
|
198
229
|
// 2-of-2 -> 2-of-3:
|
|
199
|
-
// -- server shares: 1 existing, 0 new
|
|
230
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
200
231
|
// -- client shares: 1 existing, 1 new
|
|
201
232
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
202
233
|
return {
|
|
@@ -206,7 +237,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
206
237
|
newServerShareCount: 0
|
|
207
238
|
};
|
|
208
239
|
// 2-of-2 -> 3-of-5:
|
|
209
|
-
// -- server shares: 1 existing, 1 new
|
|
240
|
+
// -- dynamic server shares: 1 existing, 1 new
|
|
210
241
|
// -- client shares: 1 existing, 2 new
|
|
211
242
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
212
243
|
return {
|
|
@@ -216,7 +247,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
216
247
|
newServerShareCount: 1
|
|
217
248
|
};
|
|
218
249
|
// 2-of-3 -> 3-of-5:
|
|
219
|
-
// -- server shares: 1 existing, 1 new
|
|
250
|
+
// -- dynamic server shares: 1 existing, 1 new
|
|
220
251
|
// -- client shares: 1 existing, 2 new
|
|
221
252
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
222
253
|
return {
|
|
@@ -226,7 +257,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
226
257
|
newServerShareCount: 1
|
|
227
258
|
};
|
|
228
259
|
// 2-of-3 -> 2-of-2:
|
|
229
|
-
// -- server shares: 1 existing, 0 new
|
|
260
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
230
261
|
// -- client shares: 1 existing, 0 new
|
|
231
262
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
232
263
|
return {
|
|
@@ -236,7 +267,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
236
267
|
newServerShareCount: 0
|
|
237
268
|
};
|
|
238
269
|
// 3-of-5 -> 2-of-3:
|
|
239
|
-
// -- server shares: 1 existing, 0 new
|
|
270
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
240
271
|
// -- client shares: 2 existing, 0 new
|
|
241
272
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
242
273
|
return {
|
|
@@ -249,6 +280,102 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
249
280
|
throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
|
|
250
281
|
}
|
|
251
282
|
};
|
|
283
|
+
/**
|
|
284
|
+
* Helper function to get the reshare config for client and server shares
|
|
285
|
+
* @param {ThresholdSignatureScheme} oldThresholdSignatureScheme - The current threshold signature scheme
|
|
286
|
+
* @param {ThresholdSignatureScheme} newThresholdSignatureScheme - The target threshold signature scheme
|
|
287
|
+
* @returns {{
|
|
288
|
+
* existingServerShareCount: number,
|
|
289
|
+
* newServerhareCount: number,
|
|
290
|
+
* existingDynamicServerShareCount: number,
|
|
291
|
+
* newDynamicServerShareCount: number
|
|
292
|
+
* }} The number of existing and new client and server shares needed
|
|
293
|
+
*/ const getServerWalletReshareConfig = ({ oldThresholdSignatureScheme, newThresholdSignatureScheme })=>{
|
|
294
|
+
switch(true){
|
|
295
|
+
// 2-of-2 -> 2-of-2:
|
|
296
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
297
|
+
// -- external server shares: 1 existing, 0 new
|
|
298
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
299
|
+
return {
|
|
300
|
+
existingExternalServerShareCount: 1,
|
|
301
|
+
newExternalServerShareCount: 0,
|
|
302
|
+
existingDynamicServerShareCount: 1,
|
|
303
|
+
newDynamicServerShareCount: 0
|
|
304
|
+
};
|
|
305
|
+
// 2-of-3 -> 2-of-3:
|
|
306
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
307
|
+
// -- external server shares: 1 existing, 1 new
|
|
308
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
309
|
+
return {
|
|
310
|
+
existingExternalServerShareCount: 1,
|
|
311
|
+
newExternalServerShareCount: 1,
|
|
312
|
+
existingDynamicServerShareCount: 1,
|
|
313
|
+
newDynamicServerShareCount: 0
|
|
314
|
+
};
|
|
315
|
+
// 3-of-5 -> 3-of-5:
|
|
316
|
+
// -- dyanmic server shares: 2 existing, 0 new
|
|
317
|
+
// -- external server shares: 1 existing, 2 new
|
|
318
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
319
|
+
return {
|
|
320
|
+
existingExternalServerShareCount: 1,
|
|
321
|
+
newExternalServerShareCount: 2,
|
|
322
|
+
existingDynamicServerShareCount: 2,
|
|
323
|
+
newDynamicServerShareCount: 0
|
|
324
|
+
};
|
|
325
|
+
// 2-of-2 -> 2-of-3:
|
|
326
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
327
|
+
// -- external server shares: 1 existing, 1 new
|
|
328
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
329
|
+
return {
|
|
330
|
+
existingExternalServerShareCount: 1,
|
|
331
|
+
newExternalServerShareCount: 1,
|
|
332
|
+
existingDynamicServerShareCount: 1,
|
|
333
|
+
newDynamicServerShareCount: 0
|
|
334
|
+
};
|
|
335
|
+
// 2-of-2 -> 3-of-5:
|
|
336
|
+
// -- dyanmic server shares: 1 existing, 1 new
|
|
337
|
+
// -- external server shares: 1 existing, 2 new
|
|
338
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
339
|
+
return {
|
|
340
|
+
existingExternalServerShareCount: 1,
|
|
341
|
+
newExternalServerShareCount: 2,
|
|
342
|
+
existingDynamicServerShareCount: 1,
|
|
343
|
+
newDynamicServerShareCount: 1
|
|
344
|
+
};
|
|
345
|
+
// 2-of-3 -> 3-of-5:
|
|
346
|
+
// -- dyanmic server shares: 1 existing, 1 new
|
|
347
|
+
// -- external server shares: 1 existing, 2 new
|
|
348
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
349
|
+
return {
|
|
350
|
+
existingExternalServerShareCount: 1,
|
|
351
|
+
newExternalServerShareCount: 2,
|
|
352
|
+
existingDynamicServerShareCount: 1,
|
|
353
|
+
newDynamicServerShareCount: 1
|
|
354
|
+
};
|
|
355
|
+
// 2-of-3 -> 2-of-2:
|
|
356
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
357
|
+
// -- external server shares: 1 existing, 0 new
|
|
358
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
359
|
+
return {
|
|
360
|
+
existingExternalServerShareCount: 1,
|
|
361
|
+
newExternalServerShareCount: 0,
|
|
362
|
+
existingDynamicServerShareCount: 1,
|
|
363
|
+
newDynamicServerShareCount: 0
|
|
364
|
+
};
|
|
365
|
+
// 3-of-5 -> 2-of-3:
|
|
366
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
367
|
+
// -- external server shares: 2 existing, 0 new
|
|
368
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
369
|
+
return {
|
|
370
|
+
existingExternalServerShareCount: 2,
|
|
371
|
+
newExternalServerShareCount: 0,
|
|
372
|
+
existingDynamicServerShareCount: 1,
|
|
373
|
+
newDynamicServerShareCount: 0
|
|
374
|
+
};
|
|
375
|
+
default:
|
|
376
|
+
throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
252
379
|
|
|
253
380
|
class BaseClient {
|
|
254
381
|
constructor({ environmentId, baseApiUrl, authToken, baseClientRelayApiUrl }){
|
|
@@ -343,7 +470,7 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
|
|
|
343
470
|
}
|
|
344
471
|
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
345
472
|
const { accountAddress, walletId } = event.data;
|
|
346
|
-
onCeremonyComplete == null ? void 0 : onCeremonyComplete(
|
|
473
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
347
474
|
}
|
|
348
475
|
if (event.type === 'error') {
|
|
349
476
|
reject(createErrorFromEventData(event.data));
|
|
@@ -408,6 +535,9 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
|
|
|
408
535
|
};
|
|
409
536
|
|
|
410
537
|
class DynamicApiClient extends BaseClient {
|
|
538
|
+
async authenticateApiToken({ environmentId }) {
|
|
539
|
+
return this.apiClient.post(`/api/v0/environments/${environmentId}/waas/authenticate`);
|
|
540
|
+
}
|
|
411
541
|
async createWalletAccount({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete }) {
|
|
412
542
|
return createEventStreamPromise({
|
|
413
543
|
apiClient: this.apiClient,
|
|
@@ -491,7 +621,6 @@ class DynamicApiClient extends BaseClient {
|
|
|
491
621
|
}
|
|
492
622
|
async getAccessToken({ oauthAccountId }) {
|
|
493
623
|
const { data } = await this.apiClient.get(`/api/v0/sdk/${this.environmentId}/oauthAccounts/${oauthAccountId}/accessToken`);
|
|
494
|
-
console.log('data', data);
|
|
495
624
|
return data.accessToken;
|
|
496
625
|
}
|
|
497
626
|
// TODO: return array instead considering cases where server has multiple parties
|
|
@@ -557,21 +686,28 @@ class DynamicApiClient extends BaseClient {
|
|
|
557
686
|
|
|
558
687
|
exports.BITCOIN_DERIVATION_PATHS = BITCOIN_DERIVATION_PATHS;
|
|
559
688
|
exports.BackupLocation = BackupLocation;
|
|
689
|
+
exports.ChainEnumToVerifiedCredentialName = ChainEnumToVerifiedCredentialName;
|
|
560
690
|
exports.CreateRoomPartiesOptions = CreateRoomPartiesOptions;
|
|
561
691
|
exports.DYNAMIC_AUTH_PREPROD_BASE_API_URL = DYNAMIC_AUTH_PREPROD_BASE_API_URL;
|
|
562
692
|
exports.DYNAMIC_AUTH_PROD_BASE_API_URL = DYNAMIC_AUTH_PROD_BASE_API_URL;
|
|
563
693
|
exports.DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL;
|
|
564
694
|
exports.DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL = DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL;
|
|
565
695
|
exports.DynamicApiClient = DynamicApiClient;
|
|
696
|
+
exports.IFRAME_DOMAIN = IFRAME_DOMAIN;
|
|
566
697
|
exports.MPC_CHAIN_CONFIG = MPC_CHAIN_CONFIG;
|
|
567
698
|
exports.MPC_CONFIG = MPC_CONFIG;
|
|
568
699
|
exports.MPC_RELAY_PREPROD_API_URL = MPC_RELAY_PREPROD_API_URL;
|
|
569
700
|
exports.MPC_RELAY_PROD_API_URL = MPC_RELAY_PROD_API_URL;
|
|
570
701
|
exports.SOLANA_RPC_URL = SOLANA_RPC_URL;
|
|
571
702
|
exports.SigningAlgorithm = SigningAlgorithm;
|
|
703
|
+
exports.SuccessEventType = SuccessEventType;
|
|
572
704
|
exports.ThresholdSignatureScheme = ThresholdSignatureScheme;
|
|
705
|
+
exports.VerifiedCredentialNameToChainEnum = VerifiedCredentialNameToChainEnum;
|
|
706
|
+
exports.WalletOperation = WalletOperation;
|
|
707
|
+
exports.chain = chain;
|
|
573
708
|
exports.getClientThreshold = getClientThreshold;
|
|
574
709
|
exports.getDynamicServerThreshold = getDynamicServerThreshold;
|
|
575
710
|
exports.getMPCChainConfig = getMPCChainConfig;
|
|
576
711
|
exports.getReshareConfig = getReshareConfig;
|
|
712
|
+
exports.getServerWalletReshareConfig = getServerWalletReshareConfig;
|
|
577
713
|
exports.getTSSConfig = getTSSConfig;
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { getAddress } from 'viem';
|
|
3
2
|
|
|
4
3
|
const DYNAMIC_AUTH_PROD_BASE_API_URL = 'https://app.dynamicauth.com';
|
|
5
4
|
const DYNAMIC_AUTH_PREPROD_BASE_API_URL = 'https://app.dynamic-preprod.xyz';
|
|
@@ -8,6 +7,46 @@ const DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = 'https://app-dynamic-preprod-x
|
|
|
8
7
|
const MPC_RELAY_PROD_API_URL = 'relay.dynamicauth.com';
|
|
9
8
|
const MPC_RELAY_PREPROD_API_URL = 'relay.dynamic-preprod.xyz';
|
|
10
9
|
const SOLANA_RPC_URL = 'https://api.devnet.solana.com';
|
|
10
|
+
const chain = {
|
|
11
|
+
EVM: 'EVM',
|
|
12
|
+
SOL: 'SOL',
|
|
13
|
+
COSMOS: 'COSMOS',
|
|
14
|
+
BTC: 'BTC',
|
|
15
|
+
FLOW: 'FLOW',
|
|
16
|
+
SUI: 'SUI'
|
|
17
|
+
};
|
|
18
|
+
var WalletOperation = /*#__PURE__*/ function(WalletOperation) {
|
|
19
|
+
WalletOperation["REACH_THRESHOLD"] = "REACH_THRESHOLD";
|
|
20
|
+
WalletOperation["REACH_ALL_PARTIES"] = "REACH_ALL_PARTIES";
|
|
21
|
+
WalletOperation["SIGN_MESSAGE"] = "SIGN_MESSAGE";
|
|
22
|
+
WalletOperation["SIGN_TRANSACTION"] = "SIGN_TRANSACTION";
|
|
23
|
+
WalletOperation["REFRESH"] = "REFRESH";
|
|
24
|
+
WalletOperation["RESHARE"] = "RESHARE";
|
|
25
|
+
WalletOperation["EXPORT_PRIVATE_KEY"] = "EXPORT_PRIVATE_KEY";
|
|
26
|
+
WalletOperation["NO_OPERATION"] = "NO_OPERATION";
|
|
27
|
+
return WalletOperation;
|
|
28
|
+
}({});
|
|
29
|
+
var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
|
|
30
|
+
BackupLocation["DYNAMIC"] = "dynamic";
|
|
31
|
+
BackupLocation["GOOGLE_DRIVE"] = "googleDrive";
|
|
32
|
+
BackupLocation["ICLOUD"] = "iCloud";
|
|
33
|
+
BackupLocation["USER"] = "user";
|
|
34
|
+
BackupLocation["EXTERNAL"] = "external";
|
|
35
|
+
return BackupLocation;
|
|
36
|
+
}({});
|
|
37
|
+
// TODO: replace with apiClient proxy and move this to apiClient when ready
|
|
38
|
+
const IFRAME_DOMAIN = 'http://localhost:8090';
|
|
39
|
+
const ChainEnumToVerifiedCredentialName = {
|
|
40
|
+
BTC: 'bip122',
|
|
41
|
+
EVM: 'eip155',
|
|
42
|
+
FLOW: 'flow',
|
|
43
|
+
SOL: 'solana'
|
|
44
|
+
};
|
|
45
|
+
const VerifiedCredentialNameToChainEnum = {
|
|
46
|
+
bip122: 'BTC',
|
|
47
|
+
eip155: 'EVM',
|
|
48
|
+
solana: 'SOL'
|
|
49
|
+
};
|
|
11
50
|
|
|
12
51
|
var SigningAlgorithm = /*#__PURE__*/ function(SigningAlgorithm) {
|
|
13
52
|
SigningAlgorithm["ECDSA"] = "ECDSA";
|
|
@@ -122,14 +161,6 @@ var CreateRoomPartiesOptions = /*#__PURE__*/ function(CreateRoomPartiesOptions)
|
|
|
122
161
|
CreateRoomPartiesOptions["FULL"] = "full";
|
|
123
162
|
return CreateRoomPartiesOptions;
|
|
124
163
|
}({});
|
|
125
|
-
var BackupLocation = /*#__PURE__*/ function(BackupLocation) {
|
|
126
|
-
BackupLocation["DYNAMIC"] = "dynamic";
|
|
127
|
-
BackupLocation["GOOGLE_DRIVE"] = "googleDrive";
|
|
128
|
-
BackupLocation["ICLOUD"] = "iCloud";
|
|
129
|
-
BackupLocation["USER"] = "user";
|
|
130
|
-
BackupLocation["EXTERNAL"] = "external";
|
|
131
|
-
return BackupLocation;
|
|
132
|
-
}({});
|
|
133
164
|
|
|
134
165
|
const getMPCChainConfig = (chainName)=>{
|
|
135
166
|
const chainConfig = MPC_CHAIN_CONFIG[chainName];
|
|
@@ -164,7 +195,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
164
195
|
*/ const getReshareConfig = ({ oldThresholdSignatureScheme, newThresholdSignatureScheme })=>{
|
|
165
196
|
switch(true){
|
|
166
197
|
// 2-of-2 -> 2-of-2:
|
|
167
|
-
// -- server shares: 1 existing, 0 new
|
|
198
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
168
199
|
// -- client shares: 1 existing, 0 new
|
|
169
200
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
170
201
|
return {
|
|
@@ -174,7 +205,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
174
205
|
newServerShareCount: 0
|
|
175
206
|
};
|
|
176
207
|
// 2-of-3 -> 2-of-3:
|
|
177
|
-
// -- server shares: 1 existing, 0 new
|
|
208
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
178
209
|
// -- client shares: 1 existing, 1 new
|
|
179
210
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
180
211
|
return {
|
|
@@ -184,7 +215,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
184
215
|
newServerShareCount: 0
|
|
185
216
|
};
|
|
186
217
|
// 3-of-5 -> 3-of-5:
|
|
187
|
-
// -- server shares: 2 existing, 0 new
|
|
218
|
+
// -- dynamic server shares: 2 existing, 0 new
|
|
188
219
|
// -- client shares: 1 existing, 2 new
|
|
189
220
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
190
221
|
return {
|
|
@@ -194,7 +225,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
194
225
|
newServerShareCount: 0
|
|
195
226
|
};
|
|
196
227
|
// 2-of-2 -> 2-of-3:
|
|
197
|
-
// -- server shares: 1 existing, 0 new
|
|
228
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
198
229
|
// -- client shares: 1 existing, 1 new
|
|
199
230
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
200
231
|
return {
|
|
@@ -204,7 +235,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
204
235
|
newServerShareCount: 0
|
|
205
236
|
};
|
|
206
237
|
// 2-of-2 -> 3-of-5:
|
|
207
|
-
// -- server shares: 1 existing, 1 new
|
|
238
|
+
// -- dynamic server shares: 1 existing, 1 new
|
|
208
239
|
// -- client shares: 1 existing, 2 new
|
|
209
240
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
210
241
|
return {
|
|
@@ -214,7 +245,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
214
245
|
newServerShareCount: 1
|
|
215
246
|
};
|
|
216
247
|
// 2-of-3 -> 3-of-5:
|
|
217
|
-
// -- server shares: 1 existing, 1 new
|
|
248
|
+
// -- dynamic server shares: 1 existing, 1 new
|
|
218
249
|
// -- client shares: 1 existing, 2 new
|
|
219
250
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
220
251
|
return {
|
|
@@ -224,7 +255,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
224
255
|
newServerShareCount: 1
|
|
225
256
|
};
|
|
226
257
|
// 2-of-3 -> 2-of-2:
|
|
227
|
-
// -- server shares: 1 existing, 0 new
|
|
258
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
228
259
|
// -- client shares: 1 existing, 0 new
|
|
229
260
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
230
261
|
return {
|
|
@@ -234,7 +265,7 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
234
265
|
newServerShareCount: 0
|
|
235
266
|
};
|
|
236
267
|
// 3-of-5 -> 2-of-3:
|
|
237
|
-
// -- server shares: 1 existing, 0 new
|
|
268
|
+
// -- dynamic server shares: 1 existing, 0 new
|
|
238
269
|
// -- client shares: 2 existing, 0 new
|
|
239
270
|
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
240
271
|
return {
|
|
@@ -247,6 +278,102 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
247
278
|
throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
|
|
248
279
|
}
|
|
249
280
|
};
|
|
281
|
+
/**
|
|
282
|
+
* Helper function to get the reshare config for client and server shares
|
|
283
|
+
* @param {ThresholdSignatureScheme} oldThresholdSignatureScheme - The current threshold signature scheme
|
|
284
|
+
* @param {ThresholdSignatureScheme} newThresholdSignatureScheme - The target threshold signature scheme
|
|
285
|
+
* @returns {{
|
|
286
|
+
* existingServerShareCount: number,
|
|
287
|
+
* newServerhareCount: number,
|
|
288
|
+
* existingDynamicServerShareCount: number,
|
|
289
|
+
* newDynamicServerShareCount: number
|
|
290
|
+
* }} The number of existing and new client and server shares needed
|
|
291
|
+
*/ const getServerWalletReshareConfig = ({ oldThresholdSignatureScheme, newThresholdSignatureScheme })=>{
|
|
292
|
+
switch(true){
|
|
293
|
+
// 2-of-2 -> 2-of-2:
|
|
294
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
295
|
+
// -- external server shares: 1 existing, 0 new
|
|
296
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
297
|
+
return {
|
|
298
|
+
existingExternalServerShareCount: 1,
|
|
299
|
+
newExternalServerShareCount: 0,
|
|
300
|
+
existingDynamicServerShareCount: 1,
|
|
301
|
+
newDynamicServerShareCount: 0
|
|
302
|
+
};
|
|
303
|
+
// 2-of-3 -> 2-of-3:
|
|
304
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
305
|
+
// -- external server shares: 1 existing, 1 new
|
|
306
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
307
|
+
return {
|
|
308
|
+
existingExternalServerShareCount: 1,
|
|
309
|
+
newExternalServerShareCount: 1,
|
|
310
|
+
existingDynamicServerShareCount: 1,
|
|
311
|
+
newDynamicServerShareCount: 0
|
|
312
|
+
};
|
|
313
|
+
// 3-of-5 -> 3-of-5:
|
|
314
|
+
// -- dyanmic server shares: 2 existing, 0 new
|
|
315
|
+
// -- external server shares: 1 existing, 2 new
|
|
316
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
317
|
+
return {
|
|
318
|
+
existingExternalServerShareCount: 1,
|
|
319
|
+
newExternalServerShareCount: 2,
|
|
320
|
+
existingDynamicServerShareCount: 2,
|
|
321
|
+
newDynamicServerShareCount: 0
|
|
322
|
+
};
|
|
323
|
+
// 2-of-2 -> 2-of-3:
|
|
324
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
325
|
+
// -- external server shares: 1 existing, 1 new
|
|
326
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
327
|
+
return {
|
|
328
|
+
existingExternalServerShareCount: 1,
|
|
329
|
+
newExternalServerShareCount: 1,
|
|
330
|
+
existingDynamicServerShareCount: 1,
|
|
331
|
+
newDynamicServerShareCount: 0
|
|
332
|
+
};
|
|
333
|
+
// 2-of-2 -> 3-of-5:
|
|
334
|
+
// -- dyanmic server shares: 1 existing, 1 new
|
|
335
|
+
// -- external server shares: 1 existing, 2 new
|
|
336
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
337
|
+
return {
|
|
338
|
+
existingExternalServerShareCount: 1,
|
|
339
|
+
newExternalServerShareCount: 2,
|
|
340
|
+
existingDynamicServerShareCount: 1,
|
|
341
|
+
newDynamicServerShareCount: 1
|
|
342
|
+
};
|
|
343
|
+
// 2-of-3 -> 3-of-5:
|
|
344
|
+
// -- dyanmic server shares: 1 existing, 1 new
|
|
345
|
+
// -- external server shares: 1 existing, 2 new
|
|
346
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE:
|
|
347
|
+
return {
|
|
348
|
+
existingExternalServerShareCount: 1,
|
|
349
|
+
newExternalServerShareCount: 2,
|
|
350
|
+
existingDynamicServerShareCount: 1,
|
|
351
|
+
newDynamicServerShareCount: 1
|
|
352
|
+
};
|
|
353
|
+
// 2-of-3 -> 2-of-2:
|
|
354
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
355
|
+
// -- external server shares: 1 existing, 0 new
|
|
356
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
|
|
357
|
+
return {
|
|
358
|
+
existingExternalServerShareCount: 1,
|
|
359
|
+
newExternalServerShareCount: 0,
|
|
360
|
+
existingDynamicServerShareCount: 1,
|
|
361
|
+
newDynamicServerShareCount: 0
|
|
362
|
+
};
|
|
363
|
+
// 3-of-5 -> 2-of-3:
|
|
364
|
+
// -- dyanmic server shares: 1 existing, 0 new
|
|
365
|
+
// -- external server shares: 2 existing, 0 new
|
|
366
|
+
case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
|
|
367
|
+
return {
|
|
368
|
+
existingExternalServerShareCount: 2,
|
|
369
|
+
newExternalServerShareCount: 0,
|
|
370
|
+
existingDynamicServerShareCount: 1,
|
|
371
|
+
newDynamicServerShareCount: 0
|
|
372
|
+
};
|
|
373
|
+
default:
|
|
374
|
+
throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
|
|
375
|
+
}
|
|
376
|
+
};
|
|
250
377
|
|
|
251
378
|
class BaseClient {
|
|
252
379
|
constructor({ environmentId, baseApiUrl, authToken, baseClientRelayApiUrl }){
|
|
@@ -341,7 +468,7 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
|
|
|
341
468
|
}
|
|
342
469
|
if (event.type === SuccessEventType.CeremonyComplete) {
|
|
343
470
|
const { accountAddress, walletId } = event.data;
|
|
344
|
-
onCeremonyComplete == null ? void 0 : onCeremonyComplete(
|
|
471
|
+
onCeremonyComplete == null ? void 0 : onCeremonyComplete(accountAddress, walletId);
|
|
345
472
|
}
|
|
346
473
|
if (event.type === 'error') {
|
|
347
474
|
reject(createErrorFromEventData(event.data));
|
|
@@ -406,6 +533,9 @@ var SuccessEventType = /*#__PURE__*/ function(SuccessEventType) {
|
|
|
406
533
|
};
|
|
407
534
|
|
|
408
535
|
class DynamicApiClient extends BaseClient {
|
|
536
|
+
async authenticateApiToken({ environmentId }) {
|
|
537
|
+
return this.apiClient.post(`/api/v0/environments/${environmentId}/waas/authenticate`);
|
|
538
|
+
}
|
|
409
539
|
async createWalletAccount({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete }) {
|
|
410
540
|
return createEventStreamPromise({
|
|
411
541
|
apiClient: this.apiClient,
|
|
@@ -489,7 +619,6 @@ class DynamicApiClient extends BaseClient {
|
|
|
489
619
|
}
|
|
490
620
|
async getAccessToken({ oauthAccountId }) {
|
|
491
621
|
const { data } = await this.apiClient.get(`/api/v0/sdk/${this.environmentId}/oauthAccounts/${oauthAccountId}/accessToken`);
|
|
492
|
-
console.log('data', data);
|
|
493
622
|
return data.accessToken;
|
|
494
623
|
}
|
|
495
624
|
// TODO: return array instead considering cases where server has multiple parties
|
|
@@ -553,4 +682,4 @@ class DynamicApiClient extends BaseClient {
|
|
|
553
682
|
}
|
|
554
683
|
}
|
|
555
684
|
|
|
556
|
-
export { BITCOIN_DERIVATION_PATHS, BackupLocation, CreateRoomPartiesOptions, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DynamicApiClient, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SOLANA_RPC_URL, SigningAlgorithm, ThresholdSignatureScheme, getClientThreshold, getDynamicServerThreshold, getMPCChainConfig, getReshareConfig, getTSSConfig };
|
|
685
|
+
export { BITCOIN_DERIVATION_PATHS, BackupLocation, ChainEnumToVerifiedCredentialName, CreateRoomPartiesOptions, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DynamicApiClient, IFRAME_DOMAIN, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SOLANA_RPC_URL, SigningAlgorithm, SuccessEventType, ThresholdSignatureScheme, VerifiedCredentialNameToChainEnum, WalletOperation, chain, getClientThreshold, getDynamicServerThreshold, getMPCChainConfig, getReshareConfig, getServerWalletReshareConfig, getTSSConfig };
|
package/package.json
CHANGED
package/src/api/api.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare class DynamicApiClient extends BaseClient {
|
|
|
7
7
|
authToken: string;
|
|
8
8
|
baseApiUrl?: string;
|
|
9
9
|
});
|
|
10
|
+
authenticateApiToken({ environmentId }: {
|
|
11
|
+
environmentId: string;
|
|
12
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
13
|
createWalletAccount({ chainName, clientKeygenIds, thresholdSignatureScheme, onError, onCeremonyComplete, }: {
|
|
11
14
|
chainName: string;
|
|
12
15
|
clientKeygenIds: string[];
|
package/src/api/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAElB,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,EACV,aAAa,EACb,SAAS,EACT,UAAU,GACX,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAIK,mBAAmB,CAAC,EACxB,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,kBAAkB,GACnB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACzE;IAgBK,WAAW,CAAC,EAChB,QAAQ,EACR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kB,GACnB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KACzE;IAiBK,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;IAsBvB,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;CAqBlC"}
|
package/src/api/client.d.ts
CHANGED
package/src/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAQlD,qBAAa,UAAU;IACd,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAQlD,qBAAa,UAAU;IACd,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,aAAa,CAAC;gBAE/B,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,qBAAqB,GACtB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC;CA0BF"}
|
package/src/constants.d.ts
CHANGED
|
@@ -5,4 +5,37 @@ export declare const DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = "https://app-dy
|
|
|
5
5
|
export declare const MPC_RELAY_PROD_API_URL = "relay.dynamicauth.com";
|
|
6
6
|
export declare const MPC_RELAY_PREPROD_API_URL = "relay.dynamic-preprod.xyz";
|
|
7
7
|
export declare const SOLANA_RPC_URL = "https://api.devnet.solana.com";
|
|
8
|
+
export declare const chain: {
|
|
9
|
+
readonly EVM: "EVM";
|
|
10
|
+
readonly SOL: "SOL";
|
|
11
|
+
readonly COSMOS: "COSMOS";
|
|
12
|
+
readonly BTC: "BTC";
|
|
13
|
+
readonly FLOW: "FLOW";
|
|
14
|
+
readonly SUI: "SUI";
|
|
15
|
+
};
|
|
16
|
+
export type ChainType = (typeof chain)[keyof typeof chain];
|
|
17
|
+
export declare enum WalletOperation {
|
|
18
|
+
REACH_THRESHOLD = "REACH_THRESHOLD",
|
|
19
|
+
REACH_ALL_PARTIES = "REACH_ALL_PARTIES",
|
|
20
|
+
SIGN_MESSAGE = "SIGN_MESSAGE",
|
|
21
|
+
SIGN_TRANSACTION = "SIGN_TRANSACTION",
|
|
22
|
+
REFRESH = "REFRESH",
|
|
23
|
+
RESHARE = "RESHARE",
|
|
24
|
+
EXPORT_PRIVATE_KEY = "EXPORT_PRIVATE_KEY",
|
|
25
|
+
NO_OPERATION = "NO_OPERATION"
|
|
26
|
+
}
|
|
27
|
+
export declare enum BackupLocation {
|
|
28
|
+
DYNAMIC = "dynamic",
|
|
29
|
+
GOOGLE_DRIVE = "googleDrive",
|
|
30
|
+
ICLOUD = "iCloud",
|
|
31
|
+
USER = "user",
|
|
32
|
+
EXTERNAL = "external"
|
|
33
|
+
}
|
|
34
|
+
export declare const IFRAME_DOMAIN = "http://localhost:8090";
|
|
35
|
+
export declare const ChainEnumToVerifiedCredentialName: {
|
|
36
|
+
[key: string]: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const VerifiedCredentialNameToChainEnum: {
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
};
|
|
8
41
|
//# sourceMappingURL=constants.d.ts.map
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAC5E,eAAO,MAAM,iCAAiC,oCACX,CAAC;AAEpC,eAAO,MAAM,sCAAsC,qEACiB,CAAC;AACrE,eAAO,MAAM,yCAAyC,yEACkB,CAAC;AAEzE,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAC9D,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE,eAAO,MAAM,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAC5E,eAAO,MAAM,iCAAiC,oCACX,CAAC;AAEpC,eAAO,MAAM,sCAAsC,qEACiB,CAAC;AACrE,eAAO,MAAM,yCAAyC,yEACkB,CAAC;AAEzE,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAC9D,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE,eAAO,MAAM,cAAc,kCAAkC,CAAC;AAE9D,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAE3D,oBAAY,eAAe;IACzB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;CAC9B;AAED,oBAAY,cAAc;IACxB,OAAO,YAAY;IACnB,YAAY,gBAAgB;IAC5B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAGD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AAErD,eAAO,MAAM,iCAAiC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAKtE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAItE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/eventStream/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/eventStream/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,4GASvC;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE,KAAG,OAAO,CAAC,CAAC,CAgCZ,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oCAAoC,GAAI,CAAC,uEAMnD;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzE,gBACmB;IAChB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM;YACf,IAAI,EAAE,MAAM,OAAO,CAAC;gBAAE,KAAK,EAAE,UAAU,CAAC;gBAAC,IAAI,EAAE,OAAO,CAAA;aAAE,CAAC,CAAC;SAC3D,CAAC;KACH,CAAC;CACH,SAwCF,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,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
package/src/mpc/constants.d.ts
CHANGED
|
@@ -41,11 +41,4 @@ export declare enum CreateRoomPartiesOptions {
|
|
|
41
41
|
THRESHOLD = "threshold",
|
|
42
42
|
FULL = "full"
|
|
43
43
|
}
|
|
44
|
-
export declare enum BackupLocation {
|
|
45
|
-
DYNAMIC = "dynamic",
|
|
46
|
-
GOOGLE_DRIVE = "googleDrive",
|
|
47
|
-
ICLOUD = "iCloud",
|
|
48
|
-
USER = "user",
|
|
49
|
-
EXTERNAL = "external"
|
|
50
|
-
}
|
|
51
44
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/mpc/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,wBAAwB;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN;IAAE,cAAc,EAAE,MAAM,EAAE,CAAC;IAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAAE,CA2BjE,CAAC;AAEF,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEF,oBAAY,wBAAwB;IAClC,SAAS,cAAc;IACvB,IAAI,SAAS;CACd
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/mpc/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,wBAAwB;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN;IAAE,cAAc,EAAE,MAAM,EAAE,CAAC;IAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAAE,CA2BjE,CAAC;AAEF,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEF,oBAAY,wBAAwB;IAClC,SAAS,cAAc;IACvB,IAAI,SAAS;CACd"}
|
package/src/mpc/utils.d.ts
CHANGED
|
@@ -29,4 +29,24 @@ export declare const getReshareConfig: ({ oldThresholdSignatureScheme, newThresh
|
|
|
29
29
|
existingServerShareCount: number;
|
|
30
30
|
newServerShareCount: number;
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Helper function to get the reshare config for client and server shares
|
|
34
|
+
* @param {ThresholdSignatureScheme} oldThresholdSignatureScheme - The current threshold signature scheme
|
|
35
|
+
* @param {ThresholdSignatureScheme} newThresholdSignatureScheme - The target threshold signature scheme
|
|
36
|
+
* @returns {{
|
|
37
|
+
* existingServerShareCount: number,
|
|
38
|
+
* newServerhareCount: number,
|
|
39
|
+
* existingDynamicServerShareCount: number,
|
|
40
|
+
* newDynamicServerShareCount: number
|
|
41
|
+
* }} The number of existing and new client and server shares needed
|
|
42
|
+
*/
|
|
43
|
+
export declare const getServerWalletReshareConfig: ({ oldThresholdSignatureScheme, newThresholdSignatureScheme, }: {
|
|
44
|
+
oldThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
45
|
+
newThresholdSignatureScheme: ThresholdSignatureScheme;
|
|
46
|
+
}) => {
|
|
47
|
+
existingExternalServerShareCount: number;
|
|
48
|
+
newExternalServerShareCount: number;
|
|
49
|
+
existingDynamicServerShareCount: number;
|
|
50
|
+
newDynamicServerShareCount: number;
|
|
51
|
+
};
|
|
32
52
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/mpc/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/mpc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,iBAAiB,cAAe,MAAM;;;CAMlD,CAAC;AAEF,eAAO,MAAM,YAAY,6BACG,wBAAwB;;;CAInD,CAAC;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+B,EAAE,MAAM,CAAC;IACxC,0BAA0B,EAAE,MAAM,CAAC;CA6GpC,CAAC"}
|
package/src/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BackupLocation } from './constants';
|
|
2
|
+
import { ThresholdSignatureScheme } from './mpc';
|
|
1
3
|
export type InitKeygenResult = {
|
|
2
4
|
keygenId: string;
|
|
3
5
|
keygenSecret: string;
|
|
@@ -25,4 +27,46 @@ export declare enum SuccessEventType {
|
|
|
25
27
|
RoomCreated = "room_created",
|
|
26
28
|
CeremonyComplete = "ceremony_complete"
|
|
27
29
|
}
|
|
30
|
+
export type InitializeResult = {
|
|
31
|
+
error: unknown | null;
|
|
32
|
+
};
|
|
33
|
+
export interface KeyShareBackupInfo {
|
|
34
|
+
passwordEncrypted: boolean;
|
|
35
|
+
backups: Record<BackupLocation, string[]>;
|
|
36
|
+
}
|
|
37
|
+
export interface WaasWalletProperties {
|
|
38
|
+
derivationPath?: string;
|
|
39
|
+
keyShares: KeyShareInfo[];
|
|
40
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
41
|
+
}
|
|
42
|
+
export interface KeyShareInfo {
|
|
43
|
+
id: string;
|
|
44
|
+
backupLocation: BackupLocation;
|
|
45
|
+
passwordEncrypted: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface DynamicWalletClientProps {
|
|
48
|
+
environmentId: string;
|
|
49
|
+
authToken: string;
|
|
50
|
+
baseApiUrl?: string;
|
|
51
|
+
storageKey?: string;
|
|
52
|
+
debug?: boolean;
|
|
53
|
+
baseMPCRelayApiUrl?: string;
|
|
54
|
+
}
|
|
55
|
+
export type BackupData = {
|
|
56
|
+
keyShares: string[];
|
|
57
|
+
metadata: {
|
|
58
|
+
version: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
accountAddress: string;
|
|
61
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
62
|
+
hasPassword: boolean;
|
|
63
|
+
encryption?: {
|
|
64
|
+
algorithm: string;
|
|
65
|
+
keyDerivation: string;
|
|
66
|
+
iterations: number;
|
|
67
|
+
hashAlgorithm: string;
|
|
68
|
+
};
|
|
69
|
+
shareCount: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
28
72
|
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,oBAAY,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,WAAW,iBAAiB;IAC5B,gBAAgB,sBAAsB;CACvC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,Q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