@solana/web3.js 1.65.0 → 1.66.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.browser.cjs.js +23 -0
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +23 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +23 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/index.esm.js +23 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +23 -0
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +23 -0
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +26 -0
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -3170,6 +3170,32 @@ export class Connection {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
}
|
|
3172
3172
|
|
|
3173
|
+
/**
|
|
3174
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
3175
|
+
*/
|
|
3176
|
+
async getMultipleParsedAccounts(
|
|
3177
|
+
publicKeys: PublicKey[],
|
|
3178
|
+
rawConfig?: GetMultipleAccountsConfig,
|
|
3179
|
+
): Promise<
|
|
3180
|
+
RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>
|
|
3181
|
+
> {
|
|
3182
|
+
const {commitment, config} = extractCommitmentFromConfig(rawConfig);
|
|
3183
|
+
const keys = publicKeys.map(key => key.toBase58());
|
|
3184
|
+
const args = this._buildArgs([keys], commitment, 'jsonParsed', config);
|
|
3185
|
+
const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
|
|
3186
|
+
const res = create(
|
|
3187
|
+
unsafeRes,
|
|
3188
|
+
jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult))),
|
|
3189
|
+
);
|
|
3190
|
+
if ('error' in res) {
|
|
3191
|
+
throw new SolanaJSONRPCError(
|
|
3192
|
+
res.error,
|
|
3193
|
+
`failed to get info for accounts ${keys}`,
|
|
3194
|
+
);
|
|
3195
|
+
}
|
|
3196
|
+
return res.result;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3173
3199
|
/**
|
|
3174
3200
|
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
3175
3201
|
*/
|