@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.
@@ -2262,6 +2262,8 @@ function decodeData(type, buffer) {
2262
2262
  const FeeCalculatorLayout = BufferLayout__namespace.nu64('lamportsPerSignature');
2263
2263
  /**
2264
2264
  * Calculator for transaction fees.
2265
+ *
2266
+ * @deprecated Deprecated since Solana v1.8.0.
2265
2267
  */
2266
2268
 
2267
2269
  /**
@@ -5657,6 +5659,10 @@ const TokenBalanceResult = superstruct.type({
5657
5659
  owner: superstruct.optional(superstruct.string()),
5658
5660
  uiTokenAmount: TokenAmountResult
5659
5661
  });
5662
+ const LoadedAddressesResult = superstruct.type({
5663
+ writable: superstruct.array(PublicKeyFromString),
5664
+ readonly: superstruct.array(PublicKeyFromString)
5665
+ });
5660
5666
  /**
5661
5667
  * @internal
5662
5668
  */
@@ -5676,7 +5682,8 @@ const ConfirmedTransactionMetaResult = superstruct.type({
5676
5682
  postBalances: superstruct.array(superstruct.number()),
5677
5683
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5678
5684
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5679
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5685
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5686
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5680
5687
  });
5681
5688
  /**
5682
5689
  * @internal
@@ -5693,7 +5700,8 @@ const ParsedConfirmedTransactionMetaResult = superstruct.type({
5693
5700
  postBalances: superstruct.array(superstruct.number()),
5694
5701
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5695
5702
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5696
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5703
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5704
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5697
5705
  });
5698
5706
  /**
5699
5707
  * Expected JSON RPC response for the "getBlock" message
@@ -6289,8 +6297,13 @@ class Connection {
6289
6297
  */
6290
6298
 
6291
6299
 
6292
- async getParsedAccountInfo(publicKey, commitment) {
6293
- const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed');
6300
+ async getParsedAccountInfo(publicKey, commitmentOrConfig) {
6301
+ const {
6302
+ commitment,
6303
+ config
6304
+ } = extractCommitmentFromConfig(commitmentOrConfig);
6305
+
6306
+ const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);
6294
6307
 
6295
6308
  const unsafeRes = await this._rpcRequest('getAccountInfo', args);
6296
6309
  const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.nullable(ParsedAccountInfoResult)));
@@ -7890,6 +7903,11 @@ class Connection {
7890
7903
  this._rpcWebSocketConnected = false;
7891
7904
  this._rpcWebSocketGeneration++;
7892
7905
 
7906
+ if (this._rpcWebSocketIdleTimeout) {
7907
+ clearTimeout(this._rpcWebSocketIdleTimeout);
7908
+ this._rpcWebSocketIdleTimeout = null;
7909
+ }
7910
+
7893
7911
  if (this._rpcWebSocketHeartbeat) {
7894
7912
  clearInterval(this._rpcWebSocketHeartbeat);
7895
7913
  this._rpcWebSocketHeartbeat = null;