Skip to content

pinax-network/substreams-core

Repository files navigation

@substreams/core

Substreams ESM core utility library

This is a work in progress. Your mileage may vary.

Install

npm install @substreams/core

⚠️Warning: This package is native ESM. If your project uses CommonJS, you'll have to convert to ESM or use the dynamic import() function. Please don't open issues for questions regarding CommonJS / ESM.

Usage

import { createSubstream } from "@substreams/core";

export async function fetchSubstream(url: string) {
  const response = await fetch(url);
  const blob = await response.blob();
  const array = await blob.arrayBuffer();

  return createSubstream(array);
}

Authors

License

MIT License