@solana/web3.js 1.35.2 → 1.36.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
@@ -5538,35 +5538,32 @@ class Connection {
5538
5538
  }
5539
5539
  }
5540
5540
  /**
5541
- * Fetch all the account info for multiple accounts specified by an array of public keys
5541
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
5542
5542
  */
5543
5543
 
5544
5544
 
5545
- async getMultipleAccountsInfo(publicKeys, configOrCommitment) {
5545
+ async getMultipleAccountsInfoAndContext(publicKeys, commitment) {
5546
5546
  const keys = publicKeys.map(key => key.toBase58());
5547
- let commitment;
5548
- let encoding = 'base64';
5549
5547
 
5550
- if (configOrCommitment) {
5551
- if (typeof configOrCommitment === 'string') {
5552
- commitment = configOrCommitment;
5553
- encoding = 'base64';
5554
- } else {
5555
- commitment = configOrCommitment.commitment;
5556
- encoding = configOrCommitment.encoding || 'base64';
5557
- }
5558
- }
5559
-
5560
- const args = this._buildArgs([keys], commitment, encoding);
5548
+ const args = this._buildArgs([keys], commitment, 'base64');
5561
5549
 
5562
5550
  const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
5563
- const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.array(superstruct.nullable(ParsedAccountInfoResult))));
5551
+ const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.array(superstruct.nullable(AccountInfoResult))));
5564
5552
 
5565
5553
  if ('error' in res) {
5566
5554
  throw new Error('failed to get info for accounts ' + keys + ': ' + res.error.message);
5567
5555
  }
5568
5556
 
5569
- return res.result.value;
5557
+ return res.result;
5558
+ }
5559
+ /**
5560
+ * Fetch all the account info for multiple accounts specified by an array of public keys
5561
+ */
5562
+
5563
+
5564
+ async getMultipleAccountsInfo(publicKeys, commitment) {
5565
+ const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitment);
5566
+ return res.value;
5570
5567
  }
5571
5568
  /**
5572
5569
  * Returns epoch activation information for a stake account that has been delegated