@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.
@@ -2447,15 +2447,34 @@ class Transaction {
2447
2447
 
2448
2448
  if (!opts) {
2449
2449
  return;
2450
- } else if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {
2451
- const newOpts = opts;
2452
- Object.assign(this, newOpts);
2453
- this.recentBlockhash = newOpts.blockhash;
2454
- this.lastValidBlockHeight = newOpts.lastValidBlockHeight;
2450
+ }
2451
+
2452
+ if (opts.feePayer) {
2453
+ this.feePayer = opts.feePayer;
2454
+ }
2455
+
2456
+ if (opts.signatures) {
2457
+ this.signatures = opts.signatures;
2458
+ }
2459
+
2460
+ if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {
2461
+ const {
2462
+ blockhash,
2463
+ lastValidBlockHeight
2464
+ } = opts;
2465
+ this.recentBlockhash = blockhash;
2466
+ this.lastValidBlockHeight = lastValidBlockHeight;
2455
2467
  } else {
2456
- const oldOpts = opts;
2457
- Object.assign(this, oldOpts);
2458
- this.recentBlockhash = oldOpts.recentBlockhash;
2468
+ const {
2469
+ recentBlockhash,
2470
+ nonceInfo
2471
+ } = opts;
2472
+
2473
+ if (nonceInfo) {
2474
+ this.nonceInfo = nonceInfo;
2475
+ }
2476
+
2477
+ this.recentBlockhash = recentBlockhash;
2459
2478
  }
2460
2479
  }
2461
2480
  /**
@@ -4398,6 +4417,8 @@ var fastStableStringify = function(val) {
4398
4417
 
4399
4418
  var fastStableStringify$1 = fastStableStringify;
4400
4419
 
4420
+ const URL = globalThis.URL;
4421
+
4401
4422
  const MINIMUM_SLOT_PER_EPOCH = 32; // Returns the number of trailing zeros in the binary representation of self.
4402
4423
 
4403
4424
  function trailingZeros(n) {
@@ -4795,7 +4816,11 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4795
4816
  data: array(string()),
4796
4817
  rentEpoch: optional(number())
4797
4818
  }))))),
4798
- unitsConsumed: optional(number())
4819
+ unitsConsumed: optional(number()),
4820
+ returnData: optional(nullable(type({
4821
+ programId: string(),
4822
+ data: tuple([string(), literal('base64')])
4823
+ })))
4799
4824
  }));
4800
4825
 
4801
4826
  /**
@@ -6132,16 +6157,6 @@ class Connection {
6132
6157
  reject(err);
6133
6158
  }
6134
6159
  });
6135
-
6136
- const checkBlockHeight = async () => {
6137
- try {
6138
- const blockHeight = await this.getBlockHeight(commitment);
6139
- return blockHeight;
6140
- } catch (_e) {
6141
- return -1;
6142
- }
6143
- };
6144
-
6145
6160
  const expiryPromise = new Promise(resolve => {
6146
6161
  if (typeof strategy === 'string') {
6147
6162
  let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;
@@ -6165,6 +6180,15 @@ class Connection {
6165
6180
  } else {
6166
6181
  let config = strategy;
6167
6182
 
6183
+ const checkBlockHeight = async () => {
6184
+ try {
6185
+ const blockHeight = await this.getBlockHeight(commitment);
6186
+ return blockHeight;
6187
+ } catch (_e) {
6188
+ return -1;
6189
+ }
6190
+ };
6191
+
6168
6192
  (async () => {
6169
6193
  let currentBlockHeight = await checkBlockHeight();
6170
6194
  if (done) return;
@@ -6528,9 +6552,7 @@ class Connection {
6528
6552
 
6529
6553
 
6530
6554
  async getRecentPerformanceSamples(limit) {
6531
- const args = this._buildArgs(limit ? [limit] : []);
6532
-
6533
- const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', args);
6555
+ const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);
6534
6556
  const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);
6535
6557
 
6536
6558
  if ('error' in res) {