@apibara/protocol 2.1.0-beta.22 → 2.1.0-beta.24
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/codec.cjs +241 -0
- package/dist/codec.d.cts +81 -0
- package/dist/codec.d.mts +81 -0
- package/dist/codec.d.ts +81 -0
- package/dist/codec.mjs +223 -0
- package/dist/index.cjs +15 -29
- package/dist/index.d.cts +3 -4
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.mjs +14 -19
- package/dist/shared/{protocol.4b1cfe2c.d.cts → protocol.68a15d69.d.mts} +398 -247
- package/dist/shared/{protocol.4b1cfe2c.d.mts → protocol.8b5e318a.d.ts} +398 -247
- package/dist/shared/{protocol.991ff9ad.mjs → protocol.a64f7660.mjs} +173 -170
- package/dist/shared/{protocol.e39e40d6.cjs → protocol.d8bad371.cjs} +174 -176
- package/dist/shared/{protocol.4b1cfe2c.d.ts → protocol.f52df848.d.cts} +398 -247
- package/dist/testing/index.cjs +23 -37
- package/dist/testing/index.d.cts +107 -54
- package/dist/testing/index.d.mts +107 -54
- package/dist/testing/index.d.ts +107 -54
- package/dist/testing/index.mjs +23 -37
- package/package.json +7 -3
- package/src/client.ts +7 -12
- package/src/codec.ts +662 -0
- package/src/common.ts +70 -53
- package/src/config.ts +3 -4
- package/src/proto/google/protobuf/duration.ts +8 -6
- package/src/proto/stream.ts +38 -24
- package/src/status.ts +9 -16
- package/src/stream.ts +145 -144
- package/src/testing/mock.ts +35 -38
- package/src/common.test.ts +0 -67
- package/src/status.test.ts +0 -51
- package/src/stream.test-d.ts +0 -33
- package/src/stream.test.ts +0 -254
- package/src/testing/client.test.ts +0 -97
- package/src/testing/mock.test.ts +0 -35
package/dist/testing/index.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const config = require('../shared/protocol.
|
|
3
|
+
const codec = require('../codec.cjs');
|
|
4
|
+
const config = require('../shared/protocol.d8bad371.cjs');
|
|
5
5
|
require('protobufjs/minimal.js');
|
|
6
|
-
require('effect');
|
|
7
6
|
require('viem');
|
|
8
7
|
require('long');
|
|
9
8
|
|
|
@@ -41,44 +40,31 @@ class StreamDataIterable {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
const MockFilter =
|
|
45
|
-
filter:
|
|
43
|
+
const MockFilter = codec.MessageCodec({
|
|
44
|
+
filter: codec.OptionalCodec(codec.StringCodec)
|
|
46
45
|
});
|
|
47
|
-
const MockFilterFromBytes =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return config.MockFilter.decode(value);
|
|
54
|
-
},
|
|
55
|
-
encode(value) {
|
|
56
|
-
return config.MockFilter.encode(value).finish();
|
|
57
|
-
}
|
|
46
|
+
const MockFilterFromBytes = {
|
|
47
|
+
decode(value) {
|
|
48
|
+
return config.MockFilter.decode(value);
|
|
49
|
+
},
|
|
50
|
+
encode(value) {
|
|
51
|
+
return config.MockFilter.encode(value).finish();
|
|
58
52
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return config.MockBlock.decode(value);
|
|
73
|
-
},
|
|
74
|
-
encode(value) {
|
|
75
|
-
if (value === null) {
|
|
76
|
-
return new Uint8Array();
|
|
77
|
-
}
|
|
78
|
-
return config.MockBlock.encode(value).finish();
|
|
53
|
+
};
|
|
54
|
+
const MockBlockFromBytes = {
|
|
55
|
+
decode(value) {
|
|
56
|
+
if (value.length === 0) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return config.MockBlock.decode(value);
|
|
60
|
+
},
|
|
61
|
+
encode(value) {
|
|
62
|
+
if (value === null) {
|
|
63
|
+
return new Uint8Array();
|
|
79
64
|
}
|
|
65
|
+
return config.MockBlock.encode(value).finish();
|
|
80
66
|
}
|
|
81
|
-
|
|
67
|
+
};
|
|
82
68
|
function mergeMockFilter(a, b) {
|
|
83
69
|
let filter = "";
|
|
84
70
|
if (a.filter) {
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import 'nice-grpc';
|
|
1
|
+
import { w as Client, l as StreamDataRequest, v as StreamDataOptions, r as StreamDataResponse, S as StatusRequest, u as ClientCallOptions, f as StatusResponse, t as StreamConfig, B as Bytes, A as Cursor, E as DataFinality, J as DataProduction } from '../shared/protocol.f52df848.cjs';
|
|
2
|
+
import { MessageCodec, Codec, CodecType } from '../codec.cjs';
|
|
4
3
|
import 'nice-grpc-common';
|
|
5
4
|
import 'protobufjs/minimal.js';
|
|
6
|
-
import '
|
|
5
|
+
import 'nice-grpc';
|
|
7
6
|
|
|
8
7
|
declare class MockClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
9
8
|
private messageFactory;
|
|
@@ -17,60 +16,114 @@ declare class StreamDataIterable<TBlock> {
|
|
|
17
16
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
declare const MockFilter:
|
|
21
|
-
filter:
|
|
19
|
+
declare const MockFilter: MessageCodec<{
|
|
20
|
+
filter: Codec<string | undefined, string | undefined>;
|
|
22
21
|
}>;
|
|
23
|
-
type MockFilter = typeof MockFilter
|
|
24
|
-
declare const MockFilterFromBytes:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
declare const MockBlock: Schema.Struct<{
|
|
28
|
-
data: Schema.optional<typeof Schema.String>;
|
|
22
|
+
type MockFilter = CodecType<typeof MockFilter>;
|
|
23
|
+
declare const MockFilterFromBytes: Codec<MockFilter, Uint8Array>;
|
|
24
|
+
declare const MockBlock: MessageCodec<{
|
|
25
|
+
data: Codec<string | undefined, string | undefined>;
|
|
29
26
|
}>;
|
|
30
|
-
type MockBlock = typeof MockBlock
|
|
31
|
-
declare const MockBlockFromBytes:
|
|
32
|
-
data: Schema.optional<typeof Schema.String>;
|
|
33
|
-
}>>>;
|
|
27
|
+
type MockBlock = CodecType<typeof MockBlock>;
|
|
28
|
+
declare const MockBlockFromBytes: Codec<MockBlock | null, Uint8Array>;
|
|
34
29
|
declare const MockStream: StreamConfig<{
|
|
35
|
-
|
|
30
|
+
filter?: string | undefined;
|
|
36
31
|
}, {
|
|
37
|
-
|
|
32
|
+
data?: string | undefined;
|
|
38
33
|
}>;
|
|
39
|
-
declare const MockStreamResponse:
|
|
40
|
-
_tag:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} |
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
declare const MockStreamResponse: Codec<{
|
|
35
|
+
_tag: "heartbeat";
|
|
36
|
+
} | ({
|
|
37
|
+
_tag: "data";
|
|
38
|
+
} & {
|
|
39
|
+
data: {
|
|
40
|
+
cursor?: {
|
|
41
|
+
orderKey: bigint;
|
|
42
|
+
uniqueKey?: Bytes | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
endCursor: {
|
|
45
|
+
orderKey: bigint;
|
|
46
|
+
uniqueKey?: Bytes | undefined;
|
|
47
|
+
};
|
|
48
|
+
finality: "finalized" | "accepted" | "pending" | "unknown";
|
|
49
|
+
production: "unknown" | "backfill" | "live";
|
|
50
|
+
data: readonly ({
|
|
51
|
+
data?: string | undefined;
|
|
52
|
+
} | null)[];
|
|
53
|
+
};
|
|
54
|
+
}) | ({
|
|
55
|
+
_tag: "invalidate";
|
|
56
|
+
} & {
|
|
57
|
+
invalidate: {
|
|
58
|
+
cursor?: {
|
|
59
|
+
orderKey: bigint;
|
|
60
|
+
uniqueKey?: Bytes | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
};
|
|
63
|
+
}) | ({
|
|
64
|
+
_tag: "finalize";
|
|
65
|
+
} & {
|
|
66
|
+
finalize: {
|
|
67
|
+
cursor?: {
|
|
68
|
+
orderKey: bigint;
|
|
69
|
+
uniqueKey?: Bytes | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
};
|
|
72
|
+
}) | ({
|
|
73
|
+
_tag: "systemMessage";
|
|
74
|
+
} & {
|
|
75
|
+
systemMessage: {
|
|
76
|
+
output: ({
|
|
77
|
+
_tag: "stdout";
|
|
78
|
+
} & {
|
|
79
|
+
stdout: string;
|
|
80
|
+
}) | ({
|
|
81
|
+
_tag: "stderr";
|
|
82
|
+
} & {
|
|
83
|
+
stderr: string;
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}), ({
|
|
87
|
+
$case: "data";
|
|
88
|
+
} & {
|
|
89
|
+
data: {
|
|
90
|
+
cursor?: Cursor | undefined;
|
|
91
|
+
endCursor: Cursor;
|
|
92
|
+
finality: DataFinality;
|
|
93
|
+
production: DataProduction;
|
|
94
|
+
data?: readonly Uint8Array[] | undefined;
|
|
95
|
+
};
|
|
96
|
+
}) | ({
|
|
97
|
+
$case: "invalidate";
|
|
98
|
+
} & {
|
|
99
|
+
invalidate: {
|
|
100
|
+
cursor?: Cursor | undefined;
|
|
101
|
+
};
|
|
102
|
+
}) | ({
|
|
103
|
+
$case: "finalize";
|
|
104
|
+
} & {
|
|
105
|
+
finalize: {
|
|
106
|
+
cursor?: Cursor | undefined;
|
|
107
|
+
};
|
|
108
|
+
}) | ({
|
|
109
|
+
$case: "heartbeat";
|
|
110
|
+
} & {
|
|
111
|
+
heartbeat: undefined;
|
|
112
|
+
}) | ({
|
|
113
|
+
$case: "systemMessage";
|
|
114
|
+
} & {
|
|
115
|
+
systemMessage: {
|
|
116
|
+
output: ({
|
|
117
|
+
$case: "stdout";
|
|
118
|
+
} & {
|
|
119
|
+
stdout: string;
|
|
120
|
+
}) | ({
|
|
121
|
+
$case: "stderr";
|
|
122
|
+
} & {
|
|
123
|
+
stderr: string;
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
})>;
|
|
127
|
+
type MockStreamResponse = CodecType<typeof MockStreamResponse>;
|
|
75
128
|
|
|
76
129
|
export { MockBlock, MockBlockFromBytes, MockClient, MockFilter, MockFilterFromBytes, MockStream, MockStreamResponse, StreamDataIterable };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import 'nice-grpc';
|
|
1
|
+
import { w as Client, l as StreamDataRequest, v as StreamDataOptions, r as StreamDataResponse, S as StatusRequest, u as ClientCallOptions, f as StatusResponse, t as StreamConfig, B as Bytes, A as Cursor, E as DataFinality, J as DataProduction } from '../shared/protocol.68a15d69.mjs';
|
|
2
|
+
import { MessageCodec, Codec, CodecType } from '../codec.mjs';
|
|
4
3
|
import 'nice-grpc-common';
|
|
5
4
|
import 'protobufjs/minimal.js';
|
|
6
|
-
import '
|
|
5
|
+
import 'nice-grpc';
|
|
7
6
|
|
|
8
7
|
declare class MockClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
9
8
|
private messageFactory;
|
|
@@ -17,60 +16,114 @@ declare class StreamDataIterable<TBlock> {
|
|
|
17
16
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
declare const MockFilter:
|
|
21
|
-
filter:
|
|
19
|
+
declare const MockFilter: MessageCodec<{
|
|
20
|
+
filter: Codec<string | undefined, string | undefined>;
|
|
22
21
|
}>;
|
|
23
|
-
type MockFilter = typeof MockFilter
|
|
24
|
-
declare const MockFilterFromBytes:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
declare const MockBlock: Schema.Struct<{
|
|
28
|
-
data: Schema.optional<typeof Schema.String>;
|
|
22
|
+
type MockFilter = CodecType<typeof MockFilter>;
|
|
23
|
+
declare const MockFilterFromBytes: Codec<MockFilter, Uint8Array>;
|
|
24
|
+
declare const MockBlock: MessageCodec<{
|
|
25
|
+
data: Codec<string | undefined, string | undefined>;
|
|
29
26
|
}>;
|
|
30
|
-
type MockBlock = typeof MockBlock
|
|
31
|
-
declare const MockBlockFromBytes:
|
|
32
|
-
data: Schema.optional<typeof Schema.String>;
|
|
33
|
-
}>>>;
|
|
27
|
+
type MockBlock = CodecType<typeof MockBlock>;
|
|
28
|
+
declare const MockBlockFromBytes: Codec<MockBlock | null, Uint8Array>;
|
|
34
29
|
declare const MockStream: StreamConfig<{
|
|
35
|
-
|
|
30
|
+
filter?: string | undefined;
|
|
36
31
|
}, {
|
|
37
|
-
|
|
32
|
+
data?: string | undefined;
|
|
38
33
|
}>;
|
|
39
|
-
declare const MockStreamResponse:
|
|
40
|
-
_tag:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} |
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
declare const MockStreamResponse: Codec<{
|
|
35
|
+
_tag: "heartbeat";
|
|
36
|
+
} | ({
|
|
37
|
+
_tag: "data";
|
|
38
|
+
} & {
|
|
39
|
+
data: {
|
|
40
|
+
cursor?: {
|
|
41
|
+
orderKey: bigint;
|
|
42
|
+
uniqueKey?: Bytes | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
endCursor: {
|
|
45
|
+
orderKey: bigint;
|
|
46
|
+
uniqueKey?: Bytes | undefined;
|
|
47
|
+
};
|
|
48
|
+
finality: "finalized" | "accepted" | "pending" | "unknown";
|
|
49
|
+
production: "unknown" | "backfill" | "live";
|
|
50
|
+
data: readonly ({
|
|
51
|
+
data?: string | undefined;
|
|
52
|
+
} | null)[];
|
|
53
|
+
};
|
|
54
|
+
}) | ({
|
|
55
|
+
_tag: "invalidate";
|
|
56
|
+
} & {
|
|
57
|
+
invalidate: {
|
|
58
|
+
cursor?: {
|
|
59
|
+
orderKey: bigint;
|
|
60
|
+
uniqueKey?: Bytes | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
};
|
|
63
|
+
}) | ({
|
|
64
|
+
_tag: "finalize";
|
|
65
|
+
} & {
|
|
66
|
+
finalize: {
|
|
67
|
+
cursor?: {
|
|
68
|
+
orderKey: bigint;
|
|
69
|
+
uniqueKey?: Bytes | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
};
|
|
72
|
+
}) | ({
|
|
73
|
+
_tag: "systemMessage";
|
|
74
|
+
} & {
|
|
75
|
+
systemMessage: {
|
|
76
|
+
output: ({
|
|
77
|
+
_tag: "stdout";
|
|
78
|
+
} & {
|
|
79
|
+
stdout: string;
|
|
80
|
+
}) | ({
|
|
81
|
+
_tag: "stderr";
|
|
82
|
+
} & {
|
|
83
|
+
stderr: string;
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}), ({
|
|
87
|
+
$case: "data";
|
|
88
|
+
} & {
|
|
89
|
+
data: {
|
|
90
|
+
cursor?: Cursor | undefined;
|
|
91
|
+
endCursor: Cursor;
|
|
92
|
+
finality: DataFinality;
|
|
93
|
+
production: DataProduction;
|
|
94
|
+
data?: readonly Uint8Array[] | undefined;
|
|
95
|
+
};
|
|
96
|
+
}) | ({
|
|
97
|
+
$case: "invalidate";
|
|
98
|
+
} & {
|
|
99
|
+
invalidate: {
|
|
100
|
+
cursor?: Cursor | undefined;
|
|
101
|
+
};
|
|
102
|
+
}) | ({
|
|
103
|
+
$case: "finalize";
|
|
104
|
+
} & {
|
|
105
|
+
finalize: {
|
|
106
|
+
cursor?: Cursor | undefined;
|
|
107
|
+
};
|
|
108
|
+
}) | ({
|
|
109
|
+
$case: "heartbeat";
|
|
110
|
+
} & {
|
|
111
|
+
heartbeat: undefined;
|
|
112
|
+
}) | ({
|
|
113
|
+
$case: "systemMessage";
|
|
114
|
+
} & {
|
|
115
|
+
systemMessage: {
|
|
116
|
+
output: ({
|
|
117
|
+
$case: "stdout";
|
|
118
|
+
} & {
|
|
119
|
+
stdout: string;
|
|
120
|
+
}) | ({
|
|
121
|
+
$case: "stderr";
|
|
122
|
+
} & {
|
|
123
|
+
stderr: string;
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
})>;
|
|
127
|
+
type MockStreamResponse = CodecType<typeof MockStreamResponse>;
|
|
75
128
|
|
|
76
129
|
export { MockBlock, MockBlockFromBytes, MockClient, MockFilter, MockFilterFromBytes, MockStream, MockStreamResponse, StreamDataIterable };
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import 'nice-grpc';
|
|
1
|
+
import { w as Client, l as StreamDataRequest, v as StreamDataOptions, r as StreamDataResponse, S as StatusRequest, u as ClientCallOptions, f as StatusResponse, t as StreamConfig, B as Bytes, A as Cursor, E as DataFinality, J as DataProduction } from '../shared/protocol.8b5e318a.js';
|
|
2
|
+
import { MessageCodec, Codec, CodecType } from '../codec.js';
|
|
4
3
|
import 'nice-grpc-common';
|
|
5
4
|
import 'protobufjs/minimal.js';
|
|
6
|
-
import '
|
|
5
|
+
import 'nice-grpc';
|
|
7
6
|
|
|
8
7
|
declare class MockClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
9
8
|
private messageFactory;
|
|
@@ -17,60 +16,114 @@ declare class StreamDataIterable<TBlock> {
|
|
|
17
16
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
declare const MockFilter:
|
|
21
|
-
filter:
|
|
19
|
+
declare const MockFilter: MessageCodec<{
|
|
20
|
+
filter: Codec<string | undefined, string | undefined>;
|
|
22
21
|
}>;
|
|
23
|
-
type MockFilter = typeof MockFilter
|
|
24
|
-
declare const MockFilterFromBytes:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
declare const MockBlock: Schema.Struct<{
|
|
28
|
-
data: Schema.optional<typeof Schema.String>;
|
|
22
|
+
type MockFilter = CodecType<typeof MockFilter>;
|
|
23
|
+
declare const MockFilterFromBytes: Codec<MockFilter, Uint8Array>;
|
|
24
|
+
declare const MockBlock: MessageCodec<{
|
|
25
|
+
data: Codec<string | undefined, string | undefined>;
|
|
29
26
|
}>;
|
|
30
|
-
type MockBlock = typeof MockBlock
|
|
31
|
-
declare const MockBlockFromBytes:
|
|
32
|
-
data: Schema.optional<typeof Schema.String>;
|
|
33
|
-
}>>>;
|
|
27
|
+
type MockBlock = CodecType<typeof MockBlock>;
|
|
28
|
+
declare const MockBlockFromBytes: Codec<MockBlock | null, Uint8Array>;
|
|
34
29
|
declare const MockStream: StreamConfig<{
|
|
35
|
-
|
|
30
|
+
filter?: string | undefined;
|
|
36
31
|
}, {
|
|
37
|
-
|
|
32
|
+
data?: string | undefined;
|
|
38
33
|
}>;
|
|
39
|
-
declare const MockStreamResponse:
|
|
40
|
-
_tag:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} |
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
34
|
+
declare const MockStreamResponse: Codec<{
|
|
35
|
+
_tag: "heartbeat";
|
|
36
|
+
} | ({
|
|
37
|
+
_tag: "data";
|
|
38
|
+
} & {
|
|
39
|
+
data: {
|
|
40
|
+
cursor?: {
|
|
41
|
+
orderKey: bigint;
|
|
42
|
+
uniqueKey?: Bytes | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
endCursor: {
|
|
45
|
+
orderKey: bigint;
|
|
46
|
+
uniqueKey?: Bytes | undefined;
|
|
47
|
+
};
|
|
48
|
+
finality: "finalized" | "accepted" | "pending" | "unknown";
|
|
49
|
+
production: "unknown" | "backfill" | "live";
|
|
50
|
+
data: readonly ({
|
|
51
|
+
data?: string | undefined;
|
|
52
|
+
} | null)[];
|
|
53
|
+
};
|
|
54
|
+
}) | ({
|
|
55
|
+
_tag: "invalidate";
|
|
56
|
+
} & {
|
|
57
|
+
invalidate: {
|
|
58
|
+
cursor?: {
|
|
59
|
+
orderKey: bigint;
|
|
60
|
+
uniqueKey?: Bytes | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
};
|
|
63
|
+
}) | ({
|
|
64
|
+
_tag: "finalize";
|
|
65
|
+
} & {
|
|
66
|
+
finalize: {
|
|
67
|
+
cursor?: {
|
|
68
|
+
orderKey: bigint;
|
|
69
|
+
uniqueKey?: Bytes | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
};
|
|
72
|
+
}) | ({
|
|
73
|
+
_tag: "systemMessage";
|
|
74
|
+
} & {
|
|
75
|
+
systemMessage: {
|
|
76
|
+
output: ({
|
|
77
|
+
_tag: "stdout";
|
|
78
|
+
} & {
|
|
79
|
+
stdout: string;
|
|
80
|
+
}) | ({
|
|
81
|
+
_tag: "stderr";
|
|
82
|
+
} & {
|
|
83
|
+
stderr: string;
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}), ({
|
|
87
|
+
$case: "data";
|
|
88
|
+
} & {
|
|
89
|
+
data: {
|
|
90
|
+
cursor?: Cursor | undefined;
|
|
91
|
+
endCursor: Cursor;
|
|
92
|
+
finality: DataFinality;
|
|
93
|
+
production: DataProduction;
|
|
94
|
+
data?: readonly Uint8Array[] | undefined;
|
|
95
|
+
};
|
|
96
|
+
}) | ({
|
|
97
|
+
$case: "invalidate";
|
|
98
|
+
} & {
|
|
99
|
+
invalidate: {
|
|
100
|
+
cursor?: Cursor | undefined;
|
|
101
|
+
};
|
|
102
|
+
}) | ({
|
|
103
|
+
$case: "finalize";
|
|
104
|
+
} & {
|
|
105
|
+
finalize: {
|
|
106
|
+
cursor?: Cursor | undefined;
|
|
107
|
+
};
|
|
108
|
+
}) | ({
|
|
109
|
+
$case: "heartbeat";
|
|
110
|
+
} & {
|
|
111
|
+
heartbeat: undefined;
|
|
112
|
+
}) | ({
|
|
113
|
+
$case: "systemMessage";
|
|
114
|
+
} & {
|
|
115
|
+
systemMessage: {
|
|
116
|
+
output: ({
|
|
117
|
+
$case: "stdout";
|
|
118
|
+
} & {
|
|
119
|
+
stdout: string;
|
|
120
|
+
}) | ({
|
|
121
|
+
$case: "stderr";
|
|
122
|
+
} & {
|
|
123
|
+
stderr: string;
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
})>;
|
|
127
|
+
type MockStreamResponse = CodecType<typeof MockStreamResponse>;
|
|
75
128
|
|
|
76
129
|
export { MockBlock, MockBlockFromBytes, MockClient, MockFilter, MockFilterFromBytes, MockStream, MockStreamResponse, StreamDataIterable };
|