@solana/web3.js 1.66.3 → 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.cjs.js CHANGED
@@ -1863,7 +1863,7 @@ class Transaction {
1863
1863
  return false;
1864
1864
  }
1865
1865
  } else {
1866
- if (!verify(signature, signData, publicKey.toBuffer())) {
1866
+ if (!verify(signature, signData, publicKey.toBytes())) {
1867
1867
  return false;
1868
1868
  }
1869
1869
  }
@@ -5279,7 +5279,7 @@ class Connection {
5279
5279
  }
5280
5280
 
5281
5281
  assert(decodedSignature.length === 64, 'signature has invalid length');
5282
- const subscriptionCommitment = commitment || this.commitment;
5282
+ const confirmationCommitment = commitment || this.commitment;
5283
5283
  let timeoutId;
5284
5284
  let signatureSubscriptionId;
5285
5285
  let disposeSignatureSubscriptionStateChangeObserver;
@@ -5297,7 +5297,7 @@ class Connection {
5297
5297
  __type: exports.TransactionStatus.PROCESSED,
5298
5298
  response
5299
5299
  });
5300
- }, subscriptionCommitment);
5300
+ }, confirmationCommitment);
5301
5301
  const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {
5302
5302
  if (signatureSubscriptionId == null) {
5303
5303
  resolveSubscriptionSetup();
@@ -5325,11 +5325,41 @@ class Connection {
5325
5325
  value
5326
5326
  } = response;
5327
5327
 
5328
+ if (value == null) {
5329
+ return;
5330
+ }
5331
+
5328
5332
  if (value !== null && value !== void 0 && value.err) {
5329
5333
  reject(value.err);
5330
- }
5334
+ } else {
5335
+ switch (confirmationCommitment) {
5336
+ case 'confirmed':
5337
+ case 'single':
5338
+ case 'singleGossip':
5339
+ {
5340
+ if (value.confirmationStatus === 'processed') {
5341
+ return;
5342
+ }
5343
+
5344
+ break;
5345
+ }
5346
+
5347
+ case 'finalized':
5348
+ case 'max':
5349
+ case 'root':
5350
+ {
5351
+ if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {
5352
+ return;
5353
+ }
5354
+
5355
+ break;
5356
+ }
5357
+ // exhaust enums to ensure full coverage
5358
+
5359
+ case 'processed':
5360
+ case 'recent':
5361
+ }
5331
5362
 
5332
- if (value) {
5333
5363
  done = true;
5334
5364
  resolve({
5335
5365
  __type: exports.TransactionStatus.PROCESSED,
@@ -5348,7 +5378,7 @@ class Connection {
5348
5378
  if (typeof strategy === 'string') {
5349
5379
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
5350
5380
 
5351
- switch (subscriptionCommitment) {
5381
+ switch (confirmationCommitment) {
5352
5382
  case 'processed':
5353
5383
  case 'recent':
5354
5384
  case 'single':