@dynamic-labs-wallet/node-evm 0.0.92 → 0.0.94
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 +14 -0
- package/index.esm.js +14 -0
- package/package.json +2 -2
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -55,6 +55,10 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
55
55
|
}
|
|
56
56
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
57
57
|
try {
|
|
58
|
+
let ceremonyCeremonyCompleteResolver;
|
|
59
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
60
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
61
|
+
});
|
|
58
62
|
// Generate key shares for given threshold signature scheme (TSS)
|
|
59
63
|
const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
|
|
60
64
|
chainName: this.chainName,
|
|
@@ -70,8 +74,11 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
70
74
|
thresholdSignatureScheme,
|
|
71
75
|
externalServerKeySharesBackupInfo: node.getExternalServerKeyShareBackupInfo()
|
|
72
76
|
});
|
|
77
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
73
78
|
}
|
|
74
79
|
});
|
|
80
|
+
// Wait for the ceremony to complete before proceeding
|
|
81
|
+
await ceremonyCompletePromise;
|
|
75
82
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
76
83
|
throw new Error(ERROR_KEYGEN_FAILED);
|
|
77
84
|
}
|
|
@@ -206,6 +213,10 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
206
213
|
};
|
|
207
214
|
}
|
|
208
215
|
async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
216
|
+
let ceremonyCeremonyCompleteResolver;
|
|
217
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
218
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
219
|
+
});
|
|
209
220
|
// TODO: validate private key for EVM
|
|
210
221
|
const { rawPublicKey, externalServerKeyShares } = await this.importRawPrivateKey({
|
|
211
222
|
chainName,
|
|
@@ -222,8 +233,11 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
222
233
|
thresholdSignatureScheme,
|
|
223
234
|
externalServerKeySharesBackupInfo: node.getExternalServerKeyShareBackupInfo()
|
|
224
235
|
});
|
|
236
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
225
237
|
}
|
|
226
238
|
});
|
|
239
|
+
// Wait for the ceremony to complete before proceeding
|
|
240
|
+
await ceremonyCompletePromise;
|
|
227
241
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
228
242
|
throw new Error('Error creating wallet account');
|
|
229
243
|
}
|
package/index.esm.js
CHANGED
|
@@ -53,6 +53,10 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
53
53
|
}
|
|
54
54
|
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
55
55
|
try {
|
|
56
|
+
let ceremonyCeremonyCompleteResolver;
|
|
57
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
58
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
59
|
+
});
|
|
56
60
|
// Generate key shares for given threshold signature scheme (TSS)
|
|
57
61
|
const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
|
|
58
62
|
chainName: this.chainName,
|
|
@@ -68,8 +72,11 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
68
72
|
thresholdSignatureScheme,
|
|
69
73
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo()
|
|
70
74
|
});
|
|
75
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
71
76
|
}
|
|
72
77
|
});
|
|
78
|
+
// Wait for the ceremony to complete before proceeding
|
|
79
|
+
await ceremonyCompletePromise;
|
|
73
80
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
74
81
|
throw new Error(ERROR_KEYGEN_FAILED);
|
|
75
82
|
}
|
|
@@ -204,6 +211,10 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
204
211
|
};
|
|
205
212
|
}
|
|
206
213
|
async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
214
|
+
let ceremonyCeremonyCompleteResolver;
|
|
215
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
216
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
217
|
+
});
|
|
207
218
|
// TODO: validate private key for EVM
|
|
208
219
|
const { rawPublicKey, externalServerKeyShares } = await this.importRawPrivateKey({
|
|
209
220
|
chainName,
|
|
@@ -220,8 +231,11 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
220
231
|
thresholdSignatureScheme,
|
|
221
232
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo()
|
|
222
233
|
});
|
|
234
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
223
235
|
}
|
|
224
236
|
});
|
|
237
|
+
// Wait for the ceremony to complete before proceeding
|
|
238
|
+
await ceremonyCompletePromise;
|
|
225
239
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
226
240
|
throw new Error('Error creating wallet account');
|
|
227
241
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EAEd,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,KAAK,EAEV,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,MAAM,MAAM,CAAC;AAed,qBAAa,sBAAuB,SAAQ,mBAAmB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