Skip to content

Releases: substreams-js/substreams-node

v0.6.0

08 Feb 00:28
7a42fa6
Compare
Choose a tag to compare

Substreams now supports authenticating by passing X-Api-Key in the Header of the gRPC request, no need for creating JWT anymore (saves one less step in the auth process).

Additionally, Substreams endpoint support native ConnectWeb directly in the browser using the @substreams/node library by using createWebTransport.

What's New?

  • Replace Basic Auth => header X-Api-Key (not JWT token)
  • Rename header for User-Agent => X-User-Agent
    • add defaultHeadersInterceptor which uses {"X-User-Agent": "@substreams/node"}
  • fix createHeadersInterceptor to include headers as interceptor (previously wasn't adding any headers)
  • Update examples to use SUBSTREAMS_API_KEY instead of SUBSTREAMS_API_TOKEN

What's Breaking?

  • Add custom exports to node & web Transports
    • Allows to import @substreams/node directly in browser application without importing NodeJS specific dependencies
import { BlockEmitter } from "@substreams/node";
import { createNodeTransport } from "@substreams/node/createNodeTransport";
// or
import { createWebTransport } from "@substreams/node/createWebTransport";

What's Changed

Full Changelog: v0.5.3...v0.6.0

v0.5.3

25 Jan 17:11
d38c03a
Compare
Choose a tag to compare
  • update to latest dependencies

v0.5.2

17 Dec 15:24
Compare
Choose a tag to compare
  • add emitter.stop() & emitter.cancelFn() methods

v0.5.0

08 Dec 02:54
4046585
Compare
Choose a tag to compare

Changes

  • Replace createPromiseClient with createCallbackClient
  • Replace emitter.stop() function with CancelFn from Callback Client

Example

const cancel = emitter.start();

// Cancel after 3 seconds
setTimeout(cancel, 3000);

New event emitters

  • close
  • fatalError
type LocalEventTypes = {
  close: [error?: ConnectError];
  fatalError: [error: FatalError];
};

Examples

// End of Stream
emitter.on("close", (error) => {
  if (error) {
    console.error(error);
  }
});

// Fatal error
emitter.on("fatalError", (error) => {
  console.error(error);
});

What's Changed

Full Changelog: v0.4.4...v0.5.0

v0.4.4

05 Dec 17:45
Compare
Choose a tag to compare

Transport exports

import { createNodeTransport } from "@substreams/node";
import { createWebTransport } from "@substreams/node";

What's Changed

New Contributors

Full Changelog: v0.4.3...v0.4.4

v0.4.3

25 Nov 16:45
Compare
Choose a tag to compare
  • Switch back to using connect-node HTTP 2.0
    • connect-web isn't stable either

Bun 1.0.13 now includes HTTP 2.0 support https://bun.sh/blog/bun-v1.0.13

v0.4.2

21 Nov 17:44
Compare
Choose a tag to compare
  • FIX: Do not include auth headers if no token is provided

v0.4.1

18 Nov 03:05
Compare
Choose a tag to compare

What's Changed

  • drop the connect-node in favour of connect-web

Reason: Bun can't compile using HTTP2 at the moment, where it does work with connect-web

Whenever bun can compile into HTTP2, we can add back support for connect-node

v0.4.0

17 Nov 15:08
b5063de
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.3.0...v0.4.0

v0.3.0

12 Oct 03:45
Compare
Choose a tag to compare
  • Add eventemitter3 as drop-in dependency to replace EventEmitter