@dynamic-labs/waas-svm 4.102.0 → 4.104.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 CHANGED
@@ -1,4 +1,33 @@
1
1
 
2
+ ## [4.104.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.103.0...v4.104.0) (2026-11-03)
3
+
4
+
5
+ ### Features
6
+
7
+ * **sdk-react-core:** offer passkey recovery when export fails in upgrade flow [v4] ([#12641](https://github.com/dynamic-labs/dynamic-auth/issues/12641)) ([916829f](https://github.com/dynamic-labs/dynamic-auth/commit/916829f1eaf9f6cae7d8c0b5069512fceafa15a4))
8
+ * **webview:** forward policiesConsentLabels manifest field to SDK settings [v4] ([#12608](https://github.com/dynamic-labs/dynamic-auth/issues/12608)) ([b9ef167](https://github.com/dynamic-labs/dynamic-auth/commit/b9ef1676576eea8452c7149308492aea578b6c91))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **iconic:** add Zerion wallet icon [v4] ([#12651](https://github.com/dynamic-labs/dynamic-auth/issues/12651)) ([f5257ee](https://github.com/dynamic-labs/dynamic-auth/commit/f5257ee28fc7e8d46657957f59c13503e7eccce8))
14
+ * **react-native:** serialize WalletConnect native storage values as JSON strings ([#12682](https://github.com/dynamic-labs/dynamic-auth/issues/12682)) ([df2795a](https://github.com/dynamic-labs/dynamic-auth/commit/df2795aa432a94e429859082468b89705226dc70))
15
+ * **sdk-react-core:** default wallet return redirectUrl to current page [v4] ([#12660](https://github.com/dynamic-labs/dynamic-auth/issues/12660)) ([29b8f38](https://github.com/dynamic-labs/dynamic-auth/commit/29b8f380858ef65c52187aeb50123a287eb7b4ec))
16
+ * **waas-svm:** keep the blockhash of a transaction another key already signed ([#12678](https://github.com/dynamic-labs/dynamic-auth/issues/12678)) ([549553c](https://github.com/dynamic-labs/dynamic-auth/commit/549553c1275b3cc3995e183966a32a5f6ae63534)), closes [#12676](https://github.com/dynamic-labs/dynamic-auth/issues/12676)
17
+
18
+ ## [4.103.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.102.0...v4.103.0) (2026-10-27)
19
+
20
+
21
+ ### Features
22
+
23
+ * surface wallet creation error on backup-unsuccessful view (v4) ([#12601](https://github.com/dynamic-labs/dynamic-auth/issues/12601)) ([86b45e5](https://github.com/dynamic-labs/dynamic-auth/commit/86b45e59e64df117082257d735997ea140844453))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **react-native-extension:** vendor NativeICloudBackup TurboModule spec (v4) ([#12614](https://github.com/dynamic-labs/dynamic-auth/issues/12614)) ([833e7f4](https://github.com/dynamic-labs/dynamic-auth/commit/833e7f4741f41d327bcf1e5ea25a72d4f2d386ad))
29
+ * **sdk-react-core:** show signing wallet's network in SendBalanceTransactionCard [DYNT-2337] ([#12574](https://github.com/dynamic-labs/dynamic-auth/issues/12574)) ([f9ea046](https://github.com/dynamic-labs/dynamic-auth/commit/f9ea04620e8203d62ff7029dd2ab6324f2c1eec1)), closes [#12063](https://github.com/dynamic-labs/dynamic-auth/issues/12063) [#12425](https://github.com/dynamic-labs/dynamic-auth/issues/12425) [dynamic-waas-sdk#1786](https://github.com/dynamic-labs/dynamic-waas-sdk/issues/1786) [#1787](https://github.com/dynamic-labs/dynamic-auth/issues/1787)
30
+
2
31
  ## [4.102.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.101.0...v4.102.0) (2026-10-16)
3
32
 
4
33
  ## [4.101.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.100.5...v4.101.0) (2026-10-16)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.102.0";
6
+ var version = "4.104.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.102.0";
2
+ var version = "4.104.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/waas-svm",
3
- "version": "4.102.0",
3
+ "version": "4.104.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",
@@ -18,19 +18,20 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.104.0",
22
- "@dynamic-labs/embedded-wallet-solana": "4.102.0",
21
+ "@dynamic-labs/sdk-api-core": "0.142.0",
22
+ "@dynamic-labs/embedded-wallet-solana": "4.104.0",
23
23
  "@solana/web3.js": "1.98.1",
24
24
  "eventemitter3": "5.0.1",
25
25
  "bs58": "5.0.0",
26
- "@dynamic-labs/assert-package-version": "4.102.0",
27
- "@dynamic-labs/logger": "4.102.0",
28
- "@dynamic-labs/rpc-providers": "4.102.0",
29
- "@dynamic-labs/solana-core": "4.102.0",
30
- "@dynamic-labs/types": "4.102.0",
31
- "@dynamic-labs/utils": "4.102.0",
32
- "@dynamic-labs/waas": "4.102.0",
33
- "@dynamic-labs/wallet-connector-core": "4.102.0"
26
+ "@dynamic-labs/assert-package-version": "4.104.0",
27
+ "@dynamic-labs/logger": "4.104.0",
28
+ "@dynamic-labs/rpc-providers": "4.104.0",
29
+ "@dynamic-labs/solana-core": "4.104.0",
30
+ "@dynamic-labs/types": "4.104.0",
31
+ "@dynamic-labs/utils": "4.104.0",
32
+ "@dynamic-labs/waas": "4.104.0",
33
+ "@dynamic-labs/wallet-connector-core": "4.104.0",
34
+ "tweetnacl": "1.0.3"
34
35
  },
35
36
  "peerDependencies": {}
36
37
  }
@@ -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) {
@@ -270,9 +290,11 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
270
290
  const effectiveStartTime = startTime || Date.now();
271
291
  // Write the blockhash before sponsorship, never after: the sponsor signs the
272
292
  // message it is handed, so a later rewrite invalidates its signature and the
273
- // RPC rejects the transaction at preflight with SignatureFailure.
293
+ // RPC rejects the transaction at preflight with SignatureFailure. The same
294
+ // goes for a transaction the caller already had co-signed, so its blockhash
295
+ // is left alone.
274
296
  const txToSponsor = transaction;
275
- if (overrideBlockhash) {
297
+ if (overrideBlockhash && !this.hasForeignSignature(txToSponsor)) {
276
298
  if (solanaCore.isVersionedTransaction(txToSponsor)) {
277
299
  txToSponsor.message.recentBlockhash = overrideBlockhash.blockhash;
278
300
  }
@@ -453,7 +475,10 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
453
475
  // Use 'finalized' so the blockhash is recognized by every RPC node
454
476
  // (a 'confirmed' blockhash may not yet have propagated to the simulating
455
477
  // node, which surfaces as "Blockhash not found" at sendRawTransaction).
478
+ // Not applied to a transaction another key has already signed: see
479
+ // internalSignTransaction.
456
480
  const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
481
+ const keepsCallerBlockhash = this.hasForeignSignature(transaction);
457
482
  const signedTransaction = yield this.instrumentAsync({
458
483
  context: { chainName: 'SVM', startTime: effectiveStartTime, traceId },
459
484
  fn: () => _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -489,15 +514,22 @@ class DynamicWaasSVMConnector extends waas.withDynamicWaas(solanaCore.SolanaWall
489
514
  });
490
515
  const confirmationStartTime = Date.now();
491
516
  // Confirm against the blockhash the broadcast tx actually carries, in case a
492
- // sponsor ever substitutes its own. lastValidBlockHeight stays local, which
493
- // only errs on the side of giving up early.
517
+ // sponsor ever substitutes its own. The fetched lastValidBlockHeight is at or
518
+ // after the real expiry of any blockhash we could be holding, so an expired
519
+ // transaction is reported late, never early. A legacy transaction that
520
+ // carries its own height keeps it, which is exact.
494
521
  const broadcastBlockhash = isVersionedSolanaTransaction
495
522
  ? signedTransaction.message.recentBlockhash
496
523
  : (_a = signedTransaction.recentBlockhash) !== null && _a !== void 0 ? _a : blockhash;
524
+ const confirmationLastValidBlockHeight = keepsCallerBlockhash &&
525
+ !isVersionedSolanaTransaction &&
526
+ signedTransaction.lastValidBlockHeight !== undefined
527
+ ? signedTransaction.lastValidBlockHeight
528
+ : lastValidBlockHeight;
497
529
  try {
498
530
  const confirmationResult = yield connection.confirmTransaction({
499
531
  blockhash: broadcastBlockhash,
500
- lastValidBlockHeight,
532
+ lastValidBlockHeight: confirmationLastValidBlockHeight,
501
533
  signature,
502
534
  }, (_b = options === null || options === void 0 ? void 0 : options.preflightCommitment) !== null && _b !== void 0 ? _b : 'confirmed');
503
535
  const confirmationEndTime = Date.now();
@@ -233,6 +233,14 @@ export declare class DynamicWaasSVMConnector extends DynamicWaasSVMConnector_bas
233
233
  * Check if a transaction is already signed (has non-zero signatures).
234
234
  */
235
235
  private isTxAlreadySigned;
236
+ /**
237
+ * Whether a key other than the active wallet has already signed. That
238
+ * signature covers the current message, so rewriting the blockhash would
239
+ * invalidate it. The active wallet's own signature doesn't count: the SDK
240
+ * writes it into the caller's object on every send, so a retry with that same
241
+ * object still needs its blockhash refreshed.
242
+ */
243
+ private hasForeignSignature;
236
244
  private getFeePayerAddress;
237
245
  private attemptSponsorship;
238
246
  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) {
@@ -266,9 +286,11 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
266
286
  const effectiveStartTime = startTime || Date.now();
267
287
  // Write the blockhash before sponsorship, never after: the sponsor signs the
268
288
  // message it is handed, so a later rewrite invalidates its signature and the
269
- // RPC rejects the transaction at preflight with SignatureFailure.
289
+ // RPC rejects the transaction at preflight with SignatureFailure. The same
290
+ // goes for a transaction the caller already had co-signed, so its blockhash
291
+ // is left alone.
270
292
  const txToSponsor = transaction;
271
- if (overrideBlockhash) {
293
+ if (overrideBlockhash && !this.hasForeignSignature(txToSponsor)) {
272
294
  if (isVersionedTransaction(txToSponsor)) {
273
295
  txToSponsor.message.recentBlockhash = overrideBlockhash.blockhash;
274
296
  }
@@ -449,7 +471,10 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
449
471
  // Use 'finalized' so the blockhash is recognized by every RPC node
450
472
  // (a 'confirmed' blockhash may not yet have propagated to the simulating
451
473
  // node, which surfaces as "Blockhash not found" at sendRawTransaction).
474
+ // Not applied to a transaction another key has already signed: see
475
+ // internalSignTransaction.
452
476
  const { blockhash, lastValidBlockHeight } = yield connection.getLatestBlockhash('finalized');
477
+ const keepsCallerBlockhash = this.hasForeignSignature(transaction);
453
478
  const signedTransaction = yield this.instrumentAsync({
454
479
  context: { chainName: 'SVM', startTime: effectiveStartTime, traceId },
455
480
  fn: () => __awaiter(this, void 0, void 0, function* () {
@@ -485,15 +510,22 @@ class DynamicWaasSVMConnector extends withDynamicWaas(SolanaWalletConnector) {
485
510
  });
486
511
  const confirmationStartTime = Date.now();
487
512
  // Confirm against the blockhash the broadcast tx actually carries, in case a
488
- // sponsor ever substitutes its own. lastValidBlockHeight stays local, which
489
- // only errs on the side of giving up early.
513
+ // sponsor ever substitutes its own. The fetched lastValidBlockHeight is at or
514
+ // after the real expiry of any blockhash we could be holding, so an expired
515
+ // transaction is reported late, never early. A legacy transaction that
516
+ // carries its own height keeps it, which is exact.
490
517
  const broadcastBlockhash = isVersionedSolanaTransaction
491
518
  ? signedTransaction.message.recentBlockhash
492
519
  : (_a = signedTransaction.recentBlockhash) !== null && _a !== void 0 ? _a : blockhash;
520
+ const confirmationLastValidBlockHeight = keepsCallerBlockhash &&
521
+ !isVersionedSolanaTransaction &&
522
+ signedTransaction.lastValidBlockHeight !== undefined
523
+ ? signedTransaction.lastValidBlockHeight
524
+ : lastValidBlockHeight;
493
525
  try {
494
526
  const confirmationResult = yield connection.confirmTransaction({
495
527
  blockhash: broadcastBlockhash,
496
- lastValidBlockHeight,
528
+ lastValidBlockHeight: confirmationLastValidBlockHeight,
497
529
  signature,
498
530
  }, (_b = options === null || options === void 0 ? void 0 : options.preflightCommitment) !== null && _b !== void 0 ? _b : 'confirmed');
499
531
  const confirmationEndTime = Date.now();