@solana/web3.js 1.47.1 → 1.47.4

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
  /**
@@ -19254,6 +19273,8 @@ var solanaWeb3 = (function (exports) {
19254
19273
 
19255
19274
  var RpcClient = browser;
19256
19275
 
19276
+ const URL = globalThis.URL;
19277
+
19257
19278
  const MINIMUM_SLOT_PER_EPOCH = 32; // Returns the number of trailing zeros in the binary representation of self.
19258
19279
 
19259
19280
  function trailingZeros(n) {
@@ -19651,7 +19672,11 @@ var solanaWeb3 = (function (exports) {
19651
19672
  data: array(string()),
19652
19673
  rentEpoch: optional(number())
19653
19674
  }))))),
19654
- unitsConsumed: optional(number())
19675
+ unitsConsumed: optional(number()),
19676
+ returnData: optional(nullable(type({
19677
+ programId: string(),
19678
+ data: tuple([string(), literal('base64')])
19679
+ })))
19655
19680
  }));
19656
19681
 
19657
19682
  /**
@@ -20988,16 +21013,6 @@ var solanaWeb3 = (function (exports) {
20988
21013
  reject(err);
20989
21014
  }
20990
21015
  });
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
21016
  const expiryPromise = new Promise(resolve => {
21002
21017
  if (typeof strategy === 'string') {
21003
21018
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
@@ -21021,6 +21036,15 @@ var solanaWeb3 = (function (exports) {
21021
21036
  } else {
21022
21037
  let config = strategy;
21023
21038
 
21039
+ const checkBlockHeight = async () => {
21040
+ try {
21041
+ const blockHeight = await this.getBlockHeight(commitment);
21042
+ return blockHeight;
21043
+ } catch (_e) {
21044
+ return -1;
21045
+ }
21046
+ };
21047
+
21024
21048
  (async () => {
21025
21049
  let currentBlockHeight = await checkBlockHeight();
21026
21050
  if (done) return;
@@ -21384,9 +21408,7 @@ var solanaWeb3 = (function (exports) {
21384
21408
 
21385
21409
 
21386
21410
  async getRecentPerformanceSamples(limit) {
21387
- const args = this._buildArgs(limit ? [limit] : []);
21388
-
21389
- const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', args);
21411
+ const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);
21390
21412
  const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);
21391
21413
 
21392
21414
  if ('error' in res) {