@solana/web3.js 1.91.0 → 1.91.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.esm.js CHANGED
@@ -826,23 +826,19 @@ class Message {
826
826
  const accountCount = decodeLength(byteArray);
827
827
  let accountKeys = [];
828
828
  for (let i = 0; i < accountCount; i++) {
829
- const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);
830
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
829
+ const account = byteArray.splice(0, PUBLIC_KEY_LENGTH);
831
830
  accountKeys.push(new PublicKey(Buffer.from(account)));
832
831
  }
833
- const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);
834
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
832
+ const recentBlockhash = byteArray.splice(0, PUBLIC_KEY_LENGTH);
835
833
  const instructionCount = decodeLength(byteArray);
836
834
  let instructions = [];
837
835
  for (let i = 0; i < instructionCount; i++) {
838
836
  const programIdIndex = byteArray.shift();
839
837
  const accountCount = decodeLength(byteArray);
840
- const accounts = byteArray.slice(0, accountCount);
841
- byteArray = byteArray.slice(accountCount);
838
+ const accounts = byteArray.splice(0, accountCount);
842
839
  const dataLength = decodeLength(byteArray);
843
- const dataSlice = byteArray.slice(0, dataLength);
840
+ const dataSlice = byteArray.splice(0, dataLength);
844
841
  const data = bs58.encode(Buffer.from(dataSlice));
845
- byteArray = byteArray.slice(dataLength);
846
842
  instructions.push({
847
843
  programIdIndex,
848
844
  accounts,
@@ -1875,8 +1871,7 @@ class Transaction {
1875
1871
  const signatureCount = decodeLength(byteArray);
1876
1872
  let signatures = [];
1877
1873
  for (let i = 0; i < signatureCount; i++) {
1878
- const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
1879
- byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
1874
+ const signature = byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES);
1880
1875
  signatures.push(bs58.encode(Buffer.from(signature)));
1881
1876
  }
1882
1877
  return Transaction.populate(Message.from(byteArray), signatures);
@@ -10790,10 +10785,8 @@ class ValidatorInfo {
10790
10785
  if (configKeyCount !== 2) return null;
10791
10786
  const configKeys = [];
10792
10787
  for (let i = 0; i < 2; i++) {
10793
- const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));
10794
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
10795
- const isSigner = byteArray.slice(0, 1)[0] === 1;
10796
- byteArray = byteArray.slice(1);
10788
+ const publicKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));
10789
+ const isSigner = byteArray.splice(0, 1)[0] === 1;
10797
10790
  configKeys.push({
10798
10791
  publicKey,
10799
10792
  isSigner