@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.
@@ -298,15 +298,17 @@ function createBlockBatchLoadFn(rpc) {
298
298
  return async (blockQueryArgs) => {
299
299
  const blocksToFetch = {};
300
300
  try {
301
- return Promise.all(blockQueryArgs.map(
302
- ({ slot, ...args }) => new Promise((resolve, reject) => {
303
- const blockRecords = blocksToFetch[slot.toString()] ||= [];
304
- if (!args.commitment) {
305
- args.commitment = "confirmed";
306
- }
307
- blockRecords.push({ args, promiseCallback: { reject, resolve } });
308
- })
309
- ));
301
+ return Promise.all(
302
+ blockQueryArgs.map(
303
+ ({ slot, ...args }) => new Promise((resolve, reject) => {
304
+ const blockRecords = blocksToFetch[slot.toString()] ||= [];
305
+ if (!args.commitment) {
306
+ args.commitment = "confirmed";
307
+ }
308
+ blockRecords.push({ args, promiseCallback: { reject, resolve } });
309
+ })
310
+ )
311
+ );
310
312
  } finally {
311
313
  const blockFetchesByArgsHash = buildCoalescedFetchesByArgsHash(blocksToFetch, {
312
314
  criteria: (args) => args.encoding === void 0 && args.transactionDetails !== "signatures",
@@ -353,18 +355,23 @@ function createProgramAccountsBatchLoadFn(rpc, config) {
353
355
  return async (accountQueryArgs) => {
354
356
  const programAccountsToFetch = {};
355
357
  try {
356
- return Promise.all(accountQueryArgs.map(
357
- ({ programAddress, ...args }) => new Promise((resolve, reject) => {
358
- const accountRecords = programAccountsToFetch[programAddress] ||= [];
359
- if (!args.commitment) {
360
- args.commitment = "confirmed";
361
- }
362
- accountRecords.push({ args, promiseCallback: { reject, resolve } });
363
- })
364
- ));
358
+ return Promise.all(
359
+ accountQueryArgs.map(
360
+ ({ programAddress, ...args }) => new Promise((resolve, reject) => {
361
+ const accountRecords = programAccountsToFetch[programAddress] ||= [];
362
+ if (!args.commitment) {
363
+ args.commitment = "confirmed";
364
+ }
365
+ accountRecords.push({ args, promiseCallback: { reject, resolve } });
366
+ })
367
+ )
368
+ );
365
369
  } finally {
366
370
  const { maxDataSliceByteRange } = config;
367
- const programAccountsFetchesByArgsHash = buildCoalescedFetchesByArgsHashWithDataSlice(programAccountsToFetch, maxDataSliceByteRange);
371
+ const programAccountsFetchesByArgsHash = buildCoalescedFetchesByArgsHashWithDataSlice(
372
+ programAccountsToFetch,
373
+ maxDataSliceByteRange
374
+ );
368
375
  Object.values(programAccountsFetchesByArgsHash).map(({ args, fetches: programAddressCallbacks }) => {
369
376
  return Object.entries(programAddressCallbacks).map(([programAddress, { callbacks }]) => {
370
377
  return Array.from({ length: 1 }, async () => {
@@ -406,15 +413,17 @@ function createTransactionBatchLoadFn(rpc) {
406
413
  return async (transactionQueryArgs) => {
407
414
  const transactionsToFetch = {};
408
415
  try {
409
- return Promise.all(transactionQueryArgs.map(
410
- ({ signature, ...args }) => new Promise((resolve, reject) => {
411
- const transactionRecords = transactionsToFetch[signature] ||= [];
412
- if (!args.commitment) {
413
- args.commitment = "confirmed";
414
- }
415
- transactionRecords.push({ args, promiseCallback: { reject, resolve } });
416
- })
417
- ));
416
+ return Promise.all(
417
+ transactionQueryArgs.map(
418
+ ({ signature, ...args }) => new Promise((resolve, reject) => {
419
+ const transactionRecords = transactionsToFetch[signature] ||= [];
420
+ if (!args.commitment) {
421
+ args.commitment = "confirmed";
422
+ }
423
+ transactionRecords.push({ args, promiseCallback: { reject, resolve } });
424
+ })
425
+ )
426
+ );
418
427
  } finally {
419
428
  const transactionFetchesByArgsHash = buildCoalescedFetchesByArgsHash(transactionsToFetch, {
420
429
  criteria: (args) => args.encoding === void 0,