@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.
@@ -3891,9 +3891,15 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(superstruct.type({
3891
3891
  * A performance sample
3892
3892
  */
3893
3893
 
3894
- function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
3894
+ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) {
3895
3895
  const fetch = customFetch ? customFetch : fetchImpl;
3896
3896
 
3897
+ {
3898
+ if (httpAgent != null) {
3899
+ 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.');
3900
+ }
3901
+ }
3902
+
3897
3903
  let fetchWithMiddleware;
3898
3904
 
3899
3905
  if (fetchMiddleware) {
@@ -4800,6 +4806,7 @@ class Connection {
4800
4806
  let fetch;
4801
4807
  let fetchMiddleware;
4802
4808
  let disableRetryOnRateLimit;
4809
+ let httpAgent;
4803
4810
 
4804
4811
  if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
4805
4812
  this._commitment = commitmentOrConfig;
@@ -4811,11 +4818,12 @@ class Connection {
4811
4818
  fetch = commitmentOrConfig.fetch;
4812
4819
  fetchMiddleware = commitmentOrConfig.fetchMiddleware;
4813
4820
  disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
4821
+ httpAgent = commitmentOrConfig.httpAgent;
4814
4822
  }
4815
4823
 
4816
4824
  this._rpcEndpoint = assertEndpointUrl(endpoint);
4817
4825
  this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
4818
- this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
4826
+ this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);
4819
4827
  this._rpcRequest = createRpcRequest(this._rpcClient);
4820
4828
  this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
4821
4829
  this._rpcWebSocket = new rpcWebsockets.Client(this._rpcWsEndpoint, {