@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/README.md CHANGED
@@ -109,6 +109,10 @@ Each Github release features a tarball containing API documentation and a
109
109
  minified version of the module suitable for direct use in a browser environment
110
110
  (`<script>` tag)
111
111
 
112
+ ## Contributing
113
+
114
+ If you have an issue to report or would like to contribute a pull request, please do so against the monorepo at https://github.com/solana-labs/solana. We are not able to merge pull requests into the mirror repo https://github.com/solana-labs/solana-web3.js and issues filed there may go unnoticed.
115
+
112
116
  ## Disclaimer
113
117
 
114
118
  All claims, content, designs, algorithms, estimates, roadmaps,
@@ -2261,6 +2261,8 @@ function decodeData(type, buffer) {
2261
2261
  const FeeCalculatorLayout = BufferLayout__namespace.nu64('lamportsPerSignature');
2262
2262
  /**
2263
2263
  * Calculator for transaction fees.
2264
+ *
2265
+ * @deprecated Deprecated since Solana v1.8.0.
2264
2266
  */
2265
2267
 
2266
2268
  /**
@@ -5658,6 +5660,10 @@ const TokenBalanceResult = superstruct.type({
5658
5660
  owner: superstruct.optional(superstruct.string()),
5659
5661
  uiTokenAmount: TokenAmountResult
5660
5662
  });
5663
+ const LoadedAddressesResult = superstruct.type({
5664
+ writable: superstruct.array(PublicKeyFromString),
5665
+ readonly: superstruct.array(PublicKeyFromString)
5666
+ });
5661
5667
  /**
5662
5668
  * @internal
5663
5669
  */
@@ -5677,7 +5683,8 @@ const ConfirmedTransactionMetaResult = superstruct.type({
5677
5683
  postBalances: superstruct.array(superstruct.number()),
5678
5684
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5679
5685
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5680
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5686
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5687
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5681
5688
  });
5682
5689
  /**
5683
5690
  * @internal
@@ -5694,7 +5701,8 @@ const ParsedConfirmedTransactionMetaResult = superstruct.type({
5694
5701
  postBalances: superstruct.array(superstruct.number()),
5695
5702
  logMessages: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.string()))),
5696
5703
  preTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5697
- postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult)))
5704
+ postTokenBalances: superstruct.optional(superstruct.nullable(superstruct.array(TokenBalanceResult))),
5705
+ loadedAddresses: superstruct.optional(LoadedAddressesResult)
5698
5706
  });
5699
5707
  /**
5700
5708
  * Expected JSON RPC response for the "getBlock" message
@@ -6290,8 +6298,13 @@ class Connection {
6290
6298
  */
6291
6299
 
6292
6300
 
6293
- async getParsedAccountInfo(publicKey, commitment) {
6294
- const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed');
6301
+ async getParsedAccountInfo(publicKey, commitmentOrConfig) {
6302
+ const {
6303
+ commitment,
6304
+ config
6305
+ } = extractCommitmentFromConfig(commitmentOrConfig);
6306
+
6307
+ const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);
6295
6308
 
6296
6309
  const unsafeRes = await this._rpcRequest('getAccountInfo', args);
6297
6310
  const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.nullable(ParsedAccountInfoResult)));
@@ -7891,6 +7904,11 @@ class Connection {
7891
7904
  this._rpcWebSocketConnected = false;
7892
7905
  this._rpcWebSocketGeneration++;
7893
7906
 
7907
+ if (this._rpcWebSocketIdleTimeout) {
7908
+ clearTimeout(this._rpcWebSocketIdleTimeout);
7909
+ this._rpcWebSocketIdleTimeout = null;
7910
+ }
7911
+
7894
7912
  if (this._rpcWebSocketHeartbeat) {
7895
7913
  clearInterval(this._rpcWebSocketHeartbeat);
7896
7914
  this._rpcWebSocketHeartbeat = null;