@dynamic-labs-wallet/node-evm 0.0.135 → 0.0.136
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 +5 -23
- package/index.esm.js +5 -23
- package/package.json +2 -2
- package/src/client/client.d.ts +8 -26
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -53,14 +53,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
53
53
|
transport: viem.http(rpcUrl)
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
* Creates a new wallet account and stores the key shares in the wallet map.
|
|
58
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
59
|
-
* @param password - The password to use for the wallet.
|
|
60
|
-
* @param onError - The function to call if an error occurs.
|
|
61
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
62
|
-
* @returns The account address, public key, raw public key, external server key shares, and wallet id.
|
|
63
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
56
|
+
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
64
57
|
try {
|
|
65
58
|
let ceremonyCeremonyCompleteResolver;
|
|
66
59
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -103,8 +96,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
103
96
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
104
97
|
accountAddress,
|
|
105
98
|
externalServerKeyShares,
|
|
106
|
-
password
|
|
107
|
-
backUpToClientShareService
|
|
99
|
+
password
|
|
108
100
|
});
|
|
109
101
|
return {
|
|
110
102
|
walletId: this.walletMap[accountAddress].walletId,
|
|
@@ -167,7 +159,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
167
159
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
168
160
|
}
|
|
169
161
|
}
|
|
170
|
-
async signTransaction({ senderAddress, transaction, password = undefined, externalServerKeyShares }) {
|
|
162
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
171
163
|
await this.verifyPassword({
|
|
172
164
|
accountAddress: senderAddress,
|
|
173
165
|
password,
|
|
@@ -231,16 +223,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
231
223
|
derivedPrivateKey
|
|
232
224
|
};
|
|
233
225
|
}
|
|
234
|
-
|
|
235
|
-
* Imports a private key and stores the key shares in the wallet map.
|
|
236
|
-
* @param privateKey - The private key to import.
|
|
237
|
-
* @param chainName - The chain name to use for the wallet.
|
|
238
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
239
|
-
* @param password - The password to use for the wallet.
|
|
240
|
-
* @param onError - The function to call if an error occurs.
|
|
241
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
242
|
-
* @returns The account address, public key, raw public key, external server key shares.
|
|
243
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
226
|
+
async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
|
|
244
227
|
let ceremonyCeremonyCompleteResolver;
|
|
245
228
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
246
229
|
ceremonyCeremonyCompleteResolver = resolve;
|
|
@@ -275,8 +258,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
275
258
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
276
259
|
accountAddress,
|
|
277
260
|
externalServerKeyShares,
|
|
278
|
-
password
|
|
279
|
-
backUpToClientShareService
|
|
261
|
+
password
|
|
280
262
|
});
|
|
281
263
|
return {
|
|
282
264
|
accountAddress,
|
package/index.esm.js
CHANGED
|
@@ -51,14 +51,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
51
51
|
transport: http(rpcUrl)
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
* Creates a new wallet account and stores the key shares in the wallet map.
|
|
56
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
57
|
-
* @param password - The password to use for the wallet.
|
|
58
|
-
* @param onError - The function to call if an error occurs.
|
|
59
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
60
|
-
* @returns The account address, public key, raw public key, external server key shares, and wallet id.
|
|
61
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
54
|
+
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
62
55
|
try {
|
|
63
56
|
let ceremonyCeremonyCompleteResolver;
|
|
64
57
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -101,8 +94,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
101
94
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
102
95
|
accountAddress,
|
|
103
96
|
externalServerKeyShares,
|
|
104
|
-
password
|
|
105
|
-
backUpToClientShareService
|
|
97
|
+
password
|
|
106
98
|
});
|
|
107
99
|
return {
|
|
108
100
|
walletId: this.walletMap[accountAddress].walletId,
|
|
@@ -165,7 +157,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
165
157
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
166
158
|
}
|
|
167
159
|
}
|
|
168
|
-
async signTransaction({ senderAddress, transaction, password = undefined, externalServerKeyShares }) {
|
|
160
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
169
161
|
await this.verifyPassword({
|
|
170
162
|
accountAddress: senderAddress,
|
|
171
163
|
password,
|
|
@@ -229,16 +221,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
229
221
|
derivedPrivateKey
|
|
230
222
|
};
|
|
231
223
|
}
|
|
232
|
-
|
|
233
|
-
* Imports a private key and stores the key shares in the wallet map.
|
|
234
|
-
* @param privateKey - The private key to import.
|
|
235
|
-
* @param chainName - The chain name to use for the wallet.
|
|
236
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
237
|
-
* @param password - The password to use for the wallet.
|
|
238
|
-
* @param onError - The function to call if an error occurs.
|
|
239
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
240
|
-
* @returns The account address, public key, raw public key, external server key shares.
|
|
241
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
224
|
+
async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
|
|
242
225
|
let ceremonyCeremonyCompleteResolver;
|
|
243
226
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
244
227
|
ceremonyCeremonyCompleteResolver = resolve;
|
|
@@ -273,8 +256,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
273
256
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
274
257
|
accountAddress,
|
|
275
258
|
externalServerKeyShares,
|
|
276
|
-
password
|
|
277
|
-
backUpToClientShareService
|
|
259
|
+
password
|
|
278
260
|
});
|
|
279
261
|
return {
|
|
280
262
|
accountAddress,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-evm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.136",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/node": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/node": "0.0.136"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
package/src/client/client.d.ts
CHANGED
|
@@ -7,19 +7,10 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
7
7
|
chain: Chain;
|
|
8
8
|
rpcUrl?: string;
|
|
9
9
|
}): PublicClient;
|
|
10
|
-
|
|
11
|
-
* Creates a new wallet account and stores the key shares in the wallet map.
|
|
12
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
13
|
-
* @param password - The password to use for the wallet.
|
|
14
|
-
* @param onError - The function to call if an error occurs.
|
|
15
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
16
|
-
* @returns The account address, public key, raw public key, external server key shares, and wallet id.
|
|
17
|
-
*/
|
|
18
|
-
createWalletAccount({ thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
10
|
+
createWalletAccount({ thresholdSignatureScheme, password, onError, }: {
|
|
19
11
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
20
12
|
password?: string;
|
|
21
13
|
onError?: (error: Error) => void;
|
|
22
|
-
backUpToClientShareService?: boolean;
|
|
23
14
|
}): Promise<{
|
|
24
15
|
accountAddress: string;
|
|
25
16
|
publicKeyHex: string;
|
|
@@ -31,23 +22,24 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
31
22
|
message: string;
|
|
32
23
|
accountAddress: string;
|
|
33
24
|
password?: string;
|
|
34
|
-
externalServerKeyShares
|
|
25
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
35
26
|
}): Promise<`0x${string}`>;
|
|
36
27
|
verifyMessageSignature({ accountAddress, message, signature, }: {
|
|
37
28
|
accountAddress: string;
|
|
38
29
|
message: SignableMessage;
|
|
39
30
|
signature: any;
|
|
40
31
|
}): Promise<boolean>;
|
|
41
|
-
signTransaction({ senderAddress, transaction, password, externalServerKeyShares, }: {
|
|
32
|
+
signTransaction({ senderAddress, transaction, password, signedSessionId, externalServerKeyShares, }: {
|
|
42
33
|
senderAddress: string;
|
|
43
34
|
transaction: TransactionSerializable;
|
|
44
35
|
password?: string;
|
|
45
|
-
|
|
36
|
+
signedSessionId: string;
|
|
37
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
46
38
|
}): Promise<string>;
|
|
47
39
|
exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
|
|
48
40
|
accountAddress: string;
|
|
49
41
|
password?: string;
|
|
50
|
-
externalServerKeyShares
|
|
42
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
51
43
|
}): Promise<{
|
|
52
44
|
derivedPrivateKey: string | undefined;
|
|
53
45
|
}>;
|
|
@@ -57,23 +49,13 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
57
49
|
}): Promise<{
|
|
58
50
|
derivedPrivateKey: string | undefined;
|
|
59
51
|
}>;
|
|
60
|
-
|
|
61
|
-
* Imports a private key and stores the key shares in the wallet map.
|
|
62
|
-
* @param privateKey - The private key to import.
|
|
63
|
-
* @param chainName - The chain name to use for the wallet.
|
|
64
|
-
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
|
|
65
|
-
* @param password - The password to use for the wallet.
|
|
66
|
-
* @param onError - The function to call if an error occurs.
|
|
67
|
-
* @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
|
|
68
|
-
* @returns The account address, public key, raw public key, external server key shares.
|
|
69
|
-
*/
|
|
70
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
52
|
+
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, signedSessionId, }: {
|
|
71
53
|
privateKey: string;
|
|
72
54
|
chainName: string;
|
|
73
55
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
74
56
|
password?: string;
|
|
75
57
|
onError?: (error: Error) => void;
|
|
76
|
-
|
|
58
|
+
signedSessionId: string;
|
|
77
59
|
}): Promise<{
|
|
78
60
|
accountAddress: string;
|
|
79
61
|
publicKeyHex: string;
|
|
@@ -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;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,KAAK,GACN,EAAE,wBAAwB;IAS3B,sBAAsB,CAAC,EACrB,KAAK,EACL,MAAM,GACP,EAAE;QACD,KAAK,EAAE,KAAK,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,YAAY;
|
|
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;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,KAAK,GACN,EAAE,wBAAwB;IAS3B,sBAAsB,CAAC,EACrB,KAAK,EACL,MAAM,GACP,EAAE;QACD,KAAK,EAAE,KAAK,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,YAAY;IAOV,m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