@solana/web3.js 1.43.2 → 1.43.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.cjs.js CHANGED
@@ -2626,13 +2626,6 @@ class Transaction {
2626
2626
  isSigner: false,
2627
2627
  isWritable: false
2628
2628
  });
2629
- }); // Sort. Prioritizing first by signer, then by writable
2630
-
2631
- accountMetas.sort(function (x, y) {
2632
- const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2633
- const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
2634
- const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
2635
- return checkSigner || checkWritable;
2636
2629
  }); // Cull duplicate account metas
2637
2630
 
2638
2631
  const uniqueMetas = [];
@@ -2644,9 +2637,17 @@ class Transaction {
2644
2637
 
2645
2638
  if (uniqueIndex > -1) {
2646
2639
  uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;
2640
+ uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner;
2647
2641
  } else {
2648
2642
  uniqueMetas.push(accountMeta);
2649
2643
  }
2644
+ }); // Sort. Prioritizing first by signer, then by writable
2645
+
2646
+ uniqueMetas.sort(function (x, y) {
2647
+ const pubkeySorting = x.pubkey.toBase58().localeCompare(y.pubkey.toBase58());
2648
+ const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;
2649
+ const checkWritable = x.isWritable === y.isWritable ? pubkeySorting : x.isWritable ? -1 : 1;
2650
+ return checkSigner || checkWritable;
2650
2651
  }); // Move fee payer to the front
2651
2652
 
2652
2653
  const feePayerIndex = uniqueMetas.findIndex(x => {