@solana/web3.js 1.69.0 → 1.70.0-pr-29130

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.
@@ -3861,8 +3861,15 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(type({
3861
3861
  * A performance sample
3862
3862
  */
3863
3863
 
3864
- function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
3864
+ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) {
3865
3865
  const fetch = customFetch ? customFetch : fetchImpl;
3866
+ let agent;
3867
+
3868
+ {
3869
+ if (httpAgent != null) {
3870
+ console.warn('You have supplied an `httpAgent` when creating a `Connection` in a browser environment.' + 'It has been ignored; `httpAgent` is only used in Node environments.');
3871
+ }
3872
+ }
3866
3873
 
3867
3874
  let fetchWithMiddleware;
3868
3875
 
@@ -3880,7 +3887,6 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
3880
3887
  }
3881
3888
 
3882
3889
  const clientBrowser = new RpcClient(async (request, callback) => {
3883
- const agent = undefined;
3884
3890
  const options = {
3885
3891
  method: 'POST',
3886
3892
  body: request,
@@ -3932,7 +3938,6 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
3932
3938
  }
3933
3939
  } catch (err) {
3934
3940
  if (err instanceof Error) callback(err);
3935
- } finally {
3936
3941
  }
3937
3942
  }, {});
3938
3943
  return clientBrowser;
@@ -4770,6 +4775,7 @@ class Connection {
4770
4775
  let fetch;
4771
4776
  let fetchMiddleware;
4772
4777
  let disableRetryOnRateLimit;
4778
+ let httpAgent;
4773
4779
 
4774
4780
  if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
4775
4781
  this._commitment = commitmentOrConfig;
@@ -4781,11 +4787,12 @@ class Connection {
4781
4787
  fetch = commitmentOrConfig.fetch;
4782
4788
  fetchMiddleware = commitmentOrConfig.fetchMiddleware;
4783
4789
  disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
4790
+ httpAgent = commitmentOrConfig.httpAgent;
4784
4791
  }
4785
4792
 
4786
4793
  this._rpcEndpoint = assertEndpointUrl(endpoint);
4787
4794
  this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
4788
- this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
4795
+ this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);
4789
4796
  this._rpcRequest = createRpcRequest(this._rpcClient);
4790
4797
  this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
4791
4798
  this._rpcWebSocket = new Client(this._rpcWsEndpoint, {