Function readBundle
-
readBundle(
source: Bytes | AsyncIterable<Bytes, any, any>,
maxFrameBytes?: number,
): Promise<{ index: BundleIndex; state: BundleState }>Parameters
- source: Bytes | AsyncIterable<Bytes, any, any>
- maxFrameBytes: number = MAX_BUNDLE_FRAME_BYTES
Returns Promise<{ index: BundleIndex; state: BundleState }>
Reads a whole pack, or a pack that arrives in chunks, and returns its index and state. Every block is checked as it lands, and the set digest is checked at the end. Throws
bad-bundle.