@dynamic-labs-wallet/node 0.0.168 → 0.0.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -240,7 +240,7 @@ const getKey = async ({ password, salt, encryptionConfig })=>{
240
240
  cipher: bytesToBase64(new Uint8Array(encryptedData)),
241
241
  version
242
242
  };
243
- } catch (error) {
243
+ } catch (e) {
244
244
  throw new Error('Error encrypting data');
245
245
  }
246
246
  };
@@ -481,7 +481,7 @@ class DynamicWalletClient {
481
481
  externalServerKeyShares: externalServerKeygenResults
482
482
  };
483
483
  }
484
- async dynamicServerSign({ walletId, message, isFormatted }) {
484
+ async dynamicServerSign({ walletId, message, isFormatted, context, onError }) {
485
485
  const dynamicRequestId = uuid.v4();
486
486
  this.ensureApiClientAuthenticated();
487
487
  // Create the room and sign the message
@@ -492,7 +492,9 @@ class DynamicWalletClient {
492
492
  walletId,
493
493
  message,
494
494
  isFormatted,
495
- dynamicRequestId
495
+ dynamicRequestId,
496
+ context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined,
497
+ onError
496
498
  });
497
499
  return data;
498
500
  }
@@ -510,38 +512,45 @@ class DynamicWalletClient {
510
512
  throw error;
511
513
  }
512
514
  }
513
- async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false }) {
514
- await this.verifyPassword({
515
- accountAddress,
516
- password,
517
- walletOperation: core.WalletOperation.SIGN_MESSAGE
518
- });
519
- const wallet = await this.getWallet({
520
- accountAddress,
521
- walletOperation: core.WalletOperation.SIGN_MESSAGE,
522
- password
523
- });
524
- externalServerKeyShares = externalServerKeyShares != null ? externalServerKeyShares : wallet.externalServerKeyShares;
525
- if (!externalServerKeyShares) {
526
- throw new Error('External server key shares are required to sign a message');
515
+ async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
516
+ try {
517
+ await this.verifyPassword({
518
+ accountAddress,
519
+ password,
520
+ walletOperation: core.WalletOperation.SIGN_MESSAGE
521
+ });
522
+ const wallet = await this.getWallet({
523
+ accountAddress,
524
+ walletOperation: core.WalletOperation.SIGN_MESSAGE,
525
+ password
526
+ });
527
+ externalServerKeyShares = externalServerKeyShares != null ? externalServerKeyShares : wallet.externalServerKeyShares;
528
+ if (!externalServerKeyShares) {
529
+ throw new Error('External server key shares are required to sign a message');
530
+ }
531
+ // Perform the dynamic server sign
532
+ const data = await this.dynamicServerSign({
533
+ walletId: wallet.walletId,
534
+ message,
535
+ isFormatted,
536
+ context,
537
+ onError
538
+ });
539
+ const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
540
+ // Perform the external server sign and return the signature
541
+ const signature = await this.externalServerSign({
542
+ chainName,
543
+ message,
544
+ roomId: data.roomId,
545
+ keyShare: externalServerKeyShares[0],
546
+ derivationPath,
547
+ isFormatted
548
+ });
549
+ return signature;
550
+ } catch (error) {
551
+ this.logger.error('Error in sign', error);
552
+ throw error;
527
553
  }
528
- // Perform the dynamic server sign
529
- const data = await this.dynamicServerSign({
530
- walletId: wallet.walletId,
531
- message,
532
- isFormatted
533
- });
534
- const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
535
- // Perform the external server sign and return the signature
536
- const signature = await this.externalServerSign({
537
- chainName,
538
- message,
539
- roomId: data.roomId,
540
- keyShare: externalServerKeyShares[0],
541
- derivationPath,
542
- isFormatted
543
- });
544
- return signature;
545
554
  }
546
555
  async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, externalServerKeyShares, backUpToClientShareService = false }) {
547
556
  this.ensureApiClientAuthenticated();
@@ -1266,6 +1275,178 @@ class DynamicWalletClient {
1266
1275
  }
1267
1276
  }
1268
1277
 
1278
+ const createCore = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug = false })=>{
1279
+ const coreLogger = logger;
1280
+ coreLogger.setLogLevel(debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
1281
+ const createApiClient = (options = {})=>{
1282
+ return new core.DynamicApiClient(_extends({
1283
+ environmentId,
1284
+ baseApiUrl
1285
+ }, options));
1286
+ };
1287
+ return {
1288
+ environmentId,
1289
+ createApiClient,
1290
+ logger: coreLogger,
1291
+ baseMPCRelayApiUrl,
1292
+ baseApiUrl,
1293
+ debug
1294
+ };
1295
+ };
1296
+
1297
+ // Helper function to create API client for delegated operations
1298
+ const createDelegatedApiClient = (client, options = {})=>{
1299
+ return client.createApiClient(options);
1300
+ };
1301
+ // Helper function to create API client with wallet-specific headers
1302
+ const createDelegatedApiClientWithWalletKey = (client, walletApiKey)=>{
1303
+ const apiClient = client.createApiClient();
1304
+ // Add the wallet-specific API key header to all requests from this client
1305
+ apiClient.apiClient.defaults.headers['x-dyn-wallet-api-key'] = walletApiKey;
1306
+ return apiClient;
1307
+ };
1308
+ const createDelegatedWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
1309
+ const core = createCore({
1310
+ environmentId,
1311
+ baseApiUrl,
1312
+ baseMPCRelayApiUrl,
1313
+ debug
1314
+ });
1315
+ // Store the API key for use in delegated operations
1316
+ core.apiKey = apiKey;
1317
+ const walletMap = {};
1318
+ const client = {
1319
+ get environmentId () {
1320
+ return core.environmentId;
1321
+ },
1322
+ get debug () {
1323
+ return core.debug;
1324
+ },
1325
+ get wallets () {
1326
+ return walletMap;
1327
+ },
1328
+ createApiClient: (options = {})=>{
1329
+ return core.createApiClient(_extends({
1330
+ authToken: apiKey
1331
+ }, options));
1332
+ },
1333
+ logger: core.logger,
1334
+ apiKey,
1335
+ baseMPCRelayApiUrl: core.baseMPCRelayApiUrl
1336
+ };
1337
+ return client;
1338
+ };
1339
+
1340
+ const dynamicDelegatedSign = async (client, { walletId, message, isFormatted, walletApiKey, onError, context })=>{
1341
+ const dynamicRequestId = uuid.v4();
1342
+ // Convert message to hex if it's a Uint8Array
1343
+ if (typeof message !== 'string') {
1344
+ message = '0x' + Buffer.from(message).toString('hex');
1345
+ }
1346
+ const apiClient = createDelegatedApiClientWithWalletKey(client, walletApiKey);
1347
+ const data = await apiClient.delegatedSignMessage({
1348
+ walletId,
1349
+ message,
1350
+ isFormatted,
1351
+ dynamicRequestId,
1352
+ onError,
1353
+ context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined
1354
+ });
1355
+ return data;
1356
+ };
1357
+ const delegatedSign = async (client, { chainName, message, roomId, keyShare, derivationPath, isFormatted })=>{
1358
+ try {
1359
+ const mpcSigner = getMPCSigner({
1360
+ chainName,
1361
+ baseRelayUrl: client.baseMPCRelayApiUrl
1362
+ });
1363
+ const formattedMessage = isFormatted ? new node.MessageHash(message) : formatMessage(chainName, message);
1364
+ const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
1365
+ return signature;
1366
+ } catch (error) {
1367
+ client.logger.error('Error in delegatedSign', error);
1368
+ throw error;
1369
+ }
1370
+ };
1371
+ const delegatedSignMessage = async (client, { walletId, walletApiKey, keyShare, message, chainName, isFormatted = false, onError, context })=>{
1372
+ // Validate required parameters
1373
+ if (!keyShare) {
1374
+ throw new Error('Delegated key share is required to sign a message');
1375
+ }
1376
+ const wallet = await getWallet(client, {
1377
+ walletId
1378
+ });
1379
+ // Perform the dynamic server sign
1380
+ const data = await dynamicDelegatedSign(client, {
1381
+ walletId,
1382
+ walletApiKey,
1383
+ message,
1384
+ isFormatted,
1385
+ onError,
1386
+ context
1387
+ });
1388
+ const derivationPath = wallet.derivationPath && wallet.derivationPath !== '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
1389
+ // Perform the external server sign and return the signature
1390
+ const signature = await delegatedSign(client, {
1391
+ chainName,
1392
+ message,
1393
+ roomId: data.roomId,
1394
+ keyShare,
1395
+ derivationPath,
1396
+ isFormatted
1397
+ });
1398
+ return signature;
1399
+ };
1400
+ // Helper function to get wallet (to be implemented in wallet module)
1401
+ const getWallet = async (client, { walletId })=>{
1402
+ const wallets = client.wallets;
1403
+ // Check if wallet is already cached
1404
+ if (wallets[walletId]) {
1405
+ return wallets[walletId];
1406
+ }
1407
+ // Fetch wallet from API
1408
+ const apiClient = createDelegatedApiClient(client);
1409
+ const { wallet } = await apiClient.getWaasWalletById({
1410
+ walletId
1411
+ });
1412
+ const waasWallet = {
1413
+ walletId,
1414
+ chainName: wallet.chainName,
1415
+ accountAddress: wallet.accountAddress,
1416
+ externalServerKeyShares: [],
1417
+ derivationPath: wallet.derivationPath,
1418
+ thresholdSignatureScheme: wallet.thresholdSignatureScheme,
1419
+ externalServerKeySharesBackupInfo: {
1420
+ passwordEncrypted: false,
1421
+ backups: {
1422
+ dynamic: [],
1423
+ googleDrive: [],
1424
+ iCloud: [],
1425
+ user: [],
1426
+ external: [],
1427
+ delegated: []
1428
+ }
1429
+ }
1430
+ };
1431
+ // Cache the wallet
1432
+ wallets[walletId] = waasWallet;
1433
+ return waasWallet;
1434
+ };
1435
+
1436
+ const revokeDelegation = async (client, walletId)=>{
1437
+ try {
1438
+ // TODO: Uncomment when API method is implemented
1439
+ // const apiClient = createDelegatedApiClient(client);
1440
+ // await apiClient.revokeDelegation({
1441
+ // walletId,
1442
+ // });
1443
+ client.logger.info(`Delegation revoked for wallet: ${walletId}`);
1444
+ } catch (error) {
1445
+ client.logger.error('Error revoking delegation', error);
1446
+ throw new Error('Failed to revoke delegation');
1447
+ }
1448
+ };
1449
+
1269
1450
  Object.defineProperty(exports, "SOLANA_RPC_URL", {
1270
1451
  enumerable: true,
1271
1452
  get: function () { return core.SOLANA_RPC_URL; }
@@ -1285,6 +1466,8 @@ Object.defineProperty(exports, "getMPCChainConfig", {
1285
1466
  exports.DynamicWalletClient = DynamicWalletClient;
1286
1467
  exports.base64ToBytes = base64ToBytes;
1287
1468
  exports.bytesToBase64 = bytesToBase64;
1469
+ exports.createDelegatedWalletClient = createDelegatedWalletClient;
1470
+ exports.delegatedSignMessage = delegatedSignMessage;
1288
1471
  exports.ensureBase64Padding = ensureBase64Padding;
1289
1472
  exports.formatEvmMessage = formatEvmMessage;
1290
1473
  exports.formatMessage = formatMessage;
@@ -1294,6 +1477,7 @@ exports.getMPCSigner = getMPCSigner;
1294
1477
  exports.isHexString = isHexString;
1295
1478
  exports.mergeUniqueKeyShares = mergeUniqueKeyShares;
1296
1479
  exports.retryPromise = retryPromise;
1480
+ exports.revokeDelegation = revokeDelegation;
1297
1481
  exports.stringToBytes = stringToBytes;
1298
1482
  Object.keys(core$1).forEach(function (k) {
1299
1483
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/index.esm.js CHANGED
@@ -239,7 +239,7 @@ const getKey = async ({ password, salt, encryptionConfig })=>{
239
239
  cipher: bytesToBase64(new Uint8Array(encryptedData)),
240
240
  version
241
241
  };
242
- } catch (error) {
242
+ } catch (e) {
243
243
  throw new Error('Error encrypting data');
244
244
  }
245
245
  };
@@ -480,7 +480,7 @@ class DynamicWalletClient {
480
480
  externalServerKeyShares: externalServerKeygenResults
481
481
  };
482
482
  }
483
- async dynamicServerSign({ walletId, message, isFormatted }) {
483
+ async dynamicServerSign({ walletId, message, isFormatted, context, onError }) {
484
484
  const dynamicRequestId = v4();
485
485
  this.ensureApiClientAuthenticated();
486
486
  // Create the room and sign the message
@@ -491,7 +491,9 @@ class DynamicWalletClient {
491
491
  walletId,
492
492
  message,
493
493
  isFormatted,
494
- dynamicRequestId
494
+ dynamicRequestId,
495
+ context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined,
496
+ onError
495
497
  });
496
498
  return data;
497
499
  }
@@ -509,38 +511,45 @@ class DynamicWalletClient {
509
511
  throw error;
510
512
  }
511
513
  }
512
- async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false }) {
513
- await this.verifyPassword({
514
- accountAddress,
515
- password,
516
- walletOperation: WalletOperation.SIGN_MESSAGE
517
- });
518
- const wallet = await this.getWallet({
519
- accountAddress,
520
- walletOperation: WalletOperation.SIGN_MESSAGE,
521
- password
522
- });
523
- externalServerKeyShares = externalServerKeyShares != null ? externalServerKeyShares : wallet.externalServerKeyShares;
524
- if (!externalServerKeyShares) {
525
- throw new Error('External server key shares are required to sign a message');
514
+ async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
515
+ try {
516
+ await this.verifyPassword({
517
+ accountAddress,
518
+ password,
519
+ walletOperation: WalletOperation.SIGN_MESSAGE
520
+ });
521
+ const wallet = await this.getWallet({
522
+ accountAddress,
523
+ walletOperation: WalletOperation.SIGN_MESSAGE,
524
+ password
525
+ });
526
+ externalServerKeyShares = externalServerKeyShares != null ? externalServerKeyShares : wallet.externalServerKeyShares;
527
+ if (!externalServerKeyShares) {
528
+ throw new Error('External server key shares are required to sign a message');
529
+ }
530
+ // Perform the dynamic server sign
531
+ const data = await this.dynamicServerSign({
532
+ walletId: wallet.walletId,
533
+ message,
534
+ isFormatted,
535
+ context,
536
+ onError
537
+ });
538
+ const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
539
+ // Perform the external server sign and return the signature
540
+ const signature = await this.externalServerSign({
541
+ chainName,
542
+ message,
543
+ roomId: data.roomId,
544
+ keyShare: externalServerKeyShares[0],
545
+ derivationPath,
546
+ isFormatted
547
+ });
548
+ return signature;
549
+ } catch (error) {
550
+ this.logger.error('Error in sign', error);
551
+ throw error;
526
552
  }
527
- // Perform the dynamic server sign
528
- const data = await this.dynamicServerSign({
529
- walletId: wallet.walletId,
530
- message,
531
- isFormatted
532
- });
533
- const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
534
- // Perform the external server sign and return the signature
535
- const signature = await this.externalServerSign({
536
- chainName,
537
- message,
538
- roomId: data.roomId,
539
- keyShare: externalServerKeyShares[0],
540
- derivationPath,
541
- isFormatted
542
- });
543
- return signature;
544
553
  }
545
554
  async refreshWalletAccountShares({ accountAddress, chainName, password = undefined, externalServerKeyShares, backUpToClientShareService = false }) {
546
555
  this.ensureApiClientAuthenticated();
@@ -1265,4 +1274,176 @@ class DynamicWalletClient {
1265
1274
  }
1266
1275
  }
1267
1276
 
1268
- export { DynamicWalletClient, base64ToBytes, bytesToBase64, ensureBase64Padding, formatEvmMessage, formatMessage, getExternalServerKeyShareBackupInfo, getMPCSignatureScheme, getMPCSigner, isHexString, mergeUniqueKeyShares, retryPromise, stringToBytes };
1277
+ const createCore = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug = false })=>{
1278
+ const coreLogger = logger;
1279
+ coreLogger.setLogLevel(debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
1280
+ const createApiClient = (options = {})=>{
1281
+ return new DynamicApiClient(_extends({
1282
+ environmentId,
1283
+ baseApiUrl
1284
+ }, options));
1285
+ };
1286
+ return {
1287
+ environmentId,
1288
+ createApiClient,
1289
+ logger: coreLogger,
1290
+ baseMPCRelayApiUrl,
1291
+ baseApiUrl,
1292
+ debug
1293
+ };
1294
+ };
1295
+
1296
+ // Helper function to create API client for delegated operations
1297
+ const createDelegatedApiClient = (client, options = {})=>{
1298
+ return client.createApiClient(options);
1299
+ };
1300
+ // Helper function to create API client with wallet-specific headers
1301
+ const createDelegatedApiClientWithWalletKey = (client, walletApiKey)=>{
1302
+ const apiClient = client.createApiClient();
1303
+ // Add the wallet-specific API key header to all requests from this client
1304
+ apiClient.apiClient.defaults.headers['x-dyn-wallet-api-key'] = walletApiKey;
1305
+ return apiClient;
1306
+ };
1307
+ const createDelegatedWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
1308
+ const core = createCore({
1309
+ environmentId,
1310
+ baseApiUrl,
1311
+ baseMPCRelayApiUrl,
1312
+ debug
1313
+ });
1314
+ // Store the API key for use in delegated operations
1315
+ core.apiKey = apiKey;
1316
+ const walletMap = {};
1317
+ const client = {
1318
+ get environmentId () {
1319
+ return core.environmentId;
1320
+ },
1321
+ get debug () {
1322
+ return core.debug;
1323
+ },
1324
+ get wallets () {
1325
+ return walletMap;
1326
+ },
1327
+ createApiClient: (options = {})=>{
1328
+ return core.createApiClient(_extends({
1329
+ authToken: apiKey
1330
+ }, options));
1331
+ },
1332
+ logger: core.logger,
1333
+ apiKey,
1334
+ baseMPCRelayApiUrl: core.baseMPCRelayApiUrl
1335
+ };
1336
+ return client;
1337
+ };
1338
+
1339
+ const dynamicDelegatedSign = async (client, { walletId, message, isFormatted, walletApiKey, onError, context })=>{
1340
+ const dynamicRequestId = v4();
1341
+ // Convert message to hex if it's a Uint8Array
1342
+ if (typeof message !== 'string') {
1343
+ message = '0x' + Buffer.from(message).toString('hex');
1344
+ }
1345
+ const apiClient = createDelegatedApiClientWithWalletKey(client, walletApiKey);
1346
+ const data = await apiClient.delegatedSignMessage({
1347
+ walletId,
1348
+ message,
1349
+ isFormatted,
1350
+ dynamicRequestId,
1351
+ onError,
1352
+ context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined
1353
+ });
1354
+ return data;
1355
+ };
1356
+ const delegatedSign = async (client, { chainName, message, roomId, keyShare, derivationPath, isFormatted })=>{
1357
+ try {
1358
+ const mpcSigner = getMPCSigner({
1359
+ chainName,
1360
+ baseRelayUrl: client.baseMPCRelayApiUrl
1361
+ });
1362
+ const formattedMessage = isFormatted ? new MessageHash(message) : formatMessage(chainName, message);
1363
+ const signature = await mpcSigner.sign(roomId, keyShare, formattedMessage, derivationPath);
1364
+ return signature;
1365
+ } catch (error) {
1366
+ client.logger.error('Error in delegatedSign', error);
1367
+ throw error;
1368
+ }
1369
+ };
1370
+ const delegatedSignMessage = async (client, { walletId, walletApiKey, keyShare, message, chainName, isFormatted = false, onError, context })=>{
1371
+ // Validate required parameters
1372
+ if (!keyShare) {
1373
+ throw new Error('Delegated key share is required to sign a message');
1374
+ }
1375
+ const wallet = await getWallet(client, {
1376
+ walletId
1377
+ });
1378
+ // Perform the dynamic server sign
1379
+ const data = await dynamicDelegatedSign(client, {
1380
+ walletId,
1381
+ walletApiKey,
1382
+ message,
1383
+ isFormatted,
1384
+ onError,
1385
+ context
1386
+ });
1387
+ const derivationPath = wallet.derivationPath && wallet.derivationPath !== '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
1388
+ // Perform the external server sign and return the signature
1389
+ const signature = await delegatedSign(client, {
1390
+ chainName,
1391
+ message,
1392
+ roomId: data.roomId,
1393
+ keyShare,
1394
+ derivationPath,
1395
+ isFormatted
1396
+ });
1397
+ return signature;
1398
+ };
1399
+ // Helper function to get wallet (to be implemented in wallet module)
1400
+ const getWallet = async (client, { walletId })=>{
1401
+ const wallets = client.wallets;
1402
+ // Check if wallet is already cached
1403
+ if (wallets[walletId]) {
1404
+ return wallets[walletId];
1405
+ }
1406
+ // Fetch wallet from API
1407
+ const apiClient = createDelegatedApiClient(client);
1408
+ const { wallet } = await apiClient.getWaasWalletById({
1409
+ walletId
1410
+ });
1411
+ const waasWallet = {
1412
+ walletId,
1413
+ chainName: wallet.chainName,
1414
+ accountAddress: wallet.accountAddress,
1415
+ externalServerKeyShares: [],
1416
+ derivationPath: wallet.derivationPath,
1417
+ thresholdSignatureScheme: wallet.thresholdSignatureScheme,
1418
+ externalServerKeySharesBackupInfo: {
1419
+ passwordEncrypted: false,
1420
+ backups: {
1421
+ dynamic: [],
1422
+ googleDrive: [],
1423
+ iCloud: [],
1424
+ user: [],
1425
+ external: [],
1426
+ delegated: []
1427
+ }
1428
+ }
1429
+ };
1430
+ // Cache the wallet
1431
+ wallets[walletId] = waasWallet;
1432
+ return waasWallet;
1433
+ };
1434
+
1435
+ const revokeDelegation = async (client, walletId)=>{
1436
+ try {
1437
+ // TODO: Uncomment when API method is implemented
1438
+ // const apiClient = createDelegatedApiClient(client);
1439
+ // await apiClient.revokeDelegation({
1440
+ // walletId,
1441
+ // });
1442
+ client.logger.info(`Delegation revoked for wallet: ${walletId}`);
1443
+ } catch (error) {
1444
+ client.logger.error('Error revoking delegation', error);
1445
+ throw new Error('Failed to revoke delegation');
1446
+ }
1447
+ };
1448
+
1449
+ export { DynamicWalletClient, base64ToBytes, bytesToBase64, createDelegatedWalletClient, delegatedSignMessage, ensureBase64Padding, formatEvmMessage, formatMessage, getExternalServerKeyShareBackupInfo, getMPCSignatureScheme, getMPCSigner, isHexString, mergeUniqueKeyShares, retryPromise, revokeDelegation, stringToBytes };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/node",
3
- "version": "0.0.168",
3
+ "version": "0.0.170",
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.168",
7
+ "@dynamic-labs-wallet/core": "0.0.170",
8
8
  "@dynamic-labs/logger": "^4.25.3",
9
+ "@dynamic-labs/sdk-api-core": "^0.0.764",
9
10
  "uuid": "11.1.0",
10
11
  "@noble/hashes": "1.7.1"
11
12
  },
package/src/client.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { EcdsaKeygenResult, BIP340KeygenResult, type EcdsaPublicKey, type EcdsaSignature, ExportableEd25519KeygenResult } from '#internal/node';
1
+ import { EcdsaKeygenResult, BIP340KeygenResult, type EcdsaPublicKey, type EcdsaSignature } from '#internal/node';
2
2
  import { type ThresholdSignatureScheme, DynamicApiClient, WalletOperation, type KeyShareBackupInfo, BackupLocation } from '@dynamic-labs-wallet/core';
3
+ import type { ServerKeyShare } from './mpc/index.js';
3
4
  import type { ServerInitKeygenResult } from './mpc/types.js';
4
5
  import type { WalletProperties } from './types.js';
5
- type ServerKeyShare = EcdsaKeygenResult | BIP340KeygenResult | ExportableEd25519KeygenResult;
6
+ import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
6
7
  export declare class DynamicWalletClient {
7
8
  environmentId: string;
8
9
  debug: boolean;
@@ -67,10 +68,12 @@ export declare class DynamicWalletClient {
67
68
  rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
68
69
  externalServerKeyShares: ServerKeyShare[];
69
70
  }>;
70
- dynamicServerSign({ walletId, message, isFormatted, }: {
71
+ dynamicServerSign({ walletId, message, isFormatted, context, onError, }: {
71
72
  walletId: string;
72
73
  message: string | Uint8Array;
73
74
  isFormatted?: boolean;
75
+ context?: SignMessageContext;
76
+ onError?: (error: Error) => void;
74
77
  }): Promise<import("@dynamic-labs-wallet/core").OpenRoomResponse>;
75
78
  externalServerSign({ chainName, message, roomId, keyShare, derivationPath, isFormatted, }: {
76
79
  chainName: string;
@@ -80,13 +83,15 @@ export declare class DynamicWalletClient {
80
83
  derivationPath: Uint32Array | undefined;
81
84
  isFormatted?: boolean;
82
85
  }): Promise<Uint8Array | EcdsaSignature>;
83
- sign({ accountAddress, externalServerKeyShares, message, chainName, password, isFormatted, }: {
86
+ sign({ accountAddress, externalServerKeyShares, message, chainName, password, isFormatted, context, onError, }: {
84
87
  accountAddress: string;
85
88
  externalServerKeyShares?: ServerKeyShare[];
86
89
  message: string | Uint8Array;
87
90
  chainName: string;
88
91
  password?: string;
89
92
  isFormatted?: boolean;
93
+ context?: SignMessageContext;
94
+ onError?: (error: Error) => void;
90
95
  }): Promise<Uint8Array | EcdsaSignature>;
91
96
  refreshWalletAccountShares({ accountAddress, chainName, password, externalServerKeyShares, backUpToClientShareService, }: {
92
97
  accountAddress: string;
@@ -170,7 +175,7 @@ export declare class DynamicWalletClient {
170
175
  getExternalServerKeyShares({ accountAddress, password, }: {
171
176
  accountAddress: string;
172
177
  password?: string;
173
- }): Promise<import("./index.js").ServerKeyShare[]>;
178
+ }): Promise<ServerKeyShare[]>;
174
179
  updatePassword({ accountAddress, existingPassword, newPassword, backUpToClientShareService, }: {
175
180
  accountAddress: string;
176
181
  existingPassword?: string;
@@ -212,7 +217,7 @@ export declare class DynamicWalletClient {
212
217
  exportExternalServerKeyShares({ accountAddress, password, }: {
213
218
  accountAddress: string;
214
219
  password?: string;
215
- }): Promise<import("./index.js").ServerKeyShare[]>;
220
+ }): Promise<ServerKeyShare[]>;
216
221
  /**
217
222
  * Helper function to check if the required wallet fields are present and valid
218
223
  * @param accountAddress - The account address of the wallet to check
@@ -258,5 +263,4 @@ export declare class DynamicWalletClient {
258
263
  }): Promise<WalletProperties>;
259
264
  getWallets(): Promise<any>;
260
265
  }
261
- export {};
262
266
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,cAAc,EAEnB,KAAK,cAAc,EAInB,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,wBAAwB,EAC7B,gBAAgB,EAIhB,eAAe,EACf,KAAK,kBAAkB,EACvB,cAAc,EAIf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAcnD,KAAK,cAAc,GACf,iBAAiB,GACjB,kBAAkB,GAClB,6BAA6B,CAAC;AAElC,qBAAa,mBAAmB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,MAAM,wCAAU;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,MAAM,CAAC;IACtC,SAAS,C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amic-labs-wallet/core';
2
+ import { logger } from '../services/logger.js';
3
+ export type CoreConfig = {
4
+ environmentId: string;
5
+ baseApiUrl?: string;
6
+ baseMPCRelayApiUrl?: string;
7
+ debug?: boolean;
8
+ };
9
+ export type Core = {
10
+ environmentId: string;
11
+ createApiClient: (options?: Partial<DynamicApiClientConfig>) => DynamicApiClient;
12
+ logger: typeof logger;
13
+ baseMPCRelayApiUrl?: string;
14
+ baseApiUrl?: string;
15
+ debug: boolean;
16
+ apiKey?: string;
17
+ };
18
+ export type DynamicApiClientConfig = {
19
+ environmentId: string;
20
+ authToken?: string;
21
+ baseApiUrl?: string;
22
+ sdkVersion?: string;
23
+ };
24
+ export declare const createCore: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, }: CoreConfig) => Core;
25
+ //# sourceMappingURL=createCore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCore.d.ts","sourceRoot":"","sources":["../../src/core/createCore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,MAAM,MAAM,UAAU,GAAG;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,CACf,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KACtC,gBAAgB,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,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,8DAKpB,UAAU,KAAG,IAsBf,CAAC"}
@@ -0,0 +1,7 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,22 @@
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 wallets(): Record<string, WalletProperties>;
14
+ createApiClient: (options?: Record<string, any>) => DynamicApiClient;
15
+ logger: any;
16
+ apiKey: string;
17
+ baseMPCRelayApiUrl?: string;
18
+ };
19
+ export declare const createDelegatedApiClient: (client: DelegatedWalletClient, options?: Record<string, any>) => DynamicApiClient;
20
+ export declare const createDelegatedApiClientWithWalletKey: (client: DelegatedWalletClient, walletApiKey: string) => DynamicApiClient;
21
+ export declare const createDelegatedWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, }: DelegatedClientConfig) => DelegatedWalletClient;
22
+ //# sourceMappingURL=createDelegatedClient.d.ts.map
@@ -0,0 +1 @@
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,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,0BAmCvB,CAAC"}
@@ -0,0 +1,5 @@
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
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DelegatedWalletClient } from '../createDelegatedClient.js';
2
+ export declare const revokeDelegation: (client: DelegatedWalletClient, walletId: string) => Promise<void>;
3
+ //# sourceMappingURL=revokeDelegation.d.ts.map
@@ -0,0 +1 @@
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,WACnB,qBAAqB,YACnB,MAAM,KACf,OAAO,CAAC,IAAI,CAad,CAAC"}
@@ -0,0 +1,31 @@
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
@@ -0,0 +1 @@
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,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,eAAO,MAAM,oBAAoB,WACvB,qBAAqB,uEAQ1B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,kEA0BF,CAAC;AAEF,eAAO,MAAM,aAAa,WAChB,qBAAqB,0EAQ1B;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,KACA,OAAO,CAAC,UAAU,GAAG,cAAc,CAuBrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,WACvB,qBAAqB,4FAU1B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,KACA,OAAO,CAAC,UAAU,GAAG,cAAc,CAkCrC,CAAC"}
package/src/index.d.ts CHANGED
@@ -6,4 +6,7 @@ export type { ServerInitKeygenResult, ServerKeyShare, SignMessage, } from './mpc
6
6
  export * from './client.js';
7
7
  export * from './types.js';
8
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';
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
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,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC"}