@solana/web3.js 1.44.2 → 1.44.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
@@ -14201,24 +14201,27 @@ var solanaWeb3 = (function (exports) {
14201
14201
  return this._message;
14202
14202
  }
14203
14203
 
14204
- const {
14205
- nonceInfo
14206
- } = this;
14204
+ let recentBlockhash;
14205
+ let instructions;
14207
14206
 
14208
- if (nonceInfo && this.instructions[0] != nonceInfo.nonceInstruction) {
14209
- this.recentBlockhash = nonceInfo.nonce;
14210
- this.instructions.unshift(nonceInfo.nonceInstruction);
14211
- }
14207
+ if (this.nonceInfo) {
14208
+ recentBlockhash = this.nonceInfo.nonce;
14212
14209
 
14213
- const {
14214
- recentBlockhash
14215
- } = this;
14210
+ if (this.instructions[0] != this.nonceInfo.nonceInstruction) {
14211
+ instructions = [this.nonceInfo.nonceInstruction, ...this.instructions];
14212
+ } else {
14213
+ instructions = this.instructions;
14214
+ }
14215
+ } else {
14216
+ recentBlockhash = this.recentBlockhash;
14217
+ instructions = this.instructions;
14218
+ }
14216
14219
 
14217
14220
  if (!recentBlockhash) {
14218
14221
  throw new Error('Transaction recentBlockhash required');
14219
14222
  }
14220
14223
 
14221
- if (this.instructions.length < 1) {
14224
+ if (instructions.length < 1) {
14222
14225
  console.warn('No instructions provided');
14223
14226
  }
14224
14227
 
@@ -14233,15 +14236,15 @@ var solanaWeb3 = (function (exports) {
14233
14236
  throw new Error('Transaction fee payer required');
14234
14237
  }
14235
14238
 
14236
- for (let i = 0; i < this.instructions.length; i++) {
14237
- if (this.instructions[i].programId === undefined) {
14239
+ for (let i = 0; i < instructions.length; i++) {
14240
+ if (instructions[i].programId === undefined) {
14238
14241
  throw new Error(`Transaction instruction index ${i} has undefined program id`);
14239
14242
  }
14240
14243
  }
14241
14244
 
14242
14245
  const programIds = [];
14243
14246
  const accountMetas = [];
14244
- this.instructions.forEach(instruction => {
14247
+ instructions.forEach(instruction => {
14245
14248
  instruction.keys.forEach(accountMeta => {
14246
14249
  accountMetas.push({ ...accountMeta
14247
14250
  });
@@ -14351,7 +14354,7 @@ var solanaWeb3 = (function (exports) {
14351
14354
  }
14352
14355
  });
14353
14356
  const accountKeys = signedKeys.concat(unsignedKeys);
14354
- const instructions = this.instructions.map(instruction => {
14357
+ const compiledInstructions = instructions.map(instruction => {
14355
14358
  const {
14356
14359
  data,
14357
14360
  programId
@@ -14362,7 +14365,7 @@ var solanaWeb3 = (function (exports) {
14362
14365
  data: bs58$1.encode(data)
14363
14366
  };
14364
14367
  });
14365
- instructions.forEach(instruction => {
14368
+ compiledInstructions.forEach(instruction => {
14366
14369
  assert$c(instruction.programIdIndex >= 0);
14367
14370
  instruction.accounts.forEach(keyIndex => assert$c(keyIndex >= 0));
14368
14371
  });
@@ -14374,7 +14377,7 @@ var solanaWeb3 = (function (exports) {
14374
14377
  },
14375
14378
  accountKeys,
14376
14379
  recentBlockhash,
14377
- instructions
14380
+ instructions: compiledInstructions
14378
14381
  });
14379
14382
  }
14380
14383
  /**