@ark-us/wasmxjs 0.0.1
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/LICENSE +3 -0
- package/README.md +280 -0
- package/main/codegen/cosmos/base/abci/v1beta1/abci.js +887 -0
- package/main/codegen/cosmos/base/kv/v1beta1/kv.js +139 -0
- package/main/codegen/cosmos/base/query/v1beta1/pagination.js +157 -0
- package/main/codegen/cosmos/base/reflection/v1beta1/reflection.js +231 -0
- package/main/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1479 -0
- package/main/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +478 -0
- package/main/codegen/cosmos/base/store/v1beta1/commit_info.js +207 -0
- package/main/codegen/cosmos/base/store/v1beta1/listening.js +89 -0
- package/main/codegen/cosmos/base/tendermint/v1beta1/query.js +951 -0
- package/main/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +117 -0
- package/main/codegen/cosmos/base/v1beta1/coin.js +223 -0
- package/main/codegen/cosmos/bundle.js +63 -0
- package/main/codegen/cosmos/rpc.query.js +55 -0
- package/main/codegen/extern.js +66 -0
- package/main/codegen/gogoproto/bundle.js +16 -0
- package/main/codegen/gogoproto/gogo.js +5 -0
- package/main/codegen/google/api/annotations.js +5 -0
- package/main/codegen/google/api/http.js +306 -0
- package/main/codegen/google/api/httpbody.js +102 -0
- package/main/codegen/google/bundle.js +26 -0
- package/main/codegen/google/protobuf/any.js +69 -0
- package/main/codegen/google/protobuf/descriptor.js +3429 -0
- package/main/codegen/google/protobuf/duration.js +69 -0
- package/main/codegen/google/protobuf/timestamp.js +69 -0
- package/main/codegen/helpers.js +170 -0
- package/main/codegen/index.js +93 -0
- package/main/codegen/tendermint/abci/types.js +3616 -0
- package/main/codegen/tendermint/bundle.js +37 -0
- package/main/codegen/tendermint/crypto/keys.js +69 -0
- package/main/codegen/tendermint/crypto/proof.js +372 -0
- package/main/codegen/tendermint/libs/bits/types.js +100 -0
- package/main/codegen/tendermint/p2p/types.js +322 -0
- package/main/codegen/tendermint/types/block.js +90 -0
- package/main/codegen/tendermint/types/evidence.js +335 -0
- package/main/codegen/tendermint/types/params.js +397 -0
- package/main/codegen/tendermint/types/types.js +1223 -0
- package/main/codegen/tendermint/types/validator.js +237 -0
- package/main/codegen/tendermint/version/types.js +126 -0
- package/main/codegen/wasmx/bundle.js +30 -0
- package/main/codegen/wasmx/client.js +65 -0
- package/main/codegen/wasmx/index.js +126 -0
- package/main/codegen/wasmx/rpc.query.js +65 -0
- package/main/codegen/wasmx/rpc.tx.js +44 -0
- package/main/codegen/wasmx/wasmx/contract.js +324 -0
- package/main/codegen/wasmx/wasmx/genesis.js +481 -0
- package/main/codegen/wasmx/wasmx/params.js +45 -0
- package/main/codegen/wasmx/wasmx/query.js +1187 -0
- package/main/codegen/wasmx/wasmx/query.rpc.Query.js +154 -0
- package/main/codegen/wasmx/wasmx/tx.amino.js +251 -0
- package/main/codegen/wasmx/wasmx/tx.js +937 -0
- package/main/codegen/wasmx/wasmx/tx.registry.js +213 -0
- package/main/codegen/wasmx/wasmx/tx.rpc.msg.js +85 -0
- package/main/index.js +16 -0
- package/module/codegen/cosmos/base/abci/v1beta1/abci.js +755 -0
- package/module/codegen/cosmos/base/kv/v1beta1/kv.js +110 -0
- package/module/codegen/cosmos/base/query/v1beta1/pagination.js +154 -0
- package/module/codegen/cosmos/base/reflection/v1beta1/reflection.js +183 -0
- package/module/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1297 -0
- package/module/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +439 -0
- package/module/codegen/cosmos/base/store/v1beta1/commit_info.js +179 -0
- package/module/codegen/cosmos/base/store/v1beta1/listening.js +86 -0
- package/module/codegen/cosmos/base/tendermint/v1beta1/query.js +866 -0
- package/module/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +74 -0
- package/module/codegen/cosmos/base/v1beta1/coin.js +213 -0
- package/module/codegen/cosmos/bundle.js +52 -0
- package/module/codegen/cosmos/rpc.query.js +17 -0
- package/module/codegen/extern.js +30 -0
- package/module/codegen/gogoproto/bundle.js +5 -0
- package/module/codegen/gogoproto/gogo.js +1 -0
- package/module/codegen/google/api/annotations.js +1 -0
- package/module/codegen/google/api/http.js +264 -0
- package/module/codegen/google/api/httpbody.js +115 -0
- package/module/codegen/google/bundle.js +15 -0
- package/module/codegen/google/protobuf/any.js +140 -0
- package/module/codegen/google/protobuf/descriptor.js +2801 -0
- package/module/codegen/google/protobuf/duration.js +119 -0
- package/module/codegen/google/protobuf/timestamp.js +143 -0
- package/module/codegen/helpers.js +140 -0
- package/module/codegen/index.js +14 -0
- package/module/codegen/tendermint/abci/types.js +3305 -0
- package/module/codegen/tendermint/bundle.js +26 -0
- package/module/codegen/tendermint/crypto/keys.js +60 -0
- package/module/codegen/tendermint/crypto/proof.js +320 -0
- package/module/codegen/tendermint/libs/bits/types.js +71 -0
- package/module/codegen/tendermint/p2p/types.js +305 -0
- package/module/codegen/tendermint/types/block.js +79 -0
- package/module/codegen/tendermint/types/evidence.js +285 -0
- package/module/codegen/tendermint/types/params.js +363 -0
- package/module/codegen/tendermint/types/types.js +1149 -0
- package/module/codegen/tendermint/types/validator.js +204 -0
- package/module/codegen/tendermint/version/types.js +119 -0
- package/module/codegen/wasmx/bundle.js +19 -0
- package/module/codegen/wasmx/client.js +36 -0
- package/module/codegen/wasmx/index.js +11 -0
- package/module/codegen/wasmx/rpc.query.js +20 -0
- package/module/codegen/wasmx/rpc.tx.js +7 -0
- package/module/codegen/wasmx/wasmx/contract.js +291 -0
- package/module/codegen/wasmx/wasmx/genesis.js +386 -0
- package/module/codegen/wasmx/wasmx/params.js +36 -0
- package/module/codegen/wasmx/wasmx/query.js +1052 -0
- package/module/codegen/wasmx/wasmx/query.rpc.Query.js +101 -0
- package/module/codegen/wasmx/wasmx/tx.amino.js +236 -0
- package/module/codegen/wasmx/wasmx/tx.js +815 -0
- package/module/codegen/wasmx/wasmx/tx.registry.js +199 -0
- package/module/codegen/wasmx/wasmx/tx.rpc.msg.js +47 -0
- package/module/index.js +1 -0
- package/package.json +88 -0
- package/src/codegen/cosmos/base/abci/v1beta1/abci.ts +1254 -0
- package/src/codegen/cosmos/base/kv/v1beta1/kv.ts +156 -0
- package/src/codegen/cosmos/base/query/v1beta1/pagination.ts +314 -0
- package/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts +280 -0
- package/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +2079 -0
- package/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts +641 -0
- package/src/codegen/cosmos/base/store/v1beta1/commit_info.ts +269 -0
- package/src/codegen/cosmos/base/store/v1beta1/listening.ts +129 -0
- package/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +107 -0
- package/src/codegen/cosmos/base/tendermint/v1beta1/query.ts +1284 -0
- package/src/codegen/cosmos/base/v1beta1/coin.ts +318 -0
- package/src/codegen/cosmos/bundle.ts +52 -0
- package/src/codegen/cosmos/rpc.query.ts +19 -0
- package/src/codegen/extern.ts +33 -0
- package/src/codegen/gogoproto/bundle.ts +3 -0
- package/src/codegen/gogoproto/gogo.ts +1 -0
- package/src/codegen/google/api/annotations.ts +1 -0
- package/src/codegen/google/api/http.ts +945 -0
- package/src/codegen/google/api/httpbody.ts +200 -0
- package/src/codegen/google/bundle.ts +18 -0
- package/src/codegen/google/protobuf/any.ts +305 -0
- package/src/codegen/google/protobuf/descriptor.ts +5113 -0
- package/src/codegen/google/protobuf/duration.ts +229 -0
- package/src/codegen/google/protobuf/timestamp.ts +273 -0
- package/src/codegen/helpers.ts +240 -0
- package/src/codegen/index.ts +14 -0
- package/src/codegen/tendermint/abci/types.ts +4754 -0
- package/src/codegen/tendermint/bundle.ts +32 -0
- package/src/codegen/tendermint/crypto/keys.ts +83 -0
- package/src/codegen/tendermint/crypto/proof.ts +465 -0
- package/src/codegen/tendermint/libs/bits/types.ts +97 -0
- package/src/codegen/tendermint/p2p/types.ts +422 -0
- package/src/codegen/tendermint/types/block.ts +109 -0
- package/src/codegen/tendermint/types/evidence.ts +415 -0
- package/src/codegen/tendermint/types/params.ts +615 -0
- package/src/codegen/tendermint/types/types.ts +1663 -0
- package/src/codegen/tendermint/types/validator.ts +282 -0
- package/src/codegen/tendermint/version/types.ts +180 -0
- package/src/codegen/wasmx/bundle.ts +26 -0
- package/src/codegen/wasmx/client.ts +45 -0
- package/src/codegen/wasmx/index.ts +11 -0
- package/src/codegen/wasmx/rpc.query.ts +22 -0
- package/src/codegen/wasmx/rpc.tx.ts +10 -0
- package/src/codegen/wasmx/wasmx/contract.ts +470 -0
- package/src/codegen/wasmx/wasmx/genesis.ts +552 -0
- package/src/codegen/wasmx/wasmx/params.ts +50 -0
- package/src/codegen/wasmx/wasmx/query.rpc.Query.ts +149 -0
- package/src/codegen/wasmx/wasmx/query.ts +1668 -0
- package/src/codegen/wasmx/wasmx/tx.amino.ts +314 -0
- package/src/codegen/wasmx/wasmx/tx.registry.ts +230 -0
- package/src/codegen/wasmx/wasmx/tx.rpc.msg.ts +80 -0
- package/src/codegen/wasmx/wasmx/tx.ts +1331 -0
- package/src/index.ts +1 -0
- package/types/codegen/cosmos/base/abci/v1beta1/abci.d.ts +338 -0
- package/types/codegen/cosmos/base/kv/v1beta1/kv.d.ts +33 -0
- package/types/codegen/cosmos/base/query/v1beta1/pagination.d.ts +140 -0
- package/types/codegen/cosmos/base/reflection/v1beta1/reflection.d.ts +75 -0
- package/types/codegen/cosmos/base/reflection/v2alpha1/reflection.d.ts +565 -0
- package/types/codegen/cosmos/base/snapshots/v1beta1/snapshot.d.ts +135 -0
- package/types/codegen/cosmos/base/store/v1beta1/commit_info.d.ts +71 -0
- package/types/codegen/cosmos/base/store/v1beta1/listening.d.ts +38 -0
- package/types/codegen/cosmos/base/tendermint/v1beta1/query.d.ts +282 -0
- package/types/codegen/cosmos/base/tendermint/v1beta1/query.lcd.d.ts +14 -0
- package/types/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.d.ts +36 -0
- package/types/codegen/cosmos/base/v1beta1/coin.d.ts +85 -0
- package/types/codegen/cosmos/bundle.d.ts +594 -0
- package/types/codegen/cosmos/lcd.d.ts +11 -0
- package/types/codegen/cosmos/rpc.query.d.ts +19 -0
- package/types/codegen/extern.d.ts +9 -0
- package/types/codegen/gogoproto/bundle.d.ts +1 -0
- package/types/codegen/gogoproto/gogo.d.ts +1 -0
- package/types/codegen/google/api/annotations.d.ts +1 -0
- package/types/codegen/google/api/http.d.ts +622 -0
- package/types/codegen/google/api/httpbody.d.ts +113 -0
- package/types/codegen/google/bundle.d.ts +274 -0
- package/types/codegen/google/protobuf/any.d.ts +238 -0
- package/types/codegen/google/protobuf/descriptor.d.ts +1835 -0
- package/types/codegen/google/protobuf/duration.d.ts +163 -0
- package/types/codegen/google/protobuf/timestamp.d.ts +207 -0
- package/types/codegen/helpers.d.ts +82 -0
- package/types/codegen/index.d.ts +13 -0
- package/types/codegen/tendermint/abci/types.d.ts +993 -0
- package/types/codegen/tendermint/bundle.d.ts +639 -0
- package/types/codegen/tendermint/crypto/keys.d.ts +18 -0
- package/types/codegen/tendermint/crypto/proof.d.ts +101 -0
- package/types/codegen/tendermint/libs/bits/types.d.ts +17 -0
- package/types/codegen/tendermint/p2p/types.d.ts +78 -0
- package/types/codegen/tendermint/types/block.d.ts +22 -0
- package/types/codegen/tendermint/types/evidence.d.ts +91 -0
- package/types/codegen/tendermint/types/params.d.ts +193 -0
- package/types/codegen/tendermint/types/types.d.ts +363 -0
- package/types/codegen/tendermint/types/validator.d.ts +54 -0
- package/types/codegen/tendermint/version/types.d.ts +52 -0
- package/types/codegen/wasmx/bundle.d.ts +614 -0
- package/types/codegen/wasmx/client.d.ts +151 -0
- package/types/codegen/wasmx/index.d.ts +11 -0
- package/types/codegen/wasmx/lcd.d.ts +14 -0
- package/types/codegen/wasmx/rpc.query.d.ts +32 -0
- package/types/codegen/wasmx/rpc.tx.d.ts +8 -0
- package/types/codegen/wasmx/wasmx/contract.d.ts +122 -0
- package/types/codegen/wasmx/wasmx/genesis.d.ts +107 -0
- package/types/codegen/wasmx/wasmx/params.d.ts +14 -0
- package/types/codegen/wasmx/wasmx/query.d.ts +451 -0
- package/types/codegen/wasmx/wasmx/query.lcd.d.ts +17 -0
- package/types/codegen/wasmx/wasmx/query.rpc.Query.d.ts +48 -0
- package/types/codegen/wasmx/wasmx/tx.amino.d.ts +110 -0
- package/types/codegen/wasmx/wasmx/tx.d.ts +332 -0
- package/types/codegen/wasmx/wasmx/tx.registry.d.ts +136 -0
- package/types/codegen/wasmx/wasmx/tx.rpc.msg.d.ts +33 -0
- package/types/index.d.ts +1 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as _m0 from "protobufjs/minimal";
|
|
2
|
+
import { Long, isSet } from "../../helpers";
|
|
3
|
+
/**
|
|
4
|
+
* A Duration represents a signed, fixed-length span of time represented
|
|
5
|
+
* as a count of seconds and fractions of seconds at nanosecond
|
|
6
|
+
* resolution. It is independent of any calendar and concepts like "day"
|
|
7
|
+
* or "month". It is related to Timestamp in that the difference between
|
|
8
|
+
* two Timestamp values is a Duration and it can be added or subtracted
|
|
9
|
+
* from a Timestamp. Range is approximately +-10,000 years.
|
|
10
|
+
*
|
|
11
|
+
* # Examples
|
|
12
|
+
*
|
|
13
|
+
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
14
|
+
*
|
|
15
|
+
* Timestamp start = ...;
|
|
16
|
+
* Timestamp end = ...;
|
|
17
|
+
* Duration duration = ...;
|
|
18
|
+
*
|
|
19
|
+
* duration.seconds = end.seconds - start.seconds;
|
|
20
|
+
* duration.nanos = end.nanos - start.nanos;
|
|
21
|
+
*
|
|
22
|
+
* if (duration.seconds < 0 && duration.nanos > 0) {
|
|
23
|
+
* duration.seconds += 1;
|
|
24
|
+
* duration.nanos -= 1000000000;
|
|
25
|
+
* } else if (durations.seconds > 0 && duration.nanos < 0) {
|
|
26
|
+
* duration.seconds -= 1;
|
|
27
|
+
* duration.nanos += 1000000000;
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
31
|
+
*
|
|
32
|
+
* Timestamp start = ...;
|
|
33
|
+
* Duration duration = ...;
|
|
34
|
+
* Timestamp end = ...;
|
|
35
|
+
*
|
|
36
|
+
* end.seconds = start.seconds + duration.seconds;
|
|
37
|
+
* end.nanos = start.nanos + duration.nanos;
|
|
38
|
+
*
|
|
39
|
+
* if (end.nanos < 0) {
|
|
40
|
+
* end.seconds -= 1;
|
|
41
|
+
* end.nanos += 1000000000;
|
|
42
|
+
* } else if (end.nanos >= 1000000000) {
|
|
43
|
+
* end.seconds += 1;
|
|
44
|
+
* end.nanos -= 1000000000;
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* Example 3: Compute Duration from datetime.timedelta in Python.
|
|
48
|
+
*
|
|
49
|
+
* td = datetime.timedelta(days=3, minutes=10)
|
|
50
|
+
* duration = Duration()
|
|
51
|
+
* duration.FromTimedelta(td)
|
|
52
|
+
*
|
|
53
|
+
* # JSON Mapping
|
|
54
|
+
*
|
|
55
|
+
* In JSON format, the Duration type is encoded as a string rather than an
|
|
56
|
+
* object, where the string ends in the suffix "s" (indicating seconds) and
|
|
57
|
+
* is preceded by the number of seconds, with nanoseconds expressed as
|
|
58
|
+
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
59
|
+
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
60
|
+
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
61
|
+
* microsecond should be expressed in JSON format as "3.000001s".
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
function createBaseDuration() {
|
|
65
|
+
return {
|
|
66
|
+
seconds: Long.ZERO,
|
|
67
|
+
nanos: 0
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export const Duration = {
|
|
71
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
72
|
+
if (!message.seconds.isZero()) {
|
|
73
|
+
writer.uint32(8).int64(message.seconds);
|
|
74
|
+
}
|
|
75
|
+
if (message.nanos !== 0) {
|
|
76
|
+
writer.uint32(16).int32(message.nanos);
|
|
77
|
+
}
|
|
78
|
+
return writer;
|
|
79
|
+
},
|
|
80
|
+
decode(input, length) {
|
|
81
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
82
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
83
|
+
const message = createBaseDuration();
|
|
84
|
+
while (reader.pos < end) {
|
|
85
|
+
const tag = reader.uint32();
|
|
86
|
+
switch (tag >>> 3) {
|
|
87
|
+
case 1:
|
|
88
|
+
message.seconds = reader.int64();
|
|
89
|
+
break;
|
|
90
|
+
case 2:
|
|
91
|
+
message.nanos = reader.int32();
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
reader.skipType(tag & 7);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return message;
|
|
99
|
+
},
|
|
100
|
+
fromJSON(object) {
|
|
101
|
+
return {
|
|
102
|
+
seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
|
|
103
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
toJSON(message) {
|
|
107
|
+
const obj = {};
|
|
108
|
+
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
|
|
109
|
+
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
|
110
|
+
return obj;
|
|
111
|
+
},
|
|
112
|
+
fromPartial(object) {
|
|
113
|
+
var _object$nanos;
|
|
114
|
+
const message = createBaseDuration();
|
|
115
|
+
message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO;
|
|
116
|
+
message.nanos = (_object$nanos = object.nanos) !== null && _object$nanos !== void 0 ? _object$nanos : 0;
|
|
117
|
+
return message;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as _m0 from "protobufjs/minimal";
|
|
2
|
+
import { Long, isSet } from "../../helpers";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
5
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
7
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
8
|
+
* Gregorian calendar backwards to year one.
|
|
9
|
+
*
|
|
10
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
11
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
12
|
+
* smear](https://developers.google.com/time/smear).
|
|
13
|
+
*
|
|
14
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
15
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
16
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
17
|
+
*
|
|
18
|
+
* # Examples
|
|
19
|
+
*
|
|
20
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
21
|
+
*
|
|
22
|
+
* Timestamp timestamp;
|
|
23
|
+
* timestamp.set_seconds(time(NULL));
|
|
24
|
+
* timestamp.set_nanos(0);
|
|
25
|
+
*
|
|
26
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
27
|
+
*
|
|
28
|
+
* struct timeval tv;
|
|
29
|
+
* gettimeofday(&tv, NULL);
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
33
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
34
|
+
*
|
|
35
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
36
|
+
*
|
|
37
|
+
* FILETIME ft;
|
|
38
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
39
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
40
|
+
*
|
|
41
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
42
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
43
|
+
* Timestamp timestamp;
|
|
44
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
45
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
46
|
+
*
|
|
47
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
48
|
+
*
|
|
49
|
+
* long millis = System.currentTimeMillis();
|
|
50
|
+
*
|
|
51
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* Example 5: Compute Timestamp from current time in Python.
|
|
56
|
+
*
|
|
57
|
+
* timestamp = Timestamp()
|
|
58
|
+
* timestamp.GetCurrentTime()
|
|
59
|
+
*
|
|
60
|
+
* # JSON Mapping
|
|
61
|
+
*
|
|
62
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
63
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
64
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
65
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
66
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
67
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
68
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
69
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
70
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
71
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
72
|
+
*
|
|
73
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
74
|
+
* 01:30 UTC on January 15, 2017.
|
|
75
|
+
*
|
|
76
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
77
|
+
* standard
|
|
78
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
79
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
80
|
+
* to this format using
|
|
81
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
82
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
83
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
84
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
|
85
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
function createBaseTimestamp() {
|
|
89
|
+
return {
|
|
90
|
+
seconds: Long.ZERO,
|
|
91
|
+
nanos: 0
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export const Timestamp = {
|
|
95
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
96
|
+
if (!message.seconds.isZero()) {
|
|
97
|
+
writer.uint32(8).int64(message.seconds);
|
|
98
|
+
}
|
|
99
|
+
if (message.nanos !== 0) {
|
|
100
|
+
writer.uint32(16).int32(message.nanos);
|
|
101
|
+
}
|
|
102
|
+
return writer;
|
|
103
|
+
},
|
|
104
|
+
decode(input, length) {
|
|
105
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
106
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
107
|
+
const message = createBaseTimestamp();
|
|
108
|
+
while (reader.pos < end) {
|
|
109
|
+
const tag = reader.uint32();
|
|
110
|
+
switch (tag >>> 3) {
|
|
111
|
+
case 1:
|
|
112
|
+
message.seconds = reader.int64();
|
|
113
|
+
break;
|
|
114
|
+
case 2:
|
|
115
|
+
message.nanos = reader.int32();
|
|
116
|
+
break;
|
|
117
|
+
default:
|
|
118
|
+
reader.skipType(tag & 7);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return message;
|
|
123
|
+
},
|
|
124
|
+
fromJSON(object) {
|
|
125
|
+
return {
|
|
126
|
+
seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
|
|
127
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
toJSON(message) {
|
|
131
|
+
const obj = {};
|
|
132
|
+
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
|
|
133
|
+
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
|
134
|
+
return obj;
|
|
135
|
+
},
|
|
136
|
+
fromPartial(object) {
|
|
137
|
+
var _object$nanos;
|
|
138
|
+
const message = createBaseTimestamp();
|
|
139
|
+
message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO;
|
|
140
|
+
message.nanos = (_object$nanos = object.nanos) !== null && _object$nanos !== void 0 ? _object$nanos : 0;
|
|
141
|
+
return message;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @osmonauts/telescope@0.78.0
|
|
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
|
+
|
|
7
|
+
import * as _m0 from "protobufjs/minimal";
|
|
8
|
+
import Long from 'long';
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
if (_m0.util.Long !== Long) {
|
|
12
|
+
_m0.util.Long = Long;
|
|
13
|
+
_m0.configure();
|
|
14
|
+
}
|
|
15
|
+
export { Long };
|
|
16
|
+
var globalThis = (() => {
|
|
17
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
18
|
+
if (typeof self !== 'undefined') return self;
|
|
19
|
+
if (typeof window !== 'undefined') return window;
|
|
20
|
+
if (typeof global !== 'undefined') return global;
|
|
21
|
+
throw 'Unable to locate global object';
|
|
22
|
+
})();
|
|
23
|
+
const atob = globalThis.atob || (b64 => globalThis.Buffer.from(b64, 'base64').toString('binary'));
|
|
24
|
+
export function bytesFromBase64(b64) {
|
|
25
|
+
const bin = atob(b64);
|
|
26
|
+
const arr = new Uint8Array(bin.length);
|
|
27
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
28
|
+
arr[i] = bin.charCodeAt(i);
|
|
29
|
+
}
|
|
30
|
+
return arr;
|
|
31
|
+
}
|
|
32
|
+
const btoa = globalThis.btoa || (bin => globalThis.Buffer.from(bin, 'binary').toString('base64'));
|
|
33
|
+
export function base64FromBytes(arr) {
|
|
34
|
+
const bin = [];
|
|
35
|
+
arr.forEach(byte => {
|
|
36
|
+
bin.push(String.fromCharCode(byte));
|
|
37
|
+
});
|
|
38
|
+
return btoa(bin.join(''));
|
|
39
|
+
}
|
|
40
|
+
;
|
|
41
|
+
export function omitDefault(input) {
|
|
42
|
+
if (typeof input === "string") {
|
|
43
|
+
return input === "" ? undefined : input;
|
|
44
|
+
}
|
|
45
|
+
if (typeof input === "number") {
|
|
46
|
+
return input === 0 ? undefined : input;
|
|
47
|
+
}
|
|
48
|
+
if (Long.isLong(input)) {
|
|
49
|
+
return input.isZero() ? undefined : input;
|
|
50
|
+
}
|
|
51
|
+
throw new Error(`Got unsupported type ${typeof input}`);
|
|
52
|
+
}
|
|
53
|
+
;
|
|
54
|
+
export function toDuration(duration) {
|
|
55
|
+
return {
|
|
56
|
+
seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1000000000)),
|
|
57
|
+
nanos: parseInt(duration) % 1000000000
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
;
|
|
61
|
+
export function fromDuration(duration) {
|
|
62
|
+
return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString();
|
|
63
|
+
}
|
|
64
|
+
;
|
|
65
|
+
export function isSet(value) {
|
|
66
|
+
return value !== null && value !== undefined;
|
|
67
|
+
}
|
|
68
|
+
;
|
|
69
|
+
export function isObject(value) {
|
|
70
|
+
return typeof value === 'object' && value !== null;
|
|
71
|
+
}
|
|
72
|
+
;
|
|
73
|
+
;
|
|
74
|
+
;
|
|
75
|
+
;
|
|
76
|
+
export const setPaginationParams = (options, pagination) => {
|
|
77
|
+
if (!pagination) {
|
|
78
|
+
return options;
|
|
79
|
+
}
|
|
80
|
+
if (typeof (pagination === null || pagination === void 0 ? void 0 : pagination.countTotal) !== "undefined") {
|
|
81
|
+
options.params['pagination.count_total'] = pagination.countTotal;
|
|
82
|
+
}
|
|
83
|
+
if (typeof (pagination === null || pagination === void 0 ? void 0 : pagination.key) !== "undefined") {
|
|
84
|
+
// String to Uint8Array
|
|
85
|
+
// let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
|
|
86
|
+
|
|
87
|
+
// Uint8Array to String
|
|
88
|
+
options.params['pagination.key'] = Buffer.from(pagination.key).toString('base64');
|
|
89
|
+
}
|
|
90
|
+
if (typeof (pagination === null || pagination === void 0 ? void 0 : pagination.limit) !== "undefined") {
|
|
91
|
+
options.params["pagination.limit"] = pagination.limit.toString();
|
|
92
|
+
}
|
|
93
|
+
if (typeof (pagination === null || pagination === void 0 ? void 0 : pagination.offset) !== "undefined") {
|
|
94
|
+
options.params["pagination.offset"] = pagination.offset.toString();
|
|
95
|
+
}
|
|
96
|
+
if (typeof (pagination === null || pagination === void 0 ? void 0 : pagination.reverse) !== "undefined") {
|
|
97
|
+
options.params['pagination.reverse'] = pagination.reverse;
|
|
98
|
+
}
|
|
99
|
+
return options;
|
|
100
|
+
};
|
|
101
|
+
;
|
|
102
|
+
export function toTimestamp(date) {
|
|
103
|
+
const seconds = numberToLong(date.getTime() / 1000);
|
|
104
|
+
const nanos = date.getTime() % 1000 * 1000000;
|
|
105
|
+
return {
|
|
106
|
+
seconds,
|
|
107
|
+
nanos
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
;
|
|
111
|
+
export function fromTimestamp(t) {
|
|
112
|
+
let millis = t.seconds.toNumber() * 1000;
|
|
113
|
+
millis += t.nanos / 1000000;
|
|
114
|
+
return new Date(millis);
|
|
115
|
+
}
|
|
116
|
+
;
|
|
117
|
+
const fromJSON = object => {
|
|
118
|
+
return {
|
|
119
|
+
seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO,
|
|
120
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const timestampFromJSON = object => {
|
|
124
|
+
return {
|
|
125
|
+
seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO,
|
|
126
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
export function fromJsonTimestamp(o) {
|
|
130
|
+
if (o instanceof Date) {
|
|
131
|
+
return toTimestamp(o);
|
|
132
|
+
} else if (typeof o === "string") {
|
|
133
|
+
return toTimestamp(new Date(o));
|
|
134
|
+
} else {
|
|
135
|
+
return timestampFromJSON(o);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function numberToLong(number) {
|
|
139
|
+
return Long.fromNumber(number);
|
|
140
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @osmonauts/telescope@0.78.0
|
|
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
|
+
|
|
7
|
+
export * from "./cosmos/bundle";
|
|
8
|
+
export * from "./gogoproto/bundle";
|
|
9
|
+
export * from "./google/bundle";
|
|
10
|
+
export * from "./tendermint/bundle";
|
|
11
|
+
export * from "./wasmx/bundle";
|
|
12
|
+
export * from "./wasmx/client";
|
|
13
|
+
export * from "./wasmx/index";
|
|
14
|
+
export * from "./extern";
|