@agoric/cosmic-proto 0.3.1-upgrade-14-dev-c8f9e7b.0 → 0.4.1-orchestration-dev-096c4e8.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.
- package/README.md +220 -6
- package/dist/codegen/agoric/bundle.d.ts +1006 -0
- package/dist/codegen/agoric/bundle.js +71 -0
- package/dist/codegen/agoric/bundle.js.map +1 -0
- package/dist/codegen/agoric/client.d.ts +47 -0
- package/dist/codegen/agoric/client.js +36 -0
- package/dist/codegen/agoric/client.js.map +1 -0
- package/dist/codegen/agoric/lien/genesis.d.ts +77 -0
- package/dist/codegen/agoric/lien/genesis.js +179 -0
- package/dist/codegen/agoric/lien/genesis.js.map +1 -0
- package/dist/codegen/agoric/lien/lien.d.ts +51 -0
- package/dist/codegen/agoric/lien/lien.js +111 -0
- package/dist/codegen/agoric/lien/lien.js.map +1 -0
- package/dist/codegen/agoric/rpc.query.d.ts +21 -0
- package/dist/codegen/agoric/rpc.query.js +15 -0
- package/dist/codegen/agoric/rpc.query.js.map +1 -0
- package/dist/codegen/agoric/rpc.tx.d.ts +9 -0
- package/dist/codegen/agoric/rpc.tx.js +7 -0
- package/dist/codegen/agoric/rpc.tx.js.map +1 -0
- package/dist/codegen/agoric/swingset/genesis.d.ts +79 -0
- package/dist/codegen/agoric/swingset/genesis.js +213 -0
- package/dist/codegen/agoric/swingset/genesis.js.map +1 -0
- package/dist/codegen/agoric/swingset/msgs.amino.d.ts +28 -0
- package/dist/codegen/agoric/swingset/msgs.amino.js +30 -0
- package/dist/codegen/agoric/swingset/msgs.amino.js.map +1 -0
- package/dist/codegen/agoric/swingset/msgs.d.ts +406 -0
- package/dist/codegen/agoric/swingset/msgs.js +896 -0
- package/dist/codegen/agoric/swingset/msgs.js.map +1 -0
- package/dist/codegen/agoric/swingset/msgs.registry.d.ts +116 -0
- package/dist/codegen/agoric/swingset/msgs.registry.js +176 -0
- package/dist/codegen/agoric/swingset/msgs.registry.js.map +1 -0
- package/dist/codegen/agoric/swingset/msgs.rpc.msg.d.ts +24 -0
- package/dist/codegen/agoric/swingset/msgs.rpc.msg.js +39 -0
- package/dist/codegen/agoric/swingset/msgs.rpc.msg.js.map +1 -0
- package/dist/codegen/agoric/swingset/query.d.ts +205 -0
- package/dist/codegen/agoric/swingset/query.js +441 -0
- package/dist/codegen/agoric/swingset/query.js.map +1 -0
- package/dist/codegen/agoric/swingset/query.rpc.Query.d.ts +24 -0
- package/dist/codegen/agoric/swingset/query.rpc.Query.js +43 -0
- package/dist/codegen/agoric/swingset/query.rpc.Query.js.map +1 -0
- package/dist/codegen/agoric/swingset/swingset.d.ts +499 -0
- package/dist/codegen/agoric/swingset/swingset.js +945 -0
- package/dist/codegen/agoric/swingset/swingset.js.map +1 -0
- package/dist/codegen/agoric/vbank/genesis.d.ts +43 -0
- package/dist/codegen/agoric/vbank/genesis.js +100 -0
- package/dist/codegen/agoric/vbank/genesis.js.map +1 -0
- package/dist/codegen/agoric/vbank/msgs.d.ts +1 -0
- package/dist/codegen/agoric/vbank/msgs.js +2 -0
- package/dist/codegen/agoric/vbank/msgs.js.map +1 -0
- package/dist/codegen/agoric/vbank/query.d.ts +136 -0
- package/dist/codegen/agoric/vbank/query.js +273 -0
- package/dist/codegen/agoric/vbank/query.js.map +1 -0
- package/dist/codegen/agoric/vbank/query.rpc.Query.d.ts +20 -0
- package/dist/codegen/agoric/vbank/query.rpc.Query.js +34 -0
- package/dist/codegen/agoric/vbank/query.rpc.Query.js.map +1 -0
- package/dist/codegen/agoric/vbank/vbank.d.ts +135 -0
- package/dist/codegen/agoric/vbank/vbank.js +288 -0
- package/dist/codegen/agoric/vbank/vbank.js.map +1 -0
- package/dist/codegen/agoric/vibc/msgs.amino.d.ts +8 -0
- package/dist/codegen/agoric/vibc/msgs.amino.js +10 -0
- package/dist/codegen/agoric/vibc/msgs.amino.js.map +1 -0
- package/dist/codegen/agoric/vibc/msgs.d.ts +70 -0
- package/dist/codegen/agoric/vibc/msgs.js +156 -0
- package/dist/codegen/agoric/vibc/msgs.js.map +1 -0
- package/dist/codegen/agoric/vibc/msgs.registry.d.ts +36 -0
- package/dist/codegen/agoric/vibc/msgs.registry.js +52 -0
- package/dist/codegen/agoric/vibc/msgs.registry.js.map +1 -0
- package/dist/codegen/agoric/vibc/msgs.rpc.msg.d.ts +12 -0
- package/dist/codegen/agoric/vibc/msgs.rpc.msg.js +15 -0
- package/dist/codegen/agoric/vibc/msgs.rpc.msg.js.map +1 -0
- package/dist/codegen/agoric/vlocalchain/vlocalchain.d.ts +159 -0
- package/dist/codegen/agoric/vlocalchain/vlocalchain.js +389 -0
- package/dist/codegen/agoric/vlocalchain/vlocalchain.js.map +1 -0
- package/dist/codegen/agoric/vstorage/genesis.d.ts +89 -0
- package/dist/codegen/agoric/vstorage/genesis.js +174 -0
- package/dist/codegen/agoric/vstorage/genesis.js.map +1 -0
- package/dist/codegen/agoric/vstorage/query.d.ts +269 -0
- package/dist/codegen/agoric/vstorage/query.js +562 -0
- package/dist/codegen/agoric/vstorage/query.js.map +1 -0
- package/dist/codegen/agoric/vstorage/query.rpc.Query.d.ts +27 -0
- package/dist/codegen/agoric/vstorage/query.rpc.Query.js +43 -0
- package/dist/codegen/agoric/vstorage/query.rpc.Query.js.map +1 -0
- package/dist/codegen/agoric/vstorage/vstorage.d.ts +78 -0
- package/dist/codegen/agoric/vstorage/vstorage.js +160 -0
- package/dist/codegen/agoric/vstorage/vstorage.js.map +1 -0
- package/dist/codegen/binary.d.ts +130 -0
- package/dist/codegen/binary.js +367 -0
- package/dist/codegen/binary.js.map +1 -0
- package/dist/codegen/cosmos/base/query/v1beta1/pagination.d.ts +202 -0
- package/dist/codegen/cosmos/base/query/v1beta1/pagination.js +252 -0
- package/dist/codegen/cosmos/base/query/v1beta1/pagination.js.map +1 -0
- package/dist/codegen/cosmos/base/v1beta1/coin.d.ts +177 -0
- package/dist/codegen/cosmos/base/v1beta1/coin.js +348 -0
- package/dist/codegen/cosmos/base/v1beta1/coin.js.map +1 -0
- package/dist/codegen/cosmos/bundle.d.ts +167 -0
- package/dist/codegen/cosmos/bundle.js +26 -0
- package/dist/codegen/cosmos/bundle.js.map +1 -0
- package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.d.ts +282 -0
- package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.js +468 -0
- package/dist/codegen/cosmos/upgrade/v1beta1/upgrade.js.map +1 -0
- package/dist/codegen/cosmos_proto/bundle.d.ts +36 -0
- package/dist/codegen/cosmos_proto/bundle.js +6 -0
- package/dist/codegen/cosmos_proto/bundle.js.map +1 -0
- package/dist/codegen/cosmos_proto/cosmos.d.ts +175 -0
- package/dist/codegen/cosmos_proto/cosmos.js +254 -0
- package/dist/codegen/cosmos_proto/cosmos.js.map +1 -0
- package/dist/codegen/gogoproto/bundle.d.ts +1 -0
- package/dist/codegen/gogoproto/bundle.js +6 -0
- package/dist/codegen/gogoproto/bundle.js.map +1 -0
- package/dist/codegen/gogoproto/gogo.d.ts +1 -0
- package/dist/codegen/gogoproto/gogo.js +2 -0
- package/dist/codegen/gogoproto/gogo.js.map +1 -0
- package/dist/codegen/google/api/annotations.d.ts +1 -0
- package/dist/codegen/google/api/annotations.js +2 -0
- package/dist/codegen/google/api/annotations.js.map +1 -0
- package/dist/codegen/google/api/http.d.ts +1079 -0
- package/dist/codegen/google/api/http.js +418 -0
- package/dist/codegen/google/api/http.js.map +1 -0
- package/dist/codegen/google/bundle.d.ts +443 -0
- package/dist/codegen/google/bundle.js +13 -0
- package/dist/codegen/google/bundle.js.map +1 -0
- package/dist/codegen/google/protobuf/any.d.ts +340 -0
- package/dist/codegen/google/protobuf/any.js +91 -0
- package/dist/codegen/google/protobuf/any.js.map +1 -0
- package/dist/codegen/google/protobuf/descriptor.d.ts +2332 -0
- package/dist/codegen/google/protobuf/descriptor.js +4419 -0
- package/dist/codegen/google/protobuf/descriptor.js.map +1 -0
- package/dist/codegen/google/protobuf/timestamp.d.ts +295 -0
- package/dist/codegen/google/protobuf/timestamp.js +89 -0
- package/dist/codegen/google/protobuf/timestamp.js.map +1 -0
- package/dist/codegen/helpers.d.ts +81 -0
- package/dist/codegen/helpers.js +124 -0
- package/dist/codegen/helpers.js.map +1 -0
- package/dist/codegen/ibc/bundle.d.ts +234 -0
- package/dist/codegen/ibc/bundle.js +22 -0
- package/dist/codegen/ibc/bundle.js.map +1 -0
- package/dist/codegen/ibc/core/channel/v1/channel.d.ts +513 -0
- package/dist/codegen/ibc/core/channel/v1/channel.js +1106 -0
- package/dist/codegen/ibc/core/channel/v1/channel.js.map +1 -0
- package/dist/codegen/ibc/core/client/v1/client.d.ts +414 -0
- package/dist/codegen/ibc/core/client/v1/client.js +786 -0
- package/dist/codegen/ibc/core/client/v1/client.js.map +1 -0
- package/dist/codegen/index.d.ts +15 -0
- package/dist/codegen/index.js +17 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/codegen/utf8.d.ts +27 -0
- package/dist/codegen/utf8.js +138 -0
- package/dist/codegen/utf8.js.map +1 -0
- package/dist/codegen/varint.d.ts +105 -0
- package/dist/codegen/varint.js +409 -0
- package/dist/codegen/varint.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -27
- package/CHANGELOG.md +0 -41
- package/dist/agoric/swingset/msgs.d.ts +0 -450
- package/dist/agoric/swingset/msgs.js +0 -630
- package/dist/agoric/swingset/query.d.ts +0 -406
- package/dist/agoric/swingset/query.js +0 -346
- package/dist/agoric/swingset/swingset.d.ts +0 -571
- package/dist/agoric/swingset/swingset.js +0 -644
- package/dist/cosmos/base/v1beta1/coin.d.ts +0 -90
- package/dist/cosmos/base/v1beta1/coin.js +0 -197
- package/swingset/msgs.js +0 -2
- package/swingset/query.js +0 -2
- package/swingset/swingset.js +0 -2
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '../../binary.js';
|
|
2
|
+
/**
|
|
3
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
4
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
5
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
6
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
7
|
+
* Gregorian calendar backwards to year one.
|
|
8
|
+
*
|
|
9
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
10
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
11
|
+
* smear](https://developers.google.com/time/smear).
|
|
12
|
+
*
|
|
13
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
14
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
15
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
16
|
+
*
|
|
17
|
+
* # Examples
|
|
18
|
+
*
|
|
19
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
20
|
+
*
|
|
21
|
+
* Timestamp timestamp;
|
|
22
|
+
* timestamp.set_seconds(time(NULL));
|
|
23
|
+
* timestamp.set_nanos(0);
|
|
24
|
+
*
|
|
25
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
26
|
+
*
|
|
27
|
+
* struct timeval tv;
|
|
28
|
+
* gettimeofday(&tv, NULL);
|
|
29
|
+
*
|
|
30
|
+
* Timestamp timestamp;
|
|
31
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
32
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
33
|
+
*
|
|
34
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
35
|
+
*
|
|
36
|
+
* FILETIME ft;
|
|
37
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
38
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
39
|
+
*
|
|
40
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
41
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
42
|
+
* Timestamp timestamp;
|
|
43
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
44
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
45
|
+
*
|
|
46
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
47
|
+
*
|
|
48
|
+
* long millis = System.currentTimeMillis();
|
|
49
|
+
*
|
|
50
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
51
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* Example 5: Compute Timestamp from current time in Python.
|
|
55
|
+
*
|
|
56
|
+
* timestamp = Timestamp()
|
|
57
|
+
* timestamp.GetCurrentTime()
|
|
58
|
+
*
|
|
59
|
+
* # JSON Mapping
|
|
60
|
+
*
|
|
61
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
62
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
63
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
64
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
65
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
66
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
67
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
68
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
69
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
70
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
71
|
+
*
|
|
72
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
73
|
+
* 01:30 UTC on January 15, 2017.
|
|
74
|
+
*
|
|
75
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
76
|
+
* standard
|
|
77
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
78
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
79
|
+
* to this format using
|
|
80
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
81
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
82
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
83
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
84
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
85
|
+
*/
|
|
86
|
+
export interface Timestamp {
|
|
87
|
+
/**
|
|
88
|
+
* Represents seconds of UTC time since Unix epoch
|
|
89
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
90
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
91
|
+
*/
|
|
92
|
+
seconds: bigint;
|
|
93
|
+
/**
|
|
94
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
95
|
+
* second values with fractions must still have non-negative nanos values
|
|
96
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
97
|
+
* inclusive.
|
|
98
|
+
*/
|
|
99
|
+
nanos: number;
|
|
100
|
+
}
|
|
101
|
+
export interface TimestampProtoMsg {
|
|
102
|
+
typeUrl: '/google.protobuf.Timestamp';
|
|
103
|
+
value: Uint8Array;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
107
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
108
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
109
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
110
|
+
* Gregorian calendar backwards to year one.
|
|
111
|
+
*
|
|
112
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
113
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
114
|
+
* smear](https://developers.google.com/time/smear).
|
|
115
|
+
*
|
|
116
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
117
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
118
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
119
|
+
*
|
|
120
|
+
* # Examples
|
|
121
|
+
*
|
|
122
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
123
|
+
*
|
|
124
|
+
* Timestamp timestamp;
|
|
125
|
+
* timestamp.set_seconds(time(NULL));
|
|
126
|
+
* timestamp.set_nanos(0);
|
|
127
|
+
*
|
|
128
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
129
|
+
*
|
|
130
|
+
* struct timeval tv;
|
|
131
|
+
* gettimeofday(&tv, NULL);
|
|
132
|
+
*
|
|
133
|
+
* Timestamp timestamp;
|
|
134
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
135
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
136
|
+
*
|
|
137
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
138
|
+
*
|
|
139
|
+
* FILETIME ft;
|
|
140
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
141
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
142
|
+
*
|
|
143
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
144
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
145
|
+
* Timestamp timestamp;
|
|
146
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
147
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
148
|
+
*
|
|
149
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
150
|
+
*
|
|
151
|
+
* long millis = System.currentTimeMillis();
|
|
152
|
+
*
|
|
153
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
154
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
155
|
+
*
|
|
156
|
+
*
|
|
157
|
+
* Example 5: Compute Timestamp from current time in Python.
|
|
158
|
+
*
|
|
159
|
+
* timestamp = Timestamp()
|
|
160
|
+
* timestamp.GetCurrentTime()
|
|
161
|
+
*
|
|
162
|
+
* # JSON Mapping
|
|
163
|
+
*
|
|
164
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
165
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
166
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
167
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
168
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
169
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
170
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
171
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
172
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
173
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
174
|
+
*
|
|
175
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
176
|
+
* 01:30 UTC on January 15, 2017.
|
|
177
|
+
*
|
|
178
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
179
|
+
* standard
|
|
180
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
181
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
182
|
+
* to this format using
|
|
183
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
184
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
185
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
186
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
187
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
188
|
+
*/
|
|
189
|
+
export type TimestampAmino = string;
|
|
190
|
+
export interface TimestampAminoMsg {
|
|
191
|
+
type: '/google.protobuf.Timestamp';
|
|
192
|
+
value: TimestampAmino;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
196
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
197
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
198
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
199
|
+
* Gregorian calendar backwards to year one.
|
|
200
|
+
*
|
|
201
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
202
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
203
|
+
* smear](https://developers.google.com/time/smear).
|
|
204
|
+
*
|
|
205
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
206
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
207
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
208
|
+
*
|
|
209
|
+
* # Examples
|
|
210
|
+
*
|
|
211
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
212
|
+
*
|
|
213
|
+
* Timestamp timestamp;
|
|
214
|
+
* timestamp.set_seconds(time(NULL));
|
|
215
|
+
* timestamp.set_nanos(0);
|
|
216
|
+
*
|
|
217
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
218
|
+
*
|
|
219
|
+
* struct timeval tv;
|
|
220
|
+
* gettimeofday(&tv, NULL);
|
|
221
|
+
*
|
|
222
|
+
* Timestamp timestamp;
|
|
223
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
224
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
225
|
+
*
|
|
226
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
227
|
+
*
|
|
228
|
+
* FILETIME ft;
|
|
229
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
230
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
231
|
+
*
|
|
232
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
233
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
234
|
+
* Timestamp timestamp;
|
|
235
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
236
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
237
|
+
*
|
|
238
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
239
|
+
*
|
|
240
|
+
* long millis = System.currentTimeMillis();
|
|
241
|
+
*
|
|
242
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
243
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
244
|
+
*
|
|
245
|
+
*
|
|
246
|
+
* Example 5: Compute Timestamp from current time in Python.
|
|
247
|
+
*
|
|
248
|
+
* timestamp = Timestamp()
|
|
249
|
+
* timestamp.GetCurrentTime()
|
|
250
|
+
*
|
|
251
|
+
* # JSON Mapping
|
|
252
|
+
*
|
|
253
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
254
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
255
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
256
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
257
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
258
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
259
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
260
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
261
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
262
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
263
|
+
*
|
|
264
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
265
|
+
* 01:30 UTC on January 15, 2017.
|
|
266
|
+
*
|
|
267
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
268
|
+
* standard
|
|
269
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
270
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
271
|
+
* to this format using
|
|
272
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
273
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
274
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
275
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
276
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
277
|
+
*/
|
|
278
|
+
export interface TimestampSDKType {
|
|
279
|
+
seconds: bigint;
|
|
280
|
+
nanos: number;
|
|
281
|
+
}
|
|
282
|
+
export declare const Timestamp: {
|
|
283
|
+
typeUrl: string;
|
|
284
|
+
encode(message: Timestamp, writer?: BinaryWriter): BinaryWriter;
|
|
285
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Timestamp;
|
|
286
|
+
fromJSON(object: any): Timestamp;
|
|
287
|
+
toJSON(message: Timestamp): unknown;
|
|
288
|
+
fromPartial(object: Partial<Timestamp>): Timestamp;
|
|
289
|
+
fromAmino(object: TimestampAmino): Timestamp;
|
|
290
|
+
toAmino(message: Timestamp): TimestampAmino;
|
|
291
|
+
fromAminoMsg(object: TimestampAminoMsg): Timestamp;
|
|
292
|
+
fromProtoMsg(message: TimestampProtoMsg): Timestamp;
|
|
293
|
+
toProto(message: Timestamp): Uint8Array;
|
|
294
|
+
toProtoMsg(message: Timestamp): TimestampProtoMsg;
|
|
295
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { BinaryReader, BinaryWriter } from '../../binary.js';
|
|
3
|
+
import { isSet, fromJsonTimestamp, fromTimestamp } from '../../helpers.js';
|
|
4
|
+
function createBaseTimestamp() {
|
|
5
|
+
return {
|
|
6
|
+
seconds: BigInt(0),
|
|
7
|
+
nanos: 0,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export const Timestamp = {
|
|
11
|
+
typeUrl: '/google.protobuf.Timestamp',
|
|
12
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
13
|
+
if (message.seconds !== BigInt(0)) {
|
|
14
|
+
writer.uint32(8).int64(message.seconds);
|
|
15
|
+
}
|
|
16
|
+
if (message.nanos !== 0) {
|
|
17
|
+
writer.uint32(16).int32(message.nanos);
|
|
18
|
+
}
|
|
19
|
+
return writer;
|
|
20
|
+
},
|
|
21
|
+
decode(input, length) {
|
|
22
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
23
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
24
|
+
const message = createBaseTimestamp();
|
|
25
|
+
while (reader.pos < end) {
|
|
26
|
+
const tag = reader.uint32();
|
|
27
|
+
switch (tag >>> 3) {
|
|
28
|
+
case 1:
|
|
29
|
+
message.seconds = reader.int64();
|
|
30
|
+
break;
|
|
31
|
+
case 2:
|
|
32
|
+
message.nanos = reader.int32();
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
reader.skipType(tag & 7);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return message;
|
|
40
|
+
},
|
|
41
|
+
fromJSON(object) {
|
|
42
|
+
return {
|
|
43
|
+
seconds: isSet(object.seconds)
|
|
44
|
+
? BigInt(object.seconds.toString())
|
|
45
|
+
: BigInt(0),
|
|
46
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
toJSON(message) {
|
|
50
|
+
const obj = {};
|
|
51
|
+
message.seconds !== undefined &&
|
|
52
|
+
(obj.seconds = (message.seconds || BigInt(0)).toString());
|
|
53
|
+
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
|
54
|
+
return obj;
|
|
55
|
+
},
|
|
56
|
+
fromPartial(object) {
|
|
57
|
+
const message = createBaseTimestamp();
|
|
58
|
+
message.seconds =
|
|
59
|
+
object.seconds !== undefined && object.seconds !== null
|
|
60
|
+
? BigInt(object.seconds.toString())
|
|
61
|
+
: BigInt(0);
|
|
62
|
+
message.nanos = object.nanos ?? 0;
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
fromAmino(object) {
|
|
66
|
+
return fromJsonTimestamp(object);
|
|
67
|
+
},
|
|
68
|
+
toAmino(message) {
|
|
69
|
+
return fromTimestamp(message)
|
|
70
|
+
.toISOString()
|
|
71
|
+
.replace(/\.\d+Z$/, 'Z');
|
|
72
|
+
},
|
|
73
|
+
fromAminoMsg(object) {
|
|
74
|
+
return Timestamp.fromAmino(object.value);
|
|
75
|
+
},
|
|
76
|
+
fromProtoMsg(message) {
|
|
77
|
+
return Timestamp.decode(message.value);
|
|
78
|
+
},
|
|
79
|
+
toProto(message) {
|
|
80
|
+
return Timestamp.encode(message).finish();
|
|
81
|
+
},
|
|
82
|
+
toProtoMsg(message) {
|
|
83
|
+
return {
|
|
84
|
+
typeUrl: '/google.protobuf.Timestamp',
|
|
85
|
+
value: Timestamp.encode(message).finish(),
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=timestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/codegen/google/protobuf/timestamp.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAyR3E,SAAS,mBAAmB;IAC1B,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;QAClB,KAAK,EAAE,CAAC;KACT,CAAC;AACJ,CAAC;AACD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,4BAA4B;IACrC,MAAM,CACJ,OAAkB,EAClB,SAAuB,YAAY,CAAC,MAAM,EAAE;QAE5C,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,KAAgC,EAAE,MAAe;QACtD,MAAM,MAAM,GACV,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;QAClE,IAAI,GAAG,GAAG,MAAM,KAAK,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ACF,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12
|
|
3
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
4
|
+
* and run the transpile command or yarn proto command to regenerate this bundle.
|
|
5
|
+
*/
|
|
6
|
+
export declare function bytesFromBase64(b64: string): Uint8Array;
|
|
7
|
+
export declare function base64FromBytes(arr: Uint8Array): string;
|
|
8
|
+
export interface AminoHeight {
|
|
9
|
+
readonly revision_number?: string;
|
|
10
|
+
readonly revision_height?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function omitDefault<T extends string | number | bigint>(input: T): T | undefined;
|
|
13
|
+
interface Duration {
|
|
14
|
+
/**
|
|
15
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
16
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
17
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
18
|
+
*/
|
|
19
|
+
seconds: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
22
|
+
* of time. Durations less than one second are represented with a 0
|
|
23
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
24
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
25
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
26
|
+
* to +999,999,999 inclusive.
|
|
27
|
+
*/
|
|
28
|
+
nanos: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function toDuration(duration: string): Duration;
|
|
31
|
+
export declare function fromDuration(duration: Duration): string;
|
|
32
|
+
export declare function isSet(value: any): boolean;
|
|
33
|
+
export declare function isObject(value: any): boolean;
|
|
34
|
+
export interface PageRequest {
|
|
35
|
+
key: Uint8Array;
|
|
36
|
+
offset: bigint;
|
|
37
|
+
limit: bigint;
|
|
38
|
+
countTotal: boolean;
|
|
39
|
+
reverse: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PageRequestParams {
|
|
42
|
+
'pagination.key'?: string;
|
|
43
|
+
'pagination.offset'?: string;
|
|
44
|
+
'pagination.limit'?: string;
|
|
45
|
+
'pagination.count_total'?: boolean;
|
|
46
|
+
'pagination.reverse'?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface Params {
|
|
49
|
+
params: PageRequestParams;
|
|
50
|
+
}
|
|
51
|
+
export declare const setPaginationParams: (options: Params, pagination?: PageRequest) => Params;
|
|
52
|
+
type Builtin = Date | Function | Uint8Array | string | number | bigint | boolean | undefined;
|
|
53
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
54
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
55
|
+
} : Partial<T>;
|
|
56
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
57
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
58
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
59
|
+
} & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
|
|
60
|
+
export interface Rpc {
|
|
61
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
62
|
+
}
|
|
63
|
+
interface Timestamp {
|
|
64
|
+
/**
|
|
65
|
+
* Represents seconds of UTC time since Unix epoch
|
|
66
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
67
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
68
|
+
*/
|
|
69
|
+
seconds: bigint;
|
|
70
|
+
/**
|
|
71
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
72
|
+
* second values with fractions must still have non-negative nanos values
|
|
73
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
74
|
+
* inclusive.
|
|
75
|
+
*/
|
|
76
|
+
nanos: number;
|
|
77
|
+
}
|
|
78
|
+
export declare function toTimestamp(date: Date): Timestamp;
|
|
79
|
+
export declare function fromTimestamp(t: Timestamp): Date;
|
|
80
|
+
export declare function fromJsonTimestamp(o: any): Timestamp;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12
|
|
4
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
5
|
+
* and run the transpile command or yarn proto command to regenerate this bundle.
|
|
6
|
+
*/
|
|
7
|
+
var globalThis = (() => {
|
|
8
|
+
if (typeof globalThis !== 'undefined')
|
|
9
|
+
return globalThis;
|
|
10
|
+
if (typeof self !== 'undefined')
|
|
11
|
+
return self;
|
|
12
|
+
if (typeof window !== 'undefined')
|
|
13
|
+
return window;
|
|
14
|
+
if (typeof global !== 'undefined')
|
|
15
|
+
return global;
|
|
16
|
+
throw 'Unable to locate global object';
|
|
17
|
+
})();
|
|
18
|
+
const atob = globalThis.atob ||
|
|
19
|
+
(b64 => globalThis.Buffer.from(b64, 'base64').toString('binary'));
|
|
20
|
+
export function bytesFromBase64(b64) {
|
|
21
|
+
const bin = atob(b64);
|
|
22
|
+
const arr = new Uint8Array(bin.length);
|
|
23
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
24
|
+
arr[i] = bin.charCodeAt(i);
|
|
25
|
+
}
|
|
26
|
+
return arr;
|
|
27
|
+
}
|
|
28
|
+
const btoa = globalThis.btoa ||
|
|
29
|
+
(bin => globalThis.Buffer.from(bin, 'binary').toString('base64'));
|
|
30
|
+
export function base64FromBytes(arr) {
|
|
31
|
+
const bin = [];
|
|
32
|
+
arr.forEach(byte => {
|
|
33
|
+
bin.push(String.fromCharCode(byte));
|
|
34
|
+
});
|
|
35
|
+
return btoa(bin.join(''));
|
|
36
|
+
}
|
|
37
|
+
export function omitDefault(input) {
|
|
38
|
+
if (typeof input === 'string') {
|
|
39
|
+
return input === '' ? undefined : input;
|
|
40
|
+
}
|
|
41
|
+
if (typeof input === 'number') {
|
|
42
|
+
return input === 0 ? undefined : input;
|
|
43
|
+
}
|
|
44
|
+
if (typeof input === 'bigint') {
|
|
45
|
+
return input === BigInt(0) ? undefined : input;
|
|
46
|
+
}
|
|
47
|
+
throw new Error(`Got unsupported type ${typeof input}`);
|
|
48
|
+
}
|
|
49
|
+
export function toDuration(duration) {
|
|
50
|
+
return {
|
|
51
|
+
seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)),
|
|
52
|
+
nanos: parseInt(duration) % 1000000000,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function fromDuration(duration) {
|
|
56
|
+
return (parseInt(duration.seconds.toString()) * 1000000000 +
|
|
57
|
+
duration.nanos).toString();
|
|
58
|
+
}
|
|
59
|
+
export function isSet(value) {
|
|
60
|
+
return value !== null && value !== undefined;
|
|
61
|
+
}
|
|
62
|
+
export function isObject(value) {
|
|
63
|
+
return typeof value === 'object' && value !== null;
|
|
64
|
+
}
|
|
65
|
+
export const setPaginationParams = (options, pagination) => {
|
|
66
|
+
if (!pagination) {
|
|
67
|
+
return options;
|
|
68
|
+
}
|
|
69
|
+
if (typeof pagination?.countTotal !== 'undefined') {
|
|
70
|
+
options.params['pagination.count_total'] = pagination.countTotal;
|
|
71
|
+
}
|
|
72
|
+
if (typeof pagination?.key !== 'undefined') {
|
|
73
|
+
// String to Uint8Array
|
|
74
|
+
// let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
|
|
75
|
+
// Uint8Array to String
|
|
76
|
+
options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64');
|
|
77
|
+
}
|
|
78
|
+
if (typeof pagination?.limit !== 'undefined') {
|
|
79
|
+
options.params['pagination.limit'] = pagination.limit.toString();
|
|
80
|
+
}
|
|
81
|
+
if (typeof pagination?.offset !== 'undefined') {
|
|
82
|
+
options.params['pagination.offset'] = pagination.offset.toString();
|
|
83
|
+
}
|
|
84
|
+
if (typeof pagination?.reverse !== 'undefined') {
|
|
85
|
+
options.params['pagination.reverse'] = pagination.reverse;
|
|
86
|
+
}
|
|
87
|
+
return options;
|
|
88
|
+
};
|
|
89
|
+
export function toTimestamp(date) {
|
|
90
|
+
const seconds = numberToLong(date.getTime() / 1000);
|
|
91
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
92
|
+
return {
|
|
93
|
+
seconds,
|
|
94
|
+
nanos,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function fromTimestamp(t) {
|
|
98
|
+
let millis = Number(t.seconds) * 1000;
|
|
99
|
+
millis += t.nanos / 1000000;
|
|
100
|
+
return new Date(millis);
|
|
101
|
+
}
|
|
102
|
+
const timestampFromJSON = (object) => {
|
|
103
|
+
return {
|
|
104
|
+
seconds: isSet(object.seconds)
|
|
105
|
+
? BigInt(object.seconds.toString())
|
|
106
|
+
: BigInt(0),
|
|
107
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export function fromJsonTimestamp(o) {
|
|
111
|
+
if (o instanceof Date) {
|
|
112
|
+
return toTimestamp(o);
|
|
113
|
+
}
|
|
114
|
+
else if (typeof o === 'string') {
|
|
115
|
+
return toTimestamp(new Date(o));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return timestampFromJSON(o);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function numberToLong(number) {
|
|
122
|
+
return BigInt(Math.trunc(number));
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/codegen/helpers.ts"],"names":[],"mappings":"AAAA,aAAa;AACb;;;;GAIG;AAKH,IAAI,UAAU,GAAQ,CAAC,GAAG,EAAE;IAC1B,IAAI,OAAO,UAAU,KAAK,WAAW;Q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