@dynamic-labs-wallet/node 0.0.187 → 0.0.188
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 +83 -11
- package/index.esm.js +84 -12
- package/package.json +3 -2
- package/src/client.d.ts +14 -8
- package/src/client.d.ts.map +1 -1
- package/src/types.d.ts +3 -0
- package/src/types.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -284,6 +284,16 @@ const getKey = async ({ password, salt, encryptionConfig })=>{
|
|
|
284
284
|
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
285
285
|
|
|
286
286
|
class DynamicWalletClient {
|
|
287
|
+
async initializeForwardMPCClient() {
|
|
288
|
+
try {
|
|
289
|
+
await this.apiClient.forwardMPCClient.ensureWsConnection();
|
|
290
|
+
} catch (error) {
|
|
291
|
+
this.logger.error('Error connecting to ForwardMPC enclave websocket. Environment: ' + this.environmentId, {
|
|
292
|
+
error,
|
|
293
|
+
environmentId: this.environmentId
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
287
297
|
ensureApiClientAuthenticated() {
|
|
288
298
|
if (!this.isApiClientAuthenticated) {
|
|
289
299
|
throw new Error('Client must be authenticated before making API calls. Call authenticateApiToken first.');
|
|
@@ -496,7 +506,8 @@ class DynamicWalletClient {
|
|
|
496
506
|
isFormatted,
|
|
497
507
|
dynamicRequestId,
|
|
498
508
|
context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined,
|
|
499
|
-
onError
|
|
509
|
+
onError,
|
|
510
|
+
forwardMPCClientEnabled: this.forwardMPCEnabled
|
|
500
511
|
});
|
|
501
512
|
return data;
|
|
502
513
|
}
|
|
@@ -514,6 +525,41 @@ class DynamicWalletClient {
|
|
|
514
525
|
throw error;
|
|
515
526
|
}
|
|
516
527
|
}
|
|
528
|
+
async forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId }) {
|
|
529
|
+
try {
|
|
530
|
+
if (!this.apiClient.forwardMPCClient.connected) {
|
|
531
|
+
await this.initializeForwardMPCClient();
|
|
532
|
+
}
|
|
533
|
+
this.logger.info('Forward MPC enabled, signing message with forward MPC');
|
|
534
|
+
const signature = await this.apiClient.forwardMPCClient.signMessage({
|
|
535
|
+
keyshare: keyShare,
|
|
536
|
+
message: chainName === 'EVM' || chainName === 'SUI' ? message : formattedMessage,
|
|
537
|
+
relayDomain: this.baseMPCRelayApiUrl || '',
|
|
538
|
+
signingAlgo: chainName === 'EVM' ? 'ECDSA' : 'ED25519',
|
|
539
|
+
hashAlgo: chainName === 'EVM' ? 'keccak256' : undefined,
|
|
540
|
+
derivationPath: derivationPath,
|
|
541
|
+
roomUuid: roomId
|
|
542
|
+
});
|
|
543
|
+
const signatureBytes = signature.data.signature;
|
|
544
|
+
if (!(signatureBytes instanceof Uint8Array)) {
|
|
545
|
+
throw new TypeError(`Invalid signature format: expected Uint8Array, got ${typeof signatureBytes}`);
|
|
546
|
+
}
|
|
547
|
+
// Convert to EcdsaSignature
|
|
548
|
+
if (chainName === 'EVM') {
|
|
549
|
+
const ecdsaSignature = node.EcdsaSignature.fromBuffer(signatureBytes);
|
|
550
|
+
return ecdsaSignature;
|
|
551
|
+
} else {
|
|
552
|
+
return signatureBytes;
|
|
553
|
+
}
|
|
554
|
+
} catch (error) {
|
|
555
|
+
this.logger.error('Error signing message with forward MPC client', {
|
|
556
|
+
error,
|
|
557
|
+
environmentId: this.environmentId,
|
|
558
|
+
dynamicRequestId
|
|
559
|
+
});
|
|
560
|
+
throw error;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
517
563
|
async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
|
|
518
564
|
try {
|
|
519
565
|
await this.verifyPassword({
|
|
@@ -540,15 +586,29 @@ class DynamicWalletClient {
|
|
|
540
586
|
});
|
|
541
587
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
542
588
|
// Perform the external server sign and return the signature
|
|
543
|
-
|
|
544
|
-
chainName,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
589
|
+
if (this.forwardMPCEnabled) {
|
|
590
|
+
const formattedMessage = isFormatted ? new node.MessageHash(message) : formatMessage(chainName, message);
|
|
591
|
+
const signature = await this.forwardMPCClientSign({
|
|
592
|
+
chainName,
|
|
593
|
+
message,
|
|
594
|
+
roomId: data.roomId,
|
|
595
|
+
keyShare: externalServerKeyShares[0],
|
|
596
|
+
derivationPath,
|
|
597
|
+
formattedMessage,
|
|
598
|
+
dynamicRequestId: uuid.v4()
|
|
599
|
+
});
|
|
600
|
+
return signature;
|
|
601
|
+
} else {
|
|
602
|
+
const signature = await this.externalServerSign({
|
|
603
|
+
chainName,
|
|
604
|
+
message,
|
|
605
|
+
roomId: data.roomId,
|
|
606
|
+
keyShare: externalServerKeyShares[0],
|
|
607
|
+
derivationPath,
|
|
608
|
+
isFormatted
|
|
609
|
+
});
|
|
610
|
+
return signature;
|
|
611
|
+
}
|
|
552
612
|
} catch (error) {
|
|
553
613
|
this.logger.error('Error in sign', error);
|
|
554
614
|
throw error;
|
|
@@ -1264,16 +1324,28 @@ class DynamicWalletClient {
|
|
|
1264
1324
|
}, {});
|
|
1265
1325
|
return wallets;
|
|
1266
1326
|
}
|
|
1267
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug }){
|
|
1327
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator = false }){
|
|
1268
1328
|
this.logger = logger;
|
|
1269
1329
|
this.walletMap = {} // todo: store in session storage
|
|
1270
1330
|
;
|
|
1271
1331
|
this.isApiClientAuthenticated = false;
|
|
1332
|
+
this.forwardMPCEnabled = false;
|
|
1272
1333
|
this.environmentId = environmentId;
|
|
1273
1334
|
this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
|
|
1274
1335
|
this.baseApiUrl = baseApiUrl;
|
|
1275
1336
|
this.debug = Boolean(debug);
|
|
1276
1337
|
this.logger.setLogLevel(this.debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
|
|
1338
|
+
this.forwardMPCEnabled = enableMPCAccelerator || Boolean(forwardMPCClient);
|
|
1339
|
+
// Initialize API client with forwardMPCClient
|
|
1340
|
+
this.apiClient = new core.DynamicApiClient({
|
|
1341
|
+
environmentId,
|
|
1342
|
+
baseApiUrl,
|
|
1343
|
+
forwardMPCClient
|
|
1344
|
+
});
|
|
1345
|
+
if (this.forwardMPCEnabled) {
|
|
1346
|
+
this.logger.info('Initializing ForwardMPC enclave websocket in node client. Environment: ' + this.environmentId);
|
|
1347
|
+
this.initializeForwardMPCClient();
|
|
1348
|
+
}
|
|
1277
1349
|
}
|
|
1278
1350
|
}
|
|
1279
1351
|
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from '#internal/core';
|
|
2
2
|
import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, DynamicApiClient, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getServerWalletReshareConfig } from '@dynamic-labs-wallet/core';
|
|
3
3
|
export { SOLANA_RPC_URL, ThresholdSignatureScheme, WalletOperation, getMPCChainConfig } from '@dynamic-labs-wallet/core';
|
|
4
|
-
import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from '#internal/node';
|
|
4
|
+
import { BIP340, ExportableEd25519, Ecdsa, MessageHash, EcdsaSignature, EcdsaKeygenResult, ExportableEd25519KeygenResult, BIP340KeygenResult } from '#internal/node';
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
import crypto from 'crypto';
|
|
7
7
|
import { Logger } from '@dynamic-labs/logger';
|
|
@@ -283,6 +283,16 @@ const getKey = async ({ password, salt, encryptionConfig })=>{
|
|
|
283
283
|
const DEFAULT_LOG_LEVEL = 'INFO';
|
|
284
284
|
|
|
285
285
|
class DynamicWalletClient {
|
|
286
|
+
async initializeForwardMPCClient() {
|
|
287
|
+
try {
|
|
288
|
+
await this.apiClient.forwardMPCClient.ensureWsConnection();
|
|
289
|
+
} catch (error) {
|
|
290
|
+
this.logger.error('Error connecting to ForwardMPC enclave websocket. Environment: ' + this.environmentId, {
|
|
291
|
+
error,
|
|
292
|
+
environmentId: this.environmentId
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
286
296
|
ensureApiClientAuthenticated() {
|
|
287
297
|
if (!this.isApiClientAuthenticated) {
|
|
288
298
|
throw new Error('Client must be authenticated before making API calls. Call authenticateApiToken first.');
|
|
@@ -495,7 +505,8 @@ class DynamicWalletClient {
|
|
|
495
505
|
isFormatted,
|
|
496
506
|
dynamicRequestId,
|
|
497
507
|
context: context ? JSON.parse(JSON.stringify(context, (_key, value)=>typeof value === 'bigint' ? value.toString() : value)) : undefined,
|
|
498
|
-
onError
|
|
508
|
+
onError,
|
|
509
|
+
forwardMPCClientEnabled: this.forwardMPCEnabled
|
|
499
510
|
});
|
|
500
511
|
return data;
|
|
501
512
|
}
|
|
@@ -513,6 +524,41 @@ class DynamicWalletClient {
|
|
|
513
524
|
throw error;
|
|
514
525
|
}
|
|
515
526
|
}
|
|
527
|
+
async forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId }) {
|
|
528
|
+
try {
|
|
529
|
+
if (!this.apiClient.forwardMPCClient.connected) {
|
|
530
|
+
await this.initializeForwardMPCClient();
|
|
531
|
+
}
|
|
532
|
+
this.logger.info('Forward MPC enabled, signing message with forward MPC');
|
|
533
|
+
const signature = await this.apiClient.forwardMPCClient.signMessage({
|
|
534
|
+
keyshare: keyShare,
|
|
535
|
+
message: chainName === 'EVM' || chainName === 'SUI' ? message : formattedMessage,
|
|
536
|
+
relayDomain: this.baseMPCRelayApiUrl || '',
|
|
537
|
+
signingAlgo: chainName === 'EVM' ? 'ECDSA' : 'ED25519',
|
|
538
|
+
hashAlgo: chainName === 'EVM' ? 'keccak256' : undefined,
|
|
539
|
+
derivationPath: derivationPath,
|
|
540
|
+
roomUuid: roomId
|
|
541
|
+
});
|
|
542
|
+
const signatureBytes = signature.data.signature;
|
|
543
|
+
if (!(signatureBytes instanceof Uint8Array)) {
|
|
544
|
+
throw new TypeError(`Invalid signature format: expected Uint8Array, got ${typeof signatureBytes}`);
|
|
545
|
+
}
|
|
546
|
+
// Convert to EcdsaSignature
|
|
547
|
+
if (chainName === 'EVM') {
|
|
548
|
+
const ecdsaSignature = EcdsaSignature.fromBuffer(signatureBytes);
|
|
549
|
+
return ecdsaSignature;
|
|
550
|
+
} else {
|
|
551
|
+
return signatureBytes;
|
|
552
|
+
}
|
|
553
|
+
} catch (error) {
|
|
554
|
+
this.logger.error('Error signing message with forward MPC client', {
|
|
555
|
+
error,
|
|
556
|
+
environmentId: this.environmentId,
|
|
557
|
+
dynamicRequestId
|
|
558
|
+
});
|
|
559
|
+
throw error;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
516
562
|
async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
|
|
517
563
|
try {
|
|
518
564
|
await this.verifyPassword({
|
|
@@ -539,15 +585,29 @@ class DynamicWalletClient {
|
|
|
539
585
|
});
|
|
540
586
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
541
587
|
// Perform the external server sign and return the signature
|
|
542
|
-
|
|
543
|
-
chainName,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
588
|
+
if (this.forwardMPCEnabled) {
|
|
589
|
+
const formattedMessage = isFormatted ? new MessageHash(message) : formatMessage(chainName, message);
|
|
590
|
+
const signature = await this.forwardMPCClientSign({
|
|
591
|
+
chainName,
|
|
592
|
+
message,
|
|
593
|
+
roomId: data.roomId,
|
|
594
|
+
keyShare: externalServerKeyShares[0],
|
|
595
|
+
derivationPath,
|
|
596
|
+
formattedMessage,
|
|
597
|
+
dynamicRequestId: v4()
|
|
598
|
+
});
|
|
599
|
+
return signature;
|
|
600
|
+
} else {
|
|
601
|
+
const signature = await this.externalServerSign({
|
|
602
|
+
chainName,
|
|
603
|
+
message,
|
|
604
|
+
roomId: data.roomId,
|
|
605
|
+
keyShare: externalServerKeyShares[0],
|
|
606
|
+
derivationPath,
|
|
607
|
+
isFormatted
|
|
608
|
+
});
|
|
609
|
+
return signature;
|
|
610
|
+
}
|
|
551
611
|
} catch (error) {
|
|
552
612
|
this.logger.error('Error in sign', error);
|
|
553
613
|
throw error;
|
|
@@ -1263,16 +1323,28 @@ class DynamicWalletClient {
|
|
|
1263
1323
|
}, {});
|
|
1264
1324
|
return wallets;
|
|
1265
1325
|
}
|
|
1266
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug }){
|
|
1326
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator = false }){
|
|
1267
1327
|
this.logger = logger;
|
|
1268
1328
|
this.walletMap = {} // todo: store in session storage
|
|
1269
1329
|
;
|
|
1270
1330
|
this.isApiClientAuthenticated = false;
|
|
1331
|
+
this.forwardMPCEnabled = false;
|
|
1271
1332
|
this.environmentId = environmentId;
|
|
1272
1333
|
this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
|
|
1273
1334
|
this.baseApiUrl = baseApiUrl;
|
|
1274
1335
|
this.debug = Boolean(debug);
|
|
1275
1336
|
this.logger.setLogLevel(this.debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
|
|
1337
|
+
this.forwardMPCEnabled = enableMPCAccelerator || Boolean(forwardMPCClient);
|
|
1338
|
+
// Initialize API client with forwardMPCClient
|
|
1339
|
+
this.apiClient = new DynamicApiClient({
|
|
1340
|
+
environmentId,
|
|
1341
|
+
baseApiUrl,
|
|
1342
|
+
forwardMPCClient
|
|
1343
|
+
});
|
|
1344
|
+
if (this.forwardMPCEnabled) {
|
|
1345
|
+
this.logger.info('Initializing ForwardMPC enclave websocket in node client. Environment: ' + this.environmentId);
|
|
1346
|
+
this.initializeForwardMPCClient();
|
|
1347
|
+
}
|
|
1276
1348
|
}
|
|
1277
1349
|
}
|
|
1278
1350
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.188",
|
|
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.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.188",
|
|
8
|
+
"@dynamic-labs-wallet/forward-mpc-client": "0.1.0",
|
|
8
9
|
"@dynamic-labs/logger": "^4.25.3",
|
|
9
10
|
"@dynamic-labs/sdk-api-core": "^0.0.801",
|
|
10
11
|
"uuid": "11.1.0",
|
package/src/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BIP340KeygenResult, EcdsaKeygenResult,
|
|
1
|
+
import { BIP340KeygenResult, EcdsaKeygenResult, EcdsaSignature, MessageHash, type EcdsaPublicKey } from '#internal/node';
|
|
2
2
|
import { BackupLocation, DynamicApiClient, WalletOperation, type KeyShareBackupInfo, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/core';
|
|
3
3
|
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
4
4
|
import type { ServerKeyShare } from './mpc/index.js';
|
|
5
5
|
import type { ServerInitKeygenResult } from './mpc/types.js';
|
|
6
|
-
import type { WalletProperties } from './types.js';
|
|
6
|
+
import type { DynamicWalletClientProps, WalletProperties } from './types.js';
|
|
7
7
|
export declare class DynamicWalletClient {
|
|
8
8
|
environmentId: string;
|
|
9
9
|
debug: boolean;
|
|
@@ -14,12 +14,9 @@ export declare class DynamicWalletClient {
|
|
|
14
14
|
protected baseJWTAuthToken?: string;
|
|
15
15
|
protected baseApiUrl?: string;
|
|
16
16
|
protected isApiClientAuthenticated: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
baseMPCRelayApiUrl?: string;
|
|
21
|
-
debug?: boolean;
|
|
22
|
-
});
|
|
17
|
+
protected forwardMPCEnabled: boolean;
|
|
18
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator, }: DynamicWalletClientProps);
|
|
19
|
+
initializeForwardMPCClient(): Promise<void>;
|
|
23
20
|
private ensureApiClientAuthenticated;
|
|
24
21
|
authenticateApiToken(authToken: string): Promise<void>;
|
|
25
22
|
dynamicServerInitializeKeyGen({ chainName, externalServerKeygenIds, thresholdSignatureScheme, dynamicRequestId, skipLock, onError, onCeremonyComplete, }: {
|
|
@@ -85,6 +82,15 @@ export declare class DynamicWalletClient {
|
|
|
85
82
|
derivationPath: Uint32Array | undefined;
|
|
86
83
|
isFormatted?: boolean;
|
|
87
84
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
85
|
+
forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId, }: {
|
|
86
|
+
chainName: string;
|
|
87
|
+
message: string | Uint8Array;
|
|
88
|
+
roomId: string;
|
|
89
|
+
keyShare: ServerKeyShare;
|
|
90
|
+
derivationPath: Uint32Array | undefined;
|
|
91
|
+
formattedMessage: string | Uint8Array | MessageHash;
|
|
92
|
+
dynamicRequestId: string;
|
|
93
|
+
}): Promise<Uint8Array | EcdsaSignature>;
|
|
88
94
|
sign({ accountAddress, externalServerKeyShares, message, chainName, password, isFormatted, context, onError, }: {
|
|
89
95
|
accountAddress: string;
|
|
90
96
|
externalServerKeyShares?: ServerKeyShare[];
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,iBAAiB,
|
|
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;AACxB,OAAO,EACL,cAAc,EACd,gBAAgB,EAMhB,eAAe,EAEf,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQ7E,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,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACpC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,wBAAwB,UAAS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EAAE,MAAM,CAAC;KACnB;IA2EK,UAAU;CAqCjB"}
|
package/src/types.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ThresholdSignatureScheme, KeyShareBackupInfo } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import type { ForwardMPCClient } from '@dynamic-labs-wallet/forward-mpc-client';
|
|
2
3
|
import type { ServerKeyShare } from './mpc/types.js';
|
|
3
4
|
export interface DynamicWalletClientProps {
|
|
4
5
|
environmentId: string;
|
|
5
6
|
baseApiUrl?: string;
|
|
6
7
|
baseMPCRelayApiUrl?: string;
|
|
7
8
|
debug?: boolean;
|
|
9
|
+
forwardMPCClient?: ForwardMPCClient;
|
|
10
|
+
enableMPCAccelerator?: boolean;
|
|
8
11
|
}
|
|
9
12
|
export interface WalletProperties {
|
|
10
13
|
chainName: string;
|
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,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,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,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,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,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;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,iCAAiC,EAAE,kBAAkB,CAAC;CACvD"}
|