@apibara/protocol 2.0.0-beta.2 → 2.0.0-beta.4
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/package.json +33 -45
- 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 +441 -10
- 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/dist/index.cjs +0 -189
- package/dist/index.d.cts +0 -72
- package/dist/index.d.mts +0 -72
- package/dist/index.d.ts +0 -72
- package/dist/index.mjs +0 -153
- package/dist/shared/protocol.6b1bdade.cjs +0 -1060
- package/dist/shared/protocol.a07a51b5.mjs +0 -1028
- package/dist/shared/protocol.e9aed6a3.d.cts +0 -549
- package/dist/shared/protocol.e9aed6a3.d.mts +0 -549
- package/dist/shared/protocol.e9aed6a3.d.ts +0 -549
- package/dist/testing/index.cjs +0 -105
- package/dist/testing/index.d.cts +0 -70
- package/dist/testing/index.d.mts +0 -70
- package/dist/testing/index.d.ts +0 -70
- package/dist/testing/index.mjs +0 -97
- 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,549 +0,0 @@
|
|
|
1
|
-
import { Schema } from '@effect/schema';
|
|
2
|
-
import { DefaultCallOptions, NormalizedServiceDefinition } from 'nice-grpc';
|
|
3
|
-
import { CallContext, CallOptions } from 'nice-grpc-common';
|
|
4
|
-
import _m0 from 'protobufjs/minimal';
|
|
5
|
-
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
6
|
-
|
|
7
|
-
declare const protobufPackage$1 = "dna.v2.common";
|
|
8
|
-
/** A cursor over the stream content. */
|
|
9
|
-
interface Cursor$1 {
|
|
10
|
-
/** Key used for ordering messages in the stream. */
|
|
11
|
-
readonly orderKey: bigint;
|
|
12
|
-
/** Key used to discriminate branches in the stream. */
|
|
13
|
-
readonly uniqueKey: Uint8Array;
|
|
14
|
-
}
|
|
15
|
-
declare const Cursor$1: {
|
|
16
|
-
encode(message: Cursor$1, writer?: _m0.Writer): _m0.Writer;
|
|
17
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Cursor$1;
|
|
18
|
-
fromJSON(object: any): Cursor$1;
|
|
19
|
-
toJSON(message: Cursor$1): unknown;
|
|
20
|
-
create(base?: DeepPartial$1<Cursor$1>): Cursor$1;
|
|
21
|
-
fromPartial(object: DeepPartial$1<Cursor$1>): Cursor$1;
|
|
22
|
-
};
|
|
23
|
-
/** Request for the `Status` method. */
|
|
24
|
-
interface StatusRequest$1 {
|
|
25
|
-
}
|
|
26
|
-
declare const StatusRequest$1: {
|
|
27
|
-
encode(_: StatusRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
28
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StatusRequest$1;
|
|
29
|
-
fromJSON(_: any): StatusRequest$1;
|
|
30
|
-
toJSON(_: StatusRequest$1): unknown;
|
|
31
|
-
create(base?: DeepPartial$1<StatusRequest$1>): StatusRequest$1;
|
|
32
|
-
fromPartial(_: DeepPartial$1<StatusRequest$1>): StatusRequest$1;
|
|
33
|
-
};
|
|
34
|
-
/** Response for the `Status` method. */
|
|
35
|
-
interface StatusResponse$1 {
|
|
36
|
-
/** The current head of the chain. */
|
|
37
|
-
readonly currentHead?: Cursor$1 | undefined;
|
|
38
|
-
/** The last cursor that was ingested by the node. */
|
|
39
|
-
readonly lastIngested?: Cursor$1 | undefined;
|
|
40
|
-
}
|
|
41
|
-
declare const StatusResponse$1: {
|
|
42
|
-
encode(message: StatusResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
43
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StatusResponse$1;
|
|
44
|
-
fromJSON(object: any): StatusResponse$1;
|
|
45
|
-
toJSON(message: StatusResponse$1): unknown;
|
|
46
|
-
create(base?: DeepPartial$1<StatusResponse$1>): StatusResponse$1;
|
|
47
|
-
fromPartial(object: DeepPartial$1<StatusResponse$1>): StatusResponse$1;
|
|
48
|
-
};
|
|
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
|
-
/** Request data to be streamed. */
|
|
80
|
-
interface StreamDataRequest$1 {
|
|
81
|
-
/** Cursor to start streaming from. */
|
|
82
|
-
readonly startingCursor?: Cursor$1 | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Return data with the specified finality.
|
|
85
|
-
* If not specified, defaults to `DATA_FINALITY_ACCEPTED`.
|
|
86
|
-
*/
|
|
87
|
-
readonly finality?: DataFinality$1 | undefined;
|
|
88
|
-
/** Filters used to generate data. */
|
|
89
|
-
readonly filter: readonly Uint8Array[];
|
|
90
|
-
}
|
|
91
|
-
declare const StreamDataRequest$1: {
|
|
92
|
-
encode(message: StreamDataRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
93
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StreamDataRequest$1;
|
|
94
|
-
fromJSON(object: any): StreamDataRequest$1;
|
|
95
|
-
toJSON(message: StreamDataRequest$1): unknown;
|
|
96
|
-
create(base?: DeepPartial<StreamDataRequest$1>): StreamDataRequest$1;
|
|
97
|
-
fromPartial(object: DeepPartial<StreamDataRequest$1>): StreamDataRequest$1;
|
|
98
|
-
};
|
|
99
|
-
/** Contains a piece of streamed data. */
|
|
100
|
-
interface StreamDataResponse$1 {
|
|
101
|
-
readonly message?: {
|
|
102
|
-
readonly $case: "data";
|
|
103
|
-
readonly data: Data$1;
|
|
104
|
-
} | {
|
|
105
|
-
readonly $case: "invalidate";
|
|
106
|
-
readonly invalidate: Invalidate$1;
|
|
107
|
-
} | {
|
|
108
|
-
readonly $case: "heartbeat";
|
|
109
|
-
readonly heartbeat: Heartbeat$1;
|
|
110
|
-
} | {
|
|
111
|
-
readonly $case: "systemMessage";
|
|
112
|
-
readonly systemMessage: SystemMessage$1;
|
|
113
|
-
} | undefined;
|
|
114
|
-
}
|
|
115
|
-
declare const StreamDataResponse$1: {
|
|
116
|
-
encode(message: StreamDataResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
117
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StreamDataResponse$1;
|
|
118
|
-
fromJSON(object: any): StreamDataResponse$1;
|
|
119
|
-
toJSON(message: StreamDataResponse$1): unknown;
|
|
120
|
-
create(base?: DeepPartial<StreamDataResponse$1>): StreamDataResponse$1;
|
|
121
|
-
fromPartial(object: DeepPartial<StreamDataResponse$1>): StreamDataResponse$1;
|
|
122
|
-
};
|
|
123
|
-
/** Invalidate data after the given cursor. */
|
|
124
|
-
interface Invalidate$1 {
|
|
125
|
-
/** The cursor of the message before the now invalid data. */
|
|
126
|
-
readonly cursor?: Cursor$1 | undefined;
|
|
127
|
-
}
|
|
128
|
-
declare const Invalidate$1: {
|
|
129
|
-
encode(message: Invalidate$1, writer?: _m0.Writer): _m0.Writer;
|
|
130
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Invalidate$1;
|
|
131
|
-
fromJSON(object: any): Invalidate$1;
|
|
132
|
-
toJSON(message: Invalidate$1): unknown;
|
|
133
|
-
create(base?: DeepPartial<Invalidate$1>): Invalidate$1;
|
|
134
|
-
fromPartial(object: DeepPartial<Invalidate$1>): Invalidate$1;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* A single block of data.
|
|
138
|
-
*
|
|
139
|
-
* If the request specified multiple filters, the `data` field will contain the
|
|
140
|
-
* data for each filter in the same order as the filters were specified in the
|
|
141
|
-
* request.
|
|
142
|
-
* If no data is available for a filter, the corresponding data field will be
|
|
143
|
-
* empty.
|
|
144
|
-
*/
|
|
145
|
-
interface Data$1 {
|
|
146
|
-
/** Cursor that generated this block of data. */
|
|
147
|
-
readonly cursor?: Cursor$1 | undefined;
|
|
148
|
-
/** Block cursor. Use this cursor to resume the stream. */
|
|
149
|
-
readonly endCursor?: Cursor$1 | undefined;
|
|
150
|
-
/** The finality status of the block. */
|
|
151
|
-
readonly finality: DataFinality$1;
|
|
152
|
-
/** The block data. */
|
|
153
|
-
readonly data: readonly Uint8Array[];
|
|
154
|
-
}
|
|
155
|
-
declare const Data$1: {
|
|
156
|
-
encode(message: Data$1, writer?: _m0.Writer): _m0.Writer;
|
|
157
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Data$1;
|
|
158
|
-
fromJSON(object: any): Data$1;
|
|
159
|
-
toJSON(message: Data$1): unknown;
|
|
160
|
-
create(base?: DeepPartial<Data$1>): Data$1;
|
|
161
|
-
fromPartial(object: DeepPartial<Data$1>): Data$1;
|
|
162
|
-
};
|
|
163
|
-
/** Sent to clients to check if stream is still connected. */
|
|
164
|
-
interface Heartbeat$1 {
|
|
165
|
-
}
|
|
166
|
-
declare const Heartbeat$1: {
|
|
167
|
-
encode(_: Heartbeat$1, writer?: _m0.Writer): _m0.Writer;
|
|
168
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Heartbeat$1;
|
|
169
|
-
fromJSON(_: any): Heartbeat$1;
|
|
170
|
-
toJSON(_: Heartbeat$1): unknown;
|
|
171
|
-
create(base?: DeepPartial<Heartbeat$1>): Heartbeat$1;
|
|
172
|
-
fromPartial(_: DeepPartial<Heartbeat$1>): Heartbeat$1;
|
|
173
|
-
};
|
|
174
|
-
/** Message from the server to the client. */
|
|
175
|
-
interface SystemMessage$1 {
|
|
176
|
-
readonly output?: {
|
|
177
|
-
readonly $case: "stdout";
|
|
178
|
-
readonly stdout: string;
|
|
179
|
-
} | {
|
|
180
|
-
readonly $case: "stderr";
|
|
181
|
-
readonly stderr: string;
|
|
182
|
-
} | undefined;
|
|
183
|
-
}
|
|
184
|
-
declare const SystemMessage$1: {
|
|
185
|
-
encode(message: SystemMessage$1, writer?: _m0.Writer): _m0.Writer;
|
|
186
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): SystemMessage$1;
|
|
187
|
-
fromJSON(object: any): SystemMessage$1;
|
|
188
|
-
toJSON(message: SystemMessage$1): unknown;
|
|
189
|
-
create(base?: DeepPartial<SystemMessage$1>): SystemMessage$1;
|
|
190
|
-
fromPartial(object: DeepPartial<SystemMessage$1>): SystemMessage$1;
|
|
191
|
-
};
|
|
192
|
-
type DnaStreamDefinition = typeof DnaStreamDefinition;
|
|
193
|
-
declare const DnaStreamDefinition: {
|
|
194
|
-
readonly name: "DnaStream";
|
|
195
|
-
readonly fullName: "dna.v2.stream.DnaStream";
|
|
196
|
-
readonly methods: {
|
|
197
|
-
/** Stream data from the server. */
|
|
198
|
-
readonly streamData: {
|
|
199
|
-
readonly name: "StreamData";
|
|
200
|
-
readonly requestType: {
|
|
201
|
-
encode(message: StreamDataRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
202
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StreamDataRequest$1;
|
|
203
|
-
fromJSON(object: any): StreamDataRequest$1;
|
|
204
|
-
toJSON(message: StreamDataRequest$1): unknown;
|
|
205
|
-
create(base?: DeepPartial<StreamDataRequest$1>): StreamDataRequest$1;
|
|
206
|
-
fromPartial(object: DeepPartial<StreamDataRequest$1>): StreamDataRequest$1;
|
|
207
|
-
};
|
|
208
|
-
readonly requestStream: false;
|
|
209
|
-
readonly responseType: {
|
|
210
|
-
encode(message: StreamDataResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
211
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): StreamDataResponse$1;
|
|
212
|
-
fromJSON(object: any): StreamDataResponse$1;
|
|
213
|
-
toJSON(message: StreamDataResponse$1): unknown;
|
|
214
|
-
create(base?: DeepPartial<StreamDataResponse$1>): StreamDataResponse$1;
|
|
215
|
-
fromPartial(object: DeepPartial<StreamDataResponse$1>): StreamDataResponse$1;
|
|
216
|
-
};
|
|
217
|
-
readonly responseStream: true;
|
|
218
|
-
readonly options: {};
|
|
219
|
-
};
|
|
220
|
-
/** Get DNA server status. */
|
|
221
|
-
readonly status: {
|
|
222
|
-
readonly name: "Status";
|
|
223
|
-
readonly requestType: {
|
|
224
|
-
encode(_: StatusRequest$1, writer?: _m0.Writer): _m0.Writer;
|
|
225
|
-
decode(input: Uint8Array | _m0.Reader, length?: number | undefined): StatusRequest$1;
|
|
226
|
-
fromJSON(_: any): StatusRequest$1;
|
|
227
|
-
toJSON(_: StatusRequest$1): unknown;
|
|
228
|
-
create(base?: {} | undefined): StatusRequest$1;
|
|
229
|
-
fromPartial(_: {}): StatusRequest$1;
|
|
230
|
-
};
|
|
231
|
-
readonly requestStream: false;
|
|
232
|
-
readonly responseType: {
|
|
233
|
-
encode(message: StatusResponse$1, writer?: _m0.Writer): _m0.Writer;
|
|
234
|
-
decode(input: Uint8Array | _m0.Reader, length?: number | undefined): StatusResponse$1;
|
|
235
|
-
fromJSON(object: any): StatusResponse$1;
|
|
236
|
-
toJSON(message: StatusResponse$1): unknown;
|
|
237
|
-
create(base?: {
|
|
238
|
-
readonly currentHead?: {
|
|
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;
|
|
257
|
-
};
|
|
258
|
-
readonly responseStream: false;
|
|
259
|
-
readonly options: {};
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
interface DnaStreamServiceImplementation<CallContextExt = {}> {
|
|
264
|
-
/** Stream data from the server. */
|
|
265
|
-
streamData(request: StreamDataRequest$1, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<StreamDataResponse$1>>;
|
|
266
|
-
/** Get DNA server status. */
|
|
267
|
-
status(request: StatusRequest$1, context: CallContext & CallContextExt): Promise<DeepPartial<StatusResponse$1>>;
|
|
268
|
-
}
|
|
269
|
-
interface DnaStreamClient<CallOptionsExt = {}> {
|
|
270
|
-
/** Stream data from the server. */
|
|
271
|
-
streamData(request: DeepPartial<StreamDataRequest$1>, options?: CallOptions & CallOptionsExt): AsyncIterable<StreamDataResponse$1>;
|
|
272
|
-
/** Get DNA server status. */
|
|
273
|
-
status(request: DeepPartial<StatusRequest$1>, options?: CallOptions & CallOptionsExt): Promise<StatusResponse$1>;
|
|
274
|
-
}
|
|
275
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
276
|
-
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
277
|
-
readonly $case: string;
|
|
278
|
-
} ? {
|
|
279
|
-
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
280
|
-
} & {
|
|
281
|
-
readonly $case: T["$case"];
|
|
282
|
-
} : T extends {} ? {
|
|
283
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
284
|
-
} : Partial<T>;
|
|
285
|
-
type ServerStreamingMethodResult<Response> = {
|
|
286
|
-
[Symbol.asyncIterator](): AsyncIterator<Response, void>;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
type stream_DeepPartial<T> = DeepPartial<T>;
|
|
290
|
-
type stream_DnaStreamClient<CallOptionsExt = {}> = DnaStreamClient<CallOptionsExt>;
|
|
291
|
-
declare const stream_DnaStreamDefinition: typeof DnaStreamDefinition;
|
|
292
|
-
type stream_DnaStreamServiceImplementation<CallContextExt = {}> = DnaStreamServiceImplementation<CallContextExt>;
|
|
293
|
-
type stream_ServerStreamingMethodResult<Response> = ServerStreamingMethodResult<Response>;
|
|
294
|
-
declare const stream_dataFinalityFromJSON: typeof dataFinalityFromJSON;
|
|
295
|
-
declare const stream_dataFinalityToJSON: typeof dataFinalityToJSON;
|
|
296
|
-
declare const stream_protobufPackage: typeof protobufPackage;
|
|
297
|
-
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 };
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/** Bytes encoded as a 0x-prefixed hex string. */
|
|
302
|
-
declare const Bytes: Schema.SchemaClass<`0x${string}`, `0x${string}`, never>;
|
|
303
|
-
type Bytes = typeof Bytes.Type;
|
|
304
|
-
declare const BytesFromUint8Array: Schema.PropertySignature<"?:", `0x${string}`, never, ":", Uint8Array, false, never>;
|
|
305
|
-
/** Represent a position in the stream. */
|
|
306
|
-
declare const _Cursor: Schema.Struct<{
|
|
307
|
-
/** The block number. */
|
|
308
|
-
orderKey: typeof Schema.BigIntFromSelf;
|
|
309
|
-
/** The block hash, if any. */
|
|
310
|
-
uniqueKey: Schema.PropertySignature<"?:", `0x${string}`, never, ":", Uint8Array, false, never>;
|
|
311
|
-
}>;
|
|
312
|
-
/** The Cursor protobuf representation. */
|
|
313
|
-
interface CursorProto extends Schema.Schema.Encoded<typeof _Cursor> {
|
|
314
|
-
}
|
|
315
|
-
interface Cursor extends Schema.Schema.Type<typeof _Cursor> {
|
|
316
|
-
}
|
|
317
|
-
declare const Cursor: Schema.Schema<Cursor, CursorProto>;
|
|
318
|
-
declare const createCursor: (props: Cursor) => Cursor;
|
|
319
|
-
declare const cursorToProto: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => CursorProto;
|
|
320
|
-
declare const cursorFromProto: (i: CursorProto, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => Cursor;
|
|
321
|
-
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 | undefined) => Uint8Array;
|
|
323
|
-
declare const cursorFromBytes: (i: Uint8Array, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => Cursor;
|
|
324
|
-
|
|
325
|
-
/** The request to the `status` endpoint. */
|
|
326
|
-
declare const StatusRequest: Schema.Struct<{}>;
|
|
327
|
-
type StatusRequest = typeof StatusRequest.Type;
|
|
328
|
-
declare const statusRequestToProto: (a: {}, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => {};
|
|
329
|
-
declare const statusRequestFromProto: (i: {}, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => {};
|
|
330
|
-
/** The response from the `status` endpoint. */
|
|
331
|
-
declare const StatusResponse: Schema.Struct<{
|
|
332
|
-
currentHead: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
333
|
-
lastIngested: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
334
|
-
}>;
|
|
335
|
-
type StatusResponse = typeof StatusResponse.Type;
|
|
336
|
-
declare const statusResponseToProto: (a: {
|
|
337
|
-
readonly currentHead?: Cursor | undefined;
|
|
338
|
-
readonly lastIngested?: Cursor | undefined;
|
|
339
|
-
}, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => {
|
|
340
|
-
readonly currentHead?: CursorProto | undefined;
|
|
341
|
-
readonly lastIngested?: CursorProto | undefined;
|
|
342
|
-
};
|
|
343
|
-
declare const statusResponseFromProto: (i: {
|
|
344
|
-
readonly currentHead?: CursorProto | undefined;
|
|
345
|
-
readonly lastIngested?: CursorProto | undefined;
|
|
346
|
-
}, overrideOptions?: _effect_schema_AST.ParseOptions | undefined) => {
|
|
347
|
-
readonly currentHead?: Cursor | undefined;
|
|
348
|
-
readonly lastIngested?: Cursor | undefined;
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
/** Data finality. */
|
|
352
|
-
declare const DataFinality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
353
|
-
type DataFinality = typeof DataFinality.Type;
|
|
354
|
-
/** Create a `StreamDataRequest` with the given filter schema. */
|
|
355
|
-
declare const StreamDataRequest: <TA, TR>(filter: Schema.Schema<TA, Uint8Array, TR>) => Schema.Struct<{
|
|
356
|
-
finality: Schema.optional<Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>>;
|
|
357
|
-
startingCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
358
|
-
filter: Schema.mutable<Schema.Array$<Schema.Schema<TA, Uint8Array, TR>>>;
|
|
359
|
-
}>;
|
|
360
|
-
type StreamDataRequest<TA> = {
|
|
361
|
-
finality?: DataFinality | undefined;
|
|
362
|
-
startingCursor?: Cursor | undefined;
|
|
363
|
-
filter: TA[];
|
|
364
|
-
};
|
|
365
|
-
declare const Invalidate: Schema.Struct<{
|
|
366
|
-
_tag: Schema.PropertySignature<":", "invalidate", "$case", ":", "invalidate", false, never>;
|
|
367
|
-
invalidate: Schema.Struct<{
|
|
368
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
369
|
-
}>;
|
|
370
|
-
}>;
|
|
371
|
-
type Invalidate = typeof Invalidate.Type;
|
|
372
|
-
declare const Heartbeat: Schema.Struct<{
|
|
373
|
-
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
374
|
-
}>;
|
|
375
|
-
type Heartbeat = typeof Heartbeat.Type;
|
|
376
|
-
declare const StdOut: Schema.Struct<{
|
|
377
|
-
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
378
|
-
stdout: typeof Schema.String;
|
|
379
|
-
}>;
|
|
380
|
-
type StdOut = typeof StdOut.Type;
|
|
381
|
-
declare const StdErr: Schema.Struct<{
|
|
382
|
-
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
383
|
-
stderr: typeof Schema.String;
|
|
384
|
-
}>;
|
|
385
|
-
type StdErr = typeof StdErr.Type;
|
|
386
|
-
declare const SystemMessage: Schema.Struct<{
|
|
387
|
-
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
388
|
-
systemMessage: Schema.Struct<{
|
|
389
|
-
output: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
390
|
-
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
391
|
-
stdout: typeof Schema.String;
|
|
392
|
-
}>, Schema.Struct<{
|
|
393
|
-
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
394
|
-
stderr: typeof Schema.String;
|
|
395
|
-
}>]>>;
|
|
396
|
-
}>;
|
|
397
|
-
}>;
|
|
398
|
-
type SystemMessage = typeof SystemMessage.Type;
|
|
399
|
-
declare const Data: <TA, TR>(schema: Schema.Schema<TA | null, Uint8Array, TR>) => Schema.Struct<{
|
|
400
|
-
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
401
|
-
data: Schema.Struct<{
|
|
402
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
403
|
-
endCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
404
|
-
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
405
|
-
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
406
|
-
}>;
|
|
407
|
-
}>;
|
|
408
|
-
declare const ResponseWithoutData: Schema.Union<[Schema.Struct<{
|
|
409
|
-
_tag: Schema.PropertySignature<":", "invalidate", "$case", ":", "invalidate", false, never>;
|
|
410
|
-
invalidate: Schema.Struct<{
|
|
411
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
412
|
-
}>;
|
|
413
|
-
}>, Schema.Struct<{
|
|
414
|
-
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
415
|
-
}>, Schema.Struct<{
|
|
416
|
-
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
417
|
-
systemMessage: Schema.Struct<{
|
|
418
|
-
output: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
419
|
-
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
420
|
-
stdout: typeof Schema.String;
|
|
421
|
-
}>, Schema.Struct<{
|
|
422
|
-
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
423
|
-
stderr: typeof Schema.String;
|
|
424
|
-
}>]>>;
|
|
425
|
-
}>;
|
|
426
|
-
}>]>;
|
|
427
|
-
type ResponseWithoutData = typeof ResponseWithoutData.Type;
|
|
428
|
-
declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8Array, TR>) => Schema.Union<[Schema.Struct<{
|
|
429
|
-
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
430
|
-
data: Schema.Struct<{
|
|
431
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
432
|
-
endCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
433
|
-
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
434
|
-
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
435
|
-
}>;
|
|
436
|
-
}>, Schema.Struct<{
|
|
437
|
-
_tag: Schema.PropertySignature<":", "invalidate", "$case", ":", "invalidate", false, never>;
|
|
438
|
-
invalidate: Schema.Struct<{
|
|
439
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
440
|
-
}>;
|
|
441
|
-
}>, Schema.Struct<{
|
|
442
|
-
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
443
|
-
}>, Schema.Struct<{
|
|
444
|
-
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
445
|
-
systemMessage: Schema.Struct<{
|
|
446
|
-
output: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
447
|
-
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
448
|
-
stdout: typeof Schema.String;
|
|
449
|
-
}>, Schema.Struct<{
|
|
450
|
-
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
451
|
-
stderr: typeof Schema.String;
|
|
452
|
-
}>]>>;
|
|
453
|
-
}>;
|
|
454
|
-
}>]>;
|
|
455
|
-
type StreamDataResponse<TA> = ResponseWithoutData | {
|
|
456
|
-
_tag: "data";
|
|
457
|
-
data: {
|
|
458
|
-
cursor?: Cursor | undefined;
|
|
459
|
-
endCursor?: Cursor | undefined;
|
|
460
|
-
finality: DataFinality;
|
|
461
|
-
data: readonly (TA | null)[];
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
/** Configure a DNA stream. */
|
|
466
|
-
declare class StreamConfig<TFilter, TBlock> {
|
|
467
|
-
private filter;
|
|
468
|
-
private block;
|
|
469
|
-
mergeFilter: (a: TFilter, b: TFilter) => TFilter;
|
|
470
|
-
private request;
|
|
471
|
-
private response;
|
|
472
|
-
constructor(filter: Schema.Schema<TFilter, Uint8Array, never>, block: Schema.Schema<TBlock | null, Uint8Array, never>, mergeFilter: (a: TFilter, b: TFilter) => TFilter);
|
|
473
|
-
/** Filter schema. */
|
|
474
|
-
get Filter(): Schema.Schema<TFilter, Uint8Array, never>;
|
|
475
|
-
/** Block schema. */
|
|
476
|
-
get Block(): Schema.Schema<TBlock | null, Uint8Array, never>;
|
|
477
|
-
/** Stream data request schema. */
|
|
478
|
-
get Request(): Schema.Struct<{
|
|
479
|
-
finality: Schema.optional<Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>>;
|
|
480
|
-
startingCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
481
|
-
filter: Schema.mutable<Schema.Array$<Schema.Schema<TFilter, Uint8Array, never>>>;
|
|
482
|
-
}>;
|
|
483
|
-
/** Stream data response schema. */
|
|
484
|
-
get Response(): Schema.Union<[Schema.Struct<{
|
|
485
|
-
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
486
|
-
data: Schema.Struct<{
|
|
487
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
488
|
-
endCursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
489
|
-
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
490
|
-
data: Schema.Array$<Schema.Schema<TBlock | null, Uint8Array, never>>;
|
|
491
|
-
}>;
|
|
492
|
-
}>, Schema.Struct<{
|
|
493
|
-
_tag: Schema.PropertySignature<":", "invalidate", "$case", ":", "invalidate", false, never>;
|
|
494
|
-
invalidate: Schema.Struct<{
|
|
495
|
-
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
496
|
-
}>;
|
|
497
|
-
}>, Schema.Struct<{
|
|
498
|
-
_tag: Schema.PropertySignature<":", "heartbeat", "$case", ":", "heartbeat", false, never>;
|
|
499
|
-
}>, Schema.Struct<{
|
|
500
|
-
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
501
|
-
systemMessage: Schema.Struct<{
|
|
502
|
-
output: Schema.optional<Schema.Union<[Schema.Struct<{
|
|
503
|
-
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
504
|
-
stdout: typeof Schema.String;
|
|
505
|
-
}>, Schema.Struct<{
|
|
506
|
-
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
507
|
-
stderr: typeof Schema.String;
|
|
508
|
-
}>]>>;
|
|
509
|
-
}>;
|
|
510
|
-
}>]>;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/** Client call options. */
|
|
514
|
-
interface ClientCallOptions {
|
|
515
|
-
signal?: AbortSignal;
|
|
516
|
-
}
|
|
517
|
-
interface StreamDataOptions extends ClientCallOptions {
|
|
518
|
-
/** Stop at the specified cursor (inclusive) */
|
|
519
|
-
endingCursor?: Cursor;
|
|
520
|
-
}
|
|
521
|
-
/** DNA client. */
|
|
522
|
-
interface Client<TFilter, TBlock> {
|
|
523
|
-
/** Fetch the DNA stream status. */
|
|
524
|
-
status(request?: StatusRequest, options?: ClientCallOptions): Promise<StatusResponse>;
|
|
525
|
-
/** Start streaming data from the DNA server. */
|
|
526
|
-
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): AsyncIterable<StreamDataResponse<TBlock>>;
|
|
527
|
-
}
|
|
528
|
-
/** Create a client connecting to the DNA grpc service. */
|
|
529
|
-
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string, defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<DnaStreamDefinition>>): GrpcClient<TFilter, TBlock>;
|
|
530
|
-
declare class GrpcClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
531
|
-
private config;
|
|
532
|
-
private client;
|
|
533
|
-
private encodeRequest;
|
|
534
|
-
constructor(config: StreamConfig<TFilter, TBlock>, client: DnaStreamClient);
|
|
535
|
-
status(request?: StatusRequest, options?: ClientCallOptions): Promise<{
|
|
536
|
-
readonly currentHead?: Cursor | undefined;
|
|
537
|
-
readonly lastIngested?: Cursor | undefined;
|
|
538
|
-
}>;
|
|
539
|
-
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): StreamDataIterable<TBlock>;
|
|
540
|
-
}
|
|
541
|
-
declare class StreamDataIterable<TBlock> {
|
|
542
|
-
private it;
|
|
543
|
-
private schema;
|
|
544
|
-
private options?;
|
|
545
|
-
constructor(it: AsyncIterable<StreamDataResponse$1>, schema: Schema.Schema<TBlock | null, Uint8Array, never>, options?: StreamDataOptions | undefined);
|
|
546
|
-
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
export { type Client as A, Bytes as B, type CursorProto as C, type DnaStreamClient as D, createClient as E, StreamDataIterable as F, GrpcClient as G, Heartbeat as H, Invalidate as I, DataFinality$1 as J, StatusRequest as S, _Cursor as _, DnaStreamDefinition as a, BytesFromUint8Array as b, common as c, Cursor as d, createCursor as e, cursorToProto as f, cursorFromProto as g, CursorFromBytes as h, cursorToBytes as i, cursorFromBytes as j, statusRequestToProto as k, statusRequestFromProto as l, StatusResponse as m, statusResponseToProto as n, statusResponseFromProto as o, DataFinality 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 };
|