@dynamic-labs-wallet/evm 0.0.71 → 0.0.73
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 +14 -4
- package/index.esm.js +14 -4
- 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
|
@@ -92,6 +92,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
92
92
|
rawPublicKey: rawPublicKey
|
|
93
93
|
});
|
|
94
94
|
// Update client key shares in wallet map
|
|
95
|
+
// warning: this might result in race condition if `onCeremonyComplete` executes at the same time
|
|
96
|
+
// TODO: remove this once iframe handling for secret shares is implemented
|
|
95
97
|
await this.setClientKeySharesToLocalStorage({
|
|
96
98
|
accountAddress,
|
|
97
99
|
clientKeyShares,
|
|
@@ -106,7 +108,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
106
108
|
return {
|
|
107
109
|
accountAddress,
|
|
108
110
|
rawPublicKey,
|
|
109
|
-
publicKeyHex
|
|
111
|
+
publicKeyHex,
|
|
112
|
+
clientKeyShares
|
|
110
113
|
};
|
|
111
114
|
} catch (error) {
|
|
112
115
|
this.logger.error(ERROR_CREATE_WALLET_ACCOUNT, error);
|
|
@@ -206,7 +209,7 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
206
209
|
publicKeyHex
|
|
207
210
|
};
|
|
208
211
|
}
|
|
209
|
-
async exportPrivateKey({ accountAddress, password = undefined }) {
|
|
212
|
+
async exportPrivateKey({ accountAddress, displayContainer, password = undefined }) {
|
|
210
213
|
await this.verifyPassword({
|
|
211
214
|
accountAddress,
|
|
212
215
|
password,
|
|
@@ -217,7 +220,11 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
217
220
|
chainName: this.chainName,
|
|
218
221
|
password
|
|
219
222
|
});
|
|
220
|
-
|
|
223
|
+
// Display the private key in the container via iframe
|
|
224
|
+
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
225
|
+
container: displayContainer
|
|
226
|
+
});
|
|
227
|
+
iframeDisplay.displayPrivateKey(derivedPrivateKey);
|
|
221
228
|
}
|
|
222
229
|
async offlineExportPrivateKey({ keyShares, derivationPath }) {
|
|
223
230
|
const { derivedPrivateKey } = await this.offlineExportKey({
|
|
@@ -256,6 +263,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
256
263
|
rawPublicKey: rawPublicKey
|
|
257
264
|
});
|
|
258
265
|
// Update client key shares in wallet map
|
|
266
|
+
// warning: this might result in race condition if `onCeremonyComplete` executes at the same time
|
|
267
|
+
// TODO: remove this once iframe handling for secret shares is implemented
|
|
259
268
|
await this.setClientKeySharesToLocalStorage({
|
|
260
269
|
accountAddress,
|
|
261
270
|
clientKeyShares,
|
|
@@ -270,7 +279,8 @@ class DynamicEvmWalletClient extends browser.DynamicWalletClient {
|
|
|
270
279
|
return {
|
|
271
280
|
accountAddress,
|
|
272
281
|
rawPublicKey,
|
|
273
|
-
publicKeyHex
|
|
282
|
+
publicKeyHex,
|
|
283
|
+
clientKeyShares
|
|
274
284
|
};
|
|
275
285
|
}
|
|
276
286
|
async getEvmWallets() {
|
package/index.esm.js
CHANGED
|
@@ -90,6 +90,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
90
90
|
rawPublicKey: rawPublicKey
|
|
91
91
|
});
|
|
92
92
|
// Update client key shares in wallet map
|
|
93
|
+
// warning: this might result in race condition if `onCeremonyComplete` executes at the same time
|
|
94
|
+
// TODO: remove this once iframe handling for secret shares is implemented
|
|
93
95
|
await this.setClientKeySharesToLocalStorage({
|
|
94
96
|
accountAddress,
|
|
95
97
|
clientKeyShares,
|
|
@@ -104,7 +106,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
104
106
|
return {
|
|
105
107
|
accountAddress,
|
|
106
108
|
rawPublicKey,
|
|
107
|
-
publicKeyHex
|
|
109
|
+
publicKeyHex,
|
|
110
|
+
clientKeyShares
|
|
108
111
|
};
|
|
109
112
|
} catch (error) {
|
|
110
113
|
this.logger.error(ERROR_CREATE_WALLET_ACCOUNT, error);
|
|
@@ -204,7 +207,7 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
204
207
|
publicKeyHex
|
|
205
208
|
};
|
|
206
209
|
}
|
|
207
|
-
async exportPrivateKey({ accountAddress, password = undefined }) {
|
|
210
|
+
async exportPrivateKey({ accountAddress, displayContainer, password = undefined }) {
|
|
208
211
|
await this.verifyPassword({
|
|
209
212
|
accountAddress,
|
|
210
213
|
password,
|
|
@@ -215,7 +218,11 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
215
218
|
chainName: this.chainName,
|
|
216
219
|
password
|
|
217
220
|
});
|
|
218
|
-
|
|
221
|
+
// Display the private key in the container via iframe
|
|
222
|
+
const { iframeDisplay } = await this.initializeIframeDisplayForContainer({
|
|
223
|
+
container: displayContainer
|
|
224
|
+
});
|
|
225
|
+
iframeDisplay.displayPrivateKey(derivedPrivateKey);
|
|
219
226
|
}
|
|
220
227
|
async offlineExportPrivateKey({ keyShares, derivationPath }) {
|
|
221
228
|
const { derivedPrivateKey } = await this.offlineExportKey({
|
|
@@ -254,6 +261,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
254
261
|
rawPublicKey: rawPublicKey
|
|
255
262
|
});
|
|
256
263
|
// Update client key shares in wallet map
|
|
264
|
+
// warning: this might result in race condition if `onCeremonyComplete` executes at the same time
|
|
265
|
+
// TODO: remove this once iframe handling for secret shares is implemented
|
|
257
266
|
await this.setClientKeySharesToLocalStorage({
|
|
258
267
|
accountAddress,
|
|
259
268
|
clientKeyShares,
|
|
@@ -268,7 +277,8 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
268
277
|
return {
|
|
269
278
|
accountAddress,
|
|
270
279
|
rawPublicKey,
|
|
271
|
-
publicKeyHex
|
|
280
|
+
publicKeyHex,
|
|
281
|
+
clientKeyShares
|
|
272
282
|
};
|
|
273
283
|
}
|
|
274
284
|
async getEvmWallets() {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/evm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/browser": "0.0.73"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
9
|
"viem": "^2.22.1"
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicWalletClient, EcdsaKeygenResult, EcdsaPublicKey, Ed25519KeygenResult, ThresholdSignatureScheme, DynamicWalletClientProps } from '@dynamic-labs-wallet/browser';
|
|
1
|
+
import { ClientKeyShare, DynamicWalletClient, EcdsaKeygenResult, EcdsaPublicKey, Ed25519KeygenResult, ThresholdSignatureScheme, DynamicWalletClientProps } from '@dynamic-labs-wallet/browser';
|
|
2
2
|
import { type PublicClient, type Chain, type SignableMessage, type TransactionSerializable } from 'viem';
|
|
3
3
|
export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
4
4
|
readonly chainName = "EVM";
|
|
@@ -15,6 +15,7 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
15
15
|
accountAddress: string;
|
|
16
16
|
publicKeyHex: string;
|
|
17
17
|
rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
|
|
18
|
+
clientKeyShares: ClientKeyShare[];
|
|
18
19
|
}>;
|
|
19
20
|
signMessage({ message, accountAddress, password, }: {
|
|
20
21
|
message: string;
|
|
@@ -37,10 +38,11 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
37
38
|
accountAddress: `0x${string}`;
|
|
38
39
|
publicKeyHex: any;
|
|
39
40
|
};
|
|
40
|
-
exportPrivateKey({ accountAddress, password, }: {
|
|
41
|
+
exportPrivateKey({ accountAddress, displayContainer, password, }: {
|
|
41
42
|
accountAddress: string;
|
|
43
|
+
displayContainer: HTMLElement;
|
|
42
44
|
password?: string;
|
|
43
|
-
}): Promise<
|
|
45
|
+
}): Promise<void>;
|
|
44
46
|
offlineExportPrivateKey({ keyShares, derivationPath, }: {
|
|
45
47
|
keyShares: (EcdsaKeygenResult | Ed25519KeygenResult)[];
|
|
46
48
|
derivationPath?: string;
|
|
@@ -57,6 +59,7 @@ export declare class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
57
59
|
accountAddress: string;
|
|
58
60
|
publicKeyHex: string;
|
|
59
61
|
rawPublicKey: EcdsaPublicKey | Uint8Array | string | undefined;
|
|
62
|
+
clientKeyShares: ClientKeyShare[];
|
|
60
63
|
}>;
|
|
61
64
|
getEvmWallets(): Promise<any>;
|
|
62
65
|
}
|
|
@@ -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,GA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