@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/module.flow.js CHANGED
@@ -2171,6 +2171,14 @@ account: AccountInfo<ParsedAccountData>,...
2171
2171
  commitment?: Commitment
2172
2172
  ): Promise<AccountInfo<Buffer> | null>;
2173
2173
 
2174
+ /**
2175
+ * Fetch all the account info for multiple accounts specified by an array of public keys
2176
+ */
2177
+ getMultipleAccountsInfo(
2178
+ publicKeys: PublicKey[],
2179
+ commitment?: Commitment
2180
+ ): Promise<AccountInfo<Buffer>[] | null>;
2181
+
2174
2182
  /**
2175
2183
  * Returns epoch activation information for a stake account that has been delegated
2176
2184
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.21.1",
3
+ "version": "1.22.1",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -67,7 +67,7 @@
67
67
  "@rollup/plugin-json": "^4.1.0",
68
68
  "@rollup/plugin-multi-entry": "^4.0.0",
69
69
  "@rollup/plugin-node-resolve": "^13.0.0",
70
- "@rollup/plugin-replace": "^2.3.4",
70
+ "@rollup/plugin-replace": "^3.0.0",
71
71
  "@solana/spl-token": "^0.1.2",
72
72
  "@types/bn.js": "^5.1.0",
73
73
  "@types/bs58": "^4.0.1",
@@ -103,7 +103,7 @@
103
103
  "nyc": "^15.1.0",
104
104
  "prettier": "^2.3.0",
105
105
  "rimraf": "3.0.2",
106
- "rollup": "2.53.1",
106
+ "rollup": "2.53.2",
107
107
  "rollup-plugin-dts": "^3.0.1",
108
108
  "rollup-plugin-node-polyfills": "^0.2.1",
109
109
  "rollup-plugin-terser": "^7.0.2",
package/src/connection.ts CHANGED
@@ -2407,6 +2407,28 @@ export class Connection {
2407
2407
  }
2408
2408
  }
2409
2409
 
2410
+ /**
2411
+ * Fetch all the account info for multiple accounts specified by an array of public keys
2412
+ */
2413
+ async getMultipleAccountsInfo(
2414
+ publicKeys: PublicKey[],
2415
+ commitment?: Commitment,
2416
+ ): Promise<AccountInfo<Buffer>[] | null> {
2417
+ const keys = publicKeys.map(key => key.toBase58());
2418
+ const args = this._buildArgs([keys], commitment, 'base64');
2419
+ const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
2420
+ const res = create(
2421
+ unsafeRes,
2422
+ jsonRpcResultAndContext(nullable(array(AccountInfoResult))),
2423
+ );
2424
+ if ('error' in res) {
2425
+ throw new Error(
2426
+ 'failed to get info for accounts ' + keys + ': ' + res.error.message,
2427
+ );
2428
+ }
2429
+ return res.result.value;
2430
+ }
2431
+
2410
2432
  /**
2411
2433
  * Returns epoch activation information for a stake account that has been delegated
2412
2434
  */