@dynamic-labs-wallet/evm 0.0.82 → 0.0.83

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 CHANGED
@@ -56,7 +56,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
56
56
  transport: viem.http(rpcUrl)
57
57
  });
58
58
  }
59
- async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
59
+ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
60
60
  try {
61
61
  // Create a promise that will resolve when the ceremony is complete
62
62
  let ceremonyCeremonyCompleteResolver;
@@ -101,7 +101,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
101
101
  await this.storeEncryptedBackupByWalletWithRetry({
102
102
  accountAddress,
103
103
  clientKeyShares,
104
- password
104
+ password,
105
+ signedSessionId
105
106
  });
106
107
  return {
107
108
  accountAddress,
@@ -131,7 +132,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
131
132
  message: formattedMessage,
132
133
  accountAddress: accountAddress,
133
134
  chainName: this.chainName,
134
- password
135
+ password,
136
+ signedSessionId
135
137
  });
136
138
  // Serialize the signature
137
139
  const serializedSignature = serializeECDSASignature(signatureEcdsa);
@@ -175,7 +177,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
175
177
  message: serializedTxBytes,
176
178
  accountAddress: senderAddress,
177
179
  chainName: this.chainName,
178
- password
180
+ password,
181
+ signedSessionId
179
182
  });
180
183
  if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
181
184
  throw new Error('Invalid signature format returned from MPC signing');
@@ -218,7 +221,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
218
221
  const { derivedPrivateKey } = await this.exportKey({
219
222
  accountAddress,
220
223
  chainName: this.chainName,
221
- password
224
+ password,
225
+ signedSessionId
222
226
  });
223
227
  return derivedPrivateKey;
224
228
  }
@@ -232,7 +236,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
232
236
  derivedPrivateKey
233
237
  };
234
238
  }
235
- async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
239
+ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
236
240
  // TODO: validate private key for EVM
237
241
  const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
238
242
  chainName,
@@ -268,7 +272,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
268
272
  await this.storeEncryptedBackupByWalletWithRetry({
269
273
  accountAddress,
270
274
  clientKeyShares,
271
- password
275
+ password,
276
+ signedSessionId
272
277
  });
273
278
  return {
274
279
  accountAddress,
package/index.esm.js CHANGED
@@ -54,7 +54,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
54
54
  transport: http(rpcUrl)
55
55
  });
56
56
  }
57
- async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError }) {
57
+ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
58
58
  try {
59
59
  // Create a promise that will resolve when the ceremony is complete
60
60
  let ceremonyCeremonyCompleteResolver;
@@ -99,7 +99,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
99
99
  await this.storeEncryptedBackupByWalletWithRetry({
100
100
  accountAddress,
101
101
  clientKeyShares,
102
- password
102
+ password,
103
+ signedSessionId
103
104
  });
104
105
  return {
105
106
  accountAddress,
@@ -129,7 +130,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
129
130
  message: formattedMessage,
130
131
  accountAddress: accountAddress,
131
132
  chainName: this.chainName,
132
- password
133
+ password,
134
+ signedSessionId
133
135
  });
134
136
  // Serialize the signature
135
137
  const serializedSignature = serializeECDSASignature(signatureEcdsa);
@@ -173,7 +175,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
173
175
  message: serializedTxBytes,
174
176
  accountAddress: senderAddress,
175
177
  chainName: this.chainName,
176
- password
178
+ password,
179
+ signedSessionId
177
180
  });
178
181
  if (!('r' in signatureEcdsa && 's' in signatureEcdsa && 'v' in signatureEcdsa)) {
179
182
  throw new Error('Invalid signature format returned from MPC signing');
@@ -216,7 +219,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
216
219
  const { derivedPrivateKey } = await this.exportKey({
217
220
  accountAddress,
218
221
  chainName: this.chainName,
219
- password
222
+ password,
223
+ signedSessionId
220
224
  });
221
225
  return derivedPrivateKey;
222
226
  }
@@ -230,7 +234,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
230
234
  derivedPrivateKey
231
235
  };
232
236
  }
233
- async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
237
+ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, signedSessionId }) {
234
238
  // TODO: validate private key for EVM
235
239
  const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
236
240
  chainName,
@@ -266,7 +270,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
266
270
  await this.storeEncryptedBackupByWalletWithRetry({
267
271
  accountAddress,
268
272
  clientKeyShares,
269
- password
273
+ password,
274
+ signedSessionId
270
275
  });
271
276
  return {
272
277
  accountAddress,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/evm",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
- "@dynamic-labs-wallet/browser": "0.0.82"
6
+ "@dynamic-labs-wallet/browser": "0.0.83"
7
7
  },
8
8
  "peerDependencies": {
9
9
  "viem": "^2.22.1"
@@ -7,10 +7,11 @@ 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, signedSessionId, }: {
11
11
  thresholdSignatureScheme: ThresholdSignatureScheme;
12
12
  password?: string;
13
13
  onError?: (error: Error) => void;
14
+ signedSessionId?: string;
14
15
  }): Promise<{
15
16
  accountAddress: string;
16
17
  publicKeyHex: string;
@@ -50,12 +51,13 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
50
51
  }): Promise<{
51
52
  derivedPrivateKey: string | undefined;
52
53
  }>;
53
- importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, }: {
54
+ importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, signedSessionId, }: {
54
55
  privateKey: string;
55
56
  chainName: string;
56
57
  thresholdSignatureScheme: ThresholdSignatureScheme;
57
58
  password?: string;
58
59
  onError?: (error: Error) => void;
60
+ signedSessionId?: string;
59
61
  }): Promise<{
60
62
  accountAddress: string;
61
63
  publicKeyHex: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EAEd,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EAIzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,KAAK,EAEV,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE7B,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,GACN,EAAE,wBAAwB;IAW3B,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,GACR,EAAE;QACD,wBAAwB,EAAE,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