@solana/web3.js 1.35.1 → 1.36.0

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
@@ -5509,35 +5509,32 @@ class Connection {
5509
5509
  }
5510
5510
  }
5511
5511
  /**
5512
- * Fetch all the account info for multiple accounts specified by an array of public keys
5512
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
5513
5513
  */
5514
5514
 
5515
5515
 
5516
- async getMultipleAccountsInfo(publicKeys, configOrCommitment) {
5516
+ async getMultipleAccountsInfoAndContext(publicKeys, commitment) {
5517
5517
  const keys = publicKeys.map(key => key.toBase58());
5518
- let commitment;
5519
- let encoding = 'base64';
5520
5518
 
5521
- if (configOrCommitment) {
5522
- if (typeof configOrCommitment === 'string') {
5523
- commitment = configOrCommitment;
5524
- encoding = 'base64';
5525
- } else {
5526
- commitment = configOrCommitment.commitment;
5527
- encoding = configOrCommitment.encoding || 'base64';
5528
- }
5529
- }
5530
-
5531
- const args = this._buildArgs([keys], commitment, encoding);
5519
+ const args = this._buildArgs([keys], commitment, 'base64');
5532
5520
 
5533
5521
  const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
5534
- const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.array(superstruct.nullable(ParsedAccountInfoResult))));
5522
+ const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.array(superstruct.nullable(AccountInfoResult))));
5535
5523
 
5536
5524
  if ('error' in res) {
5537
5525
  throw new Error('failed to get info for accounts ' + keys + ': ' + res.error.message);
5538
5526
  }
5539
5527
 
5540
- return res.result.value;
5528
+ return res.result;
5529
+ }
5530
+ /**
5531
+ * Fetch all the account info for multiple accounts specified by an array of public keys
5532
+ */
5533
+
5534
+
5535
+ async getMultipleAccountsInfo(publicKeys, commitment) {
5536
+ const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitment);
5537
+ return res.value;
5541
5538
  }
5542
5539
  /**
5543
5540
  * Returns epoch activation information for a stake account that has been delegated