@solana/web3.js 1.69.0 → 1.70.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.
@@ -3861,9 +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
3866
 
3867
+ {
3868
+ if (httpAgent != null) {
3869
+ 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.');
3870
+ }
3871
+ }
3872
+
3867
3873
  let fetchWithMiddleware;
3868
3874
 
3869
3875
  if (fetchMiddleware) {
@@ -4770,6 +4776,7 @@ class Connection {
4770
4776
  let fetch;
4771
4777
  let fetchMiddleware;
4772
4778
  let disableRetryOnRateLimit;
4779
+ let httpAgent;
4773
4780
 
4774
4781
  if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
4775
4782
  this._commitment = commitmentOrConfig;
@@ -4781,11 +4788,12 @@ class Connection {
4781
4788
  fetch = commitmentOrConfig.fetch;
4782
4789
  fetchMiddleware = commitmentOrConfig.fetchMiddleware;
4783
4790
  disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
4791
+ httpAgent = commitmentOrConfig.httpAgent;
4784
4792
  }
4785
4793
 
4786
4794
  this._rpcEndpoint = assertEndpointUrl(endpoint);
4787
4795
  this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
4788
- this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
4796
+ this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);
4789
4797
  this._rpcRequest = createRpcRequest(this._rpcClient);
4790
4798
  this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
4791
4799
  this._rpcWebSocket = new Client(this._rpcWsEndpoint, {