@dynamic-labs-wallet/node-svm 0.0.91 → 0.0.93
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
|
@@ -63,6 +63,10 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
63
63
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
64
64
|
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
65
65
|
try {
|
|
66
|
+
let ceremonyCeremonyCompleteResolver;
|
|
67
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
68
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
69
|
+
});
|
|
66
70
|
const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
|
|
67
71
|
chainName: this.chainName,
|
|
68
72
|
thresholdSignatureScheme,
|
|
@@ -76,8 +80,11 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
76
80
|
thresholdSignatureScheme,
|
|
77
81
|
externalServerKeySharesBackupInfo: node.getExternalServerKeyShareBackupInfo()
|
|
78
82
|
});
|
|
83
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
79
84
|
}
|
|
80
85
|
});
|
|
86
|
+
// Wait for the ceremony to complete before proceeding
|
|
87
|
+
await ceremonyCompletePromise;
|
|
81
88
|
if (!rawPublicKey || !(rawPublicKey instanceof Uint8Array)) {
|
|
82
89
|
throw new Error('Raw public key is not a Uint8Array');
|
|
83
90
|
}
|
|
@@ -244,6 +251,10 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
244
251
|
* @param password The password for encrypted backup shares
|
|
245
252
|
* @returns The account address, raw public key, and client key shares
|
|
246
253
|
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
254
|
+
let ceremonyCeremonyCompleteResolver;
|
|
255
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
256
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
257
|
+
});
|
|
247
258
|
//get public key from private key
|
|
248
259
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKey);
|
|
249
260
|
const formattedPrivateKey = await this.decodePrivateKeyForSolana(privateKey);
|
|
@@ -261,8 +272,11 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
261
272
|
thresholdSignatureScheme,
|
|
262
273
|
externalServerKeySharesBackupInfo: node.getExternalServerKeyShareBackupInfo()
|
|
263
274
|
});
|
|
275
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
264
276
|
}
|
|
265
277
|
});
|
|
278
|
+
// Wait for the ceremony to complete before proceeding
|
|
279
|
+
await ceremonyCompletePromise;
|
|
266
280
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
267
281
|
throw new Error('Error creating wallet account');
|
|
268
282
|
}
|
package/index.esm.js
CHANGED
|
@@ -61,6 +61,10 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
61
61
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
62
62
|
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
63
63
|
try {
|
|
64
|
+
let ceremonyCeremonyCompleteResolver;
|
|
65
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
66
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
67
|
+
});
|
|
64
68
|
const { rawPublicKey, externalServerKeyShares } = await this.keyGen({
|
|
65
69
|
chainName: this.chainName,
|
|
66
70
|
thresholdSignatureScheme,
|
|
@@ -74,8 +78,11 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
74
78
|
thresholdSignatureScheme,
|
|
75
79
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo()
|
|
76
80
|
});
|
|
81
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
77
82
|
}
|
|
78
83
|
});
|
|
84
|
+
// Wait for the ceremony to complete before proceeding
|
|
85
|
+
await ceremonyCompletePromise;
|
|
79
86
|
if (!rawPublicKey || !(rawPublicKey instanceof Uint8Array)) {
|
|
80
87
|
throw new Error('Raw public key is not a Uint8Array');
|
|
81
88
|
}
|
|
@@ -242,6 +249,10 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
242
249
|
* @param password The password for encrypted backup shares
|
|
243
250
|
* @returns The account address, raw public key, and client key shares
|
|
244
251
|
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
252
|
+
let ceremonyCeremonyCompleteResolver;
|
|
253
|
+
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
254
|
+
ceremonyCeremonyCompleteResolver = resolve;
|
|
255
|
+
});
|
|
245
256
|
//get public key from private key
|
|
246
257
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKey);
|
|
247
258
|
const formattedPrivateKey = await this.decodePrivateKeyForSolana(privateKey);
|
|
@@ -259,8 +270,11 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
259
270
|
thresholdSignatureScheme,
|
|
260
271
|
externalServerKeySharesBackupInfo: getExternalServerKeyShareBackupInfo()
|
|
261
272
|
});
|
|
273
|
+
ceremonyCeremonyCompleteResolver(undefined);
|
|
262
274
|
}
|
|
263
275
|
});
|
|
276
|
+
// Wait for the ceremony to complete before proceeding
|
|
277
|
+
await ceremonyCompletePromise;
|
|
264
278
|
if (!rawPublicKey || !externalServerKeyShares) {
|
|
265
279
|
throw new Error('Error creating wallet account');
|
|
266
280
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/node": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/node": "0.0.93",
|
|
7
7
|
"@solana/web3.js": "^1.98.2"
|
|
8
8
|
},
|
|
9
9
|
"publishConfig": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,WAAW,EACX,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAIzB,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B;IAQD;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,GACR,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KAClC,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,CAAC;QACzB,uBAAuB,EAAE,cAAc,EAAE,CAAC;KAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,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