@solana/web3.js 1.47.0 → 1.47.3

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
@@ -14138,15 +14138,34 @@ var solanaWeb3 = (function (exports) {
14138
14138
 
14139
14139
  if (!opts) {
14140
14140
  return;
14141
- } else if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {
14142
- const newOpts = opts;
14143
- Object.assign(this, newOpts);
14144
- this.recentBlockhash = newOpts.blockhash;
14145
- this.lastValidBlockHeight = newOpts.lastValidBlockHeight;
14141
+ }
14142
+
14143
+ if (opts.feePayer) {
14144
+ this.feePayer = opts.feePayer;
14145
+ }
14146
+
14147
+ if (opts.signatures) {
14148
+ this.signatures = opts.signatures;
14149
+ }
14150
+
14151
+ if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {
14152
+ const {
14153
+ blockhash,
14154
+ lastValidBlockHeight
14155
+ } = opts;
14156
+ this.recentBlockhash = blockhash;
14157
+ this.lastValidBlockHeight = lastValidBlockHeight;
14146
14158
  } else {
14147
- const oldOpts = opts;
14148
- Object.assign(this, oldOpts);
14149
- this.recentBlockhash = oldOpts.recentBlockhash;
14159
+ const {
14160
+ recentBlockhash,
14161
+ nonceInfo
14162
+ } = opts;
14163
+
14164
+ if (nonceInfo) {
14165
+ this.nonceInfo = nonceInfo;
14166
+ }
14167
+
14168
+ this.recentBlockhash = recentBlockhash;
14150
14169
  }
14151
14170
  }
14152
14171
  /**
@@ -20988,16 +21007,6 @@ var solanaWeb3 = (function (exports) {
20988
21007
  reject(err);
20989
21008
  }
20990
21009
  });
20991
-
20992
- const checkBlockHeight = async () => {
20993
- try {
20994
- const blockHeight = await this.getBlockHeight(commitment);
20995
- return blockHeight;
20996
- } catch (_e) {
20997
- return -1;
20998
- }
20999
- };
21000
-
21001
21010
  const expiryPromise = new Promise(resolve => {
21002
21011
  if (typeof strategy === 'string') {
21003
21012
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
@@ -21021,6 +21030,15 @@ var solanaWeb3 = (function (exports) {
21021
21030
  } else {
21022
21031
  let config = strategy;
21023
21032
 
21033
+ const checkBlockHeight = async () => {
21034
+ try {
21035
+ const blockHeight = await this.getBlockHeight(commitment);
21036
+ return blockHeight;
21037
+ } catch (_e) {
21038
+ return -1;
21039
+ }
21040
+ };
21041
+
21024
21042
  (async () => {
21025
21043
  let currentBlockHeight = await checkBlockHeight();
21026
21044
  if (done) return;
@@ -21384,9 +21402,7 @@ var solanaWeb3 = (function (exports) {
21384
21402
 
21385
21403
 
21386
21404
  async getRecentPerformanceSamples(limit) {
21387
- const args = this._buildArgs(limit ? [limit] : []);
21388
-
21389
- const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', args);
21405
+ const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);
21390
21406
  const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);
21391
21407
 
21392
21408
  if ('error' in res) {
@@ -22299,7 +22315,7 @@ var solanaWeb3 = (function (exports) {
22299
22315
  const skipPreflight = options && options.skipPreflight;
22300
22316
  const preflightCommitment = options && options.preflightCommitment || this.commitment;
22301
22317
 
22302
- if (options && options.maxRetries) {
22318
+ if (options && options.maxRetries != null) {
22303
22319
  config.maxRetries = options.maxRetries;
22304
22320
  }
22305
22321