@dynamic-labs/waas-svm 5.14.0 → 5.15.1
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 +30 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -11
- package/src/connector/DynamicWaasSVMConnector.cjs +37 -5
- package/src/connector/DynamicWaasSVMConnector.d.ts +8 -0
- package/src/connector/DynamicWaasSVMConnector.js +37 -5
- package/src/signer/DynamicWaasSVMSigner.cjs +0 -1
- package/src/signer/DynamicWaasSVMSigner.d.ts +0 -1
- package/src/signer/DynamicWaasSVMSigner.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
|
|
2
|
+
### [5.15.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.15.0...v5.15.1) (2026-11-09)
|
|
3
|
+
|
|
4
|
+
## [5.15.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.14.0...v5.15.0) (2026-11-05)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### ⚠ BREAKING CHANGES
|
|
8
|
+
|
|
9
|
+
* **wallet-book:** the ExodusEvm connector export and the exodus,
|
|
10
|
+
exodusevm and exodussol wallet-book entries are removed
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **tron:** support MetaMask via @metamask/connect-tron adapter ([#12671](https://github.com/dynamic-labs/dynamic-auth/issues/12671)) ([9b5bd65](https://github.com/dynamic-labs/dynamic-auth/commit/9b5bd65e51a0827fc06521804301fb4334698db5))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **deps:** bump joi to 17.13.9 for GHSA-4528-x5fx-h6hg ([#12685](https://github.com/dynamic-labs/dynamic-auth/issues/12685)) ([4b48f61](https://github.com/dynamic-labs/dynamic-auth/commit/4b48f6161cfac51820f3c3eb243bdaeedfdb974c))
|
|
20
|
+
* **deps:** override decode-uri-component to 0.5.1 for GHSA-qr28-fpjm-wq7f ([#12674](https://github.com/dynamic-labs/dynamic-auth/issues/12674)) ([5679fbe](https://github.com/dynamic-labs/dynamic-auth/commit/5679fbe96bef807b044d2af55cbef4583263e34a)), closes [#1203](https://github.com/dynamic-labs/dynamic-auth/issues/1203) [#1205](https://github.com/dynamic-labs/dynamic-auth/issues/1205) [#1206](https://github.com/dynamic-labs/dynamic-auth/issues/1206) [#1173](https://github.com/dynamic-labs/dynamic-auth/issues/1173) [#1176](https://github.com/dynamic-labs/dynamic-auth/issues/1176) [#1114](https://github.com/dynamic-labs/dynamic-auth/issues/1114) [#1115](https://github.com/dynamic-labs/dynamic-auth/issues/1115) [#12645](https://github.com/dynamic-labs/dynamic-auth/issues/12645)
|
|
21
|
+
* **iconic:** add Zerion wallet icon ([#12650](https://github.com/dynamic-labs/dynamic-auth/issues/12650)) ([578615c](https://github.com/dynamic-labs/dynamic-auth/commit/578615cc81245295624833ce307ade1c1630d9f7))
|
|
22
|
+
* **sdk-react-core:** default wallet return redirectUrl to current page ([#12659](https://github.com/dynamic-labs/dynamic-auth/issues/12659)) ([c41c9ef](https://github.com/dynamic-labs/dynamic-auth/commit/c41c9ef639ebcc505425d5f7014d695189d02835))
|
|
23
|
+
* **sdk-react-core:** scroll the whole modal box on the collect user data screen ([#12698](https://github.com/dynamic-labs/dynamic-auth/issues/12698)) ([6bafd1f](https://github.com/dynamic-labs/dynamic-auth/commit/6bafd1ff4732b8f9ae8f16622331b9b080300107))
|
|
24
|
+
* **waas-svm:** keep the blockhash of a transaction another key already signed ([#12676](https://github.com/dynamic-labs/dynamic-auth/issues/12676)) ([74bf588](https://github.com/dynamic-labs/dynamic-auth/commit/74bf588ae72a24f7951451ef791a3eebe6f5baf4))
|
|
25
|
+
* **waas:** wire elevated access token provider on all WaaS connectors ([#12711](https://github.com/dynamic-labs/dynamic-auth/issues/12711)) ([1c343be](https://github.com/dynamic-labs/dynamic-auth/commit/1c343bee5b6e04219be513e24afb16d5ac652723))
|
|
26
|
+
* **wallet-book:** restore Magic Eden WalletConnect connect flow on mobile ([#12657](https://github.com/dynamic-labs/dynamic-auth/issues/12657)) ([740026a](https://github.com/dynamic-labs/dynamic-auth/commit/740026a6637f441049678e563d36ffdac5e61e8b))
|
|
27
|
+
* **wallet-book:** use Backpack's ul/v1/browse link for the in-app browser ([#12702](https://github.com/dynamic-labs/dynamic-auth/issues/12702)) ([99f8e95](https://github.com/dynamic-labs/dynamic-auth/commit/99f8e956a51baccba3616a76104ab9fba2545847)), closes [#12053](https://github.com/dynamic-labs/dynamic-auth/issues/12053)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
* **wallet-book:** drop Exodus wallets ([#12664](https://github.com/dynamic-labs/dynamic-auth/issues/12664)) ([e3c850f](https://github.com/dynamic-labs/dynamic-auth/commit/e3c850fefb8db92bcd2706fb9b58f92e4a536533))
|
|
31
|
+
|
|
2
32
|
## [5.14.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.13.0...v5.14.0) (2026-10-30)
|
|
3
33
|
|
|
4
34
|
|
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": "5.
|
|
3
|
+
"version": "5.15.1",
|
|
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",
|
|
@@ -19,19 +19,20 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs-wallet/core": "1.1.49",
|
|
22
|
-
"@dynamic-labs/sdk-api-core": "0.
|
|
23
|
-
"@dynamic-labs/embedded-wallet-solana": "5.
|
|
22
|
+
"@dynamic-labs/sdk-api-core": "0.142.0",
|
|
23
|
+
"@dynamic-labs/embedded-wallet-solana": "5.15.1",
|
|
24
24
|
"@solana/web3.js": "1.98.1",
|
|
25
25
|
"eventemitter3": "5.0.1",
|
|
26
26
|
"bs58": "5.0.0",
|
|
27
|
-
"@dynamic-labs/assert-package-version": "5.
|
|
28
|
-
"@dynamic-labs/logger": "5.
|
|
29
|
-
"@dynamic-labs/rpc-providers": "5.
|
|
30
|
-
"@dynamic-labs/solana-core": "5.
|
|
31
|
-
"@dynamic-labs/types": "5.
|
|
32
|
-
"@dynamic-labs/utils": "5.
|
|
33
|
-
"@dynamic-labs/waas": "5.
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "5.
|
|
27
|
+
"@dynamic-labs/assert-package-version": "5.15.1",
|
|
28
|
+
"@dynamic-labs/logger": "5.15.1",
|
|
29
|
+
"@dynamic-labs/rpc-providers": "5.15.1",
|
|
30
|
+
"@dynamic-labs/solana-core": "5.15.1",
|
|
31
|
+
"@dynamic-labs/types": "5.15.1",
|
|
32
|
+
"@dynamic-labs/utils": "5.15.1",
|
|
33
|
+
"@dynamic-labs/waas": "5.15.1",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "5.15.1",
|
|
35
|
+
"tweetnacl": "1.0.3"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {}
|
|
37
38
|
}
|
|
@@ -72,6 +72,26 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
72
72
|
}
|
|
73
73
|
return transaction.signatures.some((sig) => sig.signature && !sig.signature.every((byte) => byte === 0));
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Whether a key other than the active wallet has already signed. That
|
|
77
|
+
* signature covers the current message, so rewriting the blockhash would
|
|
78
|
+
* invalidate it. The active wallet's own signature doesn't count: the SDK
|
|
79
|
+
* writes it into the caller's object on every send, so a retry with that same
|
|
80
|
+
* object still needs its blockhash refreshed.
|
|
81
|
+
*/
|
|
82
|
+
hasForeignSignature(transaction) {
|
|
83
|
+
const isNonZero = (signature) => signature ? signature.some((byte) => byte !== 0) : false;
|
|
84
|
+
if (solanaCore.isVersionedTransaction(transaction)) {
|
|
85
|
+
const signerKeys = transaction.message.staticAccountKeys;
|
|
86
|
+
return transaction.signatures.some((signature, index) => {
|
|
87
|
+
var _a;
|
|
88
|
+
return isNonZero(signature) &&
|
|
89
|
+
((_a = signerKeys[index]) === null || _a === void 0 ? void 0 : _a.toBase58()) !== this.activeAccountAddress;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return transaction.signatures.some(({ publicKey, signature }) => isNonZero(signature) &&
|
|
93
|
+
publicKey.toBase58() !== this.activeAccountAddress);
|
|
94
|
+
}
|
|
75
95
|
getFeePayerAddress(transaction) {
|
|
76
96
|
var _a, _b;
|
|
77
97
|
if ('version' in transaction) {
|
|
@@ -272,9 +292,11 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
272
292
|
const effectiveStartTime = startTime || Date.now();
|
|
273
293
|
// Write the blockhash before sponsorship, never after: the sponsor signs the
|
|
274
294
|
// message it is handed, so a later rewrite invalidates its signature and the
|
|
275
|
-
// RPC rejects the transaction at preflight with SignatureFailure.
|
|
295
|
+
// RPC rejects the transaction at preflight with SignatureFailure. The same
|
|
296
|
+
// goes for a transaction the caller already had co-signed, so its blockhash
|
|
297
|
+
// is left alone.
|
|
276
298
|
const txToSponsor = transaction;
|
|
277
|
-
if (overrideBlockhash) {
|
|
299
|
+
if (overrideBlockhash && !this.hasForeignSignature(txToSponsor)) {
|
|
278
300
|
if (solanaCore.isVersionedTransaction(txToSponsor)) {
|
|
279
301
|
txToSponsor.message.recentBlockhash = overrideBlockhash.blockhash;
|
|
280
302
|
}
|
|
@@ -455,7 +477,10 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
455
477
|
// Use 'finalized' so the blockhash is recognized by every RPC node
|
|
456
478
|
// (a 'confirmed' blockhash may not yet have propagated to the simulating
|
|
457
479
|
// node, which surfaces as "Blockhash not found" at sendRawTransaction).
|
|
480
|
+
// Not applied to a transaction another key has already signed: see
|
|
481
|
+
// internalSignTransaction.
|
|
458
482
|
const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
|
|
483
|
+
const keepsCallerBlockhash = this.hasForeignSignature(transaction);
|
|
459
484
|
const signedTransaction = yield this.instrumentAsync({
|
|
460
485
|
context: { chainName: 'SVM', startTime: effectiveStartTime, traceId },
|
|
461
486
|
fn: () => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -491,15 +516,22 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
|
|
|
491
516
|
});
|
|
492
517
|
const confirmationStartTime = Date.now();
|
|
493
518
|
// Confirm against the blockhash the broadcast tx actually carries, in case a
|
|
494
|
-
// sponsor ever substitutes its own. lastValidBlockHeight
|
|
495
|
-
//
|
|
519
|
+
// sponsor ever substitutes its own. The fetched lastValidBlockHeight is at or
|
|
520
|
+
// after the real expiry of any blockhash we could be holding, so an expired
|
|
521
|
+
// transaction is reported late, never early. A legacy transaction that
|
|
522
|
+
// carries its own height keeps it, which is exact.
|
|
496
523
|
const broadcastBlockhash = isVersionedSolanaTransaction
|
|
497
524
|
? signedTransaction.message.recentBlockhash
|
|
498
525
|
: (_a = signedTransaction.recentBlockhash) !== null && _a !== void 0 ? _a : blockhash;
|
|
526
|
+
const confirmationLastValidBlockHeight = keepsCallerBlockhash &&
|
|
527
|
+
!isVersionedSolanaTransaction &&
|
|
528
|
+
signedTransaction.lastValidBlockHeight !== undefined
|
|
529
|
+
? signedTransaction.lastValidBlockHeight
|
|
530
|
+
: lastValidBlockHeight;
|
|
499
531
|
try {
|
|
500
532
|
const confirmationResult = yield connection.confirmTransaction({
|
|
501
533
|
blockhash: broadcastBlockhash,
|
|
502
|
-
lastValidBlockHeight,
|
|
534
|
+
lastValidBlockHeight: confirmationLastValidBlockHeight,
|
|
503
535
|
signature,
|
|
504
536
|
}, (_b = options === null || options === void 0 ? void 0 : options.preflightCommitment) !== null && _b !== void 0 ? _b : 'confirmed');
|
|
505
537
|
const confirmationEndTime = Date.now();
|
|
@@ -235,6 +235,14 @@ export declare class DynamicWaasSVMConnector extends DynamicWaasSVMConnector_bas
|
|
|
235
235
|
* Check if a transaction is already signed (has non-zero signatures).
|
|
236
236
|
*/
|
|
237
237
|
private isTxAlreadySigned;
|
|
238
|
+
/**
|
|
239
|
+
* Whether a key other than the active wallet has already signed. That
|
|
240
|
+
* signature covers the current message, so rewriting the blockhash would
|
|
241
|
+
* invalidate it. The active wallet's own signature doesn't count: the SDK
|
|
242
|
+
* writes it into the caller's object on every send, so a retry with that same
|
|
243
|
+
* object still needs its blockhash refreshed.
|
|
244
|
+
*/
|
|
245
|
+
private hasForeignSignature;
|
|
238
246
|
private getFeePayerAddress;
|
|
239
247
|
private attemptSponsorship;
|
|
240
248
|
private asSponsorshipError;
|
|
@@ -68,6 +68,26 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
68
68
|
}
|
|
69
69
|
return transaction.signatures.some((sig) => sig.signature && !sig.signature.every((byte) => byte === 0));
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether a key other than the active wallet has already signed. That
|
|
73
|
+
* signature covers the current message, so rewriting the blockhash would
|
|
74
|
+
* invalidate it. The active wallet's own signature doesn't count: the SDK
|
|
75
|
+
* writes it into the caller's object on every send, so a retry with that same
|
|
76
|
+
* object still needs its blockhash refreshed.
|
|
77
|
+
*/
|
|
78
|
+
hasForeignSignature(transaction) {
|
|
79
|
+
const isNonZero = (signature) => signature ? signature.some((byte) => byte !== 0) : false;
|
|
80
|
+
if (isVersionedTransaction(transaction)) {
|
|
81
|
+
const signerKeys = transaction.message.staticAccountKeys;
|
|
82
|
+
return transaction.signatures.some((signature, index) => {
|
|
83
|
+
var _a;
|
|
84
|
+
return isNonZero(signature) &&
|
|
85
|
+
((_a = signerKeys[index]) === null || _a === void 0 ? void 0 : _a.toBase58()) !== this.activeAccountAddress;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return transaction.signatures.some(({ publicKey, signature }) => isNonZero(signature) &&
|
|
89
|
+
publicKey.toBase58() !== this.activeAccountAddress);
|
|
90
|
+
}
|
|
71
91
|
getFeePayerAddress(transaction) {
|
|
72
92
|
var _a, _b;
|
|
73
93
|
if ('version' in transaction) {
|
|
@@ -268,9 +288,11 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
268
288
|
const effectiveStartTime = startTime || Date.now();
|
|
269
289
|
// Write the blockhash before sponsorship, never after: the sponsor signs the
|
|
270
290
|
// message it is handed, so a later rewrite invalidates its signature and the
|
|
271
|
-
// RPC rejects the transaction at preflight with SignatureFailure.
|
|
291
|
+
// RPC rejects the transaction at preflight with SignatureFailure. The same
|
|
292
|
+
// goes for a transaction the caller already had co-signed, so its blockhash
|
|
293
|
+
// is left alone.
|
|
272
294
|
const txToSponsor = transaction;
|
|
273
|
-
if (overrideBlockhash) {
|
|
295
|
+
if (overrideBlockhash && !this.hasForeignSignature(txToSponsor)) {
|
|
274
296
|
if (isVersionedTransaction(txToSponsor)) {
|
|
275
297
|
txToSponsor.message.recentBlockhash = overrideBlockhash.blockhash;
|
|
276
298
|
}
|
|
@@ -451,7 +473,10 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
451
473
|
// Use 'finalized' so the blockhash is recognized by every RPC node
|
|
452
474
|
// (a 'confirmed' blockhash may not yet have propagated to the simulating
|
|
453
475
|
// node, which surfaces as "Blockhash not found" at sendRawTransaction).
|
|
476
|
+
// Not applied to a transaction another key has already signed: see
|
|
477
|
+
// internalSignTransaction.
|
|
454
478
|
const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
|
|
479
|
+
const keepsCallerBlockhash = this.hasForeignSignature(transaction);
|
|
455
480
|
const signedTransaction = yield this.instrumentAsync({
|
|
456
481
|
context: { chainName: 'SVM', startTime: effectiveStartTime, traceId },
|
|
457
482
|
fn: () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -487,15 +512,22 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
|
|
|
487
512
|
});
|
|
488
513
|
const confirmationStartTime = Date.now();
|
|
489
514
|
// Confirm against the blockhash the broadcast tx actually carries, in case a
|
|
490
|
-
// sponsor ever substitutes its own. lastValidBlockHeight
|
|
491
|
-
//
|
|
515
|
+
// sponsor ever substitutes its own. The fetched lastValidBlockHeight is at or
|
|
516
|
+
// after the real expiry of any blockhash we could be holding, so an expired
|
|
517
|
+
// transaction is reported late, never early. A legacy transaction that
|
|
518
|
+
// carries its own height keeps it, which is exact.
|
|
492
519
|
const broadcastBlockhash = isVersionedSolanaTransaction
|
|
493
520
|
? signedTransaction.message.recentBlockhash
|
|
494
521
|
: (_a = signedTransaction.recentBlockhash) !== null && _a !== void 0 ? _a : blockhash;
|
|
522
|
+
const confirmationLastValidBlockHeight = keepsCallerBlockhash &&
|
|
523
|
+
!isVersionedSolanaTransaction &&
|
|
524
|
+
signedTransaction.lastValidBlockHeight !== undefined
|
|
525
|
+
? signedTransaction.lastValidBlockHeight
|
|
526
|
+
: lastValidBlockHeight;
|
|
495
527
|
try {
|
|
496
528
|
const confirmationResult = yield connection.confirmTransaction({
|
|
497
529
|
blockhash: broadcastBlockhash,
|
|
498
|
-
lastValidBlockHeight,
|
|
530
|
+
lastValidBlockHeight: confirmationLastValidBlockHeight,
|
|
499
531
|
signature,
|
|
500
532
|
}, (_b = options === null || options === void 0 ? void 0 : options.preflightCommitment) !== null && _b !== void 0 ? _b : 'confirmed');
|
|
501
533
|
const confirmationEndTime = Date.now();
|
|
@@ -29,7 +29,6 @@ class DynamicWaasSVMSigner extends EventEmitter__default["default"] {
|
|
|
29
29
|
this.isSolflare = false;
|
|
30
30
|
this.isExodus = false;
|
|
31
31
|
this.isBackpack = false;
|
|
32
|
-
this.isMagicEden = false;
|
|
33
32
|
this.walletConnector = walletConnector;
|
|
34
33
|
this.accountAddress = this.walletConnector.activeAccountAddress;
|
|
35
34
|
this.publicKey = this.accountAddress
|
|
@@ -16,7 +16,6 @@ export declare class DynamicWaasSVMSigner extends EventEmitter<ISolanaEvents> im
|
|
|
16
16
|
readonly isSolflare = false;
|
|
17
17
|
readonly isExodus = false;
|
|
18
18
|
readonly isBackpack = false;
|
|
19
|
-
readonly isMagicEden = false;
|
|
20
19
|
private readonly accountAddress;
|
|
21
20
|
private walletConnector;
|
|
22
21
|
constructor({ walletConnector, }: {
|
|
@@ -20,7 +20,6 @@ class DynamicWaasSVMSigner extends EventEmitter {
|
|
|
20
20
|
this.isSolflare = false;
|
|
21
21
|
this.isExodus = false;
|
|
22
22
|
this.isBackpack = false;
|
|
23
|
-
this.isMagicEden = false;
|
|
24
23
|
this.walletConnector = walletConnector;
|
|
25
24
|
this.accountAddress = this.walletConnector.activeAccountAddress;
|
|
26
25
|
this.publicKey = this.accountAddress
|