@solana/web3.js 1.37.1 → 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.
package/lib/index.iife.js CHANGED
@@ -16242,7 +16242,7 @@ var solanaWeb3 = (function (exports) {
16242
16242
  module.exports = exports;
16243
16243
  }(browserPonyfill, browserPonyfill.exports));
16244
16244
 
16245
- var fetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
16245
+ var crossFetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
16246
16246
 
16247
16247
  /**
16248
16248
  * A `StructFailure` represents a single specific failure in validation.
@@ -20190,7 +20190,8 @@ var solanaWeb3 = (function (exports) {
20190
20190
  * A performance sample
20191
20191
  */
20192
20192
 
20193
- function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit) {
20193
+ function createRpcClient(url, useHttps, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
20194
+ const fetch = customFetch ? customFetch : crossFetch;
20194
20195
 
20195
20196
  let fetchWithMiddleware;
20196
20197
 
@@ -20992,6 +20993,7 @@ var solanaWeb3 = (function (exports) {
20992
20993
  const useHttps = url.protocol === 'https:';
20993
20994
  let wsEndpoint;
20994
20995
  let httpHeaders;
20996
+ let fetch;
20995
20997
  let fetchMiddleware;
20996
20998
  let disableRetryOnRateLimit;
20997
20999
 
@@ -21002,13 +21004,14 @@ var solanaWeb3 = (function (exports) {
21002
21004
  this._confirmTransactionInitialTimeout = commitmentOrConfig.confirmTransactionInitialTimeout;
21003
21005
  wsEndpoint = commitmentOrConfig.wsEndpoint;
21004
21006
  httpHeaders = commitmentOrConfig.httpHeaders;
21007
+ fetch = commitmentOrConfig.fetch;
21005
21008
  fetchMiddleware = commitmentOrConfig.fetchMiddleware;
21006
21009
  disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
21007
21010
  }
21008
21011
 
21009
21012
  this._rpcEndpoint = endpoint;
21010
21013
  this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
21011
- this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit);
21014
+ this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
21012
21015
  this._rpcRequest = createRpcRequest(this._rpcClient);
21013
21016
  this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
21014
21017
  this._rpcWebSocket = new Client_1(this._rpcWsEndpoint, {
@@ -22514,7 +22517,14 @@ var solanaWeb3 = (function (exports) {
22514
22517
  let transaction;
22515
22518
 
22516
22519
  if (transactionOrMessage instanceof Transaction) {
22517
- transaction = transactionOrMessage;
22520
+ let originalTx = transactionOrMessage;
22521
+ transaction = new Transaction({
22522
+ recentBlockhash: originalTx.recentBlockhash,
22523
+ nonceInfo: originalTx.nonceInfo,
22524
+ feePayer: originalTx.feePayer,
22525
+ signatures: [...originalTx.signatures]
22526
+ });
22527
+ transaction.instructions = transactionOrMessage.instructions;
22518
22528
  } else {
22519
22529
  transaction = Transaction.populate(transactionOrMessage);
22520
22530
  }
@@ -22787,6 +22797,7 @@ var solanaWeb3 = (function (exports) {
22787
22797
 
22788
22798
  _resetSubscriptions() {
22789
22799
  Object.values(this._accountChangeSubscriptions).forEach(s => s.subscriptionId = null);
22800
+ Object.values(this._logsSubscriptions).forEach(s => s.subscriptionId = null);
22790
22801
  Object.values(this._programAccountChangeSubscriptions).forEach(s => s.subscriptionId = null);
22791
22802
  Object.values(this._rootSubscriptions).forEach(s => s.subscriptionId = null);
22792
22803
  Object.values(this._signatureSubscriptions).forEach(s => s.subscriptionId = null);