@dynamic-labs-wallet/svm 0.0.143 → 0.0.144
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 +6 -5
- package/index.esm.js +6 -5
- package/package.json +3 -3
- package/src/svm/client.d.ts +3 -1
- package/src/svm/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -122,7 +122,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
122
122
|
throw new Error(browser.ERROR_SIGN_MESSAGE);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, onError }) {
|
|
125
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
|
|
126
126
|
await this.verifyPassword({
|
|
127
127
|
accountAddress: senderAddress,
|
|
128
128
|
password,
|
|
@@ -138,7 +138,8 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
138
138
|
signedSessionId,
|
|
139
139
|
mfaToken,
|
|
140
140
|
chainId,
|
|
141
|
-
base58SerializedTransaction
|
|
141
|
+
base58SerializedTransaction,
|
|
142
|
+
context
|
|
142
143
|
});
|
|
143
144
|
const signatureEd25519 = await this.sign(_extends({}, signParams, {
|
|
144
145
|
onError
|
|
@@ -162,7 +163,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
162
163
|
const serializedTransaction = versionedTransaction.serialize();
|
|
163
164
|
return bs58.encode(serializedTransaction);
|
|
164
165
|
}
|
|
165
|
-
buildSignParams({ transaction, senderAddress, password, signedSessionId, mfaToken, chainId, base58SerializedTransaction }) {
|
|
166
|
+
buildSignParams({ transaction, senderAddress, password, signedSessionId, mfaToken, chainId, base58SerializedTransaction, context }) {
|
|
166
167
|
const signParams = {
|
|
167
168
|
message: transaction,
|
|
168
169
|
accountAddress: senderAddress,
|
|
@@ -172,7 +173,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
172
173
|
mfaToken
|
|
173
174
|
};
|
|
174
175
|
if (chainId !== undefined) {
|
|
175
|
-
signParams.context = {
|
|
176
|
+
signParams.context = _extends({}, context, {
|
|
176
177
|
svmTransaction: {
|
|
177
178
|
chainId,
|
|
178
179
|
method: 'signAndSendTransaction',
|
|
@@ -180,7 +181,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
180
181
|
base58SerializedTransaction
|
|
181
182
|
]
|
|
182
183
|
}
|
|
183
|
-
};
|
|
184
|
+
});
|
|
184
185
|
}
|
|
185
186
|
return signParams;
|
|
186
187
|
}
|
package/index.esm.js
CHANGED
|
@@ -120,7 +120,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
120
120
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, onError }) {
|
|
123
|
+
async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
|
|
124
124
|
await this.verifyPassword({
|
|
125
125
|
accountAddress: senderAddress,
|
|
126
126
|
password,
|
|
@@ -136,7 +136,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
136
136
|
signedSessionId,
|
|
137
137
|
mfaToken,
|
|
138
138
|
chainId,
|
|
139
|
-
base58SerializedTransaction
|
|
139
|
+
base58SerializedTransaction,
|
|
140
|
+
context
|
|
140
141
|
});
|
|
141
142
|
const signatureEd25519 = await this.sign(_extends({}, signParams, {
|
|
142
143
|
onError
|
|
@@ -160,7 +161,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
160
161
|
const serializedTransaction = versionedTransaction.serialize();
|
|
161
162
|
return bs58.encode(serializedTransaction);
|
|
162
163
|
}
|
|
163
|
-
buildSignParams({ transaction, senderAddress, password, signedSessionId, mfaToken, chainId, base58SerializedTransaction }) {
|
|
164
|
+
buildSignParams({ transaction, senderAddress, password, signedSessionId, mfaToken, chainId, base58SerializedTransaction, context }) {
|
|
164
165
|
const signParams = {
|
|
165
166
|
message: transaction,
|
|
166
167
|
accountAddress: senderAddress,
|
|
@@ -170,7 +171,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
170
171
|
mfaToken
|
|
171
172
|
};
|
|
172
173
|
if (chainId !== undefined) {
|
|
173
|
-
signParams.context = {
|
|
174
|
+
signParams.context = _extends({}, context, {
|
|
174
175
|
svmTransaction: {
|
|
175
176
|
chainId,
|
|
176
177
|
method: 'signAndSendTransaction',
|
|
@@ -178,7 +179,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
178
179
|
base58SerializedTransaction
|
|
179
180
|
]
|
|
180
181
|
}
|
|
181
|
-
};
|
|
182
|
+
});
|
|
182
183
|
}
|
|
183
184
|
return signParams;
|
|
184
185
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.144",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "^0.0.
|
|
7
|
+
"@dynamic-labs-wallet/browser": "0.0.144",
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "^0.0.764",
|
|
9
9
|
"@solana/web3.js": "^1.98.2",
|
|
10
10
|
"bs58": "^6.0.0"
|
|
11
11
|
},
|
package/src/svm/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DynamicWalletClient, DynamicWalletClientProps, Ed25519KeygenResult, ThresholdSignatureScheme } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
2
3
|
export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
3
4
|
readonly chainName = "SVM";
|
|
4
5
|
accountAddress?: string;
|
|
@@ -35,13 +36,14 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
35
36
|
mfaToken?: string;
|
|
36
37
|
onError?: (error: Error) => void;
|
|
37
38
|
}): Promise<string>;
|
|
38
|
-
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, onError, }: {
|
|
39
|
+
signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError, }: {
|
|
39
40
|
senderAddress: string;
|
|
40
41
|
transaction: string;
|
|
41
42
|
password?: string;
|
|
42
43
|
signedSessionId: string;
|
|
43
44
|
mfaToken?: string;
|
|
44
45
|
chainId?: string;
|
|
46
|
+
context?: SignMessageContext;
|
|
45
47
|
onError?: (error: Error) => void;
|
|
46
48
|
}): Promise<string>;
|
|
47
49
|
private prepareTransactionForSigning;
|
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,wBAAwB,EAMxB,mBAAmB,EACnB,wBAAwB,EAGzB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/svm/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,wBAAwB,EAMxB,mBAAmB,EACnB,wBAAwB,EAGzB,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,k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