@dynamic-labs-wallet/svm 0.0.215-paolo-1 → 0.0.215
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 +7 -9
- package/index.esm.js +7 -9
- package/package.json +2 -2
- package/src/svm/client.d.ts +4 -7
- package/src/svm/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -21,7 +21,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
21
21
|
*
|
|
22
22
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
23
23
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
24
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId
|
|
24
|
+
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
25
25
|
try {
|
|
26
26
|
let ceremonyCeremonyCompleteResolver;
|
|
27
27
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -39,13 +39,13 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
39
39
|
thresholdSignatureScheme,
|
|
40
40
|
clientKeySharesBackupInfo: browser.getClientKeyShareBackupInfo()
|
|
41
41
|
});
|
|
42
|
-
this.logger.debug('walletMap updated for wallet',
|
|
42
|
+
this.logger.debug('walletMap updated for wallet', {
|
|
43
43
|
context: {
|
|
44
44
|
accountAddress,
|
|
45
45
|
walletId,
|
|
46
46
|
walletMap: this.walletMap
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
});
|
|
49
49
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
@@ -92,7 +92,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
92
92
|
* @param message The message to sign (Uint8Array)
|
|
93
93
|
* @param accountAddress Solana address (base58 encoded)
|
|
94
94
|
* @param password The password for encrypted backup shares
|
|
95
|
-
*/ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError
|
|
95
|
+
*/ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
96
96
|
await this.verifyPassword({
|
|
97
97
|
accountAddress,
|
|
98
98
|
password,
|
|
@@ -113,8 +113,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
113
113
|
context: {
|
|
114
114
|
svmMessage: message
|
|
115
115
|
},
|
|
116
|
-
onError
|
|
117
|
-
traceContext
|
|
116
|
+
onError
|
|
118
117
|
});
|
|
119
118
|
const base58Signature = bs58.encode(signatureEd25519);
|
|
120
119
|
return base58Signature;
|
|
@@ -123,7 +122,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
123
122
|
throw new Error(browser.ERROR_SIGN_MESSAGE);
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError
|
|
125
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
|
|
127
126
|
await this.verifyPassword({
|
|
128
127
|
accountAddress: senderAddress,
|
|
129
128
|
password,
|
|
@@ -143,8 +142,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
143
142
|
context
|
|
144
143
|
});
|
|
145
144
|
const signatureEd25519 = await this.sign(_extends({}, signParams, {
|
|
146
|
-
onError
|
|
147
|
-
traceContext
|
|
145
|
+
onError
|
|
148
146
|
}));
|
|
149
147
|
if (!signatureEd25519) {
|
|
150
148
|
throw new Error('Signature is undefined');
|
package/index.esm.js
CHANGED
|
@@ -19,7 +19,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
19
19
|
*
|
|
20
20
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
21
21
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
22
|
-
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId
|
|
22
|
+
*/ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
|
|
23
23
|
try {
|
|
24
24
|
let ceremonyCeremonyCompleteResolver;
|
|
25
25
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
@@ -37,13 +37,13 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
37
37
|
thresholdSignatureScheme,
|
|
38
38
|
clientKeySharesBackupInfo: getClientKeyShareBackupInfo()
|
|
39
39
|
});
|
|
40
|
-
this.logger.debug('walletMap updated for wallet',
|
|
40
|
+
this.logger.debug('walletMap updated for wallet', {
|
|
41
41
|
context: {
|
|
42
42
|
accountAddress,
|
|
43
43
|
walletId,
|
|
44
44
|
walletMap: this.walletMap
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
});
|
|
47
47
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
@@ -90,7 +90,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
90
90
|
* @param message The message to sign (Uint8Array)
|
|
91
91
|
* @param accountAddress Solana address (base58 encoded)
|
|
92
92
|
* @param password The password for encrypted backup shares
|
|
93
|
-
*/ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError
|
|
93
|
+
*/ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError }) {
|
|
94
94
|
await this.verifyPassword({
|
|
95
95
|
accountAddress,
|
|
96
96
|
password,
|
|
@@ -111,8 +111,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
111
111
|
context: {
|
|
112
112
|
svmMessage: message
|
|
113
113
|
},
|
|
114
|
-
onError
|
|
115
|
-
traceContext
|
|
114
|
+
onError
|
|
116
115
|
});
|
|
117
116
|
const base58Signature = bs58.encode(signatureEd25519);
|
|
118
117
|
return base58Signature;
|
|
@@ -121,7 +120,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
121
120
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError
|
|
123
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
|
|
125
124
|
await this.verifyPassword({
|
|
126
125
|
accountAddress: senderAddress,
|
|
127
126
|
password,
|
|
@@ -141,8 +140,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
141
140
|
context
|
|
142
141
|
});
|
|
143
142
|
const signatureEd25519 = await this.sign(_extends({}, signParams, {
|
|
144
|
-
onError
|
|
145
|
-
traceContext
|
|
143
|
+
onError
|
|
146
144
|
}));
|
|
147
145
|
if (!signatureEd25519) {
|
|
148
146
|
throw new Error('Signature is undefined');
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/svm",
|
|
3
|
-
"version": "0.0.215
|
|
3
|
+
"version": "0.0.215",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/browser": "0.0.215
|
|
7
|
+
"@dynamic-labs-wallet/browser": "0.0.215",
|
|
8
8
|
"@solana/web3.js": "^1.98.2",
|
|
9
9
|
"bs58": "^6.0.0",
|
|
10
10
|
"@dynamic-labs/sdk-api-core": "^0.0.818"
|
package/src/svm/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicWalletClient, type DynamicWalletClientProps, type Ed25519KeygenResult, type ThresholdSignatureScheme
|
|
1
|
+
import { DynamicWalletClient, type DynamicWalletClientProps, type Ed25519KeygenResult, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/browser';
|
|
2
2
|
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
3
3
|
export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
4
4
|
readonly chainName = "SVM";
|
|
@@ -10,11 +10,10 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
10
10
|
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
11
11
|
* @returns The account address, public key hex, raw public key, and client key shares
|
|
12
12
|
*/
|
|
13
|
-
createWalletAccount({ thresholdSignatureScheme, password, signedSessionId,
|
|
13
|
+
createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, }: {
|
|
14
14
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
15
15
|
password?: string;
|
|
16
16
|
signedSessionId: string;
|
|
17
|
-
traceContext?: TraceContext;
|
|
18
17
|
}): Promise<{
|
|
19
18
|
accountAddress: string;
|
|
20
19
|
rawPublicKey: Uint8Array | string;
|
|
@@ -29,16 +28,15 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
29
28
|
* @param accountAddress Solana address (base58 encoded)
|
|
30
29
|
* @param password The password for encrypted backup shares
|
|
31
30
|
*/
|
|
32
|
-
signMessage({ message, accountAddress, password, signedSessionId, mfaToken, onError,
|
|
31
|
+
signMessage({ message, accountAddress, password, signedSessionId, mfaToken, onError, }: {
|
|
33
32
|
message: string;
|
|
34
33
|
accountAddress: string;
|
|
35
34
|
password?: string;
|
|
36
35
|
signedSessionId: string;
|
|
37
36
|
mfaToken?: string;
|
|
38
37
|
onError?: (error: Error) => void;
|
|
39
|
-
traceContext?: TraceContext;
|
|
40
38
|
}): Promise<string>;
|
|
41
|
-
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError,
|
|
39
|
+
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError, }: {
|
|
42
40
|
senderAddress: string;
|
|
43
41
|
transaction: string;
|
|
44
42
|
password?: string;
|
|
@@ -47,7 +45,6 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
47
45
|
chainId?: string;
|
|
48
46
|
context?: SignMessageContext;
|
|
49
47
|
onError?: (error: Error) => void;
|
|
50
|
-
traceContext?: TraceContext;
|
|
51
48
|
}): Promise<string>;
|
|
52
49
|
private prepareTransactionForSigning;
|
|
53
50
|
private buildSignParams;
|
package/src/svm/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/svm/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,wBAAwB,EAM7B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/svm/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,wBAAwB,EAM7B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAG9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAkBrE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,EACV,gBAAgB,GACjB,EAAE,wBAAwB;IAe3B;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,eAAe,GAChB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC;KACnC,CAAC;IA2EI,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU;;;IAY5D;;;;;;OAMG;IACG,WAAW,CAAC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