@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.
@@ -177,13 +177,13 @@ class PublicKey extends Struct {
177
177
  this._bn = new BN__default["default"](value);
178
178
  }
179
179
 
180
- if (this._bn.byteLength() > 32) {
180
+ if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) {
181
181
  throw new Error(`Invalid public key input`);
182
182
  }
183
183
  }
184
184
  }
185
185
  /**
186
- * Returns a unique PublicKey for tests and benchmarks using acounter
186
+ * Returns a unique PublicKey for tests and benchmarks using a counter
187
187
  */
188
188
 
189
189
 
@@ -290,6 +290,8 @@ class PublicKey extends Struct {
290
290
  /**
291
291
  * Async version of createProgramAddressSync
292
292
  * For backwards compatibility
293
+ *
294
+ * @deprecated Use {@link createProgramAddressSync} instead
293
295
  */
294
296
 
295
297
  /* eslint-disable require-await */
@@ -332,6 +334,8 @@ class PublicKey extends Struct {
332
334
  /**
333
335
  * Async version of findProgramAddressSync
334
336
  * For backwards compatibility
337
+ *
338
+ * @deprecated Use {@link findProgramAddressSync} instead
335
339
  */
336
340
 
337
341
 
@@ -2047,7 +2051,7 @@ class TransactionMessage {
2047
2051
  } = header;
2048
2052
  const numWritableSignedAccounts = numRequiredSignatures - numReadonlySignedAccounts;
2049
2053
  assert(numWritableSignedAccounts > 0, 'Message header is invalid');
2050
- const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
2054
+ const numWritableUnsignedAccounts = message.staticAccountKeys.length - numRequiredSignatures - numReadonlyUnsignedAccounts;
2051
2055
  assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
2052
2056
  const accountKeys = message.getAccountKeys(args);
2053
2057
  const payerKey = accountKeys.get(0);
@@ -6009,7 +6013,7 @@ class Connection {
6009
6013
 
6010
6014
 
6011
6015
  async getFeeForMessage(message, commitment) {
6012
- const wireMessage = message.serialize().toString('base64');
6016
+ const wireMessage = toBuffer(message.serialize()).toString('base64');
6013
6017
 
6014
6018
  const args = this._buildArgs([wireMessage], commitment);
6015
6019