@sentio/runtime 1.0.0-development

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.
@@ -0,0 +1,85 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+
5
+ export interface Timestamp {
6
+ seconds: Long;
7
+ nanos: number;
8
+ }
9
+
10
+ function createBaseTimestamp(): Timestamp {
11
+ return { seconds: Long.ZERO, nanos: 0 };
12
+ }
13
+
14
+ export const Timestamp = {
15
+ encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
16
+ if (!message.seconds.isZero()) {
17
+ writer.uint32(8).int64(message.seconds);
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 = 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) ? Long.fromValue(object.seconds) : Long.ZERO,
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 || Long.ZERO).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 !== undefined && object.seconds !== null)
63
+ ? Long.fromValue(object.seconds)
64
+ : Long.ZERO;
65
+ message.nanos = object.nanos ?? 0;
66
+ return message;
67
+ },
68
+ };
69
+
70
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
71
+
72
+ type DeepPartial<T> = T extends Builtin ? T
73
+ : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>>
74
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
75
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
76
+ : Partial<T>;
77
+
78
+ if (_m0.util.Long !== Long) {
79
+ _m0.util.Long = Long as any;
80
+ _m0.configure();
81
+ }
82
+
83
+ function isSet(value: any): boolean {
84
+ return value !== null && value !== undefined;
85
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "inlineSources": true,
5
+ "rootDir": "./src",
6
+ "baseUrl": "./src",
7
+ "paths": {
8
+ "@sentio/sdk": ["."]
9
+ },
10
+ "outDir": "lib"
11
+ },
12
+ "exclude": ["lib"]
13
+ }