@dynamic-labs/waas-svm 4.21.0 → 4.22.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/CHANGELOG.md +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/connector/DynamicWaasSVMConnector.cjs +11 -5
- package/src/connector/DynamicWaasSVMConnector.js +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.22.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.21.1...v4.22.0) (2025-07-07)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* add authtoken to sign messsage and transaction ([#9106](https://github.com/dynamic-labs/dynamic-auth/issues/9106)) ([fe49a6b](https://github.com/dynamic-labs/dynamic-auth/commit/fe49a6b9dcf1121e3cc128835481107edaeb522a))
|
|
8
|
+
* bump waas wallet sdk to 0.0.110 to fix esmodule inference with node 20 and earlier versions ([#9108](https://github.com/dynamic-labs/dynamic-auth/issues/9108)) ([fa54fe6](https://github.com/dynamic-labs/dynamic-auth/commit/fa54fe610d885fcc826e3dff1c57e50b6b7f2934))
|
|
9
|
+
|
|
10
|
+
### [4.21.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.21.0...v4.21.1) (2025-07-04)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add auth token refresh to waas evm & svm functionalities ([#9102](https://github.com/dynamic-labs/dynamic-auth/issues/9102)) ([c155c37](https://github.com/dynamic-labs/dynamic-auth/commit/c155c3709f041ea48c6e76d300ca443e19a28539))
|
|
16
|
+
|
|
2
17
|
## [4.21.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.20.17...v4.21.0) (2025-07-04)
|
|
3
18
|
|
|
4
19
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-svm",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.0",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"@solana/web3.js": "1.98.1",
|
|
22
22
|
"eventemitter3": "5.0.1",
|
|
23
23
|
"bs58": "5.0.0",
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
25
|
-
"@dynamic-labs/logger": "4.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
27
|
-
"@dynamic-labs/solana-core": "4.
|
|
28
|
-
"@dynamic-labs/types": "4.
|
|
29
|
-
"@dynamic-labs/utils": "4.
|
|
30
|
-
"@dynamic-labs/waas": "4.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.22.0",
|
|
25
|
+
"@dynamic-labs/logger": "4.22.0",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "4.22.0",
|
|
27
|
+
"@dynamic-labs/solana-core": "4.22.0",
|
|
28
|
+
"@dynamic-labs/types": "4.22.0",
|
|
29
|
+
"@dynamic-labs/utils": "4.22.0",
|
|
30
|
+
"@dynamic-labs/waas": "4.22.0",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "4.22.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {}
|
|
34
34
|
}
|
|
@@ -7,8 +7,8 @@ var _tslib = require('../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var web3_js = require('@solana/web3.js');
|
|
8
8
|
var solanaCore = require('@dynamic-labs/solana-core');
|
|
9
9
|
var utils = require('@dynamic-labs/utils');
|
|
10
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
10
|
var waas = require('@dynamic-labs/waas');
|
|
11
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
12
12
|
var logger = require('../../utils/logger.cjs');
|
|
13
13
|
var DynamicWaasSVMSigner = require('../signer/DynamicWaasSVMSigner.cjs');
|
|
14
14
|
|
|
@@ -44,11 +44,12 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
44
44
|
}
|
|
45
45
|
validateActiveWallet(expectedAddress) {
|
|
46
46
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
var _a;
|
|
47
|
+
var _a, _b;
|
|
48
48
|
const walletClient = this.getWaasWalletClient();
|
|
49
49
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
50
50
|
const targetWallet = yield walletClient.getWallet({
|
|
51
51
|
accountAddress: expectedAddress,
|
|
52
|
+
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
52
53
|
signedSessionId,
|
|
53
54
|
});
|
|
54
55
|
if (!targetWallet) {
|
|
@@ -104,7 +105,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
104
105
|
}
|
|
105
106
|
internalSignTransaction(transaction) {
|
|
106
107
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
var _a;
|
|
108
|
+
var _a, _b;
|
|
108
109
|
const walletClient = this.getWaasWalletClient();
|
|
109
110
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
110
111
|
if (!this.activeAccountAddress) {
|
|
@@ -115,6 +116,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
115
116
|
: transaction.message.serialize();
|
|
116
117
|
const messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
117
118
|
const signature = yield walletClient.signTransaction({
|
|
119
|
+
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
118
120
|
senderAddress: this.activeAccountAddress,
|
|
119
121
|
signedSessionId,
|
|
120
122
|
transaction: messageToSign,
|
|
@@ -228,6 +230,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
228
230
|
}
|
|
229
231
|
exportPrivateKey() {
|
|
230
232
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, password, } = {}) {
|
|
233
|
+
var _a;
|
|
231
234
|
const walletClient = this.getWaasWalletClient();
|
|
232
235
|
const targetAccountAddress = accountAddress || this.activeAccountAddress;
|
|
233
236
|
if (!targetAccountAddress) {
|
|
@@ -239,6 +242,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
239
242
|
this.__exportHandler.setIframeStamper(displayContainer);
|
|
240
243
|
yield walletClient.exportPrivateKey({
|
|
241
244
|
accountAddress: targetAccountAddress,
|
|
245
|
+
authToken: (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this),
|
|
242
246
|
displayContainer,
|
|
243
247
|
password,
|
|
244
248
|
});
|
|
@@ -249,13 +253,14 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
249
253
|
}
|
|
250
254
|
importPrivateKey(_a) {
|
|
251
255
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
|
|
252
|
-
var _b;
|
|
256
|
+
var _b, _c;
|
|
253
257
|
const walletClient = this.getWaasWalletClient();
|
|
254
258
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
255
259
|
if (!signedSessionId) {
|
|
256
260
|
throw new Error('Signed session ID is required');
|
|
257
261
|
}
|
|
258
262
|
yield walletClient.importPrivateKey({
|
|
263
|
+
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
259
264
|
privateKey,
|
|
260
265
|
signedSessionId,
|
|
261
266
|
thresholdSignatureScheme: thresholdSignatureScheme,
|
|
@@ -316,7 +321,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
316
321
|
}
|
|
317
322
|
exportClientKeyshares(_a) {
|
|
318
323
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
319
|
-
var _b;
|
|
324
|
+
var _b, _c;
|
|
320
325
|
const walletClient = this.getWaasWalletClient();
|
|
321
326
|
const targetAccountAddress = accountAddress || this.activeAccountAddress;
|
|
322
327
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
@@ -328,6 +333,7 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
328
333
|
}
|
|
329
334
|
yield walletClient.exportClientKeyshares({
|
|
330
335
|
accountAddress: targetAccountAddress,
|
|
336
|
+
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
331
337
|
password,
|
|
332
338
|
signedSessionId,
|
|
333
339
|
});
|
|
@@ -3,8 +3,8 @@ import { __awaiter } from '../../_virtual/_tslib.js';
|
|
|
3
3
|
import { Transaction, PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { SolanaWalletConnector, SolanaUiTransaction } from '@dynamic-labs/solana-core';
|
|
5
5
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
6
|
-
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
7
6
|
import { withDynamicWaas } from '@dynamic-labs/waas';
|
|
7
|
+
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import { logger } from '../../utils/logger.js';
|
|
9
9
|
import { DynamicWaasSVMSigner } from '../signer/DynamicWaasSVMSigner.js';
|
|
10
10
|
|
|
@@ -40,11 +40,12 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
40
40
|
}
|
|
41
41
|
validateActiveWallet(expectedAddress) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a;
|
|
43
|
+
var _a, _b;
|
|
44
44
|
const walletClient = this.getWaasWalletClient();
|
|
45
45
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
46
46
|
const targetWallet = yield walletClient.getWallet({
|
|
47
47
|
accountAddress: expectedAddress,
|
|
48
|
+
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
48
49
|
signedSessionId,
|
|
49
50
|
});
|
|
50
51
|
if (!targetWallet) {
|
|
@@ -100,7 +101,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
100
101
|
}
|
|
101
102
|
internalSignTransaction(transaction) {
|
|
102
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
var _a;
|
|
104
|
+
var _a, _b;
|
|
104
105
|
const walletClient = this.getWaasWalletClient();
|
|
105
106
|
const signedSessionId = yield ((_a = this.getSignedSessionId) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
106
107
|
if (!this.activeAccountAddress) {
|
|
@@ -111,6 +112,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
111
112
|
: transaction.message.serialize();
|
|
112
113
|
const messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
113
114
|
const signature = yield walletClient.signTransaction({
|
|
115
|
+
authToken: (_b = this.getAuthToken) === null || _b === void 0 ? void 0 : _b.call(this),
|
|
114
116
|
senderAddress: this.activeAccountAddress,
|
|
115
117
|
signedSessionId,
|
|
116
118
|
transaction: messageToSign,
|
|
@@ -224,6 +226,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
224
226
|
}
|
|
225
227
|
exportPrivateKey() {
|
|
226
228
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, displayContainer, password, } = {}) {
|
|
229
|
+
var _a;
|
|
227
230
|
const walletClient = this.getWaasWalletClient();
|
|
228
231
|
const targetAccountAddress = accountAddress || this.activeAccountAddress;
|
|
229
232
|
if (!targetAccountAddress) {
|
|
@@ -235,6 +238,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
235
238
|
this.__exportHandler.setIframeStamper(displayContainer);
|
|
236
239
|
yield walletClient.exportPrivateKey({
|
|
237
240
|
accountAddress: targetAccountAddress,
|
|
241
|
+
authToken: (_a = this.getAuthToken) === null || _a === void 0 ? void 0 : _a.call(this),
|
|
238
242
|
displayContainer,
|
|
239
243
|
password,
|
|
240
244
|
});
|
|
@@ -245,13 +249,14 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
245
249
|
}
|
|
246
250
|
importPrivateKey(_a) {
|
|
247
251
|
return __awaiter(this, arguments, void 0, function* ({ privateKey, thresholdSignatureScheme = 'TWO_OF_TWO', }) {
|
|
248
|
-
var _b;
|
|
252
|
+
var _b, _c;
|
|
249
253
|
const walletClient = this.getWaasWalletClient();
|
|
250
254
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
251
255
|
if (!signedSessionId) {
|
|
252
256
|
throw new Error('Signed session ID is required');
|
|
253
257
|
}
|
|
254
258
|
yield walletClient.importPrivateKey({
|
|
259
|
+
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
255
260
|
privateKey,
|
|
256
261
|
signedSessionId,
|
|
257
262
|
thresholdSignatureScheme: thresholdSignatureScheme,
|
|
@@ -312,7 +317,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
312
317
|
}
|
|
313
318
|
exportClientKeyshares(_a) {
|
|
314
319
|
return __awaiter(this, arguments, void 0, function* ({ accountAddress, password, }) {
|
|
315
|
-
var _b;
|
|
320
|
+
var _b, _c;
|
|
316
321
|
const walletClient = this.getWaasWalletClient();
|
|
317
322
|
const targetAccountAddress = accountAddress || this.activeAccountAddress;
|
|
318
323
|
const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
|
|
@@ -324,6 +329,7 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
324
329
|
}
|
|
325
330
|
yield walletClient.exportClientKeyshares({
|
|
326
331
|
accountAddress: targetAccountAddress,
|
|
332
|
+
authToken: (_c = this.getAuthToken) === null || _c === void 0 ? void 0 : _c.call(this),
|
|
327
333
|
password,
|
|
328
334
|
signedSessionId,
|
|
329
335
|
});
|