@solana/web3.js 1.38.0 → 1.39.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.
@@ -4589,7 +4589,7 @@ exports.Response = ctx.Response;
4589
4589
  module.exports = exports;
4590
4590
  }(browserPonyfill, browserPonyfill.exports));
4591
4591
 
4592
- var fetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
4592
+ var crossFetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
4593
4593
 
4594
4594
  const MINIMUM_SLOT_PER_EPOCH = 32; // Returns the number of trailing zeros in the binary representation of self.
4595
4595
 
@@ -4926,7 +4926,8 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(superstruct.type({
4926
4926
  * A performance sample
4927
4927
  */
4928
4928
 
4929
- function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit) {
4929
+ function createRpcClient(url, useHttps, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
4930
+ const fetch = customFetch ? customFetch : crossFetch;
4930
4931
 
4931
4932
  let fetchWithMiddleware;
4932
4933
 
@@ -5728,6 +5729,7 @@ class Connection {
5728
5729
  const useHttps = url.protocol === 'https:';
5729
5730
  let wsEndpoint;
5730
5731
  let httpHeaders;
5732
+ let fetch;
5731
5733
  let fetchMiddleware;
5732
5734
  let disableRetryOnRateLimit;
5733
5735
 
@@ -5738,13 +5740,14 @@ class Connection {
5738
5740
  this._confirmTransactionInitialTimeout = commitmentOrConfig.confirmTransactionInitialTimeout;
5739
5741
  wsEndpoint = commitmentOrConfig.wsEndpoint;
5740
5742
  httpHeaders = commitmentOrConfig.httpHeaders;
5743
+ fetch = commitmentOrConfig.fetch;
5741
5744
  fetchMiddleware = commitmentOrConfig.fetchMiddleware;
5742
5745
  disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
5743
5746
  }
5744
5747
 
5745
5748
  this._rpcEndpoint = endpoint;
5746
5749
  this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
5747
- this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit);
5750
+ this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
5748
5751
  this._rpcRequest = createRpcRequest(this._rpcClient);
5749
5752
  this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
5750
5753
  this._rpcWebSocket = new rpcWebsockets.Client(this._rpcWsEndpoint, {