@solana/web3.js 1.22.1 → 1.23.1

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.cjs.js CHANGED
@@ -2155,8 +2155,7 @@ class Loader {
2155
2155
  * Can be used to calculate transaction fees
2156
2156
  */
2157
2157
  static getMinNumSignatures(dataLength) {
2158
- return 2 * ( // Every transaction requires two signatures (payer + program)
2159
- Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction
2158
+ return 2 * (Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction
2160
2159
  1) // Add one for Finalize transaction
2161
2160
  ;
2162
2161
  }
@@ -2753,8 +2752,8 @@ function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRet
2753
2752
  if (res.status !== 429
2754
2753
  /* Too many requests */
2755
2754
  ) {
2756
- break;
2757
- }
2755
+ break;
2756
+ }
2758
2757
 
2759
2758
  if (disableRetryOnRateLimit === true) {
2760
2759
  break;
@@ -6420,13 +6419,15 @@ class Secp256k1Program {
6420
6419
  publicKey,
6421
6420
  message,
6422
6421
  signature,
6423
- recoveryId
6422
+ recoveryId,
6423
+ instructionIndex
6424
6424
  } = params;
6425
6425
  return Secp256k1Program.createInstructionWithEthAddress({
6426
6426
  ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),
6427
6427
  message,
6428
6428
  signature,
6429
- recoveryId
6429
+ recoveryId,
6430
+ instructionIndex
6430
6431
  });
6431
6432
  }
6432
6433
  /**
@@ -6440,7 +6441,8 @@ class Secp256k1Program {
6440
6441
  ethAddress: rawAddress,
6441
6442
  message,
6442
6443
  signature,
6443
- recoveryId
6444
+ recoveryId,
6445
+ instructionIndex = 0
6444
6446
  } = params;
6445
6447
  let ethAddress;
6446
6448
 
@@ -6464,12 +6466,12 @@ class Secp256k1Program {
6464
6466
  SECP256K1_INSTRUCTION_LAYOUT.encode({
6465
6467
  numSignatures,
6466
6468
  signatureOffset,
6467
- signatureInstructionIndex: 0,
6469
+ signatureInstructionIndex: instructionIndex,
6468
6470
  ethAddressOffset,
6469
- ethAddressInstructionIndex: 0,
6471
+ ethAddressInstructionIndex: instructionIndex,
6470
6472
  messageDataOffset,
6471
6473
  messageDataSize: message.length,
6472
- messageInstructionIndex: 0,
6474
+ messageInstructionIndex: instructionIndex,
6473
6475
  signature: toBuffer(signature),
6474
6476
  ethAddress: toBuffer(ethAddress),
6475
6477
  recoveryId
@@ -6490,7 +6492,8 @@ class Secp256k1Program {
6490
6492
  static createInstructionWithPrivateKey(params) {
6491
6493
  const {
6492
6494
  privateKey: pkey,
6493
- message
6495
+ message,
6496
+ instructionIndex
6494
6497
  } = params;
6495
6498
  assert(pkey.length === PRIVATE_KEY_BYTES, `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`);
6496
6499
 
@@ -6507,7 +6510,8 @@ class Secp256k1Program {
6507
6510
  publicKey,
6508
6511
  message,
6509
6512
  signature,
6510
- recoveryId
6513
+ recoveryId,
6514
+ instructionIndex
6511
6515
  });
6512
6516
  } catch (error) {
6513
6517
  throw new Error(`Error creating instruction; ${error}`);