@solana/web3.js 1.59.0 → 1.59.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.d.ts CHANGED
@@ -1847,7 +1847,7 @@ declare module '@solana/web3.js' {
1847
1847
  }
1848
1848
 
1849
1849
  export type TransactionMessageArgs = {
1850
- accountKeys: MessageAccountKeys;
1850
+ payerKey: PublicKey;
1851
1851
  instructions: Array<TransactionInstruction>;
1852
1852
  recentBlockhash: Blockhash;
1853
1853
  };
@@ -1859,7 +1859,7 @@ declare module '@solana/web3.js' {
1859
1859
  addressLookupTableAccounts: AddressLookupTableAccount[];
1860
1860
  };
1861
1861
  export class TransactionMessage {
1862
- accountKeys: MessageAccountKeys;
1862
+ payerKey: PublicKey;
1863
1863
  instructions: Array<TransactionInstruction>;
1864
1864
  recentBlockhash: Blockhash;
1865
1865
  constructor(args: TransactionMessageArgs);
package/lib/index.esm.js CHANGED
@@ -1945,10 +1945,10 @@ class Transaction {
1945
1945
 
1946
1946
  class TransactionMessage {
1947
1947
  constructor(args) {
1948
- this.accountKeys = void 0;
1948
+ this.payerKey = void 0;
1949
1949
  this.instructions = void 0;
1950
1950
  this.recentBlockhash = void 0;
1951
- this.accountKeys = args.accountKeys;
1951
+ this.payerKey = args.payerKey;
1952
1952
  this.instructions = args.instructions;
1953
1953
  this.recentBlockhash = args.recentBlockhash;
1954
1954
  }
@@ -1969,6 +1969,12 @@ class TransactionMessage {
1969
1969
  const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
1970
1970
  assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
1971
1971
  const accountKeys = message.getAccountKeys(args);
1972
+ const payerKey = accountKeys.get(0);
1973
+
1974
+ if (payerKey === undefined) {
1975
+ throw new Error('Failed to decompile message because no account keys were found');
1976
+ }
1977
+
1972
1978
  const instructions = [];
1973
1979
 
1974
1980
  for (const compiledIx of compiledInstructions) {
@@ -2014,35 +2020,23 @@ class TransactionMessage {
2014
2020
  }
2015
2021
 
2016
2022
  return new TransactionMessage({
2017
- accountKeys,
2023
+ payerKey,
2018
2024
  instructions,
2019
2025
  recentBlockhash
2020
2026
  });
2021
2027
  }
2022
2028
 
2023
2029
  compileToLegacyMessage() {
2024
- const payerKey = this.accountKeys.get(0);
2025
-
2026
- if (payerKey === undefined) {
2027
- throw new Error('Failed to compile message because no account keys were found');
2028
- }
2029
-
2030
2030
  return Message.compile({
2031
- payerKey,
2031
+ payerKey: this.payerKey,
2032
2032
  recentBlockhash: this.recentBlockhash,
2033
2033
  instructions: this.instructions
2034
2034
  });
2035
2035
  }
2036
2036
 
2037
2037
  compileToV0Message(addressLookupTableAccounts) {
2038
- const payerKey = this.accountKeys.get(0);
2039
-
2040
- if (payerKey === undefined) {
2041
- throw new Error('Failed to compile message because no account keys were found');
2042
- }
2043
-
2044
2038
  return MessageV0.compile({
2045
- payerKey,
2039
+ payerKey: this.payerKey,
2046
2040
  recentBlockhash: this.recentBlockhash,
2047
2041
  instructions: this.instructions,
2048
2042
  addressLookupTableAccounts