@dynamic-labs-wallet/node 0.0.187 → 0.0.189
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 +89 -11
- package/index.esm.js +91 -13
- package/package.json +3 -2
- package/src/client.d.ts +15 -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,46 @@ class DynamicWalletClient {
|
|
|
514
525
|
throw error;
|
|
515
526
|
}
|
|
516
527
|
}
|
|
528
|
+
async forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId, isFormatted }) {
|
|
529
|
+
try {
|
|
530
|
+
if (!this.apiClient.forwardMPCClient.connected) {
|
|
531
|
+
await this.initializeForwardMPCClient();
|
|
532
|
+
}
|
|
533
|
+
const messageForForwardMPC = core.serializeMessageForForwardMPC({
|
|
534
|
+
message,
|
|
535
|
+
isFormatted,
|
|
536
|
+
chainName
|
|
537
|
+
});
|
|
538
|
+
this.logger.info('Forward MPC enabled, signing message with forward MPC');
|
|
539
|
+
const signature = await this.apiClient.forwardMPCClient.signMessage({
|
|
540
|
+
keyshare: keyShare,
|
|
541
|
+
message: chainName === 'SVM' ? formattedMessage : messageForForwardMPC,
|
|
542
|
+
relayDomain: this.baseMPCRelayApiUrl || '',
|
|
543
|
+
signingAlgo: chainName === 'EVM' ? 'ECDSA' : 'ED25519',
|
|
544
|
+
hashAlgo: chainName === 'EVM' && !isFormatted ? 'keccak256' : undefined,
|
|
545
|
+
derivationPath: derivationPath,
|
|
546
|
+
roomUuid: roomId
|
|
547
|
+
});
|
|
548
|
+
const signatureBytes = signature.data.signature;
|
|
549
|
+
if (!(signatureBytes instanceof Uint8Array)) {
|
|
550
|
+
throw new TypeError(`Invalid signature format: expected Uint8Array, got ${typeof signatureBytes}`);
|
|
551
|
+
}
|
|
552
|
+
// Convert to EcdsaSignature
|
|
553
|
+
if (chainName === 'EVM') {
|
|
554
|
+
const ecdsaSignature = node.EcdsaSignature.fromBuffer(signatureBytes);
|
|
555
|
+
return ecdsaSignature;
|
|
556
|
+
} else {
|
|
557
|
+
return signatureBytes;
|
|
558
|
+
}
|
|
559
|
+
} catch (error) {
|
|
560
|
+
this.logger.error('Error signing message with forward MPC client', {
|
|
561
|
+
error,
|
|
562
|
+
environmentId: this.environmentId,
|
|
563
|
+
dynamicRequestId
|
|
564
|
+
});
|
|
565
|
+
throw error;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
517
568
|
async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
|
|
518
569
|
try {
|
|
519
570
|
await this.verifyPassword({
|
|
@@ -540,15 +591,30 @@ class DynamicWalletClient {
|
|
|
540
591
|
});
|
|
541
592
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
542
593
|
// Perform the external server sign and return the signature
|
|
543
|
-
|
|
544
|
-
chainName,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
594
|
+
if (this.forwardMPCEnabled) {
|
|
595
|
+
const formattedMessage = isFormatted ? new node.MessageHash(message) : formatMessage(chainName, message);
|
|
596
|
+
const signature = await this.forwardMPCClientSign({
|
|
597
|
+
chainName,
|
|
598
|
+
message,
|
|
599
|
+
roomId: data.roomId,
|
|
600
|
+
keyShare: externalServerKeyShares[0],
|
|
601
|
+
derivationPath,
|
|
602
|
+
formattedMessage,
|
|
603
|
+
dynamicRequestId: uuid.v4(),
|
|
604
|
+
isFormatted
|
|
605
|
+
});
|
|
606
|
+
return signature;
|
|
607
|
+
} else {
|
|
608
|
+
const signature = await this.externalServerSign({
|
|
609
|
+
chainName,
|
|
610
|
+
message,
|
|
611
|
+
roomId: data.roomId,
|
|
612
|
+
keyShare: externalServerKeyShares[0],
|
|
613
|
+
derivationPath,
|
|
614
|
+
isFormatted
|
|
615
|
+
});
|
|
616
|
+
return signature;
|
|
617
|
+
}
|
|
552
618
|
} catch (error) {
|
|
553
619
|
this.logger.error('Error in sign', error);
|
|
554
620
|
throw error;
|
|
@@ -1264,16 +1330,28 @@ class DynamicWalletClient {
|
|
|
1264
1330
|
}, {});
|
|
1265
1331
|
return wallets;
|
|
1266
1332
|
}
|
|
1267
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug }){
|
|
1333
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator = false }){
|
|
1268
1334
|
this.logger = logger;
|
|
1269
1335
|
this.walletMap = {} // todo: store in session storage
|
|
1270
1336
|
;
|
|
1271
1337
|
this.isApiClientAuthenticated = false;
|
|
1338
|
+
this.forwardMPCEnabled = false;
|
|
1272
1339
|
this.environmentId = environmentId;
|
|
1273
1340
|
this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
|
|
1274
1341
|
this.baseApiUrl = baseApiUrl;
|
|
1275
1342
|
this.debug = Boolean(debug);
|
|
1276
1343
|
this.logger.setLogLevel(this.debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
|
|
1344
|
+
this.forwardMPCEnabled = enableMPCAccelerator || Boolean(forwardMPCClient);
|
|
1345
|
+
// Initialize API client with forwardMPCClient
|
|
1346
|
+
this.apiClient = new core.DynamicApiClient({
|
|
1347
|
+
environmentId,
|
|
1348
|
+
baseApiUrl,
|
|
1349
|
+
forwardMPCClient
|
|
1350
|
+
});
|
|
1351
|
+
if (this.forwardMPCEnabled) {
|
|
1352
|
+
this.logger.info('Initializing ForwardMPC enclave websocket in node client. Environment: ' + this.environmentId);
|
|
1353
|
+
this.initializeForwardMPCClient();
|
|
1354
|
+
}
|
|
1277
1355
|
}
|
|
1278
1356
|
}
|
|
1279
1357
|
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from '#internal/core';
|
|
2
|
-
import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, DynamicApiClient, getClientThreshold, MPC_CONFIG, getTSSConfig, WalletOperation, getServerWalletReshareConfig } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import { SigningAlgorithm, MPC_RELAY_PROD_API_URL, getMPCChainConfig, BackupLocation, DynamicApiClient, getClientThreshold, MPC_CONFIG, getTSSConfig, serializeMessageForForwardMPC, 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,46 @@ class DynamicWalletClient {
|
|
|
513
524
|
throw error;
|
|
514
525
|
}
|
|
515
526
|
}
|
|
527
|
+
async forwardMPCClientSign({ chainName, message, roomId, keyShare, derivationPath, formattedMessage, dynamicRequestId, isFormatted }) {
|
|
528
|
+
try {
|
|
529
|
+
if (!this.apiClient.forwardMPCClient.connected) {
|
|
530
|
+
await this.initializeForwardMPCClient();
|
|
531
|
+
}
|
|
532
|
+
const messageForForwardMPC = serializeMessageForForwardMPC({
|
|
533
|
+
message,
|
|
534
|
+
isFormatted,
|
|
535
|
+
chainName
|
|
536
|
+
});
|
|
537
|
+
this.logger.info('Forward MPC enabled, signing message with forward MPC');
|
|
538
|
+
const signature = await this.apiClient.forwardMPCClient.signMessage({
|
|
539
|
+
keyshare: keyShare,
|
|
540
|
+
message: chainName === 'SVM' ? formattedMessage : messageForForwardMPC,
|
|
541
|
+
relayDomain: this.baseMPCRelayApiUrl || '',
|
|
542
|
+
signingAlgo: chainName === 'EVM' ? 'ECDSA' : 'ED25519',
|
|
543
|
+
hashAlgo: chainName === 'EVM' && !isFormatted ? 'keccak256' : undefined,
|
|
544
|
+
derivationPath: derivationPath,
|
|
545
|
+
roomUuid: roomId
|
|
546
|
+
});
|
|
547
|
+
const signatureBytes = signature.data.signature;
|
|
548
|
+
if (!(signatureBytes instanceof Uint8Array)) {
|
|
549
|
+
throw new TypeError(`Invalid signature format: expected Uint8Array, got ${typeof signatureBytes}`);
|
|
550
|
+
}
|
|
551
|
+
// Convert to EcdsaSignature
|
|
552
|
+
if (chainName === 'EVM') {
|
|
553
|
+
const ecdsaSignature = EcdsaSignature.fromBuffer(signatureBytes);
|
|
554
|
+
return ecdsaSignature;
|
|
555
|
+
} else {
|
|
556
|
+
return signatureBytes;
|
|
557
|
+
}
|
|
558
|
+
} catch (error) {
|
|
559
|
+
this.logger.error('Error signing message with forward MPC client', {
|
|
560
|
+
error,
|
|
561
|
+
environmentId: this.environmentId,
|
|
562
|
+
dynamicRequestId
|
|
563
|
+
});
|
|
564
|
+
throw error;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
516
567
|
async sign({ accountAddress, externalServerKeyShares, message, chainName, password = undefined, isFormatted = false, context, onError }) {
|
|
517
568
|
try {
|
|
518
569
|
await this.verifyPassword({
|
|
@@ -539,15 +590,30 @@ class DynamicWalletClient {
|
|
|
539
590
|
});
|
|
540
591
|
const derivationPath = wallet.derivationPath && wallet.derivationPath != '' ? new Uint32Array(Object.values(JSON.parse(wallet.derivationPath))) : undefined;
|
|
541
592
|
// Perform the external server sign and return the signature
|
|
542
|
-
|
|
543
|
-
chainName,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
593
|
+
if (this.forwardMPCEnabled) {
|
|
594
|
+
const formattedMessage = isFormatted ? new MessageHash(message) : formatMessage(chainName, message);
|
|
595
|
+
const signature = await this.forwardMPCClientSign({
|
|
596
|
+
chainName,
|
|
597
|
+
message,
|
|
598
|
+
roomId: data.roomId,
|
|
599
|
+
keyShare: externalServerKeyShares[0],
|
|
600
|
+
derivationPath,
|
|
601
|
+
formattedMessage,
|
|
602
|
+
dynamicRequestId: v4(),
|
|
603
|
+
isFormatted
|
|
604
|
+
});
|
|
605
|
+
return signature;
|
|
606
|
+
} else {
|
|
607
|
+
const signature = await this.externalServerSign({
|
|
608
|
+
chainName,
|
|
609
|
+
message,
|
|
610
|
+
roomId: data.roomId,
|
|
611
|
+
keyShare: externalServerKeyShares[0],
|
|
612
|
+
derivationPath,
|
|
613
|
+
isFormatted
|
|
614
|
+
});
|
|
615
|
+
return signature;
|
|
616
|
+
}
|
|
551
617
|
} catch (error) {
|
|
552
618
|
this.logger.error('Error in sign', error);
|
|
553
619
|
throw error;
|
|
@@ -1263,16 +1329,28 @@ class DynamicWalletClient {
|
|
|
1263
1329
|
}, {});
|
|
1264
1330
|
return wallets;
|
|
1265
1331
|
}
|
|
1266
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug }){
|
|
1332
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, forwardMPCClient, enableMPCAccelerator = false }){
|
|
1267
1333
|
this.logger = logger;
|
|
1268
1334
|
this.walletMap = {} // todo: store in session storage
|
|
1269
1335
|
;
|
|
1270
1336
|
this.isApiClientAuthenticated = false;
|
|
1337
|
+
this.forwardMPCEnabled = false;
|
|
1271
1338
|
this.environmentId = environmentId;
|
|
1272
1339
|
this.baseMPCRelayApiUrl = baseMPCRelayApiUrl;
|
|
1273
1340
|
this.baseApiUrl = baseApiUrl;
|
|
1274
1341
|
this.debug = Boolean(debug);
|
|
1275
1342
|
this.logger.setLogLevel(this.debug ? 'DEBUG' : DEFAULT_LOG_LEVEL);
|
|
1343
|
+
this.forwardMPCEnabled = enableMPCAccelerator || Boolean(forwardMPCClient);
|
|
1344
|
+
// Initialize API client with forwardMPCClient
|
|
1345
|
+
this.apiClient = new DynamicApiClient({
|
|
1346
|
+
environmentId,
|
|
1347
|
+
baseApiUrl,
|
|
1348
|
+
forwardMPCClient
|
|
1349
|
+
});
|
|
1350
|
+
if (this.forwardMPCEnabled) {
|
|
1351
|
+
this.logger.info('Initializing ForwardMPC enclave websocket in node client. Environment: ' + this.environmentId);
|
|
1352
|
+
this.initializeForwardMPCClient();
|
|
1353
|
+
}
|
|
1276
1354
|
}
|
|
1277
1355
|
}
|
|
1278
1356
|
|
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.189",
|
|
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.189",
|
|
8
|
+
"@dynamic-labs-wallet/forward-mpc-client": "0.1.2",
|
|
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,16 @@ 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, isFormatted, }: {
|
|
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
|
+
isFormatted?: boolean;
|
|
94
|
+
}): Promise<Uint8Array | EcdsaSignature>;
|
|
88
95
|
sign({ accountAddress, externalServerKeyShares, message, chainName, password, isFormatted, context, onError, }: {
|
|
89
96
|
accountAddress: string;
|
|
90
97
|
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,EAOhB,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,CA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EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB;;OAEG;IACG,uCAAuC,CAAC,EAC5C,cAAc,EACd,eAAiD,GAClD,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,GAAG,OAAO,CAAC,OAAO,CAAC;IAwCd,yCAAyC,CAAC,EAC9C,cAAc,GACf,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoBzB,SAAS,CAAC,EACd,cAAc,EACd,eAA8C,EAC9C,UAAsB,EACtB,QAAoB,GACrB,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;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"}
|