@solana/rpc-graphql 2.0.0-experimental.e3e579c → 2.0.0-experimental.e587f8d

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.
@@ -291,15 +291,17 @@ function createBlockBatchLoadFn(rpc) {
291
291
  return async (blockQueryArgs) => {
292
292
  const blocksToFetch = {};
293
293
  try {
294
- return Promise.all(blockQueryArgs.map(
295
- ({ slot, ...args }) => new Promise((resolve, reject) => {
296
- const blockRecords = blocksToFetch[slot.toString()] ||= [];
297
- if (!args.commitment) {
298
- args.commitment = "confirmed";
299
- }
300
- blockRecords.push({ args, promiseCallback: { reject, resolve } });
301
- })
302
- ));
294
+ return Promise.all(
295
+ blockQueryArgs.map(
296
+ ({ slot, ...args }) => new Promise((resolve, reject) => {
297
+ const blockRecords = blocksToFetch[slot.toString()] ||= [];
298
+ if (!args.commitment) {
299
+ args.commitment = "confirmed";
300
+ }
301
+ blockRecords.push({ args, promiseCallback: { reject, resolve } });
302
+ })
303
+ )
304
+ );
303
305
  } finally {
304
306
  const blockFetchesByArgsHash = buildCoalescedFetchesByArgsHash(blocksToFetch, {
305
307
  criteria: (args) => args.encoding === void 0 && args.transactionDetails !== "signatures",
@@ -346,18 +348,23 @@ function createProgramAccountsBatchLoadFn(rpc, config) {
346
348
  return async (accountQueryArgs) => {
347
349
  const programAccountsToFetch = {};
348
350
  try {
349
- return Promise.all(accountQueryArgs.map(
350
- ({ programAddress, ...args }) => new Promise((resolve, reject) => {
351
- const accountRecords = programAccountsToFetch[programAddress] ||= [];
352
- if (!args.commitment) {
353
- args.commitment = "confirmed";
354
- }
355
- accountRecords.push({ args, promiseCallback: { reject, resolve } });
356
- })
357
- ));
351
+ return Promise.all(
352
+ accountQueryArgs.map(
353
+ ({ programAddress, ...args }) => new Promise((resolve, reject) => {
354
+ const accountRecords = programAccountsToFetch[programAddress] ||= [];
355
+ if (!args.commitment) {
356
+ args.commitment = "confirmed";
357
+ }
358
+ accountRecords.push({ args, promiseCallback: { reject, resolve } });
359
+ })
360
+ )
361
+ );
358
362
  } finally {
359
363
  const { maxDataSliceByteRange } = config;
360
- const programAccountsFetchesByArgsHash = buildCoalescedFetchesByArgsHashWithDataSlice(programAccountsToFetch, maxDataSliceByteRange);
364
+ const programAccountsFetchesByArgsHash = buildCoalescedFetchesByArgsHashWithDataSlice(
365
+ programAccountsToFetch,
366
+ maxDataSliceByteRange
367
+ );
361
368
  Object.values(programAccountsFetchesByArgsHash).map(({ args, fetches: programAddressCallbacks }) => {
362
369
  return Object.entries(programAddressCallbacks).map(([programAddress, { callbacks }]) => {
363
370
  return Array.from({ length: 1 }, async () => {
@@ -399,15 +406,17 @@ function createTransactionBatchLoadFn(rpc) {
399
406
  return async (transactionQueryArgs) => {
400
407
  const transactionsToFetch = {};
401
408
  try {
402
- return Promise.all(transactionQueryArgs.map(
403
- ({ signature, ...args }) => new Promise((resolve, reject) => {
404
- const transactionRecords = transactionsToFetch[signature] ||= [];
405
- if (!args.commitment) {
406
- args.commitment = "confirmed";
407
- }
408
- transactionRecords.push({ args, promiseCallback: { reject, resolve } });
409
- })
410
- ));
409
+ return Promise.all(
410
+ transactionQueryArgs.map(
411
+ ({ signature, ...args }) => new Promise((resolve, reject) => {
412
+ const transactionRecords = transactionsToFetch[signature] ||= [];
413
+ if (!args.commitment) {
414
+ args.commitment = "confirmed";
415
+ }
416
+ transactionRecords.push({ args, promiseCallback: { reject, resolve } });
417
+ })
418
+ )
419
+ );
411
420
  } finally {
412
421
  const transactionFetchesByArgsHash = buildCoalescedFetchesByArgsHash(transactionsToFetch, {
413
422
  criteria: (args) => args.encoding === void 0,