Releases: substreams-js/substreams-node
Releases · substreams-js/substreams-node
v0.6.0
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"}
- add
- fix
createHeadersInterceptor
to include headers as interceptor (previously wasn't adding any headers) - Update examples to use
SUBSTREAMS_API_KEY
instead ofSUBSTREAMS_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
- Allows to import
import { BlockEmitter } from "@substreams/node";
import { createNodeTransport } from "@substreams/node/createNodeTransport";
// or
import { createWebTransport } from "@substreams/node/createWebTransport";
What's Changed
- Update auth api key & export to web/node by @DenisCarriere in #11
Full Changelog: v0.5.3...v0.6.0
v0.5.3
- update to latest dependencies
v0.5.2
- add
emitter.stop()
&emitter.cancelFn()
methods
v0.5.0
Changes
- Replace
createPromiseClient
withcreateCallbackClient
- Replace
emitter.stop()
function withCancelFn
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
- Implement CallbackClient by @DenisCarriere in #9
Full Changelog: v0.4.4...v0.5.0
v0.4.4
Transport exports
import { createNodeTransport } from "@substreams/node";
import { createWebTransport } from "@substreams/node";
What's Changed
- export
createWebTransport
by @DenisCarriere in #8
New Contributors
- @DenisCarriere made their first contribution in #8
Full Changelog: v0.4.3...v0.4.4
v0.4.3
- Switch back to using
connect-node
HTTP 2.0connect-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
- FIX: Do not include auth headers if no token is provided
v0.4.1
What's Changed
- drop the
connect-node
in favour ofconnect-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
What's Changed
- Replaced @bufbuild/connect deprecated dependency with @connectrpc by @chamorin in #7
Full Changelog: v0.3.0...v0.4.0
v0.3.0
- Add
eventemitter3
as drop-in dependency to replace EventEmitter