@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.
package/lib/index.cjs.js CHANGED
@@ -2288,6 +2288,8 @@ function decodeData(type, buffer) {
2288
2288
  const FeeCalculatorLayout = BufferLayout__namespace.nu64('lamportsPerSignature');
2289
2289
  /**
2290
2290
  * Calculator for transaction fees.
2291
+ *
2292
+ * @deprecated Deprecated since Solana v1.8.0.
2291
2293
  */
2292
2294
 
2293
2295
  /**
@@ -5743,6 +5745,10 @@ const TokenBalanceResult = superstruct.type({
5743
5745
  owner: superstruct.optional(superstruct.string()),
5744
5746
  uiTokenAmount: TokenAmountResult
5745
5747
  });
5748
+ const LoadedAddressesResult = superstruct.type({
5749
+ writable: superstruct.array(PublicKeyFromString),
5750
+ readonly: superstruct.array(PublicKeyFromString)
5751
+ });
5746
5752
  /**
5747
5753
  * @internal
5748
5754
  */
@@ -5762,7 +5768,8 @@ const ConfirmedTransactionMetaResult = superstruct.type({
5762
5768
  postBalances: superstruct.array(superstruct.number()),
5763
5769
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5764
5770
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5765
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5771
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5772
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5766
5773
  });
5767
5774
  /**
5768
5775
  * @internal
@@ -5779,7 +5786,8 @@ const ParsedConfirmedTransactionMetaResult = superstruct.type({
5779
5786
  postBalances: superstruct.array(superstruct.number()),
5780
5787
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5781
5788
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5782
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5789
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5790
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5783
5791
  });
5784
5792
  /**
5785
5793
  * Expected JSON RPC response for the "getBlock" message
@@ -6375,8 +6383,13 @@ class Connection {
6375
6383
  */
6376
6384
 
6377
6385
 
6378
- async getParsedAccountInfo(publicKey, commitment) {
6379
- const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed');
6386
+ async getParsedAccountInfo(publicKey, commitmentOrConfig) {
6387
+ const {
6388
+ commitment,
6389
+ config
6390
+ } = extractCommitmentFromConfig(commitmentOrConfig);
6391
+
6392
+ const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);
6380
6393
 
6381
6394
  const unsafeRes = await this._rpcRequest('getAccountInfo', args);
6382
6395
  const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.nullable(ParsedAccountInfoResult)));
@@ -7976,6 +7989,11 @@ class Connection {
7976
7989
  this._rpcWebSocketConnected = false;
7977
7990
  this._rpcWebSocketGeneration++;
7978
7991
 
7992
+ if (this._rpcWebSocketIdleTimeout) {
7993
+ clearTimeout(this._rpcWebSocketIdleTimeout);
7994
+ this._rpcWebSocketIdleTimeout = null;
7995
+ }
7996
+
7979
7997
  if (this._rpcWebSocketHeartbeat) {
7980
7998
  clearInterval(this._rpcWebSocketHeartbeat);
7981
7999
  this._rpcWebSocketHeartbeat = null;