@solana/web3.js 1.64.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 +25 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +25 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +25 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +15 -1
- package/lib/index.esm.js +25 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +25 -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 +25 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +30 -0
- package/src/publickey.ts +2 -1
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -470,6 +470,8 @@ export type GetAccountInfoConfig = {
|
|
|
470
470
|
commitment?: Commitment;
|
|
471
471
|
/** The minimum slot that the request can be evaluated at */
|
|
472
472
|
minContextSlot?: number;
|
|
473
|
+
/** Optional data slice to limit the returned account data */
|
|
474
|
+
dataSlice?: DataSlice;
|
|
473
475
|
};
|
|
474
476
|
|
|
475
477
|
/**
|
|
@@ -2396,6 +2398,8 @@ export type GetMultipleAccountsConfig = {
|
|
|
2396
2398
|
commitment?: Commitment;
|
|
2397
2399
|
/** The minimum slot that the request can be evaluated at */
|
|
2398
2400
|
minContextSlot?: number;
|
|
2401
|
+
/** Optional data slice to limit the returned account data */
|
|
2402
|
+
dataSlice?: DataSlice;
|
|
2399
2403
|
};
|
|
2400
2404
|
|
|
2401
2405
|
/**
|
|
@@ -3166,6 +3170,32 @@ export class Connection {
|
|
|
3166
3170
|
}
|
|
3167
3171
|
}
|
|
3168
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
|
+
|
|
3169
3199
|
/**
|
|
3170
3200
|
* Fetch all the account info for multiple accounts specified by an array of public keys, return with context
|
|
3171
3201
|
*/
|
package/src/publickey.ts
CHANGED
|
@@ -85,7 +85,8 @@ export class PublicKey extends Struct {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* Default public key value. (
|
|
88
|
+
* Default public key value. The base58-encoded string representation is all ones (as seen below)
|
|
89
|
+
* The underlying BN number is 32 bytes that are all zeros
|
|
89
90
|
*/
|
|
90
91
|
static default: PublicKey = new PublicKey('11111111111111111111111111111111');
|
|
91
92
|
|