@dynamic-labs-wallet/node-evm 0.0.121 → 0.0.123
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 +10 -6
- package/index.esm.js +10 -6
- package/package.json +2 -2
- package/src/client/client.d.ts +7 -3
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -100,6 +100,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
100
100
|
signedSessionId
|
|
101
101
|
});
|
|
102
102
|
return {
|
|
103
|
+
walletId: this.walletMap[accountAddress].walletId,
|
|
103
104
|
accountAddress,
|
|
104
105
|
rawPublicKey,
|
|
105
106
|
publicKeyHex,
|
|
@@ -110,7 +111,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
110
111
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
|
|
114
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
114
115
|
await this.verifyPassword({
|
|
115
116
|
accountAddress,
|
|
116
117
|
password,
|
|
@@ -134,7 +135,8 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
134
135
|
accountAddress: accountAddress,
|
|
135
136
|
chainName: this.chainName,
|
|
136
137
|
password,
|
|
137
|
-
signedSessionId
|
|
138
|
+
signedSessionId,
|
|
139
|
+
externalServerKeyShares
|
|
138
140
|
});
|
|
139
141
|
// Serialize the signature
|
|
140
142
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
@@ -161,7 +163,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
161
163
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
162
164
|
}
|
|
163
165
|
}
|
|
164
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId }) {
|
|
166
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
165
167
|
await this.verifyPassword({
|
|
166
168
|
accountAddress: senderAddress,
|
|
167
169
|
password,
|
|
@@ -179,7 +181,8 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
179
181
|
accountAddress: senderAddress,
|
|
180
182
|
chainName: this.chainName,
|
|
181
183
|
password,
|
|
182
|
-
signedSessionId
|
|
184
|
+
signedSessionId,
|
|
185
|
+
externalServerKeyShares
|
|
183
186
|
});
|
|
184
187
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
185
188
|
throw new Error('Invalid signature format returned from MPC signing');
|
|
@@ -200,7 +203,7 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
200
203
|
throw error;
|
|
201
204
|
}
|
|
202
205
|
}
|
|
203
|
-
async exportPrivateKey({ accountAddress, password = undefined, signedSessionId }) {
|
|
206
|
+
async exportPrivateKey({ accountAddress, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
204
207
|
await this.verifyPassword({
|
|
205
208
|
accountAddress,
|
|
206
209
|
password,
|
|
@@ -211,7 +214,8 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
211
214
|
accountAddress,
|
|
212
215
|
chainName: this.chainName,
|
|
213
216
|
password,
|
|
214
|
-
signedSessionId
|
|
217
|
+
signedSessionId,
|
|
218
|
+
externalServerKeyShares
|
|
215
219
|
});
|
|
216
220
|
return {
|
|
217
221
|
derivedPrivateKey
|
package/index.esm.js
CHANGED
|
@@ -98,6 +98,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
98
98
|
signedSessionId
|
|
99
99
|
});
|
|
100
100
|
return {
|
|
101
|
+
walletId: this.walletMap[accountAddress].walletId,
|
|
101
102
|
accountAddress,
|
|
102
103
|
rawPublicKey,
|
|
103
104
|
publicKeyHex,
|
|
@@ -108,7 +109,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
108
109
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
|
|
112
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
112
113
|
await this.verifyPassword({
|
|
113
114
|
accountAddress,
|
|
114
115
|
password,
|
|
@@ -132,7 +133,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
132
133
|
accountAddress: accountAddress,
|
|
133
134
|
chainName: this.chainName,
|
|
134
135
|
password,
|
|
135
|
-
signedSessionId
|
|
136
|
+
signedSessionId,
|
|
137
|
+
externalServerKeyShares
|
|
136
138
|
});
|
|
137
139
|
// Serialize the signature
|
|
138
140
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
@@ -159,7 +161,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
159
161
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId }) {
|
|
164
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
163
165
|
await this.verifyPassword({
|
|
164
166
|
accountAddress: senderAddress,
|
|
165
167
|
password,
|
|
@@ -177,7 +179,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
177
179
|
accountAddress: senderAddress,
|
|
178
180
|
chainName: this.chainName,
|
|
179
181
|
password,
|
|
180
|
-
signedSessionId
|
|
182
|
+
signedSessionId,
|
|
183
|
+
externalServerKeyShares
|
|
181
184
|
});
|
|
182
185
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
183
186
|
throw new Error('Invalid signature format returned from MPC signing');
|
|
@@ -198,7 +201,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
198
201
|
throw error;
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
|
-
async exportPrivateKey({ accountAddress, password = undefined, signedSessionId }) {
|
|
204
|
+
async exportPrivateKey({ accountAddress, password = undefined, signedSessionId, externalServerKeyShares }) {
|
|
202
205
|
await this.verifyPassword({
|
|
203
206
|
accountAddress,
|
|
204
207
|
password,
|
|
@@ -209,7 +212,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
209
212
|
accountAddress,
|
|
210
213
|
chainName: this.chainName,
|
|
211
214
|
password,
|
|
212
|
-
signedSessionId
|
|
215
|
+
signedSessionId,
|
|
216
|
+
externalServerKeyShares
|
|
213
217
|
});
|
|
214
218
|
return {
|
|
215
219
|
derivedPrivateKey
|
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.123",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/node": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/node": "0.0.123"
|
|
7
7
|
},
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
package/src/client/client.d.ts
CHANGED
|
@@ -17,28 +17,32 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
17
17
|
publicKeyHex: string;
|
|
18
18
|
rawPublicKey: EcdsaPublicKey | Uint8Array | undefined;
|
|
19
19
|
externalServerKeyShares: ServerKeyShare[];
|
|
20
|
+
walletId: string;
|
|
20
21
|
}>;
|
|
21
|
-
signMessage({ message, accountAddress, password, signedSessionId, }: {
|
|
22
|
+
signMessage({ message, accountAddress, password, signedSessionId, externalServerKeyShares, }: {
|
|
22
23
|
message: string;
|
|
23
24
|
accountAddress: string;
|
|
24
25
|
password?: string;
|
|
25
26
|
signedSessionId: string;
|
|
27
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
26
28
|
}): Promise<`0x${string}`>;
|
|
27
29
|
verifyMessageSignature({ accountAddress, message, signature, }: {
|
|
28
30
|
accountAddress: string;
|
|
29
31
|
message: SignableMessage;
|
|
30
32
|
signature: any;
|
|
31
33
|
}): Promise<boolean>;
|
|
32
|
-
signTransaction({ senderAddress, transaction, password, signedSessionId, }: {
|
|
34
|
+
signTransaction({ senderAddress, transaction, password, signedSessionId, externalServerKeyShares, }: {
|
|
33
35
|
senderAddress: string;
|
|
34
36
|
transaction: TransactionSerializable;
|
|
35
37
|
password?: string;
|
|
36
38
|
signedSessionId: string;
|
|
39
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
37
40
|
}): Promise<string>;
|
|
38
|
-
exportPrivateKey({ accountAddress, password, signedSessionId, }: {
|
|
41
|
+
exportPrivateKey({ accountAddress, password, signedSessionId, externalServerKeyShares, }: {
|
|
39
42
|
accountAddress: string;
|
|
40
43
|
password?: string;
|
|
41
44
|
signedSessionId: string;
|
|
45
|
+
externalServerKeyShares: ServerKeyShare[];
|
|
42
46
|
}): Promise<{
|
|
43
47
|
derivedPrivateKey: string | undefined;
|
|
44
48
|
}>;
|
|
@@ -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,EACP,eAAe,GAChB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,SAAS,CAAC;QACtD,uBAAuB,EAAE,cAAc,EAAE,CAAC;
|
|
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,EACP,e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