@apibara/protocol 2.0.0-beta.2 → 2.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const config = require('./shared/protocol.6b1bdade.cjs');
3
+ const config = require('./shared/protocol.e1dec68a.cjs');
4
4
  const schema = require('@effect/schema');
5
5
  const niceGrpc = require('nice-grpc');
6
+ require('protobufjs/minimal.js');
6
7
  const assert = require('node:assert');
7
- require('protobufjs/minimal');
8
8
  require('effect');
9
9
  require('viem');
10
10
  require('long');
@@ -15,7 +15,6 @@ const assert__default = /*#__PURE__*/_interopDefaultCompat(assert);
15
15
 
16
16
  const index = {
17
17
  __proto__: null,
18
- common: config.common,
19
18
  stream: config.stream,
20
19
  testing: config.testing
21
20
  };
@@ -25,7 +24,9 @@ const statusRequestToProto = schema.Schema.encodeSync(StatusRequest);
25
24
  const statusRequestFromProto = schema.Schema.decodeSync(StatusRequest);
26
25
  const StatusResponse = schema.Schema.Struct({
27
26
  currentHead: schema.Schema.optional(config.Cursor),
28
- lastIngested: schema.Schema.optional(config.Cursor)
27
+ lastIngested: schema.Schema.optional(config.Cursor),
28
+ finalized: schema.Schema.optional(config.Cursor),
29
+ starting: schema.Schema.optional(config.Cursor)
29
30
  });
30
31
  const statusResponseToProto = schema.Schema.encodeSync(StatusResponse);
31
32
  const statusResponseFromProto = schema.Schema.decodeSync(StatusResponse);
@@ -36,12 +37,16 @@ var __publicField$1 = (obj, key, value) => {
36
37
  __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
37
38
  return value;
38
39
  };
39
- function createClient(config$1, streamUrl, defaultCallOptions) {
40
- const channel = niceGrpc.createChannel(streamUrl);
40
+ function createClient(config$1, streamUrl, options = {}) {
41
+ const channel = niceGrpc.createChannel(
42
+ streamUrl,
43
+ options?.credentials,
44
+ options?.channelOptions
45
+ );
41
46
  const client = niceGrpc.createClient(
42
47
  config.DnaStreamDefinition,
43
48
  channel,
44
- defaultCallOptions
49
+ options?.defaultCallOptions
45
50
  );
46
51
  return new GrpcClient(config$1, client);
47
52
  }
@@ -162,6 +167,8 @@ exports.CursorFromBytes = config.CursorFromBytes;
162
167
  exports.Data = config.Data;
163
168
  exports.DataFinality = config.DataFinality;
164
169
  exports.DnaStreamDefinition = config.DnaStreamDefinition;
170
+ exports.Duration = config.Duration;
171
+ exports.Finalize = config.Finalize;
165
172
  exports.Heartbeat = config.Heartbeat;
166
173
  exports.Invalidate = config.Invalidate;
167
174
  exports.StdErr = config.StdErr;
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { c as common, s as stream } from './shared/protocol.e9aed6a3.cjs';
2
- export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, d as Cursor, h as CursorFromBytes, C as CursorProto, v as Data, p as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, G as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, m as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, F as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, E as createClient, e as createCursor, j as cursorFromBytes, g as cursorFromProto, i as cursorToBytes, f as cursorToProto, l as statusRequestFromProto, k as statusRequestToProto, o as statusResponseFromProto, n as statusResponseToProto } from './shared/protocol.e9aed6a3.cjs';
3
- import _m0 from 'protobufjs/minimal';
1
+ import { s as stream } from './shared/protocol.59e5839c.cjs';
2
+ export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, E as CreateClientOptions, c as Cursor, g as CursorFromBytes, C as CursorProto, v as Data, o as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, p as Duration, F as Finalize, J as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, l as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, K as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, G as createClient, d as createCursor, i as cursorFromBytes, f as cursorFromProto, h as cursorToBytes, e as cursorToProto, k as statusRequestFromProto, j as statusRequestToProto, n as statusResponseFromProto, m as statusResponseToProto } from './shared/protocol.59e5839c.cjs';
3
+ import _m0 from 'protobufjs/minimal.js';
4
+ export { ClientError, Status } from 'nice-grpc';
4
5
  import '@effect/schema';
5
- import 'nice-grpc';
6
6
  import 'nice-grpc-common';
7
7
  import '@effect/schema/AST';
8
8
 
@@ -48,11 +48,10 @@ declare namespace testing {
48
48
  export { type testing_DeepPartial as DeepPartial, testing_MockBlock as MockBlock, testing_MockFilter as MockFilter, testing_protobufPackage as protobufPackage };
49
49
  }
50
50
 
51
- declare const index_common: typeof common;
52
51
  declare const index_stream: typeof stream;
53
52
  declare const index_testing: typeof testing;
54
53
  declare namespace index {
55
- export { index_common as common, index_stream as stream, index_testing as testing };
54
+ export { index_stream as stream, index_testing as testing };
56
55
  }
57
56
 
58
57
  /** Track data rate using high precision timers. */
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { c as common, s as stream } from './shared/protocol.e9aed6a3.mjs';
2
- export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, d as Cursor, h as CursorFromBytes, C as CursorProto, v as Data, p as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, G as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, m as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, F as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, E as createClient, e as createCursor, j as cursorFromBytes, g as cursorFromProto, i as cursorToBytes, f as cursorToProto, l as statusRequestFromProto, k as statusRequestToProto, o as statusResponseFromProto, n as statusResponseToProto } from './shared/protocol.e9aed6a3.mjs';
3
- import _m0 from 'protobufjs/minimal';
1
+ import { s as stream } from './shared/protocol.59e5839c.mjs';
2
+ export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, E as CreateClientOptions, c as Cursor, g as CursorFromBytes, C as CursorProto, v as Data, o as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, p as Duration, F as Finalize, J as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, l as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, K as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, G as createClient, d as createCursor, i as cursorFromBytes, f as cursorFromProto, h as cursorToBytes, e as cursorToProto, k as statusRequestFromProto, j as statusRequestToProto, n as statusResponseFromProto, m as statusResponseToProto } from './shared/protocol.59e5839c.mjs';
3
+ import _m0 from 'protobufjs/minimal.js';
4
+ export { ClientError, Status } from 'nice-grpc';
4
5
  import '@effect/schema';
5
- import 'nice-grpc';
6
6
  import 'nice-grpc-common';
7
7
  import '@effect/schema/AST';
8
8
 
@@ -48,11 +48,10 @@ declare namespace testing {
48
48
  export { type testing_DeepPartial as DeepPartial, testing_MockBlock as MockBlock, testing_MockFilter as MockFilter, testing_protobufPackage as protobufPackage };
49
49
  }
50
50
 
51
- declare const index_common: typeof common;
52
51
  declare const index_stream: typeof stream;
53
52
  declare const index_testing: typeof testing;
54
53
  declare namespace index {
55
- export { index_common as common, index_stream as stream, index_testing as testing };
54
+ export { index_stream as stream, index_testing as testing };
56
55
  }
57
56
 
58
57
  /** Track data rate using high precision timers. */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { c as common, s as stream } from './shared/protocol.e9aed6a3.js';
2
- export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, d as Cursor, h as CursorFromBytes, C as CursorProto, v as Data, p as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, G as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, m as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, F as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, E as createClient, e as createCursor, j as cursorFromBytes, g as cursorFromProto, i as cursorToBytes, f as cursorToProto, l as statusRequestFromProto, k as statusRequestToProto, o as statusResponseFromProto, n as statusResponseToProto } from './shared/protocol.e9aed6a3.js';
3
- import _m0 from 'protobufjs/minimal';
1
+ import { s as stream } from './shared/protocol.59e5839c.js';
2
+ export { B as Bytes, b as BytesFromUint8Array, A as Client, y as ClientCallOptions, E as CreateClientOptions, c as Cursor, g as CursorFromBytes, C as CursorProto, v as Data, o as DataFinality, D as DnaStreamClient, a as DnaStreamDefinition, p as Duration, F as Finalize, J as GrpcClient, H as Heartbeat, I as Invalidate, S as StatusRequest, l as StatusResponse, t as StdErr, r as StdOut, x as StreamConfig, K as StreamDataIterable, z as StreamDataOptions, q as StreamDataRequest, w as StreamDataResponse, u as SystemMessage, _ as _Cursor, G as createClient, d as createCursor, i as cursorFromBytes, f as cursorFromProto, h as cursorToBytes, e as cursorToProto, k as statusRequestFromProto, j as statusRequestToProto, n as statusResponseFromProto, m as statusResponseToProto } from './shared/protocol.59e5839c.js';
3
+ import _m0 from 'protobufjs/minimal.js';
4
+ export { ClientError, Status } from 'nice-grpc';
4
5
  import '@effect/schema';
5
- import 'nice-grpc';
6
6
  import 'nice-grpc-common';
7
7
  import '@effect/schema/AST';
8
8
 
@@ -48,11 +48,10 @@ declare namespace testing {
48
48
  export { type testing_DeepPartial as DeepPartial, testing_MockBlock as MockBlock, testing_MockFilter as MockFilter, testing_protobufPackage as protobufPackage };
49
49
  }
50
50
 
51
- declare const index_common: typeof common;
52
51
  declare const index_stream: typeof stream;
53
52
  declare const index_testing: typeof testing;
54
53
  declare namespace index {
55
- export { index_common as common, index_stream as stream, index_testing as testing };
54
+ export { index_stream as stream, index_testing as testing };
56
55
  }
57
56
 
58
57
  /** Track data rate using high precision timers. */
package/dist/index.mjs CHANGED
@@ -1,16 +1,15 @@
1
- import { c as common, s as stream, t as testing, C as Cursor, D as DnaStreamDefinition, S as StreamDataResponse } from './shared/protocol.a07a51b5.mjs';
2
- export { B as Bytes, a as BytesFromUint8Array, f as CursorFromBytes, n as Data, i as DataFinality, H as Heartbeat, I as Invalidate, l as StdErr, k as StdOut, o as StreamConfig, j as StreamDataRequest, m as SystemMessage, _ as _Cursor, b as createCursor, h as cursorFromBytes, e as cursorFromProto, g as cursorToBytes, d as cursorToProto } from './shared/protocol.a07a51b5.mjs';
1
+ import { s as stream, t as testing, C as Cursor, D as DnaStreamDefinition, S as StreamDataResponse } from './shared/protocol.d9596779.mjs';
2
+ export { B as Bytes, a as BytesFromUint8Array, e as CursorFromBytes, n as Data, h as DataFinality, i as Duration, F as Finalize, H as Heartbeat, I as Invalidate, l as StdErr, k as StdOut, o as StreamConfig, j as StreamDataRequest, m as SystemMessage, _ as _Cursor, c as createCursor, g as cursorFromBytes, d as cursorFromProto, f as cursorToBytes, b as cursorToProto } from './shared/protocol.d9596779.mjs';
3
3
  import { Schema } from '@effect/schema';
4
4
  import { createChannel, createClient as createClient$1 } from 'nice-grpc';
5
+ import 'protobufjs/minimal.js';
5
6
  import assert from 'node:assert';
6
- import 'protobufjs/minimal';
7
7
  import 'effect';
8
8
  import 'viem';
9
9
  import 'long';
10
10
 
11
11
  const index = {
12
12
  __proto__: null,
13
- common: common,
14
13
  stream: stream,
15
14
  testing: testing
16
15
  };
@@ -20,7 +19,9 @@ const statusRequestToProto = Schema.encodeSync(StatusRequest);
20
19
  const statusRequestFromProto = Schema.decodeSync(StatusRequest);
21
20
  const StatusResponse = Schema.Struct({
22
21
  currentHead: Schema.optional(Cursor),
23
- lastIngested: Schema.optional(Cursor)
22
+ lastIngested: Schema.optional(Cursor),
23
+ finalized: Schema.optional(Cursor),
24
+ starting: Schema.optional(Cursor)
24
25
  });
25
26
  const statusResponseToProto = Schema.encodeSync(StatusResponse);
26
27
  const statusResponseFromProto = Schema.decodeSync(StatusResponse);
@@ -31,12 +32,16 @@ var __publicField$1 = (obj, key, value) => {
31
32
  __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
32
33
  return value;
33
34
  };
34
- function createClient(config, streamUrl, defaultCallOptions) {
35
- const channel = createChannel(streamUrl);
35
+ function createClient(config, streamUrl, options = {}) {
36
+ const channel = createChannel(
37
+ streamUrl,
38
+ options?.credentials,
39
+ options?.channelOptions
40
+ );
36
41
  const client = createClient$1(
37
42
  DnaStreamDefinition,
38
43
  channel,
39
- defaultCallOptions
44
+ options?.defaultCallOptions
40
45
  );
41
46
  return new GrpcClient(config, client);
42
47
  }