@sentio/protos 1.0.0

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.
Files changed (35) hide show
  1. package/lib/builtin.d.ts +5 -0
  2. package/lib/builtin.js +3 -0
  3. package/lib/builtin.js.map +1 -0
  4. package/lib/chainquery/protos/chainquery.d.ts +399 -0
  5. package/lib/chainquery/protos/chainquery.js +941 -0
  6. package/lib/chainquery/protos/chainquery.js.map +1 -0
  7. package/lib/google/protobuf/empty.d.ts +15 -0
  8. package/lib/google/protobuf/empty.js +42 -0
  9. package/lib/google/protobuf/empty.js.map +1 -0
  10. package/lib/google/protobuf/struct.d.ts +72 -0
  11. package/lib/google/protobuf/struct.js +366 -0
  12. package/lib/google/protobuf/struct.js.map +1 -0
  13. package/lib/google/protobuf/timestamp.d.ts +17 -0
  14. package/lib/google/protobuf/timestamp.js +72 -0
  15. package/lib/google/protobuf/timestamp.js.map +1 -0
  16. package/lib/index.d.ts +2 -0
  17. package/lib/index.js +20 -0
  18. package/lib/index.js.map +1 -0
  19. package/lib/processor/protos/processor.d.ts +825 -0
  20. package/lib/processor/protos/processor.js +3990 -0
  21. package/lib/processor/protos/processor.js.map +1 -0
  22. package/lib/service/price/protos/price.d.ts +84 -0
  23. package/lib/service/price/protos/price.js +260 -0
  24. package/lib/service/price/protos/price.js.map +1 -0
  25. package/package.json +22 -0
  26. package/processor.proto +433 -0
  27. package/src/builtin.ts +11 -0
  28. package/src/chainquery/protos/chainquery.ts +1181 -0
  29. package/src/google/protobuf/empty.ts +55 -0
  30. package/src/google/protobuf/struct.ts +420 -0
  31. package/src/google/protobuf/timestamp.ts +91 -0
  32. package/src/index.ts +5 -0
  33. package/src/processor/protos/processor.ts +4626 -0
  34. package/src/service/price/protos/price.ts +323 -0
  35. package/tsconfig.json +13 -0
@@ -0,0 +1,55 @@
1
+ /* eslint-disable */
2
+ import _m0 from 'protobufjs/minimal'
3
+
4
+ export interface Empty {}
5
+
6
+ function createBaseEmpty(): Empty {
7
+ return {}
8
+ }
9
+
10
+ export const Empty = {
11
+ encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
12
+ return writer
13
+ },
14
+
15
+ decode(input: _m0.Reader | Uint8Array, length?: number): Empty {
16
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
17
+ let end = length === undefined ? reader.len : reader.pos + length
18
+ const message = createBaseEmpty()
19
+ while (reader.pos < end) {
20
+ const tag = reader.uint32()
21
+ switch (tag >>> 3) {
22
+ default:
23
+ reader.skipType(tag & 7)
24
+ break
25
+ }
26
+ }
27
+ return message
28
+ },
29
+
30
+ fromJSON(_: any): Empty {
31
+ return {}
32
+ },
33
+
34
+ toJSON(_: Empty): unknown {
35
+ const obj: any = {}
36
+ return obj
37
+ },
38
+
39
+ fromPartial(_: DeepPartial<Empty>): Empty {
40
+ const message = createBaseEmpty()
41
+ return message
42
+ },
43
+ }
44
+
45
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined
46
+
47
+ type DeepPartial<T> = T extends Builtin
48
+ ? T
49
+ : T extends Array<infer U>
50
+ ? Array<DeepPartial<U>>
51
+ : T extends ReadonlyArray<infer U>
52
+ ? ReadonlyArray<DeepPartial<U>>
53
+ : T extends {}
54
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
55
+ : Partial<T>
@@ -0,0 +1,420 @@
1
+ /* eslint-disable */
2
+ import _m0 from 'protobufjs/minimal'
3
+
4
+ export enum NullValue {
5
+ NULL_VALUE = 0,
6
+ UNRECOGNIZED = -1,
7
+ }
8
+
9
+ export function nullValueFromJSON(object: any): NullValue {
10
+ switch (object) {
11
+ case 0:
12
+ case 'NULL_VALUE':
13
+ return NullValue.NULL_VALUE
14
+ case -1:
15
+ case 'UNRECOGNIZED':
16
+ default:
17
+ return NullValue.UNRECOGNIZED
18
+ }
19
+ }
20
+
21
+ export function nullValueToJSON(object: NullValue): string {
22
+ switch (object) {
23
+ case NullValue.NULL_VALUE:
24
+ return 'NULL_VALUE'
25
+ case NullValue.UNRECOGNIZED:
26
+ default:
27
+ return 'UNRECOGNIZED'
28
+ }
29
+ }
30
+
31
+ export interface Struct {
32
+ fields: { [key: string]: any | undefined }
33
+ }
34
+
35
+ export interface Struct_FieldsEntry {
36
+ key: string
37
+ value: any | undefined
38
+ }
39
+
40
+ export interface Value {
41
+ nullValue?: NullValue | undefined
42
+ numberValue?: number | undefined
43
+ stringValue?: string | undefined
44
+ boolValue?: boolean | undefined
45
+ structValue?: { [key: string]: any } | undefined
46
+ listValue?: Array<any> | undefined
47
+ }
48
+
49
+ export interface ListValue {
50
+ values: any[]
51
+ }
52
+
53
+ function createBaseStruct(): Struct {
54
+ return { fields: {} }
55
+ }
56
+
57
+ export const Struct = {
58
+ encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
59
+ Object.entries(message.fields).forEach(([key, value]) => {
60
+ if (value !== undefined) {
61
+ Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim()
62
+ }
63
+ })
64
+ return writer
65
+ },
66
+
67
+ decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
68
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
69
+ let end = length === undefined ? reader.len : reader.pos + length
70
+ const message = createBaseStruct()
71
+ while (reader.pos < end) {
72
+ const tag = reader.uint32()
73
+ switch (tag >>> 3) {
74
+ case 1:
75
+ const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32())
76
+ if (entry1.value !== undefined) {
77
+ message.fields[entry1.key] = entry1.value
78
+ }
79
+ break
80
+ default:
81
+ reader.skipType(tag & 7)
82
+ break
83
+ }
84
+ }
85
+ return message
86
+ },
87
+
88
+ fromJSON(object: any): Struct {
89
+ return {
90
+ fields: isObject(object.fields)
91
+ ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
92
+ acc[key] = value as any | undefined
93
+ return acc
94
+ }, {})
95
+ : {},
96
+ }
97
+ },
98
+
99
+ toJSON(message: Struct): unknown {
100
+ const obj: any = {}
101
+ obj.fields = {}
102
+ if (message.fields) {
103
+ Object.entries(message.fields).forEach(([k, v]) => {
104
+ obj.fields[k] = v
105
+ })
106
+ }
107
+ return obj
108
+ },
109
+
110
+ fromPartial(object: DeepPartial<Struct>): Struct {
111
+ const message = createBaseStruct()
112
+ message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
113
+ (acc, [key, value]) => {
114
+ if (value !== undefined) {
115
+ acc[key] = value
116
+ }
117
+ return acc
118
+ },
119
+ {}
120
+ )
121
+ return message
122
+ },
123
+
124
+ wrap(object: { [key: string]: any } | undefined): Struct {
125
+ const struct = createBaseStruct()
126
+ if (object !== undefined) {
127
+ Object.keys(object).forEach((key) => {
128
+ struct.fields[key] = object[key]
129
+ })
130
+ }
131
+ return struct
132
+ },
133
+
134
+ unwrap(message: Struct): { [key: string]: any } {
135
+ const object: { [key: string]: any } = {}
136
+ Object.keys(message.fields).forEach((key) => {
137
+ object[key] = message.fields[key]
138
+ })
139
+ return object
140
+ },
141
+ }
142
+
143
+ function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
144
+ return { key: '', value: undefined }
145
+ }
146
+
147
+ export const Struct_FieldsEntry = {
148
+ encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
149
+ if (message.key !== '') {
150
+ writer.uint32(10).string(message.key)
151
+ }
152
+ if (message.value !== undefined) {
153
+ Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim()
154
+ }
155
+ return writer
156
+ },
157
+
158
+ decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
159
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
160
+ let end = length === undefined ? reader.len : reader.pos + length
161
+ const message = createBaseStruct_FieldsEntry()
162
+ while (reader.pos < end) {
163
+ const tag = reader.uint32()
164
+ switch (tag >>> 3) {
165
+ case 1:
166
+ message.key = reader.string()
167
+ break
168
+ case 2:
169
+ message.value = Value.unwrap(Value.decode(reader, reader.uint32()))
170
+ break
171
+ default:
172
+ reader.skipType(tag & 7)
173
+ break
174
+ }
175
+ }
176
+ return message
177
+ },
178
+
179
+ fromJSON(object: any): Struct_FieldsEntry {
180
+ return { key: isSet(object.key) ? String(object.key) : '', value: isSet(object?.value) ? object.value : undefined }
181
+ },
182
+
183
+ toJSON(message: Struct_FieldsEntry): unknown {
184
+ const obj: any = {}
185
+ message.key !== undefined && (obj.key = message.key)
186
+ message.value !== undefined && (obj.value = message.value)
187
+ return obj
188
+ },
189
+
190
+ fromPartial(object: DeepPartial<Struct_FieldsEntry>): Struct_FieldsEntry {
191
+ const message = createBaseStruct_FieldsEntry()
192
+ message.key = object.key ?? ''
193
+ message.value = object.value ?? undefined
194
+ return message
195
+ },
196
+ }
197
+
198
+ function createBaseValue(): Value {
199
+ return {
200
+ nullValue: undefined,
201
+ numberValue: undefined,
202
+ stringValue: undefined,
203
+ boolValue: undefined,
204
+ structValue: undefined,
205
+ listValue: undefined,
206
+ }
207
+ }
208
+
209
+ export const Value = {
210
+ encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
211
+ if (message.nullValue !== undefined) {
212
+ writer.uint32(8).int32(message.nullValue)
213
+ }
214
+ if (message.numberValue !== undefined) {
215
+ writer.uint32(17).double(message.numberValue)
216
+ }
217
+ if (message.stringValue !== undefined) {
218
+ writer.uint32(26).string(message.stringValue)
219
+ }
220
+ if (message.boolValue !== undefined) {
221
+ writer.uint32(32).bool(message.boolValue)
222
+ }
223
+ if (message.structValue !== undefined) {
224
+ Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim()
225
+ }
226
+ if (message.listValue !== undefined) {
227
+ ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim()
228
+ }
229
+ return writer
230
+ },
231
+
232
+ decode(input: _m0.Reader | Uint8Array, length?: number): Value {
233
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
234
+ let end = length === undefined ? reader.len : reader.pos + length
235
+ const message = createBaseValue()
236
+ while (reader.pos < end) {
237
+ const tag = reader.uint32()
238
+ switch (tag >>> 3) {
239
+ case 1:
240
+ message.nullValue = reader.int32() as any
241
+ break
242
+ case 2:
243
+ message.numberValue = reader.double()
244
+ break
245
+ case 3:
246
+ message.stringValue = reader.string()
247
+ break
248
+ case 4:
249
+ message.boolValue = reader.bool()
250
+ break
251
+ case 5:
252
+ message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()))
253
+ break
254
+ case 6:
255
+ message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()))
256
+ break
257
+ default:
258
+ reader.skipType(tag & 7)
259
+ break
260
+ }
261
+ }
262
+ return message
263
+ },
264
+
265
+ fromJSON(object: any): Value {
266
+ return {
267
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
268
+ numberValue: isSet(object.numberValue) ? Number(object.numberValue) : undefined,
269
+ stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined,
270
+ boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined,
271
+ structValue: isObject(object.structValue) ? object.structValue : undefined,
272
+ listValue: Array.isArray(object.listValue) ? [...object.listValue] : undefined,
273
+ }
274
+ },
275
+
276
+ toJSON(message: Value): unknown {
277
+ const obj: any = {}
278
+ message.nullValue !== undefined &&
279
+ (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined)
280
+ message.numberValue !== undefined && (obj.numberValue = message.numberValue)
281
+ message.stringValue !== undefined && (obj.stringValue = message.stringValue)
282
+ message.boolValue !== undefined && (obj.boolValue = message.boolValue)
283
+ message.structValue !== undefined && (obj.structValue = message.structValue)
284
+ message.listValue !== undefined && (obj.listValue = message.listValue)
285
+ return obj
286
+ },
287
+
288
+ fromPartial(object: DeepPartial<Value>): Value {
289
+ const message = createBaseValue()
290
+ message.nullValue = object.nullValue ?? undefined
291
+ message.numberValue = object.numberValue ?? undefined
292
+ message.stringValue = object.stringValue ?? undefined
293
+ message.boolValue = object.boolValue ?? undefined
294
+ message.structValue = object.structValue ?? undefined
295
+ message.listValue = object.listValue ?? undefined
296
+ return message
297
+ },
298
+
299
+ wrap(value: any): Value {
300
+ const result = createBaseValue()
301
+
302
+ if (value === null) {
303
+ result.nullValue = NullValue.NULL_VALUE
304
+ } else if (typeof value === 'boolean') {
305
+ result.boolValue = value
306
+ } else if (typeof value === 'number') {
307
+ result.numberValue = value
308
+ } else if (typeof value === 'string') {
309
+ result.stringValue = value
310
+ } else if (Array.isArray(value)) {
311
+ result.listValue = value
312
+ } else if (typeof value === 'object') {
313
+ result.structValue = value
314
+ } else if (typeof value !== 'undefined') {
315
+ throw new Error('Unsupported any value type: ' + typeof value)
316
+ }
317
+
318
+ return result
319
+ },
320
+
321
+ unwrap(message: Value): string | number | boolean | Object | null | Array<any> | undefined {
322
+ if (message?.stringValue !== undefined) {
323
+ return message.stringValue
324
+ } else if (message?.numberValue !== undefined) {
325
+ return message.numberValue
326
+ } else if (message?.boolValue !== undefined) {
327
+ return message.boolValue
328
+ } else if (message?.structValue !== undefined) {
329
+ return message.structValue
330
+ } else if (message?.listValue !== undefined) {
331
+ return message.listValue
332
+ } else if (message?.nullValue !== undefined) {
333
+ return null
334
+ }
335
+ return undefined
336
+ },
337
+ }
338
+
339
+ function createBaseListValue(): ListValue {
340
+ return { values: [] }
341
+ }
342
+
343
+ export const ListValue = {
344
+ encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
345
+ for (const v of message.values) {
346
+ Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim()
347
+ }
348
+ return writer
349
+ },
350
+
351
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
352
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
353
+ let end = length === undefined ? reader.len : reader.pos + length
354
+ const message = createBaseListValue()
355
+ while (reader.pos < end) {
356
+ const tag = reader.uint32()
357
+ switch (tag >>> 3) {
358
+ case 1:
359
+ message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())))
360
+ break
361
+ default:
362
+ reader.skipType(tag & 7)
363
+ break
364
+ }
365
+ }
366
+ return message
367
+ },
368
+
369
+ fromJSON(object: any): ListValue {
370
+ return { values: Array.isArray(object?.values) ? [...object.values] : [] }
371
+ },
372
+
373
+ toJSON(message: ListValue): unknown {
374
+ const obj: any = {}
375
+ if (message.values) {
376
+ obj.values = message.values.map((e) => e)
377
+ } else {
378
+ obj.values = []
379
+ }
380
+ return obj
381
+ },
382
+
383
+ fromPartial(object: DeepPartial<ListValue>): ListValue {
384
+ const message = createBaseListValue()
385
+ message.values = object.values?.map((e) => e) || []
386
+ return message
387
+ },
388
+
389
+ wrap(value: Array<any> | undefined): ListValue {
390
+ const result = createBaseListValue()
391
+
392
+ result.values = value ?? []
393
+
394
+ return result
395
+ },
396
+
397
+ unwrap(message: ListValue): Array<any> {
398
+ return message.values
399
+ },
400
+ }
401
+
402
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined
403
+
404
+ type DeepPartial<T> = T extends Builtin
405
+ ? T
406
+ : T extends Array<infer U>
407
+ ? Array<DeepPartial<U>>
408
+ : T extends ReadonlyArray<infer U>
409
+ ? ReadonlyArray<DeepPartial<U>>
410
+ : T extends {}
411
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
412
+ : Partial<T>
413
+
414
+ function isObject(value: any): boolean {
415
+ return typeof value === 'object' && value !== null
416
+ }
417
+
418
+ function isSet(value: any): boolean {
419
+ return value !== null && value !== undefined
420
+ }
@@ -0,0 +1,91 @@
1
+ /* eslint-disable */
2
+ import Long from 'long'
3
+ import _m0 from 'protobufjs/minimal'
4
+
5
+ export interface Timestamp {
6
+ seconds: bigint
7
+ nanos: number
8
+ }
9
+
10
+ function createBaseTimestamp(): Timestamp {
11
+ return { seconds: BigInt('0'), nanos: 0 }
12
+ }
13
+
14
+ export const Timestamp = {
15
+ encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
16
+ if (message.seconds !== BigInt('0')) {
17
+ writer.uint32(8).int64(message.seconds.toString())
18
+ }
19
+ if (message.nanos !== 0) {
20
+ writer.uint32(16).int32(message.nanos)
21
+ }
22
+ return writer
23
+ },
24
+
25
+ decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
26
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input)
27
+ let end = length === undefined ? reader.len : reader.pos + length
28
+ const message = createBaseTimestamp()
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32()
31
+ switch (tag >>> 3) {
32
+ case 1:
33
+ message.seconds = longToBigint(reader.int64() as Long)
34
+ break
35
+ case 2:
36
+ message.nanos = reader.int32()
37
+ break
38
+ default:
39
+ reader.skipType(tag & 7)
40
+ break
41
+ }
42
+ }
43
+ return message
44
+ },
45
+
46
+ fromJSON(object: any): Timestamp {
47
+ return {
48
+ seconds: isSet(object.seconds) ? BigInt(object.seconds) : BigInt('0'),
49
+ nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
50
+ }
51
+ },
52
+
53
+ toJSON(message: Timestamp): unknown {
54
+ const obj: any = {}
55
+ message.seconds !== undefined && (obj.seconds = message.seconds.toString())
56
+ message.nanos !== undefined && (obj.nanos = Math.round(message.nanos))
57
+ return obj
58
+ },
59
+
60
+ fromPartial(object: DeepPartial<Timestamp>): Timestamp {
61
+ const message = createBaseTimestamp()
62
+ message.seconds = object.seconds ?? BigInt('0')
63
+ message.nanos = object.nanos ?? 0
64
+ return message
65
+ },
66
+ }
67
+
68
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined
69
+
70
+ type DeepPartial<T> = T extends Builtin
71
+ ? T
72
+ : T extends Array<infer U>
73
+ ? Array<DeepPartial<U>>
74
+ : T extends ReadonlyArray<infer U>
75
+ ? ReadonlyArray<DeepPartial<U>>
76
+ : T extends {}
77
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
78
+ : Partial<T>
79
+
80
+ function longToBigint(long: Long) {
81
+ return BigInt(long.toString())
82
+ }
83
+
84
+ if (_m0.util.Long !== Long) {
85
+ _m0.util.Long = Long as any
86
+ _m0.configure()
87
+ }
88
+
89
+ function isSet(value: any): boolean {
90
+ return value !== null && value !== undefined
91
+ }
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './builtin'
2
+
3
+ export * from './processor/protos/processor'
4
+
5
+ // export * from './src/chainquery/protos/chainquery'