@solana/web3.js 1.66.4 → 1.66.5

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/lib/index.iife.js CHANGED
@@ -18836,7 +18836,7 @@ var solanaWeb3 = (function (exports) {
18836
18836
  }
18837
18837
 
18838
18838
  assert$1(decodedSignature.length === 64, 'signature has invalid length');
18839
- const subscriptionCommitment = commitment || this.commitment;
18839
+ const confirmationCommitment = commitment || this.commitment;
18840
18840
  let timeoutId;
18841
18841
  let signatureSubscriptionId;
18842
18842
  let disposeSignatureSubscriptionStateChangeObserver;
@@ -18854,7 +18854,7 @@ var solanaWeb3 = (function (exports) {
18854
18854
  __type: exports.TransactionStatus.PROCESSED,
18855
18855
  response
18856
18856
  });
18857
- }, subscriptionCommitment);
18857
+ }, confirmationCommitment);
18858
18858
  const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {
18859
18859
  if (signatureSubscriptionId == null) {
18860
18860
  resolveSubscriptionSetup();
@@ -18882,11 +18882,41 @@ var solanaWeb3 = (function (exports) {
18882
18882
  value
18883
18883
  } = response;
18884
18884
 
18885
+ if (value == null) {
18886
+ return;
18887
+ }
18888
+
18885
18889
  if (value !== null && value !== void 0 && value.err) {
18886
18890
  reject(value.err);
18887
- }
18891
+ } else {
18892
+ switch (confirmationCommitment) {
18893
+ case 'confirmed':
18894
+ case 'single':
18895
+ case 'singleGossip':
18896
+ {
18897
+ if (value.confirmationStatus === 'processed') {
18898
+ return;
18899
+ }
18900
+
18901
+ break;
18902
+ }
18903
+
18904
+ case 'finalized':
18905
+ case 'max':
18906
+ case 'root':
18907
+ {
18908
+ if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {
18909
+ return;
18910
+ }
18911
+
18912
+ break;
18913
+ }
18914
+ // exhaust enums to ensure full coverage
18915
+
18916
+ case 'processed':
18917
+ case 'recent':
18918
+ }
18888
18919
 
18889
- if (value) {
18890
18920
  done = true;
18891
18921
  resolve({
18892
18922
  __type: exports.TransactionStatus.PROCESSED,
@@ -18905,7 +18935,7 @@ var solanaWeb3 = (function (exports) {
18905
18935
  if (typeof strategy === 'string') {
18906
18936
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
18907
18937
 
18908
- switch (subscriptionCommitment) {
18938
+ switch (confirmationCommitment) {
18909
18939
  case 'processed':
18910
18940
  case 'recent':
18911
18941
  case 'single':