@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.
@@ -1972,10 +1972,10 @@ class Transaction {
1972
1972
 
1973
1973
  class TransactionMessage {
1974
1974
  constructor(args) {
1975
- this.accountKeys = void 0;
1975
+ this.payerKey = void 0;
1976
1976
  this.instructions = void 0;
1977
1977
  this.recentBlockhash = void 0;
1978
- this.accountKeys = args.accountKeys;
1978
+ this.payerKey = args.payerKey;
1979
1979
  this.instructions = args.instructions;
1980
1980
  this.recentBlockhash = args.recentBlockhash;
1981
1981
  }
@@ -1996,6 +1996,12 @@ class TransactionMessage {
1996
1996
  const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
1997
1997
  assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
1998
1998
  const accountKeys = message.getAccountKeys(args);
1999
+ const payerKey = accountKeys.get(0);
2000
+
2001
+ if (payerKey === undefined) {
2002
+ throw new Error('Failed to decompile message because no account keys were found');
2003
+ }
2004
+
1999
2005
  const instructions = [];
2000
2006
 
2001
2007
  for (const compiledIx of compiledInstructions) {
@@ -2041,35 +2047,23 @@ class TransactionMessage {
2041
2047
  }
2042
2048
 
2043
2049
  return new TransactionMessage({
2044
- accountKeys,
2050
+ payerKey,
2045
2051
  instructions,
2046
2052
  recentBlockhash
2047
2053
  });
2048
2054
  }
2049
2055
 
2050
2056
  compileToLegacyMessage() {
2051
- const payerKey = this.accountKeys.get(0);
2052
-
2053
- if (payerKey === undefined) {
2054
- throw new Error('Failed to compile message because no account keys were found');
2055
- }
2056
-
2057
2057
  return Message.compile({
2058
- payerKey,
2058
+ payerKey: this.payerKey,
2059
2059
  recentBlockhash: this.recentBlockhash,
2060
2060
  instructions: this.instructions
2061
2061
  });
2062
2062
  }
2063
2063
 
2064
2064
  compileToV0Message(addressLookupTableAccounts) {
2065
- const payerKey = this.accountKeys.get(0);
2066
-
2067
- if (payerKey === undefined) {
2068
- throw new Error('Failed to compile message because no account keys were found');
2069
- }
2070
-
2071
2065
  return MessageV0.compile({
2072
- payerKey,
2066
+ payerKey: this.payerKey,
2073
2067
  recentBlockhash: this.recentBlockhash,
2074
2068
  instructions: this.instructions,
2075
2069
  addressLookupTableAccounts