@apibara/protocol 2.0.0-beta.2 → 2.0.0-beta.21
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 +14 -7
- package/dist/index.d.cts +5 -6
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.mjs +13 -8
- package/dist/shared/{protocol.e9aed6a3.d.ts → protocol.59e5839c.d.cts} +247 -79
- package/dist/shared/{protocol.e9aed6a3.d.cts → protocol.59e5839c.d.mts} +247 -79
- package/dist/shared/{protocol.e9aed6a3.d.mts → protocol.59e5839c.d.ts} +247 -79
- package/dist/shared/{protocol.a07a51b5.mjs → protocol.d9596779.mjs} +293 -106
- package/dist/shared/{protocol.6b1bdade.cjs → protocol.e1dec68a.cjs} +294 -106
- package/dist/testing/index.cjs +2 -2
- package/dist/testing/index.d.cts +7 -2
- package/dist/testing/index.d.mts +7 -2
- package/dist/testing/index.d.ts +7 -2
- package/dist/testing/index.mjs +2 -2
- package/package.json +33 -47
- package/src/client.ts +21 -5
- package/src/common.ts +2 -2
- package/src/proto/google/protobuf/duration.ts +189 -0
- package/src/proto/index.ts +1 -2
- package/src/proto/stream.ts +442 -11
- package/src/proto/testing.ts +1 -1
- package/src/status.ts +2 -0
- package/src/stream.ts +22 -2
- package/CHANGELOG.md +0 -103
- package/LICENSE.txt +0 -202
- package/buf.gen.yaml +0 -14
- package/build.config.ts +0 -11
- package/proto/common.proto +0 -22
- package/proto/stream.proto +0 -83
- package/proto/testing.proto +0 -11
- package/src/proto/common.ts +0 -279
- package/tsconfig.json +0 -12
|
@@ -1,15 +1,133 @@
|
|
|
1
1
|
import { Schema } from '@effect/schema';
|
|
2
|
-
import { DefaultCallOptions, NormalizedServiceDefinition } from 'nice-grpc';
|
|
2
|
+
import { DefaultCallOptions, NormalizedServiceDefinition, ChannelCredentials, ChannelOptions } from 'nice-grpc';
|
|
3
3
|
import { CallContext, CallOptions } from 'nice-grpc-common';
|
|
4
|
-
import _m0 from 'protobufjs/minimal';
|
|
4
|
+
import _m0 from 'protobufjs/minimal.js';
|
|
5
5
|
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* A Duration represents a signed, fixed-length span of time represented
|
|
9
|
+
* as a count of seconds and fractions of seconds at nanosecond
|
|
10
|
+
* resolution. It is independent of any calendar and concepts like "day"
|
|
11
|
+
* or "month". It is related to Timestamp in that the difference between
|
|
12
|
+
* two Timestamp values is a Duration and it can be added or subtracted
|
|
13
|
+
* from a Timestamp. Range is approximately +-10,000 years.
|
|
14
|
+
*
|
|
15
|
+
* # Examples
|
|
16
|
+
*
|
|
17
|
+
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
18
|
+
*
|
|
19
|
+
* Timestamp start = ...;
|
|
20
|
+
* Timestamp end = ...;
|
|
21
|
+
* Duration duration = ...;
|
|
22
|
+
*
|
|
23
|
+
* duration.seconds = end.seconds - start.seconds;
|
|
24
|
+
* duration.nanos = end.nanos - start.nanos;
|
|
25
|
+
*
|
|
26
|
+
* if (duration.seconds < 0 && duration.nanos > 0) {
|
|
27
|
+
* duration.seconds += 1;
|
|
28
|
+
* duration.nanos -= 1000000000;
|
|
29
|
+
* } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
30
|
+
* duration.seconds -= 1;
|
|
31
|
+
* duration.nanos += 1000000000;
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
35
|
+
*
|
|
36
|
+
* Timestamp start = ...;
|
|
37
|
+
* Duration duration = ...;
|
|
38
|
+
* Timestamp end = ...;
|
|
39
|
+
*
|
|
40
|
+
* end.seconds = start.seconds + duration.seconds;
|
|
41
|
+
* end.nanos = start.nanos + duration.nanos;
|
|
42
|
+
*
|
|
43
|
+
* if (end.nanos < 0) {
|
|
44
|
+
* end.seconds -= 1;
|
|
45
|
+
* end.nanos += 1000000000;
|
|
46
|
+
* } else if (end.nanos >= 1000000000) {
|
|
47
|
+
* end.seconds += 1;
|
|
48
|
+
* end.nanos -= 1000000000;
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* Example 3: Compute Duration from datetime.timedelta in Python.
|
|
52
|
+
*
|
|
53
|
+
* td = datetime.timedelta(days=3, minutes=10)
|
|
54
|
+
* duration = Duration()
|
|
55
|
+
* duration.FromTimedelta(td)
|
|
56
|
+
*
|
|
57
|
+
* # JSON Mapping
|
|
58
|
+
*
|
|
59
|
+
* In JSON format, the Duration type is encoded as a string rather than an
|
|
60
|
+
* object, where the string ends in the suffix "s" (indicating seconds) and
|
|
61
|
+
* is preceded by the number of seconds, with nanoseconds expressed as
|
|
62
|
+
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
63
|
+
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
64
|
+
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
65
|
+
* microsecond should be expressed in JSON format as "3.000001s".
|
|
66
|
+
*/
|
|
67
|
+
interface Duration$1 {
|
|
68
|
+
/**
|
|
69
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
70
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
71
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
72
|
+
*/
|
|
73
|
+
readonly seconds: bigint;
|
|
74
|
+
/**
|
|
75
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
76
|
+
* of time. Durations less than one second are represented with a 0
|
|
77
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
78
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
79
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
80
|
+
* to +999,999,999 inclusive.
|
|
81
|
+
*/
|
|
82
|
+
readonly nanos: number;
|
|
83
|
+
}
|
|
84
|
+
declare const Duration$1: {
|
|
85
|
+
encode(message: Duration$1, writer?: _m0.Writer): _m0.Writer;
|
|
86
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Duration$1;
|
|
87
|
+
fromJSON(object: any): Duration$1;
|
|
88
|
+
toJSON(message: Duration$1): unknown;
|
|
89
|
+
create(base?: DeepPartial$1<Duration$1>): Duration$1;
|
|
90
|
+
fromPartial(object: DeepPartial$1<Duration$1>): Duration$1;
|
|
91
|
+
};
|
|
92
|
+
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
93
|
+
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
|
|
94
|
+
readonly $case: string;
|
|
95
|
+
} ? {
|
|
96
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
|
|
97
|
+
} & {
|
|
98
|
+
readonly $case: T["$case"];
|
|
99
|
+
} : T extends {} ? {
|
|
100
|
+
[K in keyof T]?: DeepPartial$1<T[K]>;
|
|
101
|
+
} : Partial<T>;
|
|
102
|
+
|
|
103
|
+
declare const protobufPackage = "dna.v2.stream";
|
|
104
|
+
/** Apibara DNA server V2 */
|
|
105
|
+
/** Data finality. */
|
|
106
|
+
declare enum DataFinality$1 {
|
|
107
|
+
UNKNOWN = 0,
|
|
108
|
+
/** PENDING - Data was received, but is not part of the canonical chain yet. */
|
|
109
|
+
PENDING = 1,
|
|
110
|
+
/** ACCEPTED - Data is now part of the canonical chain, but could still be invalidated. */
|
|
111
|
+
ACCEPTED = 2,
|
|
112
|
+
/** FINALIZED - Data is finalized and cannot be invalidated. */
|
|
113
|
+
FINALIZED = 3,
|
|
114
|
+
UNRECOGNIZED = -1
|
|
115
|
+
}
|
|
116
|
+
declare function dataFinalityFromJSON(object: any): DataFinality$1;
|
|
117
|
+
declare function dataFinalityToJSON(object: DataFinality$1): string;
|
|
8
118
|
/** A cursor over the stream content. */
|
|
9
119
|
interface Cursor$1 {
|
|
10
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Key used for ordering messages in the stream.
|
|
122
|
+
*
|
|
123
|
+
* This is usually the block or slot number.
|
|
124
|
+
*/
|
|
11
125
|
readonly orderKey: bigint;
|
|
12
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Key used to discriminate branches in the stream.
|
|
128
|
+
*
|
|
129
|
+
* This is usually the hash of the block.
|
|
130
|
+
*/
|
|
13
131
|
readonly uniqueKey: Uint8Array;
|
|
14
132
|
}
|
|
15
133
|
declare const Cursor$1: {
|
|
@@ -17,8 +135,8 @@ declare const Cursor$1: {
|
|
|
17
135
|
decode(input: _m0.Reader | Uint8Array, length?: number): Cursor$1;
|
|
18
136
|
fromJSON(object: any): Cursor$1;
|
|
19
137
|
toJSON(message: Cursor$1): unknown;
|
|
20
|
-
create(base?: DeepPartial
|
|
21
|
-
fromPartial(object: DeepPartial
|
|
138
|
+
create(base?: DeepPartial<Cursor$1>): Cursor$1;
|
|
139
|
+
fromPartial(object: DeepPartial<Cursor$1>): Cursor$1;
|
|
22
140
|
};
|
|
23
141
|
/** Request for the `Status` method. */
|
|
24
142
|
interface StatusRequest$1 {
|
|
@@ -28,8 +146,8 @@ declare const StatusRequest$1: {
|
|
|
28
146
|
decode(input: _m0.Reader | Uint8Array, length?: number): StatusRequest$1;
|
|
29
147
|
fromJSON(_: any): StatusRequest$1;
|
|
30
148
|
toJSON(_: StatusRequest$1): unknown;
|
|
31
|
-
create(base?: DeepPartial
|
|
32
|
-
fromPartial(_: DeepPartial
|
|
149
|
+
create(base?: DeepPartial<StatusRequest$1>): StatusRequest$1;
|
|
150
|
+
fromPartial(_: DeepPartial<StatusRequest$1>): StatusRequest$1;
|
|
33
151
|
};
|
|
34
152
|
/** Response for the `Status` method. */
|
|
35
153
|
interface StatusResponse$1 {
|
|
@@ -37,56 +155,43 @@ interface StatusResponse$1 {
|
|
|
37
155
|
readonly currentHead?: Cursor$1 | undefined;
|
|
38
156
|
/** The last cursor that was ingested by the node. */
|
|
39
157
|
readonly lastIngested?: Cursor$1 | undefined;
|
|
158
|
+
/** The finalized block. */
|
|
159
|
+
readonly finalized?: Cursor$1 | undefined;
|
|
160
|
+
/** The first block available. */
|
|
161
|
+
readonly starting?: Cursor$1 | undefined;
|
|
40
162
|
}
|
|
41
163
|
declare const StatusResponse$1: {
|
|
42
164
|
encode(message: StatusResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
43
165
|
decode(input: _m0.Reader | Uint8Array, length?: number): StatusResponse$1;
|
|
44
166
|
fromJSON(object: any): StatusResponse$1;
|
|
45
167
|
toJSON(message: StatusResponse$1): unknown;
|
|
46
|
-
create(base?: DeepPartial
|
|
47
|
-
fromPartial(object: DeepPartial
|
|
168
|
+
create(base?: DeepPartial<StatusResponse$1>): StatusResponse$1;
|
|
169
|
+
fromPartial(object: DeepPartial<StatusResponse$1>): StatusResponse$1;
|
|
48
170
|
};
|
|
49
|
-
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
50
|
-
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {
|
|
51
|
-
readonly $case: string;
|
|
52
|
-
} ? {
|
|
53
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial$1<T[K]>;
|
|
54
|
-
} & {
|
|
55
|
-
readonly $case: T["$case"];
|
|
56
|
-
} : T extends {} ? {
|
|
57
|
-
[K in keyof T]?: DeepPartial$1<T[K]>;
|
|
58
|
-
} : Partial<T>;
|
|
59
|
-
|
|
60
|
-
declare namespace common {
|
|
61
|
-
export { Cursor$1 as Cursor, type DeepPartial$1 as DeepPartial, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, protobufPackage$1 as protobufPackage };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
declare const protobufPackage = "dna.v2.stream";
|
|
65
|
-
/** Apibara DNA server V2 */
|
|
66
|
-
/** Data finality. */
|
|
67
|
-
declare enum DataFinality$1 {
|
|
68
|
-
UNKNOWN = 0,
|
|
69
|
-
/** PENDING - Data was received, but is not part of the canonical chain yet. */
|
|
70
|
-
PENDING = 1,
|
|
71
|
-
/** ACCEPTED - Data is now part of the canonical chain, but could still be invalidated. */
|
|
72
|
-
ACCEPTED = 2,
|
|
73
|
-
/** FINALIZED - Data is finalized and cannot be invalidated. */
|
|
74
|
-
FINALIZED = 3,
|
|
75
|
-
UNRECOGNIZED = -1
|
|
76
|
-
}
|
|
77
|
-
declare function dataFinalityFromJSON(object: any): DataFinality$1;
|
|
78
|
-
declare function dataFinalityToJSON(object: DataFinality$1): string;
|
|
79
171
|
/** Request data to be streamed. */
|
|
80
172
|
interface StreamDataRequest$1 {
|
|
81
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Cursor to start streaming from.
|
|
175
|
+
*
|
|
176
|
+
* If not specified, starts from the genesis block.
|
|
177
|
+
* Use the data's message `end_cursor` field to resume streaming.
|
|
178
|
+
*/
|
|
82
179
|
readonly startingCursor?: Cursor$1 | undefined;
|
|
83
180
|
/**
|
|
84
181
|
* Return data with the specified finality.
|
|
182
|
+
*
|
|
85
183
|
* If not specified, defaults to `DATA_FINALITY_ACCEPTED`.
|
|
86
184
|
*/
|
|
87
185
|
readonly finality?: DataFinality$1 | undefined;
|
|
88
186
|
/** Filters used to generate data. */
|
|
89
187
|
readonly filter: readonly Uint8Array[];
|
|
188
|
+
/**
|
|
189
|
+
* Heartbeat interval.
|
|
190
|
+
*
|
|
191
|
+
* Value must be between 10 and 60 seconds.
|
|
192
|
+
* If not specified, defaults to 30 seconds.
|
|
193
|
+
*/
|
|
194
|
+
readonly heartbeatInterval?: Duration$1 | undefined;
|
|
90
195
|
}
|
|
91
196
|
declare const StreamDataRequest$1: {
|
|
92
197
|
encode(message: StreamDataRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -104,6 +209,9 @@ interface StreamDataResponse$1 {
|
|
|
104
209
|
} | {
|
|
105
210
|
readonly $case: "invalidate";
|
|
106
211
|
readonly invalidate: Invalidate$1;
|
|
212
|
+
} | {
|
|
213
|
+
readonly $case: "finalize";
|
|
214
|
+
readonly finalize: Finalize$1;
|
|
107
215
|
} | {
|
|
108
216
|
readonly $case: "heartbeat";
|
|
109
217
|
readonly heartbeat: Heartbeat$1;
|
|
@@ -122,8 +230,14 @@ declare const StreamDataResponse$1: {
|
|
|
122
230
|
};
|
|
123
231
|
/** Invalidate data after the given cursor. */
|
|
124
232
|
interface Invalidate$1 {
|
|
125
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* The cursor of the new chain's head.
|
|
235
|
+
*
|
|
236
|
+
* All data after this cursor should be considered invalid.
|
|
237
|
+
*/
|
|
126
238
|
readonly cursor?: Cursor$1 | undefined;
|
|
239
|
+
/** List of blocks that were removed from the chain. */
|
|
240
|
+
readonly removed: readonly Cursor$1[];
|
|
127
241
|
}
|
|
128
242
|
declare const Invalidate$1: {
|
|
129
243
|
encode(message: Invalidate$1, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -133,6 +247,23 @@ declare const Invalidate$1: {
|
|
|
133
247
|
create(base?: DeepPartial<Invalidate$1>): Invalidate$1;
|
|
134
248
|
fromPartial(object: DeepPartial<Invalidate$1>): Invalidate$1;
|
|
135
249
|
};
|
|
250
|
+
/** Move the finalized block forward. */
|
|
251
|
+
interface Finalize$1 {
|
|
252
|
+
/**
|
|
253
|
+
* The cursor of the new finalized block.
|
|
254
|
+
*
|
|
255
|
+
* All data before this cursor cannot be invalidated.
|
|
256
|
+
*/
|
|
257
|
+
readonly cursor?: Cursor$1 | undefined;
|
|
258
|
+
}
|
|
259
|
+
declare const Finalize$1: {
|
|
260
|
+
encode(message: Finalize$1, writer?: _m0.Writer): _m0.Writer;
|
|
261
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Finalize$1;
|
|
262
|
+
fromJSON(object: any): Finalize$1;
|
|
263
|
+
toJSON(message: Finalize$1): unknown;
|
|
264
|
+
create(base?: DeepPartial<Finalize$1>): Finalize$1;
|
|
265
|
+
fromPartial(object: DeepPartial<Finalize$1>): Finalize$1;
|
|
266
|
+
};
|
|
136
267
|
/**
|
|
137
268
|
* A single block of data.
|
|
138
269
|
*
|
|
@@ -149,7 +280,11 @@ interface Data$1 {
|
|
|
149
280
|
readonly endCursor?: Cursor$1 | undefined;
|
|
150
281
|
/** The finality status of the block. */
|
|
151
282
|
readonly finality: DataFinality$1;
|
|
152
|
-
/**
|
|
283
|
+
/**
|
|
284
|
+
* The block data.
|
|
285
|
+
*
|
|
286
|
+
* This message contains chain-specific data serialized using protobuf.
|
|
287
|
+
*/
|
|
153
288
|
readonly data: readonly Uint8Array[];
|
|
154
289
|
}
|
|
155
290
|
declare const Data$1: {
|
|
@@ -222,38 +357,20 @@ declare const DnaStreamDefinition: {
|
|
|
222
357
|
readonly name: "Status";
|
|
223
358
|
readonly requestType: {
|
|
224
359
|
encode(_: StatusRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
225
|
-
decode(input:
|
|
360
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): StatusRequest$1;
|
|
226
361
|
fromJSON(_: any): StatusRequest$1;
|
|
227
362
|
toJSON(_: StatusRequest$1): unknown;
|
|
228
|
-
create(base?:
|
|
229
|
-
fromPartial(_:
|
|
363
|
+
create(base?: DeepPartial<StatusRequest$1>): StatusRequest$1;
|
|
364
|
+
fromPartial(_: DeepPartial<StatusRequest$1>): StatusRequest$1;
|
|
230
365
|
};
|
|
231
366
|
readonly requestStream: false;
|
|
232
367
|
readonly responseType: {
|
|
233
368
|
encode(message: StatusResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
234
|
-
decode(input:
|
|
369
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): StatusResponse$1;
|
|
235
370
|
fromJSON(object: any): StatusResponse$1;
|
|
236
371
|
toJSON(message: StatusResponse$1): unknown;
|
|
237
|
-
create(base?:
|
|
238
|
-
|
|
239
|
-
readonly orderKey?: bigint;
|
|
240
|
-
readonly uniqueKey?: Uint8Array;
|
|
241
|
-
} | undefined;
|
|
242
|
-
readonly lastIngested?: {
|
|
243
|
-
readonly orderKey?: bigint;
|
|
244
|
-
readonly uniqueKey?: Uint8Array;
|
|
245
|
-
} | undefined;
|
|
246
|
-
} | undefined): StatusResponse$1;
|
|
247
|
-
fromPartial(object: {
|
|
248
|
-
readonly currentHead?: {
|
|
249
|
-
readonly orderKey?: bigint;
|
|
250
|
-
readonly uniqueKey?: Uint8Array;
|
|
251
|
-
} | undefined;
|
|
252
|
-
readonly lastIngested?: {
|
|
253
|
-
readonly orderKey?: bigint;
|
|
254
|
-
readonly uniqueKey?: Uint8Array;
|
|
255
|
-
} | undefined;
|
|
256
|
-
}): StatusResponse$1;
|
|
372
|
+
create(base?: DeepPartial<StatusResponse$1>): StatusResponse$1;
|
|
373
|
+
fromPartial(object: DeepPartial<StatusResponse$1>): StatusResponse$1;
|
|
257
374
|
};
|
|
258
375
|
readonly responseStream: false;
|
|
259
376
|
readonly options: {};
|
|
@@ -295,7 +412,7 @@ declare const stream_dataFinalityFromJSON: typeof dataFinalityFromJSON;
|
|
|
295
412
|
declare const stream_dataFinalityToJSON: typeof dataFinalityToJSON;
|
|
296
413
|
declare const stream_protobufPackage: typeof protobufPackage;
|
|
297
414
|
declare namespace stream {
|
|
298
|
-
export { Data$1 as Data, DataFinality$1 as DataFinality, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_protobufPackage as protobufPackage };
|
|
415
|
+
export { Cursor$1 as Cursor, Data$1 as Data, DataFinality$1 as DataFinality, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Finalize$1 as Finalize, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_protobufPackage as protobufPackage };
|
|
299
416
|
}
|
|
300
417
|
|
|
301
418
|
/** Bytes encoded as a 0x-prefixed hex string. */
|
|
@@ -316,46 +433,64 @@ interface Cursor extends Schema.Schema.Type<typeof _Cursor> {
|
|
|
316
433
|
}
|
|
317
434
|
declare const Cursor: Schema.Schema<Cursor, CursorProto>;
|
|
318
435
|
declare const createCursor: (props: Cursor) => Cursor;
|
|
319
|
-
declare const cursorToProto: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
320
|
-
declare const cursorFromProto: (i: CursorProto, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
436
|
+
declare const cursorToProto: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions) => CursorProto;
|
|
437
|
+
declare const cursorFromProto: (i: CursorProto, overrideOptions?: _effect_schema_AST.ParseOptions) => Cursor;
|
|
321
438
|
declare const CursorFromBytes: Schema.transform<Schema.Schema<Uint8Array, Uint8Array, never>, Schema.Schema<Cursor, CursorProto, never>>;
|
|
322
|
-
declare const cursorToBytes: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
323
|
-
declare const cursorFromBytes: (i: Uint8Array, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
439
|
+
declare const cursorToBytes: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions) => Uint8Array;
|
|
440
|
+
declare const cursorFromBytes: (i: Uint8Array, overrideOptions?: _effect_schema_AST.ParseOptions) => Cursor;
|
|
324
441
|
|
|
325
442
|
/** The request to the `status` endpoint. */
|
|
326
443
|
declare const StatusRequest: Schema.Struct<{}>;
|
|
327
444
|
type StatusRequest = typeof StatusRequest.Type;
|
|
328
|
-
declare const statusRequestToProto: (a: {}, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
329
|
-
declare const statusRequestFromProto: (i: {}, overrideOptions?: _effect_schema_AST.ParseOptions
|
|
445
|
+
declare const statusRequestToProto: (a: {}, overrideOptions?: _effect_schema_AST.ParseOptions) => {};
|
|
446
|
+
declare const statusRequestFromProto: (i: {}, overrideOptions?: _effect_schema_AST.ParseOptions) => {};
|
|
330
447
|
/** The response from the `status` endpoint. */
|
|
331
448
|
declare const StatusResponse: Schema.Struct<{
|
|
332
449
|
currentHead: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
333
450
|
lastIngested: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
451
|
+
finalized: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
452
|
+
starting: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
334
453
|
}>;
|
|
335
454
|
type StatusResponse = typeof StatusResponse.Type;
|
|
336
455
|
declare const statusResponseToProto: (a: {
|
|
337
456
|
readonly currentHead?: Cursor | undefined;
|
|
338
457
|
readonly lastIngested?: Cursor | undefined;
|
|
339
|
-
|
|
458
|
+
readonly finalized?: Cursor | undefined;
|
|
459
|
+
readonly starting?: Cursor | undefined;
|
|
460
|
+
}, overrideOptions?: _effect_schema_AST.ParseOptions) => {
|
|
340
461
|
readonly currentHead?: CursorProto | undefined;
|
|
341
462
|
readonly lastIngested?: CursorProto | undefined;
|
|
463
|
+
readonly finalized?: CursorProto | undefined;
|
|
464
|
+
readonly starting?: CursorProto | undefined;
|
|
342
465
|
};
|
|
343
466
|
declare const statusResponseFromProto: (i: {
|
|
344
467
|
readonly currentHead?: CursorProto | undefined;
|
|
345
468
|
readonly lastIngested?: CursorProto | undefined;
|
|
346
|
-
|
|
469
|
+
readonly finalized?: CursorProto | undefined;
|
|
470
|
+
readonly starting?: CursorProto | undefined;
|
|
471
|
+
}, overrideOptions?: _effect_schema_AST.ParseOptions) => {
|
|
347
472
|
readonly currentHead?: Cursor | undefined;
|
|
348
473
|
readonly lastIngested?: Cursor | undefined;
|
|
474
|
+
readonly finalized?: Cursor | undefined;
|
|
475
|
+
readonly starting?: Cursor | undefined;
|
|
349
476
|
};
|
|
350
477
|
|
|
351
478
|
/** Data finality. */
|
|
352
479
|
declare const DataFinality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
353
480
|
type DataFinality = typeof DataFinality.Type;
|
|
481
|
+
declare const Duration: Schema.Struct<{
|
|
482
|
+
seconds: typeof Schema.BigIntFromSelf;
|
|
483
|
+
nanos: typeof Schema.Number;
|
|
484
|
+
}>;
|
|
354
485
|
/** Create a `StreamDataRequest` with the given filter schema. */
|
|
355
486
|
declare const StreamDataRequest: <TA, TR>(filter: Schema.Schema<TA, Uint8Array, TR>) => Schema.Struct<{
|
|
356
487
|
finality: Schema.optional<Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>>;
|
|
357
488
|
startingCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
358
489
|
filter: Schema.mutable<Schema.Array$<Schema.Schema<TA, Uint8Array, TR>>>;
|
|
490
|
+
heartbeatInterval: Schema.optional<Schema.Struct<{
|
|
491
|
+
seconds: typeof Schema.BigIntFromSelf;
|
|
492
|
+
nanos: typeof Schema.Number;
|
|
493
|
+
}>>;
|
|
359
494
|
}>;
|
|
360
495
|
type StreamDataRequest<TA> = {
|
|
361
496
|
finality?: DataFinality | undefined;
|
|
@@ -369,6 +504,13 @@ declare const Invalidate: Schema.Struct<{
|
|
|
369
504
|
}>;
|
|
370
505
|
}>;
|
|
371
506
|
type Invalidate = typeof Invalidate.Type;
|
|
507
|
+
declare const Finalize: Schema.Struct<{
|
|
508
|
+
_tag: Schema.PropertySignature<":", "finalize", "$case", ":", "finalize", false, never>;
|
|
509
|
+
finalize: Schema.Struct<{
|
|
510
|
+
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
511
|
+
}>;
|
|
512
|
+
}>;
|
|
513
|
+
type Finalize = typeof Finalize.Type;
|
|
372
514
|
declare const Heartbeat: Schema.Struct<{
|
|
373
515
|
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
374
516
|
}>;
|
|
@@ -410,6 +552,11 @@ declare const ResponseWithoutData: Schema.Union<[Schema.Struct<{
|
|
|
410
552
|
invalidate: Schema.Struct<{
|
|
411
553
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
412
554
|
}>;
|
|
555
|
+
}>, Schema.Struct<{
|
|
556
|
+
_tag: Schema.PropertySignature<":", "finalize", "$case", ":", "finalize", false, never>;
|
|
557
|
+
finalize: Schema.Struct<{
|
|
558
|
+
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
559
|
+
}>;
|
|
413
560
|
}>, Schema.Struct<{
|
|
414
561
|
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
415
562
|
}>, Schema.Struct<{
|
|
@@ -438,6 +585,11 @@ declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8A
|
|
|
438
585
|
invalidate: Schema.Struct<{
|
|
439
586
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
440
587
|
}>;
|
|
588
|
+
}>, Schema.Struct<{
|
|
589
|
+
_tag: Schema.PropertySignature<":", "finalize", "$case", ":", "finalize", false, never>;
|
|
590
|
+
finalize: Schema.Struct<{
|
|
591
|
+
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
592
|
+
}>;
|
|
441
593
|
}>, Schema.Struct<{
|
|
442
594
|
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
443
595
|
}>, Schema.Struct<{
|
|
@@ -479,6 +631,10 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
479
631
|
finality: Schema.optional<Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>>;
|
|
480
632
|
startingCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
481
633
|
filter: Schema.mutable<Schema.Array$<Schema.Schema<TFilter, Uint8Array, never>>>;
|
|
634
|
+
heartbeatInterval: Schema.optional<Schema.Struct<{
|
|
635
|
+
seconds: typeof Schema.BigIntFromSelf;
|
|
636
|
+
nanos: typeof Schema.Number;
|
|
637
|
+
}>>;
|
|
482
638
|
}>;
|
|
483
639
|
/** Stream data response schema. */
|
|
484
640
|
get Response(): Schema.Union<[Schema.Struct<{
|
|
@@ -494,6 +650,11 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
494
650
|
invalidate: Schema.Struct<{
|
|
495
651
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
496
652
|
}>;
|
|
653
|
+
}>, Schema.Struct<{
|
|
654
|
+
_tag: Schema.PropertySignature<":", "finalize", "$case", ":", "finalize", false, never>;
|
|
655
|
+
finalize: Schema.Struct<{
|
|
656
|
+
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
657
|
+
}>;
|
|
497
658
|
}>, Schema.Struct<{
|
|
498
659
|
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
499
660
|
}>, Schema.Struct<{
|
|
@@ -525,8 +686,13 @@ interface Client<TFilter, TBlock> {
|
|
|
525
686
|
/** Start streaming data from the DNA server. */
|
|
526
687
|
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): AsyncIterable<StreamDataResponse<TBlock>>;
|
|
527
688
|
}
|
|
689
|
+
type CreateClientOptions = {
|
|
690
|
+
defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<DnaStreamDefinition>>;
|
|
691
|
+
credentials?: ChannelCredentials;
|
|
692
|
+
channelOptions?: ChannelOptions;
|
|
693
|
+
};
|
|
528
694
|
/** Create a client connecting to the DNA grpc service. */
|
|
529
|
-
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string,
|
|
695
|
+
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string, options?: CreateClientOptions): GrpcClient<TFilter, TBlock>;
|
|
530
696
|
declare class GrpcClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
531
697
|
private config;
|
|
532
698
|
private client;
|
|
@@ -535,6 +701,8 @@ declare class GrpcClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
|
535
701
|
status(request?: StatusRequest, options?: ClientCallOptions): Promise<{
|
|
536
702
|
readonly currentHead?: Cursor | undefined;
|
|
537
703
|
readonly lastIngested?: Cursor | undefined;
|
|
704
|
+
readonly finalized?: Cursor | undefined;
|
|
705
|
+
readonly starting?: Cursor | undefined;
|
|
538
706
|
}>;
|
|
539
707
|
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): StreamDataIterable<TBlock>;
|
|
540
708
|
}
|
|
@@ -546,4 +714,4 @@ declare class StreamDataIterable<TBlock> {
|
|
|
546
714
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
547
715
|
}
|
|
548
716
|
|
|
549
|
-
export { type Client as A, Bytes as B, type CursorProto as C, type DnaStreamClient as D,
|
|
717
|
+
export { type Client as A, Bytes as B, type CursorProto as C, type DnaStreamClient as D, type CreateClientOptions as E, Finalize as F, createClient as G, Heartbeat as H, Invalidate as I, GrpcClient as J, StreamDataIterable as K, DataFinality$1 as L, StatusRequest as S, _Cursor as _, DnaStreamDefinition as a, BytesFromUint8Array as b, Cursor as c, createCursor as d, cursorToProto as e, cursorFromProto as f, CursorFromBytes as g, cursorToBytes as h, cursorFromBytes as i, statusRequestToProto as j, statusRequestFromProto as k, StatusResponse as l, statusResponseToProto as m, statusResponseFromProto as n, DataFinality as o, Duration as p, StreamDataRequest as q, StdOut as r, stream as s, StdErr as t, SystemMessage as u, Data as v, StreamDataResponse as w, StreamConfig as x, type ClientCallOptions as y, type StreamDataOptions as z };
|