@dynamic-labs-wallet/sui 0.0.188 → 0.0.190
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 +4 -1
- package/index.esm.js +4 -1
- package/package.json +2 -2
- package/src/client/client.d.ts +2 -1
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -291,7 +291,7 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
291
291
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
292
292
|
* @param password The password for encrypted backup shares
|
|
293
293
|
* @returns The account address, raw public key, and client key shares
|
|
294
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, signedSessionId, onError }) {
|
|
294
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, signedSessionId, onError, publicAddressCheck }) {
|
|
295
295
|
try {
|
|
296
296
|
let ceremonyCeremonyCompleteResolver;
|
|
297
297
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -299,6 +299,9 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
299
299
|
});
|
|
300
300
|
const { privateKey: formattedPrivateKey, privateKeyBytes } = await this.convertSuiPrivateKey(privateKey);
|
|
301
301
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKeyBytes);
|
|
302
|
+
if (publicAddressCheck && publicKey !== publicAddressCheck) {
|
|
303
|
+
throw new Error(`Public address mismatch: derived address ${publicKey} !== public address ${publicAddressCheck}`);
|
|
304
|
+
}
|
|
302
305
|
const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
|
|
303
306
|
chainName,
|
|
304
307
|
privateKey: formattedPrivateKey,
|
package/index.esm.js
CHANGED
|
@@ -289,7 +289,7 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
289
289
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
290
290
|
* @param password The password for encrypted backup shares
|
|
291
291
|
* @returns The account address, raw public key, and client key shares
|
|
292
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, signedSessionId, onError }) {
|
|
292
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, signedSessionId, onError, publicAddressCheck }) {
|
|
293
293
|
try {
|
|
294
294
|
let ceremonyCeremonyCompleteResolver;
|
|
295
295
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -297,6 +297,9 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
297
297
|
});
|
|
298
298
|
const { privateKey: formattedPrivateKey, privateKeyBytes } = await this.convertSuiPrivateKey(privateKey);
|
|
299
299
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKeyBytes);
|
|
300
|
+
if (publicAddressCheck && publicKey !== publicAddressCheck) {
|
|
301
|
+
throw new Error(`Public address mismatch: derived address ${publicKey} !== public address ${publicAddressCheck}`);
|
|
302
|
+
}
|
|
300
303
|
const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
|
|
301
304
|
chainName,
|
|
302
305
|
privateKey: formattedPrivateKey,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/sui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.190",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/browser": "0.0.190",
|
|
8
8
|
"@mysten/sui": "1.26.0",
|
|
9
9
|
"@noble/hashes": "1.7.1",
|
|
10
10
|
"bech32-converting": "^1.0.9",
|
package/src/client/client.d.ts
CHANGED
|
@@ -73,13 +73,14 @@ export declare class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
73
73
|
* @param password The password for encrypted backup shares
|
|
74
74
|
* @returns The account address, raw public key, and client key shares
|
|
75
75
|
*/
|
|
76
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, signedSessionId, onError, }: {
|
|
76
|
+
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, signedSessionId, onError, publicAddressCheck, }: {
|
|
77
77
|
privateKey: string;
|
|
78
78
|
chainName: string;
|
|
79
79
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
80
80
|
password?: string;
|
|
81
81
|
signedSessionId: string;
|
|
82
82
|
onError?: (error: Error) => void;
|
|
83
|
+
publicAddressCheck?: string;
|
|
83
84
|
}): Promise<{
|
|
84
85
|
accountAddress: string;
|
|
85
86
|
rawPublicKey: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,mBAAmB,EACnB,KAAK,wBAAwB,EAW7B,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAWtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,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,EACV,gBAAgB,GACjB,EAAE,wBAAwB;IAerB,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,CAA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