@solana/web3.js 1.88.0 → 1.89.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/lib/index.cjs.js CHANGED
@@ -1251,20 +1251,25 @@ class TransactionInstruction {
1251
1251
  // For backward compatibility; an unfortunate consequence of being
1252
1252
  // forced to over-export types by the documentation generator.
1253
1253
  // See https://github.com/solana-labs/solana/pull/25820
1254
+
1254
1255
  /**
1255
1256
  * Blockhash-based transactions have a lifetime that are defined by
1256
1257
  * the blockhash they include. Any transaction whose blockhash is
1257
1258
  * too old will be rejected.
1258
1259
  */
1260
+
1259
1261
  /**
1260
1262
  * Use these options to construct a durable nonce transaction.
1261
1263
  */
1264
+
1262
1265
  /**
1263
1266
  * Nonce information to be used to build an offline Transaction.
1264
1267
  */
1268
+
1265
1269
  /**
1266
1270
  * @internal
1267
1271
  */
1272
+
1268
1273
  /**
1269
1274
  * Transaction class
1270
1275
  */
@@ -4482,6 +4487,7 @@ function versionedMessageFromResponse(version, response) {
4482
4487
  */
4483
4488
 
4484
4489
  // Deprecated as of v1.5.5
4490
+
4485
4491
  /**
4486
4492
  * A subset of Commitment levels, which are at least optimistically confirmed
4487
4493
  * <pre>
@@ -4489,6 +4495,7 @@ function versionedMessageFromResponse(version, response) {
4489
4495
  * 'finalized': Query the most recent block which has been finalized by the cluster
4490
4496
  * </pre>
4491
4497
  */
4498
+
4492
4499
  /**
4493
4500
  * Filter for largest accounts query
4494
4501
  * <pre>
@@ -4496,70 +4503,92 @@ function versionedMessageFromResponse(version, response) {
4496
4503
  * 'nonCirculating': Return the largest accounts that are not part of the circulating supply
4497
4504
  * </pre>
4498
4505
  */
4506
+
4499
4507
  /**
4500
4508
  * Configuration object for changing `getAccountInfo` query behavior
4501
4509
  */
4510
+
4502
4511
  /**
4503
4512
  * Configuration object for changing `getBalance` query behavior
4504
4513
  */
4514
+
4505
4515
  /**
4506
4516
  * Configuration object for changing `getBlock` query behavior
4507
4517
  */
4518
+
4508
4519
  /**
4509
4520
  * Configuration object for changing `getBlock` query behavior
4510
4521
  */
4522
+
4511
4523
  /**
4512
4524
  * Configuration object for changing `getStakeMinimumDelegation` query behavior
4513
4525
  */
4526
+
4514
4527
  /**
4515
4528
  * Configuration object for changing `getBlockHeight` query behavior
4516
4529
  */
4530
+
4517
4531
  /**
4518
4532
  * Configuration object for changing `getEpochInfo` query behavior
4519
4533
  */
4534
+
4520
4535
  /**
4521
4536
  * Configuration object for changing `getInflationReward` query behavior
4522
4537
  */
4538
+
4523
4539
  /**
4524
4540
  * Configuration object for changing `getLatestBlockhash` query behavior
4525
4541
  */
4542
+
4526
4543
  /**
4527
4544
  * Configuration object for changing `isBlockhashValid` query behavior
4528
4545
  */
4546
+
4529
4547
  /**
4530
4548
  * Configuration object for changing `getSlot` query behavior
4531
4549
  */
4550
+
4532
4551
  /**
4533
4552
  * Configuration object for changing `getSlotLeader` query behavior
4534
4553
  */
4554
+
4535
4555
  /**
4536
4556
  * Configuration object for changing `getTransaction` query behavior
4537
4557
  */
4558
+
4538
4559
  /**
4539
4560
  * Configuration object for changing `getTransaction` query behavior
4540
4561
  */
4562
+
4541
4563
  /**
4542
4564
  * Configuration object for changing `getLargestAccounts` query behavior
4543
4565
  */
4566
+
4544
4567
  /**
4545
4568
  * Configuration object for changing `getSupply` request behavior
4546
4569
  */
4570
+
4547
4571
  /**
4548
4572
  * Configuration object for changing query behavior
4549
4573
  */
4574
+
4550
4575
  /**
4551
4576
  * Information describing a cluster node
4552
4577
  */
4578
+
4553
4579
  /**
4554
4580
  * Information describing a vote account
4555
4581
  */
4582
+
4556
4583
  /**
4557
4584
  * A collection of cluster vote accounts
4558
4585
  */
4586
+
4559
4587
  /**
4560
4588
  * Network Inflation
4561
4589
  * (see https://docs.solana.com/implemented-proposals/ed_overview)
4562
4590
  */
4591
+
4563
4592
  const GetInflationGovernorResult = superstruct.type({
4564
4593
  foundation: superstruct.number(),
4565
4594
  foundationTerm: superstruct.number(),
@@ -4881,7 +4910,7 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
4881
4910
  if (too_many_requests_retries === 0) {
4882
4911
  break;
4883
4912
  }
4884
- console.log(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`);
4913
+ console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`);
4885
4914
  await sleep(waitTime);
4886
4915
  waitTime *= 2;
4887
4916
  }
@@ -6310,7 +6339,9 @@ class Connection {
6310
6339
  return res.result;
6311
6340
  }
6312
6341
 
6313
- /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ // eslint-disable-next-line no-dupe-class-members
6342
+ /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */
6343
+ // eslint-disable-next-line no-dupe-class-members
6344
+
6314
6345
  // eslint-disable-next-line no-dupe-class-members
6315
6346
  async confirmTransaction(strategy, commitment) {
6316
6347
  let rawSignature;
@@ -7105,21 +7136,28 @@ class Connection {
7105
7136
  /**
7106
7137
  * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
7107
7138
  * setting the `maxSupportedTransactionVersion` property.
7108
- */ // eslint-disable-next-line no-dupe-class-members
7139
+ */
7140
+ // eslint-disable-next-line no-dupe-class-members
7141
+
7109
7142
  /**
7110
7143
  * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
7111
7144
  * setting the `maxSupportedTransactionVersion` property.
7112
7145
  */
7113
7146
  // eslint-disable-next-line no-dupe-class-members
7147
+
7114
7148
  /**
7115
7149
  * Fetch a processed block from the cluster.
7116
7150
  */
7117
7151
  // eslint-disable-next-line no-dupe-class-members
7152
+
7118
7153
  // eslint-disable-next-line no-dupe-class-members
7154
+
7119
7155
  // eslint-disable-next-line no-dupe-class-members
7156
+
7120
7157
  /**
7121
7158
  * Fetch a processed block from the cluster.
7122
- */ // eslint-disable-next-line no-dupe-class-members
7159
+ */
7160
+ // eslint-disable-next-line no-dupe-class-members
7123
7161
  async getBlock(slot, rawConfig) {
7124
7162
  const {
7125
7163
  commitment,
@@ -7258,10 +7296,13 @@ class Connection {
7258
7296
 
7259
7297
  /**
7260
7298
  * Fetch a confirmed or finalized transaction from the cluster.
7261
- */ // eslint-disable-next-line no-dupe-class-members
7299
+ */
7300
+ // eslint-disable-next-line no-dupe-class-members
7301
+
7262
7302
  /**
7263
7303
  * Fetch a confirmed or finalized transaction from the cluster.
7264
- */ // eslint-disable-next-line no-dupe-class-members
7304
+ */
7305
+ // eslint-disable-next-line no-dupe-class-members
7265
7306
  async getTransaction(signature, rawConfig) {
7266
7307
  const {
7267
7308
  commitment,
@@ -7340,12 +7381,15 @@ class Connection {
7340
7381
  * Fetch transaction details for a batch of confirmed transactions.
7341
7382
  * Similar to {@link getParsedTransactions} but returns a {@link
7342
7383
  * VersionedTransactionResponse}.
7343
- */ // eslint-disable-next-line no-dupe-class-members
7384
+ */
7385
+ // eslint-disable-next-line no-dupe-class-members
7386
+
7344
7387
  /**
7345
7388
  * Fetch transaction details for a batch of confirmed transactions.
7346
7389
  * Similar to {@link getParsedTransactions} but returns a {@link
7347
7390
  * VersionedTransactionResponse}.
7348
- */ // eslint-disable-next-line no-dupe-class-members
7391
+ */
7392
+ // eslint-disable-next-line no-dupe-class-members
7349
7393
  async getTransactions(signatures, commitmentOrConfig) {
7350
7394
  const {
7351
7395
  commitment,
@@ -7771,10 +7815,13 @@ class Connection {
7771
7815
 
7772
7816
  /**
7773
7817
  * Simulate a transaction
7774
- */ // eslint-disable-next-line no-dupe-class-members
7818
+ */
7819
+ // eslint-disable-next-line no-dupe-class-members
7820
+
7775
7821
  /**
7776
7822
  * Simulate a transaction
7777
- */ // eslint-disable-next-line no-dupe-class-members
7823
+ */
7824
+ // eslint-disable-next-line no-dupe-class-members
7778
7825
  async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {
7779
7826
  if ('message' in transactionOrMessage) {
7780
7827
  const versionedTx = transactionOrMessage;
@@ -7826,7 +7873,6 @@ class Connection {
7826
7873
  if (!transaction.signature) {
7827
7874
  throw new Error('!signature'); // should never happen
7828
7875
  }
7829
-
7830
7876
  const signature = transaction.signature.toString('base64');
7831
7877
  if (!this._blockhashInfo.simulatedSignatures.includes(signature) && !this._blockhashInfo.transactionSignatures.includes(signature)) {
7832
7878
  // The signature of this transaction has not been seen before with the
@@ -7887,10 +7933,13 @@ class Connection {
7887
7933
 
7888
7934
  /**
7889
7935
  * Send a signed transaction
7890
- */ // eslint-disable-next-line no-dupe-class-members
7936
+ */
7937
+ // eslint-disable-next-line no-dupe-class-members
7938
+
7891
7939
  /**
7892
7940
  * Sign and send a transaction
7893
- */ // eslint-disable-next-line no-dupe-class-members
7941
+ */
7942
+ // eslint-disable-next-line no-dupe-class-members
7894
7943
  async sendTransaction(transaction, signersOrOptions, options) {
7895
7944
  if ('version' in transaction) {
7896
7945
  if (signersOrOptions && Array.isArray(signersOrOptions)) {
@@ -7915,7 +7964,6 @@ class Connection {
7915
7964
  if (!transaction.signature) {
7916
7965
  throw new Error('!signature'); // should never happen
7917
7966
  }
7918
-
7919
7967
  const signature = transaction.signature.toString('base64');
7920
7968
  if (!this._blockhashInfo.transactionSignatures.includes(signature)) {
7921
7969
  // The signature of this transaction has not been seen before with the
@@ -8299,7 +8347,6 @@ class Connection {
8299
8347
  args) {
8300
8348
  const clientSubscriptionId = this._nextClientSubscriptionId++;
8301
8349
  const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
8302
-
8303
8350
  const existingSubscription = this._subscriptionsByHash[hash];
8304
8351
  if (existingSubscription === undefined) {
8305
8352
  this._subscriptionsByHash[hash] = {
@@ -8382,7 +8429,6 @@ class Connection {
8382
8429
  'base64' /* encoding */, filters ? {
8383
8430
  filters: filters
8384
8431
  } : undefined /* extra */);
8385
-
8386
8432
  return this._makeSubscription({
8387
8433
  callback,
8388
8434
  method: 'programSubscribe',
@@ -8407,7 +8453,6 @@ class Connection {
8407
8453
  mentions: [filter.toString()]
8408
8454
  } : filter], commitment || this._commitment || 'finalized' // Apply connection/server default.
8409
8455
  );
8410
-
8411
8456
  return this._makeSubscription({
8412
8457
  callback,
8413
8458
  method: 'logsSubscribe',
@@ -8588,7 +8633,6 @@ class Connection {
8588
8633
  onSignature(signature, callback, commitment) {
8589
8634
  const args = this._buildArgs([signature], commitment || this._commitment || 'finalized' // Apply connection/server default.
8590
8635
  );
8591
-
8592
8636
  const clientSubscriptionId = this._makeSubscription({
8593
8637
  callback: (notification, context) => {
8594
8638
  if (notification.type === 'status') {
@@ -8627,7 +8671,6 @@ class Connection {
8627
8671
  ...options,
8628
8672
  commitment: options && options.commitment || this._commitment || 'finalized' // Apply connection/server default.
8629
8673
  };
8630
-
8631
8674
  const args = this._buildArgs([signature], commitment, undefined /* encoding */, extra);
8632
8675
  const clientSubscriptionId = this._makeSubscription({
8633
8676
  callback: (notification, context) => {
@@ -10894,7 +10937,9 @@ function clusterApiUrl(cluster, tls) {
10894
10937
  /**
10895
10938
  * @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`
10896
10939
  * is no longer supported and will be removed in a future version.
10897
- */ // eslint-disable-next-line no-redeclare
10940
+ */
10941
+ // eslint-disable-next-line no-redeclare
10942
+
10898
10943
  // eslint-disable-next-line no-redeclare
10899
10944
  async function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {
10900
10945
  let confirmationStrategy;