@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.cjs.js CHANGED
@@ -858,23 +858,19 @@ class Message {
858
858
  const accountCount = decodeLength(byteArray);
859
859
  let accountKeys = [];
860
860
  for (let i = 0; i < accountCount; i++) {
861
- const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);
862
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
861
+ const account = byteArray.splice(0, PUBLIC_KEY_LENGTH);
863
862
  accountKeys.push(new PublicKey(buffer.Buffer.from(account)));
864
863
  }
865
- const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);
866
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
864
+ const recentBlockhash = byteArray.splice(0, PUBLIC_KEY_LENGTH);
867
865
  const instructionCount = decodeLength(byteArray);
868
866
  let instructions = [];
869
867
  for (let i = 0; i < instructionCount; i++) {
870
868
  const programIdIndex = byteArray.shift();
871
869
  const accountCount = decodeLength(byteArray);
872
- const accounts = byteArray.slice(0, accountCount);
873
- byteArray = byteArray.slice(accountCount);
870
+ const accounts = byteArray.splice(0, accountCount);
874
871
  const dataLength = decodeLength(byteArray);
875
- const dataSlice = byteArray.slice(0, dataLength);
872
+ const dataSlice = byteArray.splice(0, dataLength);
876
873
  const data = bs58__default.default.encode(buffer.Buffer.from(dataSlice));
877
- byteArray = byteArray.slice(dataLength);
878
874
  instructions.push({
879
875
  programIdIndex,
880
876
  accounts,
@@ -1907,8 +1903,7 @@ class Transaction {
1907
1903
  const signatureCount = decodeLength(byteArray);
1908
1904
  let signatures = [];
1909
1905
  for (let i = 0; i < signatureCount; i++) {
1910
- const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
1911
- byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
1906
+ const signature = byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES);
1912
1907
  signatures.push(bs58__default.default.encode(buffer.Buffer.from(signature)));
1913
1908
  }
1914
1909
  return Transaction.populate(Message.from(byteArray), signatures);
@@ -10822,10 +10817,8 @@ class ValidatorInfo {
10822
10817
  if (configKeyCount !== 2) return null;
10823
10818
  const configKeys = [];
10824
10819
  for (let i = 0; i < 2; i++) {
10825
- const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));
10826
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
10827
- const isSigner = byteArray.slice(0, 1)[0] === 1;
10828
- byteArray = byteArray.slice(1);
10820
+ const publicKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));
10821
+ const isSigner = byteArray.splice(0, 1)[0] === 1;
10829
10822
  configKeys.push({
10830
10823
  publicKey,
10831
10824
  isSigner