@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.
@@ -5183,7 +5183,7 @@ class Connection {
5183
5183
  }
5184
5184
 
5185
5185
  assert(decodedSignature.length === 64, 'signature has invalid length');
5186
- const subscriptionCommitment = commitment || this.commitment;
5186
+ const confirmationCommitment = commitment || this.commitment;
5187
5187
  let timeoutId;
5188
5188
  let signatureSubscriptionId;
5189
5189
  let disposeSignatureSubscriptionStateChangeObserver;
@@ -5201,7 +5201,7 @@ class Connection {
5201
5201
  __type: TransactionStatus.PROCESSED,
5202
5202
  response
5203
5203
  });
5204
- }, subscriptionCommitment);
5204
+ }, confirmationCommitment);
5205
5205
  const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {
5206
5206
  if (signatureSubscriptionId == null) {
5207
5207
  resolveSubscriptionSetup();
@@ -5229,11 +5229,41 @@ class Connection {
5229
5229
  value
5230
5230
  } = response;
5231
5231
 
5232
+ if (value == null) {
5233
+ return;
5234
+ }
5235
+
5232
5236
  if (value !== null && value !== void 0 && value.err) {
5233
5237
  reject(value.err);
5234
- }
5238
+ } else {
5239
+ switch (confirmationCommitment) {
5240
+ case 'confirmed':
5241
+ case 'single':
5242
+ case 'singleGossip':
5243
+ {
5244
+ if (value.confirmationStatus === 'processed') {
5245
+ return;
5246
+ }
5247
+
5248
+ break;
5249
+ }
5250
+
5251
+ case 'finalized':
5252
+ case 'max':
5253
+ case 'root':
5254
+ {
5255
+ if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {
5256
+ return;
5257
+ }
5258
+
5259
+ break;
5260
+ }
5261
+ // exhaust enums to ensure full coverage
5262
+
5263
+ case 'processed':
5264
+ case 'recent':
5265
+ }
5235
5266
 
5236
- if (value) {
5237
5267
  done = true;
5238
5268
  resolve({
5239
5269
  __type: TransactionStatus.PROCESSED,
@@ -5252,7 +5282,7 @@ class Connection {
5252
5282
  if (typeof strategy === 'string') {
5253
5283
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
5254
5284
 
5255
- switch (subscriptionCommitment) {
5285
+ switch (confirmationCommitment) {
5256
5286
  case 'processed':
5257
5287
  case 'recent':
5258
5288
  case 'single':