@solana/web3.js 1.67.0 → 1.67.2

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.
@@ -147,13 +147,13 @@ class PublicKey extends Struct {
147
147
  this._bn = new BN(value);
148
148
  }
149
149
 
150
- if (this._bn.byteLength() > 32) {
150
+ if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) {
151
151
  throw new Error(`Invalid public key input`);
152
152
  }
153
153
  }
154
154
  }
155
155
  /**
156
- * Returns a unique PublicKey for tests and benchmarks using acounter
156
+ * Returns a unique PublicKey for tests and benchmarks using a counter
157
157
  */
158
158
 
159
159
 
@@ -260,6 +260,8 @@ class PublicKey extends Struct {
260
260
  /**
261
261
  * Async version of createProgramAddressSync
262
262
  * For backwards compatibility
263
+ *
264
+ * @deprecated Use {@link createProgramAddressSync} instead
263
265
  */
264
266
 
265
267
  /* eslint-disable require-await */
@@ -302,6 +304,8 @@ class PublicKey extends Struct {
302
304
  /**
303
305
  * Async version of findProgramAddressSync
304
306
  * For backwards compatibility
307
+ *
308
+ * @deprecated Use {@link findProgramAddressSync} instead
305
309
  */
306
310
 
307
311
 
@@ -2017,7 +2021,7 @@ class TransactionMessage {
2017
2021
  } = header;
2018
2022
  const numWritableSignedAccounts = numRequiredSignatures - numReadonlySignedAccounts;
2019
2023
  assert(numWritableSignedAccounts > 0, 'Message header is invalid');
2020
- const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
2024
+ const numWritableUnsignedAccounts = message.staticAccountKeys.length - numRequiredSignatures - numReadonlyUnsignedAccounts;
2021
2025
  assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
2022
2026
  const accountKeys = message.getAccountKeys(args);
2023
2027
  const payerKey = accountKeys.get(0);
@@ -5979,7 +5983,7 @@ class Connection {
5979
5983
 
5980
5984
 
5981
5985
  async getFeeForMessage(message, commitment) {
5982
- const wireMessage = message.serialize().toString('base64');
5986
+ const wireMessage = toBuffer(message.serialize()).toString('base64');
5983
5987
 
5984
5988
  const args = this._buildArgs([wireMessage], commitment);
5985
5989