@dynamic-labs-wallet/evm 0.0.141 → 0.0.142
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 +11 -11
- package/index.esm.js +11 -11
- package/package.json +2 -2
- package/src/client/client.d.ts +6 -3
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -144,7 +144,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
144
144
|
throw new Error(browser.ERROR_CREATE_WALLET_ACCOUNT);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, context }) {
|
|
147
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, context, onError }) {
|
|
148
148
|
await this.verifyPassword({
|
|
149
149
|
accountAddress,
|
|
150
150
|
password,
|
|
@@ -168,7 +168,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
168
168
|
password,
|
|
169
169
|
signedSessionId,
|
|
170
170
|
mfaToken,
|
|
171
|
-
context: resolvedContext
|
|
171
|
+
context: resolvedContext,
|
|
172
|
+
onError
|
|
172
173
|
});
|
|
173
174
|
// Serialize the signature
|
|
174
175
|
const serializedSignature = serializeECDSASignature(signatureEcdsa, this.logger);
|
|
@@ -195,7 +196,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
195
196
|
throw new Error(browser.ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken }) {
|
|
199
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
199
200
|
await this.verifyPassword({
|
|
200
201
|
accountAddress: senderAddress,
|
|
201
202
|
password,
|
|
@@ -217,7 +218,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
217
218
|
mfaToken,
|
|
218
219
|
context: {
|
|
219
220
|
evmTransaction: mapTransactionToEvmTransaction(transaction)
|
|
220
|
-
}
|
|
221
|
+
},
|
|
222
|
+
onError
|
|
221
223
|
});
|
|
222
224
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
223
225
|
throw new Error('Invalid signature format returned from MPC signing');
|
|
@@ -238,7 +240,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
238
240
|
throw error;
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
|
-
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, mfaToken }) {
|
|
243
|
+
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
242
244
|
await this.verifyPassword({
|
|
243
245
|
accountAddress,
|
|
244
246
|
password,
|
|
@@ -260,7 +262,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
260
262
|
mfaToken,
|
|
261
263
|
context: {
|
|
262
264
|
evmTypedData: typedData
|
|
263
|
-
}
|
|
265
|
+
},
|
|
266
|
+
onError
|
|
264
267
|
});
|
|
265
268
|
const serializedSignature = serializeECDSASignature(signatureEcdsa, this.logger);
|
|
266
269
|
return serializedSignature;
|
|
@@ -320,10 +323,6 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
320
323
|
chainName,
|
|
321
324
|
privateKey: formattedPrivateKey,
|
|
322
325
|
thresholdSignatureScheme,
|
|
323
|
-
onError: (error)=>{
|
|
324
|
-
this.logger.error(browser.ERROR_IMPORT_PRIVATE_KEY, error);
|
|
325
|
-
onError == null ? void 0 : onError(error);
|
|
326
|
-
},
|
|
327
326
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
328
327
|
// update wallet map
|
|
329
328
|
const checksumAddress = viem.getAddress(accountAddress);
|
|
@@ -342,7 +341,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
342
341
|
}
|
|
343
342
|
});
|
|
344
343
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
345
|
-
}
|
|
344
|
+
},
|
|
345
|
+
onError
|
|
346
346
|
});
|
|
347
347
|
// Wait for the ceremony to complete before proceeding
|
|
348
348
|
await ceremonyCompletePromise;
|
package/index.esm.js
CHANGED
|
@@ -142,7 +142,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
142
142
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, context }) {
|
|
145
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, context, onError }) {
|
|
146
146
|
await this.verifyPassword({
|
|
147
147
|
accountAddress,
|
|
148
148
|
password,
|
|
@@ -166,7 +166,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
166
166
|
password,
|
|
167
167
|
signedSessionId,
|
|
168
168
|
mfaToken,
|
|
169
|
-
context: resolvedContext
|
|
169
|
+
context: resolvedContext,
|
|
170
|
+
onError
|
|
170
171
|
});
|
|
171
172
|
// Serialize the signature
|
|
172
173
|
const serializedSignature = serializeECDSASignature(signatureEcdsa, this.logger);
|
|
@@ -193,7 +194,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
193
194
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken }) {
|
|
197
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
197
198
|
await this.verifyPassword({
|
|
198
199
|
accountAddress: senderAddress,
|
|
199
200
|
password,
|
|
@@ -215,7 +216,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
215
216
|
mfaToken,
|
|
216
217
|
context: {
|
|
217
218
|
evmTransaction: mapTransactionToEvmTransaction(transaction)
|
|
218
|
-
}
|
|
219
|
+
},
|
|
220
|
+
onError
|
|
219
221
|
});
|
|
220
222
|
if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
|
|
221
223
|
throw new Error('Invalid signature format returned from MPC signing');
|
|
@@ -236,7 +238,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
236
238
|
throw error;
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
|
-
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, mfaToken }) {
|
|
241
|
+
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
240
242
|
await this.verifyPassword({
|
|
241
243
|
accountAddress,
|
|
242
244
|
password,
|
|
@@ -258,7 +260,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
258
260
|
mfaToken,
|
|
259
261
|
context: {
|
|
260
262
|
evmTypedData: typedData
|
|
261
|
-
}
|
|
263
|
+
},
|
|
264
|
+
onError
|
|
262
265
|
});
|
|
263
266
|
const serializedSignature = serializeECDSASignature(signatureEcdsa, this.logger);
|
|
264
267
|
return serializedSignature;
|
|
@@ -318,10 +321,6 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
318
321
|
chainName,
|
|
319
322
|
privateKey: formattedPrivateKey,
|
|
320
323
|
thresholdSignatureScheme,
|
|
321
|
-
onError: (error)=>{
|
|
322
|
-
this.logger.error(ERROR_IMPORT_PRIVATE_KEY, error);
|
|
323
|
-
onError == null ? void 0 : onError(error);
|
|
324
|
-
},
|
|
325
324
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
326
325
|
// update wallet map
|
|
327
326
|
const checksumAddress = getAddress(accountAddress);
|
|
@@ -340,7 +339,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
340
339
|
}
|
|
341
340
|
});
|
|
342
341
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
343
|
-
}
|
|
342
|
+
},
|
|
343
|
+
onError
|
|
344
344
|
});
|
|
345
345
|
// Wait for the ceremony to complete before proceeding
|
|
346
346
|
await ceremonyCompletePromise;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/evm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.142",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/browser": "0.0.142",
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.758"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
package/src/client/client.d.ts
CHANGED
|
@@ -18,32 +18,35 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
18
18
|
publicKeyHex: string;
|
|
19
19
|
rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
|
|
20
20
|
}>;
|
|
21
|
-
signMessage({ message, accountAddress, password, signedSessionId, mfaToken, context, }: {
|
|
21
|
+
signMessage({ message, accountAddress, password, signedSessionId, mfaToken, context, onError, }: {
|
|
22
22
|
message: string;
|
|
23
23
|
accountAddress: string;
|
|
24
24
|
password?: string;
|
|
25
25
|
signedSessionId: string;
|
|
26
26
|
mfaToken?: string;
|
|
27
27
|
context?: SignMessageContext;
|
|
28
|
+
onError?: (error: Error) => void;
|
|
28
29
|
}): Promise<`0x${string}`>;
|
|
29
30
|
verifyMessageSignature({ accountAddress, message, signature, }: {
|
|
30
31
|
accountAddress: string;
|
|
31
32
|
message: SignableMessage;
|
|
32
33
|
signature: any;
|
|
33
34
|
}): Promise<boolean>;
|
|
34
|
-
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, }: {
|
|
35
|
+
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, onError, }: {
|
|
35
36
|
senderAddress: string;
|
|
36
37
|
transaction: TransactionSerializable;
|
|
37
38
|
password?: string;
|
|
38
39
|
signedSessionId: string;
|
|
39
40
|
mfaToken?: string;
|
|
41
|
+
onError?: (error: Error) => void;
|
|
40
42
|
}): Promise<string>;
|
|
41
|
-
signTypedData({ accountAddress, typedData, password, signedSessionId, mfaToken, }: {
|
|
43
|
+
signTypedData({ accountAddress, typedData, password, signedSessionId, mfaToken, onError, }: {
|
|
42
44
|
accountAddress: string;
|
|
43
45
|
typedData: TypedData;
|
|
44
46
|
password?: string;
|
|
45
47
|
signedSessionId: string;
|
|
46
48
|
mfaToken?: string;
|
|
49
|
+
onError?: (error: Error) => void;
|
|
47
50
|
}): Promise<`0x${string}`>;
|
|
48
51
|
deriveAccountAddress({ rawPublicKey }: {
|
|
49
52
|
rawPublicKey: EcdsaPublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,cAAc,EAEd,mBAAmB,EAUnB,wBAAwB,EAEzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,KAAK,EAIV,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AAYd,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,GACX,EAAE,wBAAwB;IAc3B,sBAAsB,CAAC,EACrB,KAAK,EACL,MAAM,GACP,EAAE;QACD,KAAK,EAAE,KAAK,CAAC;QACb,MAAM,CAAC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