@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.d.ts CHANGED
@@ -1527,13 +1527,20 @@ declare module '@solana/web3.js' {
1527
1527
  publicKey: PublicKey,
1528
1528
  commitment?: Commitment,
1529
1529
  ): Promise<AccountInfo<Buffer> | null>;
1530
+ /**
1531
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
1532
+ */
1533
+ getMultipleAccountsInfoAndContext(
1534
+ publicKeys: PublicKey[],
1535
+ commitment?: Commitment,
1536
+ ): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
1530
1537
  /**
1531
1538
  * Fetch all the account info for multiple accounts specified by an array of public keys
1532
1539
  */
1533
1540
  getMultipleAccountsInfo(
1534
1541
  publicKeys: PublicKey[],
1535
- configOrCommitment?: GetMultipleAccountsConfig | Commitment,
1536
- ): Promise<(AccountInfo<Buffer | ParsedAccountData> | null)[]>;
1542
+ commitment?: Commitment,
1543
+ ): Promise<(AccountInfo<Buffer> | null)[]>;
1537
1544
  /**
1538
1545
  * Returns epoch activation information for a stake account that has been delegated
1539
1546
  */
package/lib/index.esm.js CHANGED
@@ -5474,35 +5474,32 @@ class Connection {
5474
5474
  }
5475
5475
  }
5476
5476
  /**
5477
- * Fetch all the account info for multiple accounts specified by an array of public keys
5477
+ * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
5478
5478
  */
5479
5479
 
5480
5480
 
5481
- async getMultipleAccountsInfo(publicKeys, configOrCommitment) {
5481
+ async getMultipleAccountsInfoAndContext(publicKeys, commitment) {
5482
5482
  const keys = publicKeys.map(key => key.toBase58());
5483
- let commitment;
5484
- let encoding = 'base64';
5485
5483
 
5486
- if (configOrCommitment) {
5487
- if (typeof configOrCommitment === 'string') {
5488
- commitment = configOrCommitment;
5489
- encoding = 'base64';
5490
- } else {
5491
- commitment = configOrCommitment.commitment;
5492
- encoding = configOrCommitment.encoding || 'base64';
5493
- }
5494
- }
5495
-
5496
- const args = this._buildArgs([keys], commitment, encoding);
5484
+ const args = this._buildArgs([keys], commitment, 'base64');
5497
5485
 
5498
5486
  const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
5499
- const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult))));
5487
+ const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult))));
5500
5488
 
5501
5489
  if ('error' in res) {
5502
5490
  throw new Error('failed to get info for accounts ' + keys + ': ' + res.error.message);
5503
5491
  }
5504
5492
 
5505
- return res.result.value;
5493
+ return res.result;
5494
+ }
5495
+ /**
5496
+ * Fetch all the account info for multiple accounts specified by an array of public keys
5497
+ */
5498
+
5499
+
5500
+ async getMultipleAccountsInfo(publicKeys, commitment) {
5501
+ const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitment);
5502
+ return res.value;
5506
5503
  }
5507
5504
  /**
5508
5505
  * Returns epoch activation information for a stake account that has been delegated