MCPcopy Create free account
hub / github.com/subquery/subql / fetchBlocksArray

Function fetchBlocksArray

packages/node/src/utils/substrate.ts:348–355  ·  view source on GitHub ↗
(
  api: ApiPromise,
  blockArray: number[],
)

Source from the content-addressed store, hash-verified

346}
347
348export async function fetchBlocksArray(
349 api: ApiPromise,
350 blockArray: number[],
351): Promise<SignedBlock[]> {
352 return Promise.all(
353 blockArray.map(async (height) => getBlockByHeight(api, height)),
354 );
355}
356
357export async function fetchHeaderArray(
358 api: ApiPromise,

Callers 2

substrate.test.tsFile · 0.90
fetchBlocksBatchesFunction · 0.85

Calls 2

getBlockByHeightFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected