@solana/web3.js 1.50.0 → 1.52.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.
@@ -2230,6 +2230,8 @@ function decodeData(type, buffer) {
2230
2230
  const FeeCalculatorLayout = BufferLayout.nu64('lamportsPerSignature');
2231
2231
  /**
2232
2232
  * Calculator for transaction fees.
2233
+ *
2234
+ * @deprecated Deprecated since Solana v1.8.0.
2233
2235
  */
2234
2236
 
2235
2237
  /**
@@ -5627,6 +5629,10 @@ const TokenBalanceResult = type({
5627
5629
  owner: optional(string()),
5628
5630
  uiTokenAmount: TokenAmountResult
5629
5631
  });
5632
+ const LoadedAddressesResult = type({
5633
+ writable: array(PublicKeyFromString),
5634
+ readonly: array(PublicKeyFromString)
5635
+ });
5630
5636
  /**
5631
5637
  * @internal
5632
5638
  */
@@ -5646,7 +5652,8 @@ const ConfirmedTransactionMetaResult = type({
5646
5652
  postBalances: array(number()),
5647
5653
  logMessages: optional(nullable(array(string()))),
5648
5654
  preTokenBalances: optional(nullable(array(TokenBalanceResult))),
5649
- postTokenBalances: optional(nullable(array(TokenBalanceResult)))
5655
+ postTokenBalances: optional(nullable(array(TokenBalanceResult))),
5656
+ loadedAddresses: optional(LoadedAddressesResult)
5650
5657
  });
5651
5658
  /**
5652
5659
  * @internal
@@ -5663,7 +5670,8 @@ const ParsedConfirmedTransactionMetaResult = type({
5663
5670
  postBalances: array(number()),
5664
5671
  logMessages: optional(nullable(array(string()))),
5665
5672
  preTokenBalances: optional(nullable(array(TokenBalanceResult))),
5666
- postTokenBalances: optional(nullable(array(TokenBalanceResult)))
5673
+ postTokenBalances: optional(nullable(array(TokenBalanceResult))),
5674
+ loadedAddresses: optional(LoadedAddressesResult)
5667
5675
  });
5668
5676
  /**
5669
5677
  * Expected JSON RPC response for the "getBlock" message
@@ -6259,8 +6267,13 @@ class Connection {
6259
6267
  */
6260
6268
 
6261
6269
 
6262
- async getParsedAccountInfo(publicKey, commitment) {
6263
- const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed');
6270
+ async getParsedAccountInfo(publicKey, commitmentOrConfig) {
6271
+ const {
6272
+ commitment,
6273
+ config
6274
+ } = extractCommitmentFromConfig(commitmentOrConfig);
6275
+
6276
+ const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);
6264
6277
 
6265
6278
  const unsafeRes = await this._rpcRequest('getAccountInfo', args);
6266
6279
  const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)));
@@ -7860,6 +7873,11 @@ class Connection {
7860
7873
  this._rpcWebSocketConnected = false;
7861
7874
  this._rpcWebSocketGeneration++;
7862
7875
 
7876
+ if (this._rpcWebSocketIdleTimeout) {
7877
+ clearTimeout(this._rpcWebSocketIdleTimeout);
7878
+ this._rpcWebSocketIdleTimeout = null;
7879
+ }
7880
+
7863
7881
  if (this._rpcWebSocketHeartbeat) {
7864
7882
  clearInterval(this._rpcWebSocketHeartbeat);
7865
7883
  this._rpcWebSocketHeartbeat = null;