@solana/web3.js 1.65.0 → 1.66.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.browser.cjs.js +24 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +24 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +24 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/index.esm.js +24 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +24 -1
- 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 +24 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +28 -1
package/lib/index.d.ts
CHANGED
|
@@ -3268,6 +3268,15 @@ declare module '@solana/web3.js' {
|
|
|
3268
3268
|
publicKey: PublicKey,
|
|
3269
3269
|
commitmentOrConfig?: Commitment | GetAccountInfoConfig,
|
|
3270
3270
|
): Promise<AccountInfo<Buffer> | null>;
|
|
3271
|
+
/**
|
|
3272
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
3273
|
+
*/
|
|
3274
|
+
getMultipleParsedAccounts(
|
|
3275
|
+
publicKeys: PublicKey[],
|
|
3276
|
+
rawConfig?: GetMultipleAccountsConfig,
|
|
3277
|
+
): Promise<
|
|
3278
|
+
RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>
|
|
3279
|
+
>;
|
|
3271
3280
|
/**
|
|
3272
3281
|
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
3273
3282
|
*/
|
package/lib/index.esm.js
CHANGED
|
@@ -5091,6 +5091,29 @@ class Connection {
|
|
|
5091
5091
|
*/
|
|
5092
5092
|
|
|
5093
5093
|
|
|
5094
|
+
async getMultipleParsedAccounts(publicKeys, rawConfig) {
|
|
5095
|
+
const {
|
|
5096
|
+
commitment,
|
|
5097
|
+
config
|
|
5098
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
5099
|
+
const keys = publicKeys.map(key => key.toBase58());
|
|
5100
|
+
|
|
5101
|
+
const args = this._buildArgs([keys], commitment, 'jsonParsed', config);
|
|
5102
|
+
|
|
5103
|
+
const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
|
|
5104
|
+
const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult))));
|
|
5105
|
+
|
|
5106
|
+
if ('error' in res) {
|
|
5107
|
+
throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);
|
|
5108
|
+
}
|
|
5109
|
+
|
|
5110
|
+
return res.result;
|
|
5111
|
+
}
|
|
5112
|
+
/**
|
|
5113
|
+
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
5114
|
+
*/
|
|
5115
|
+
|
|
5116
|
+
|
|
5094
5117
|
async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) {
|
|
5095
5118
|
const {
|
|
5096
5119
|
commitment,
|
|
@@ -6788,7 +6811,7 @@ class Connection {
|
|
|
6788
6811
|
|
|
6789
6812
|
_wsOnClose(code) {
|
|
6790
6813
|
this._rpcWebSocketConnected = false;
|
|
6791
|
-
this._rpcWebSocketGeneration
|
|
6814
|
+
this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER;
|
|
6792
6815
|
|
|
6793
6816
|
if (this._rpcWebSocketIdleTimeout) {
|
|
6794
6817
|
clearTimeout(this._rpcWebSocketIdleTimeout);
|