@dynamic-labs-wallet/node-evm 0.0.130 → 0.0.132
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 +9 -18
- package/index.esm.js +9 -18
- package/package.json +2 -2
- package/src/client/client.d.ts +5 -8
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -53,7 +53,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
53
53
|
transport: viem.http(rpcUrl)
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError
|
|
56
|
+
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
57
57
|
try {
|
|
58
58
|
let ceremonyCeremonyCompleteResolver;
|
|
59
59
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -96,8 +96,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
96
96
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
97
97
|
accountAddress,
|
|
98
98
|
externalServerKeyShares,
|
|
99
|
-
password
|
|
100
|
-
signedSessionId
|
|
99
|
+
password
|
|
101
100
|
});
|
|
102
101
|
return {
|
|
103
102
|
walletId: this.walletMap[accountAddress].walletId,
|
|
@@ -111,17 +110,15 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
111
110
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
async signMessage({ message, accountAddress, password = undefined,
|
|
113
|
+
async signMessage({ message, accountAddress, password = undefined, externalServerKeyShares }) {
|
|
115
114
|
await this.verifyPassword({
|
|
116
115
|
accountAddress,
|
|
117
116
|
password,
|
|
118
|
-
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
119
|
-
signedSessionId
|
|
117
|
+
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
120
118
|
});
|
|
121
119
|
await this.getWallet({
|
|
122
120
|
accountAddress,
|
|
123
|
-
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
124
|
-
signedSessionId
|
|
121
|
+
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
125
122
|
});
|
|
126
123
|
try {
|
|
127
124
|
if (!accountAddress) {
|
|
@@ -135,7 +132,6 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
135
132
|
accountAddress: accountAddress,
|
|
136
133
|
chainName: this.chainName,
|
|
137
134
|
password,
|
|
138
|
-
signedSessionId,
|
|
139
135
|
externalServerKeyShares
|
|
140
136
|
});
|
|
141
137
|
// Serialize the signature
|
|
@@ -167,8 +163,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
167
163
|
await this.verifyPassword({
|
|
168
164
|
accountAddress: senderAddress,
|
|
169
165
|
password,
|
|
170
|
-
walletOperation: node.WalletOperation.SIGN_TRANSACTION
|
|
171
|
-
signedSessionId
|
|
166
|
+
walletOperation: node.WalletOperation.SIGN_TRANSACTION
|
|
172
167
|
});
|
|
173
168
|
const serializedTx = viem.serializeTransaction(transaction);
|
|
174
169
|
const serializedTxBytes = Uint8Array.from(Buffer.from(serializedTx.slice(2), 'hex'));
|
|
@@ -181,7 +176,6 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
181
176
|
accountAddress: senderAddress,
|
|
182
177
|
chainName: this.chainName,
|
|
183
178
|
password,
|
|
184
|
-
signedSessionId,
|
|
185
179
|
externalServerKeyShares
|
|
186
180
|
});
|
|
187
181
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
@@ -203,18 +197,16 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
203
197
|
throw error;
|
|
204
198
|
}
|
|
205
199
|
}
|
|
206
|
-
async exportPrivateKey({ accountAddress, password = undefined,
|
|
200
|
+
async exportPrivateKey({ accountAddress, password = undefined, externalServerKeyShares }) {
|
|
207
201
|
await this.verifyPassword({
|
|
208
202
|
accountAddress,
|
|
209
203
|
password,
|
|
210
|
-
walletOperation: node.WalletOperation.EXPORT_PRIVATE_KEY
|
|
211
|
-
signedSessionId
|
|
204
|
+
walletOperation: node.WalletOperation.EXPORT_PRIVATE_KEY
|
|
212
205
|
});
|
|
213
206
|
const { derivedPrivateKey } = await this.exportKey({
|
|
214
207
|
accountAddress,
|
|
215
208
|
chainName: this.chainName,
|
|
216
209
|
password,
|
|
217
|
-
signedSessionId,
|
|
218
210
|
externalServerKeyShares
|
|
219
211
|
});
|
|
220
212
|
return {
|
|
@@ -266,8 +258,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
266
258
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
267
259
|
accountAddress,
|
|
268
260
|
externalServerKeyShares,
|
|
269
|
-
password
|
|
270
|
-
signedSessionId
|
|
261
|
+
password
|
|
271
262
|
});
|
|
272
263
|
return {
|
|
273
264
|
accountAddress,
|
package/index.esm.js
CHANGED
|
@@ -51,7 +51,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
51
51
|
transport: http(rpcUrl)
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError
|
|
54
|
+
async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
|
|
55
55
|
try {
|
|
56
56
|
let ceremonyCeremonyCompleteResolver;
|
|
57
57
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -94,8 +94,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
94
94
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
95
95
|
accountAddress,
|
|
96
96
|
externalServerKeyShares,
|
|
97
|
-
password
|
|
98
|
-
signedSessionId
|
|
97
|
+
password
|
|
99
98
|
});
|
|
100
99
|
return {
|
|
101
100
|
walletId: this.walletMap[accountAddress].walletId,
|
|
@@ -109,17 +108,15 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
109
108
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
|
-
async signMessage({ message, accountAddress, password = undefined,
|
|
111
|
+
async signMessage({ message, accountAddress, password = undefined, externalServerKeyShares }) {
|
|
113
112
|
await this.verifyPassword({
|
|
114
113
|
accountAddress,
|
|
115
114
|
password,
|
|
116
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
117
|
-
signedSessionId
|
|
115
|
+
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
118
116
|
});
|
|
119
117
|
await this.getWallet({
|
|
120
118
|
accountAddress,
|
|
121
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
122
|
-
signedSessionId
|
|
119
|
+
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
123
120
|
});
|
|
124
121
|
try {
|
|
125
122
|
if (!accountAddress) {
|
|
@@ -133,7 +130,6 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
133
130
|
accountAddress: accountAddress,
|
|
134
131
|
chainName: this.chainName,
|
|
135
132
|
password,
|
|
136
|
-
signedSessionId,
|
|
137
133
|
externalServerKeyShares
|
|
138
134
|
});
|
|
139
135
|
// Serialize the signature
|
|
@@ -165,8 +161,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
165
161
|
await this.verifyPassword({
|
|
166
162
|
accountAddress: senderAddress,
|
|
167
163
|
password,
|
|
168
|
-
walletOperation: WalletOperation.SIGN_TRANSACTION
|
|
169
|
-
signedSessionId
|
|
164
|
+
walletOperation: WalletOperation.SIGN_TRANSACTION
|
|
170
165
|
});
|
|
171
166
|
const serializedTx = serializeTransaction(transaction);
|
|
172
167
|
const serializedTxBytes = Uint8Array.from(Buffer.from(serializedTx.slice(2), 'hex'));
|
|
@@ -179,7 +174,6 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
179
174
|
accountAddress: senderAddress,
|
|
180
175
|
chainName: this.chainName,
|
|
181
176
|
password,
|
|
182
|
-
signedSessionId,
|
|
183
177
|
externalServerKeyShares
|
|
184
178
|
});
|
|
185
179
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
@@ -201,18 +195,16 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
201
195
|
throw error;
|
|
202
196
|
}
|
|
203
197
|
}
|
|
204
|
-
async exportPrivateKey({ accountAddress, password = undefined,
|
|
198
|
+
async exportPrivateKey({ accountAddress, password = undefined, externalServerKeyShares }) {
|
|
205
199
|
await this.verifyPassword({
|
|
206
200
|
accountAddress,
|
|
207
201
|
password,
|
|
208
|
-
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY
|
|
209
|
-
signedSessionId
|
|
202
|
+
walletOperation: WalletOperation.EXPORT_PRIVATE_KEY
|
|
210
203
|
});
|
|
211
204
|
const { derivedPrivateKey } = await this.exportKey({
|
|
212
205
|
accountAddress,
|
|
213
206
|
chainName: this.chainName,
|
|
214
207
|
password,
|
|
215
|
-
signedSessionId,
|
|
216
208
|
externalServerKeyShares
|
|
217
209
|
});
|
|
218
210
|
return {
|
|
@@ -264,8 +256,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
264
256
|
await this.storeEncryptedBackupByWalletWithRetry({
|
|
265
257
|
accountAddress,
|
|
266
258
|
externalServerKeyShares,
|
|
267
|
-
password
|
|
268
|
-
signedSessionId
|
|
259
|
+
password
|
|
269
260
|
});
|
|
270
261
|
return {
|
|
271
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.132",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/node": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/node": "0.0.132"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
package/src/client/client.d.ts
CHANGED
|
@@ -7,23 +7,21 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
7
7
|
chain: Chain;
|
|
8
8
|
rpcUrl?: string;
|
|
9
9
|
}): PublicClient;
|
|
10
|
-
createWalletAccount({ thresholdSignatureScheme, password, onError,
|
|
10
|
+
createWalletAccount({ thresholdSignatureScheme, password, onError, }: {
|
|
11
11
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
12
12
|
password?: string;
|
|
13
13
|
onError?: (error: Error) => void;
|
|
14
|
-
signedSessionId: string;
|
|
15
14
|
}): Promise<{
|
|
16
15
|
accountAddress: string;
|
|
17
16
|
publicKeyHex: string;
|
|
18
|
-
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
17
|
+
rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
|
|
19
18
|
externalServerKeyShares: ServerKeyShare[];
|
|
20
19
|
walletId: string;
|
|
21
20
|
}>;
|
|
22
|
-
signMessage({ message, accountAddress, password,
|
|
21
|
+
signMessage({ message, accountAddress, password, externalServerKeyShares, }: {
|
|
23
22
|
message: string;
|
|
24
23
|
accountAddress: string;
|
|
25
24
|
password?: string;
|
|
26
|
-
signedSessionId: string;
|
|
27
25
|
externalServerKeyShares: ServerKeyShare[];
|
|
28
26
|
}): Promise<`0x${string}`>;
|
|
29
27
|
verifyMessageSignature({ accountAddress, message, signature, }: {
|
|
@@ -38,10 +36,9 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
38
36
|
signedSessionId: string;
|
|
39
37
|
externalServerKeyShares: ServerKeyShare[];
|
|
40
38
|
}): Promise<string>;
|
|
41
|
-
exportPrivateKey({ accountAddress, password,
|
|
39
|
+
exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
|
|
42
40
|
accountAddress: string;
|
|
43
41
|
password?: string;
|
|
44
|
-
signedSessionId: string;
|
|
45
42
|
externalServerKeyShares: ServerKeyShare[];
|
|
46
43
|
}): Promise<{
|
|
47
44
|
derivedPrivateKey: string | undefined;
|
|
@@ -62,7 +59,7 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
62
59
|
}): Promise<{
|
|
63
60
|
accountAddress: string;
|
|
64
61
|
publicKeyHex: string;
|
|
65
|
-
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
62
|
+
rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
|
|
66
63
|
externalServerKeyShares: ServerKeyShare[];
|
|
67
64
|
}>;
|
|
68
65
|
getEvmWallets(): Promise<any>;
|
|
@@ -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;IAOV,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd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