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