@solana/web3.js 1.47.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.47.2",
3
+ "version": "1.47.3",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
package/src/connection.ts CHANGED
@@ -3051,15 +3051,6 @@ export class Connection {
3051
3051
  }
3052
3052
  });
3053
3053
 
3054
- const checkBlockHeight = async () => {
3055
- try {
3056
- const blockHeight = await this.getBlockHeight(commitment);
3057
- return blockHeight;
3058
- } catch (_e) {
3059
- return -1;
3060
- }
3061
- };
3062
-
3063
3054
  const expiryPromise = new Promise<
3064
3055
  | {__type: TransactionStatus.BLOCKHEIGHT_EXCEEDED}
3065
3056
  | {__type: TransactionStatus.TIMED_OUT; timeoutMs: number}
@@ -3088,6 +3079,14 @@ export class Connection {
3088
3079
  } else {
3089
3080
  let config =
3090
3081
  strategy as BlockheightBasedTransactionConfirmationStrategy;
3082
+ const checkBlockHeight = async () => {
3083
+ try {
3084
+ const blockHeight = await this.getBlockHeight(commitment);
3085
+ return blockHeight;
3086
+ } catch (_e) {
3087
+ return -1;
3088
+ }
3089
+ };
3091
3090
  (async () => {
3092
3091
  let currentBlockHeight = await checkBlockHeight();
3093
3092
  if (done) return;
@@ -258,17 +258,25 @@ export class Transaction {
258
258
  ) {
259
259
  if (!opts) {
260
260
  return;
261
- } else if (
262
- Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')
263
- ) {
264
- const newOpts = opts as TransactionBlockhashCtor;
265
- Object.assign(this, newOpts);
266
- this.recentBlockhash = newOpts.blockhash;
267
- this.lastValidBlockHeight = newOpts.lastValidBlockHeight;
261
+ }
262
+ if (opts.feePayer) {
263
+ this.feePayer = opts.feePayer;
264
+ }
265
+ if (opts.signatures) {
266
+ this.signatures = opts.signatures;
267
+ }
268
+ if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {
269
+ const {blockhash, lastValidBlockHeight} =
270
+ opts as TransactionBlockhashCtor;
271
+ this.recentBlockhash = blockhash;
272
+ this.lastValidBlockHeight = lastValidBlockHeight;
268
273
  } else {
269
- const oldOpts = opts as TransactionCtorFields_DEPRECATED;
270
- Object.assign(this, oldOpts);
271
- this.recentBlockhash = oldOpts.recentBlockhash;
274
+ const {recentBlockhash, nonceInfo} =
275
+ opts as TransactionCtorFields_DEPRECATED;
276
+ if (nonceInfo) {
277
+ this.nonceInfo = nonceInfo;
278
+ }
279
+ this.recentBlockhash = recentBlockhash;
272
280
  }
273
281
  }
274
282