@dynamic-labs-wallet/svm 0.0.43 → 0.0.44
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 +3 -2
- package/index.esm.js +3 -2
- package/package.json +3 -3
- package/src/svm/svm.d.ts +2 -1
- package/src/svm/svm.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -226,14 +226,15 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
226
226
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
227
227
|
* @param password The password for encrypted backup shares
|
|
228
228
|
* @returns The account address, raw public key, and client key shares
|
|
229
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined }) {
|
|
229
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
230
230
|
//get public key from private key
|
|
231
231
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKey);
|
|
232
232
|
const formattedPrivateKey = await this.decodePrivateKeyForSolana(privateKey);
|
|
233
233
|
const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
|
|
234
234
|
chainName,
|
|
235
235
|
privateKey: formattedPrivateKey,
|
|
236
|
-
thresholdSignatureScheme
|
|
236
|
+
thresholdSignatureScheme,
|
|
237
|
+
onError
|
|
237
238
|
});
|
|
238
239
|
if (!rawPublicKey || !clientKeyShares) {
|
|
239
240
|
throw new Error('Error creating wallet account');
|
package/index.esm.js
CHANGED
|
@@ -224,14 +224,15 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
224
224
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
225
225
|
* @param password The password for encrypted backup shares
|
|
226
226
|
* @returns The account address, raw public key, and client key shares
|
|
227
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined }) {
|
|
227
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError }) {
|
|
228
228
|
//get public key from private key
|
|
229
229
|
const publicKey = this.getPublicKeyFromPrivateKey(privateKey);
|
|
230
230
|
const formattedPrivateKey = await this.decodePrivateKeyForSolana(privateKey);
|
|
231
231
|
const { rawPublicKey, clientKeyShares } = await this.importRawPrivateKey({
|
|
232
232
|
chainName,
|
|
233
233
|
privateKey: formattedPrivateKey,
|
|
234
|
-
thresholdSignatureScheme
|
|
234
|
+
thresholdSignatureScheme,
|
|
235
|
+
onError
|
|
235
236
|
});
|
|
236
237
|
if (!rawPublicKey || !clientKeyShares) {
|
|
237
238
|
throw new Error('Error creating wallet account');
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/browser": "0.0.44",
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.44",
|
|
8
8
|
"@solana/web3.js": "^1.98.0",
|
|
9
9
|
"bs58": "^6.0.0"
|
|
10
10
|
},
|
package/src/svm/svm.d.ts
CHANGED
|
@@ -86,11 +86,12 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
86
86
|
* @param password The password for encrypted backup shares
|
|
87
87
|
* @returns The account address, raw public key, and client key shares
|
|
88
88
|
*/
|
|
89
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, }: {
|
|
89
|
+
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, }: {
|
|
90
90
|
privateKey: string;
|
|
91
91
|
chainName: string;
|
|
92
92
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
93
93
|
password?: string;
|
|
94
|
+
onError?: (error: Error) => void;
|
|
94
95
|
}): Promise<{
|
|
95
96
|
accountAddress: string;
|
|
96
97
|
rawPublicKey: Uint8Array | undefined;
|
package/src/svm/svm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../src/svm/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAW,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG7E,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B;IASD;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,GACrB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,CAAC;QACzB,eAAe,EAAE,cAAc,EAAE,CAAC;KACnC,CAAC;IAoDI,oBAAoB,CAAC,YAAY,EAAE,UAAU;;;IAOnD;;;;;;OAMG;IACG,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,EACd,QAAoB,GACrB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IA6CK,eAAe,CAAC,EACpB,aAAa,EACb,WAAW,EACX,QAAoB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