@dynamic-labs-wallet/node-svm 0.0.0-beta.291.7 → 0.0.0-beta.292.0
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 +9 -14
- package/index.esm.js +9 -14
- package/package.json +2 -2
- package/src/client/client.d.ts +10 -13
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -61,7 +61,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
61
61
|
*
|
|
62
62
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
63
63
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
64
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError,
|
|
64
|
+
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
65
65
|
try {
|
|
66
66
|
let ceremonyCeremonyCompleteResolver;
|
|
67
67
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -103,7 +103,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
103
103
|
accountAddress,
|
|
104
104
|
externalServerKeyShares,
|
|
105
105
|
password,
|
|
106
|
-
|
|
106
|
+
backUpToClientShareService
|
|
107
107
|
});
|
|
108
108
|
return {
|
|
109
109
|
accountAddress,
|
|
@@ -131,12 +131,11 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
131
131
|
* @param message The message to sign (Uint8Array)
|
|
132
132
|
* @param accountAddress Solana address (base58 encoded)
|
|
133
133
|
* @param password The password for encrypted backup shares
|
|
134
|
-
*/ async signMessage({ message, accountAddress, password = undefined,
|
|
134
|
+
*/ async signMessage({ message, accountAddress, password = undefined, externalServerKeyShares }) {
|
|
135
135
|
await this.verifyPassword({
|
|
136
136
|
accountAddress,
|
|
137
137
|
password,
|
|
138
|
-
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
139
|
-
signedSessionId
|
|
138
|
+
walletOperation: node.WalletOperation.SIGN_MESSAGE
|
|
140
139
|
});
|
|
141
140
|
if (!accountAddress) {
|
|
142
141
|
throw new Error('Account address is required');
|
|
@@ -147,7 +146,6 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
147
146
|
accountAddress: accountAddress,
|
|
148
147
|
chainName: this.chainName,
|
|
149
148
|
password,
|
|
150
|
-
signedSessionId,
|
|
151
149
|
externalServerKeyShares
|
|
152
150
|
});
|
|
153
151
|
// Use PublicKey to encode signature
|
|
@@ -159,12 +157,11 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
159
157
|
}
|
|
160
158
|
}
|
|
161
159
|
//todo:should txn just be a string?
|
|
162
|
-
async signTransaction({ senderAddress, transaction, password = undefined,
|
|
160
|
+
async signTransaction({ senderAddress, transaction, password = undefined, externalServerKeyShares }) {
|
|
163
161
|
await this.verifyPassword({
|
|
164
162
|
accountAddress: senderAddress,
|
|
165
163
|
password,
|
|
166
|
-
walletOperation: node.WalletOperation.SIGN_TRANSACTION
|
|
167
|
-
signedSessionId
|
|
164
|
+
walletOperation: node.WalletOperation.SIGN_TRANSACTION
|
|
168
165
|
});
|
|
169
166
|
try {
|
|
170
167
|
let messageToSign;
|
|
@@ -182,7 +179,6 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
182
179
|
accountAddress: senderAddress,
|
|
183
180
|
chainName: this.chainName,
|
|
184
181
|
password,
|
|
185
|
-
signedSessionId,
|
|
186
182
|
externalServerKeyShares
|
|
187
183
|
});
|
|
188
184
|
if (!signatureEd25519) {
|
|
@@ -209,12 +205,11 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
209
205
|
* @param accountAddress The account address to export the private key for
|
|
210
206
|
* @param password The password for encrypted backup shares
|
|
211
207
|
* @returns The private key
|
|
212
|
-
*/ async exportPrivateKey({ accountAddress, password = undefined,
|
|
208
|
+
*/ async exportPrivateKey({ accountAddress, password = undefined, externalServerKeyShares }) {
|
|
213
209
|
const { derivedPrivateKey } = await this.exportKey({
|
|
214
210
|
accountAddress,
|
|
215
211
|
chainName: this.chainName,
|
|
216
212
|
password,
|
|
217
|
-
signedSessionId,
|
|
218
213
|
externalServerKeyShares
|
|
219
214
|
});
|
|
220
215
|
if (!derivedPrivateKey) {
|
|
@@ -264,7 +259,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
264
259
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
265
260
|
* @param password The password for encrypted backup shares
|
|
266
261
|
* @returns The account address, raw public key, and client key shares
|
|
267
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError,
|
|
262
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
268
263
|
let ceremonyCeremonyCompleteResolver;
|
|
269
264
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
270
265
|
ceremonyCeremonyCompleteResolver = resolve;
|
|
@@ -302,7 +297,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
302
297
|
accountAddress,
|
|
303
298
|
externalServerKeyShares,
|
|
304
299
|
password,
|
|
305
|
-
|
|
300
|
+
backUpToClientShareService
|
|
306
301
|
});
|
|
307
302
|
return {
|
|
308
303
|
accountAddress,
|
package/index.esm.js
CHANGED
|
@@ -59,7 +59,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
59
59
|
*
|
|
60
60
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
61
61
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
62
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError,
|
|
62
|
+
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
63
63
|
try {
|
|
64
64
|
let ceremonyCeremonyCompleteResolver;
|
|
65
65
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -101,7 +101,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
101
101
|
accountAddress,
|
|
102
102
|
externalServerKeyShares,
|
|
103
103
|
password,
|
|
104
|
-
|
|
104
|
+
backUpToClientShareService
|
|
105
105
|
});
|
|
106
106
|
return {
|
|
107
107
|
accountAddress,
|
|
@@ -129,12 +129,11 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
129
129
|
* @param message The message to sign (Uint8Array)
|
|
130
130
|
* @param accountAddress Solana address (base58 encoded)
|
|
131
131
|
* @param password The password for encrypted backup shares
|
|
132
|
-
*/ async signMessage({ message, accountAddress, password = undefined,
|
|
132
|
+
*/ async signMessage({ message, accountAddress, password = undefined, externalServerKeyShares }) {
|
|
133
133
|
await this.verifyPassword({
|
|
134
134
|
accountAddress,
|
|
135
135
|
password,
|
|
136
|
-
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
137
|
-
signedSessionId
|
|
136
|
+
walletOperation: WalletOperation.SIGN_MESSAGE
|
|
138
137
|
});
|
|
139
138
|
if (!accountAddress) {
|
|
140
139
|
throw new Error('Account address is required');
|
|
@@ -145,7 +144,6 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
145
144
|
accountAddress: accountAddress,
|
|
146
145
|
chainName: this.chainName,
|
|
147
146
|
password,
|
|
148
|
-
signedSessionId,
|
|
149
147
|
externalServerKeyShares
|
|
150
148
|
});
|
|
151
149
|
// Use PublicKey to encode signature
|
|
@@ -157,12 +155,11 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
157
155
|
}
|
|
158
156
|
}
|
|
159
157
|
//todo:should txn just be a string?
|
|
160
|
-
async signTransaction({ senderAddress, transaction, password = undefined,
|
|
158
|
+
async signTransaction({ senderAddress, transaction, password = undefined, externalServerKeyShares }) {
|
|
161
159
|
await this.verifyPassword({
|
|
162
160
|
accountAddress: senderAddress,
|
|
163
161
|
password,
|
|
164
|
-
walletOperation: WalletOperation.SIGN_TRANSACTION
|
|
165
|
-
signedSessionId
|
|
162
|
+
walletOperation: WalletOperation.SIGN_TRANSACTION
|
|
166
163
|
});
|
|
167
164
|
try {
|
|
168
165
|
let messageToSign;
|
|
@@ -180,7 +177,6 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
180
177
|
accountAddress: senderAddress,
|
|
181
178
|
chainName: this.chainName,
|
|
182
179
|
password,
|
|
183
|
-
signedSessionId,
|
|
184
180
|
externalServerKeyShares
|
|
185
181
|
});
|
|
186
182
|
if (!signatureEd25519) {
|
|
@@ -207,12 +203,11 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
207
203
|
* @param accountAddress The account address to export the private key for
|
|
208
204
|
* @param password The password for encrypted backup shares
|
|
209
205
|
* @returns The private key
|
|
210
|
-
*/ async exportPrivateKey({ accountAddress, password = undefined,
|
|
206
|
+
*/ async exportPrivateKey({ accountAddress, password = undefined, externalServerKeyShares }) {
|
|
211
207
|
const { derivedPrivateKey } = await this.exportKey({
|
|
212
208
|
accountAddress,
|
|
213
209
|
chainName: this.chainName,
|
|
214
210
|
password,
|
|
215
|
-
signedSessionId,
|
|
216
211
|
externalServerKeyShares
|
|
217
212
|
});
|
|
218
213
|
if (!derivedPrivateKey) {
|
|
@@ -262,7 +257,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
262
257
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
263
258
|
* @param password The password for encrypted backup shares
|
|
264
259
|
* @returns The account address, raw public key, and client key shares
|
|
265
|
-
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError,
|
|
260
|
+
*/ async importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password = undefined, onError, backUpToClientShareService = false }) {
|
|
266
261
|
let ceremonyCeremonyCompleteResolver;
|
|
267
262
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
268
263
|
ceremonyCeremonyCompleteResolver = resolve;
|
|
@@ -300,7 +295,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
300
295
|
accountAddress,
|
|
301
296
|
externalServerKeyShares,
|
|
302
297
|
password,
|
|
303
|
-
|
|
298
|
+
backUpToClientShareService
|
|
304
299
|
});
|
|
305
300
|
return {
|
|
306
301
|
accountAddress,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-svm",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.292.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/node": "0.0.0-beta.
|
|
6
|
+
"@dynamic-labs-wallet/node": "0.0.0-beta.292.0",
|
|
7
7
|
"@solana/web3.js": "^1.98.2"
|
|
8
8
|
},
|
|
9
9
|
"publishConfig": {
|
package/src/client/client.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
15
15
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
16
16
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
17
17
|
*/
|
|
18
|
-
createWalletAccount({ thresholdSignatureScheme, password, onError,
|
|
18
|
+
createWalletAccount({ thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
19
19
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
20
20
|
password?: string;
|
|
21
21
|
onError?: (error: Error) => void;
|
|
22
|
-
|
|
22
|
+
backUpToClientShareService?: boolean;
|
|
23
23
|
}): Promise<{
|
|
24
24
|
accountAddress: string;
|
|
25
25
|
rawPublicKey: Uint8Array | string;
|
|
@@ -35,19 +35,17 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
35
35
|
* @param accountAddress Solana address (base58 encoded)
|
|
36
36
|
* @param password The password for encrypted backup shares
|
|
37
37
|
*/
|
|
38
|
-
signMessage({ message, accountAddress, password,
|
|
38
|
+
signMessage({ message, accountAddress, password, externalServerKeyShares, }: {
|
|
39
39
|
message: string;
|
|
40
40
|
accountAddress: string;
|
|
41
41
|
password?: string;
|
|
42
|
-
|
|
43
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
42
|
+
externalServerKeyShares?: ServerKeyShare[];
|
|
44
43
|
}): Promise<string>;
|
|
45
|
-
signTransaction({ senderAddress, transaction, password,
|
|
44
|
+
signTransaction({ senderAddress, transaction, password, externalServerKeyShares, }: {
|
|
46
45
|
senderAddress: string;
|
|
47
46
|
transaction: VersionedTransaction | Transaction;
|
|
48
47
|
password?: string;
|
|
49
|
-
|
|
50
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
48
|
+
externalServerKeyShares?: ServerKeyShare[];
|
|
51
49
|
}): Promise<VersionedTransaction | Transaction>;
|
|
52
50
|
/**
|
|
53
51
|
* Exports the private key for a given account address
|
|
@@ -56,11 +54,10 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
56
54
|
* @param password The password for encrypted backup shares
|
|
57
55
|
* @returns The private key
|
|
58
56
|
*/
|
|
59
|
-
exportPrivateKey({ accountAddress, password,
|
|
57
|
+
exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
|
|
60
58
|
accountAddress: string;
|
|
61
59
|
password?: string;
|
|
62
|
-
|
|
63
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
60
|
+
externalServerKeyShares?: ServerKeyShare[];
|
|
64
61
|
}): Promise<string>;
|
|
65
62
|
/**
|
|
66
63
|
* Exports the private key for a given account address
|
|
@@ -92,13 +89,13 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
92
89
|
* @param password The password for encrypted backup shares
|
|
93
90
|
* @returns The account address, raw public key, and client key shares
|
|
94
91
|
*/
|
|
95
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError,
|
|
92
|
+
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
96
93
|
privateKey: string;
|
|
97
94
|
chainName: string;
|
|
98
95
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
99
96
|
password?: string;
|
|
100
97
|
onError?: (error: Error) => void;
|
|
101
|
-
|
|
98
|
+
backUpToClientShareService?: boolean;
|
|
102
99
|
}): Promise<{
|
|
103
100
|
accountAddress: string;
|
|
104
101
|
rawPublicKey: Uint8Array | string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,WAAW,EACX,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAIzB,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,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;IAQD;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,WAAW,EACX,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAIzB,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EA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