@solana/web3.js 1.21.1 → 1.22.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
@@ -3824,6 +3824,25 @@ class Connection {
3824
3824
  throw new Error('failed to get info about account ' + publicKey.toBase58() + ': ' + e);
3825
3825
  }
3826
3826
  }
3827
+ /**
3828
+ * Fetch all the account info for multiple accounts specified by an array of public keys
3829
+ */
3830
+
3831
+
3832
+ async getMultipleAccountsInfo(publicKeys, commitment) {
3833
+ const keys = publicKeys.map(key => key.toBase58());
3834
+
3835
+ const args = this._buildArgs([keys], commitment, 'base64');
3836
+
3837
+ const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
3838
+ const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.nullable(superstruct.array(AccountInfoResult))));
3839
+
3840
+ if ('error' in res) {
3841
+ throw new Error('failed to get info for accounts ' + keys + ': ' + res.error.message);
3842
+ }
3843
+
3844
+ return res.result.value;
3845
+ }
3827
3846
  /**
3828
3847
  * Returns epoch activation information for a stake account that has been delegated
3829
3848
  */