@burnt-labs/xion-types 16.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.
- package/README.md +111 -0
- package/package.json +26 -0
- package/types/.gitkeep +0 -0
- package/types/generated/amino/amino.ts +9 -0
- package/types/generated/cosmos/app/v1alpha1/config.ts +336 -0
- package/types/generated/cosmos/app/v1alpha1/query.ts +265 -0
- package/types/generated/cosmos/auth/v1beta1/auth.ts +520 -0
- package/types/generated/cosmos/auth/v1beta1/query.ts +1852 -0
- package/types/generated/cosmos/authz/v1beta1/authz.ts +404 -0
- package/types/generated/cosmos/authz/v1beta1/query.ts +774 -0
- package/types/generated/cosmos/autocli/v1/options.ts +1016 -0
- package/types/generated/cosmos/autocli/v1/query.ts +379 -0
- package/types/generated/cosmos/bank/v1beta1/bank.ts +752 -0
- package/types/generated/cosmos/bank/v1beta1/query.ts +2789 -0
- package/types/generated/cosmos/base/abci/v1beta1/abci.ts +1447 -0
- package/types/generated/cosmos/base/node/v1beta1/query.ts +587 -0
- package/types/generated/cosmos/base/query/v1beta1/pagination.ts +317 -0
- package/types/generated/cosmos/base/tendermint/v1beta1/query.ts +2228 -0
- package/types/generated/cosmos/base/tendermint/v1beta1/types.ts +522 -0
- package/types/generated/cosmos/base/v1beta1/coin.ts +326 -0
- package/types/generated/cosmos/circuit/v1/query.ts +606 -0
- package/types/generated/cosmos/circuit/v1/types.ts +353 -0
- package/types/generated/cosmos/consensus/v1/query.ts +271 -0
- package/types/generated/cosmos/crypto/multisig/v1beta1/multisig.ts +212 -0
- package/types/generated/cosmos/distribution/v1beta1/distribution.ts +1143 -0
- package/types/generated/cosmos/distribution/v1beta1/query.ts +2005 -0
- package/types/generated/cosmos/evidence/v1beta1/query.ts +526 -0
- package/types/generated/cosmos/feegrant/v1beta1/feegrant.ts +502 -0
- package/types/generated/cosmos/feegrant/v1beta1/query.ts +725 -0
- package/types/generated/cosmos/gov/v1/gov.ts +1656 -0
- package/types/generated/cosmos/gov/v1/query.ts +1847 -0
- package/types/generated/cosmos/gov/v1beta1/gov.ts +1239 -0
- package/types/generated/cosmos/gov/v1beta1/query.ts +1658 -0
- package/types/generated/cosmos/group/v1/query.ts +2840 -0
- package/types/generated/cosmos/group/v1/types.ts +1803 -0
- package/types/generated/cosmos/ics23/v1/proofs.ts +1685 -0
- package/types/generated/cosmos/mint/v1beta1/mint.ts +273 -0
- package/types/generated/cosmos/mint/v1beta1/query.ts +589 -0
- package/types/generated/cosmos/msg/v1/msg.ts +9 -0
- package/types/generated/cosmos/nft/v1beta1/nft.ts +333 -0
- package/types/generated/cosmos/nft/v1beta1/query.ts +1362 -0
- package/types/generated/cosmos/orm/query/v1alpha1/query.ts +1016 -0
- package/types/generated/cosmos/params/v1beta1/params.ts +227 -0
- package/types/generated/cosmos/params/v1beta1/query.ts +545 -0
- package/types/generated/cosmos/query/v1/query.ts +9 -0
- package/types/generated/cosmos/slashing/v1beta1/query.ts +626 -0
- package/types/generated/cosmos/slashing/v1beta1/slashing.ts +409 -0
- package/types/generated/cosmos/staking/v1beta1/query.ts +2912 -0
- package/types/generated/cosmos/staking/v1beta1/staking.ts +2515 -0
- package/types/generated/cosmos/tx/signing/v1beta1/signing.ts +608 -0
- package/types/generated/cosmos/tx/v1beta1/service.ts +2111 -0
- package/types/generated/cosmos/tx/v1beta1/tx.ts +1613 -0
- package/types/generated/cosmos/upgrade/v1beta1/query.ts +1007 -0
- package/types/generated/cosmos/upgrade/v1beta1/upgrade.ts +507 -0
- package/types/generated/cosmos_proto/cosmos.ts +299 -0
- package/types/generated/cosmwasm/wasm/v1/query.ts +2984 -0
- package/types/generated/cosmwasm/wasm/v1/types.ts +962 -0
- package/types/generated/gogoproto/gogo.ts +9 -0
- package/types/generated/google/api/annotations.ts +9 -0
- package/types/generated/google/api/http.ts +757 -0
- package/types/generated/google/protobuf/any.ts +253 -0
- package/types/generated/google/protobuf/descriptor.ts +4958 -0
- package/types/generated/google/protobuf/duration.ts +186 -0
- package/types/generated/google/protobuf/timestamp.ts +215 -0
- package/types/generated/ibc/applications/fee/v1/fee.ts +391 -0
- package/types/generated/ibc/applications/fee/v1/genesis.ts +553 -0
- package/types/generated/ibc/applications/fee/v1/query.ts +2056 -0
- package/types/generated/ibc/applications/interchain_accounts/controller/v1/controller.ts +100 -0
- package/types/generated/ibc/applications/interchain_accounts/controller/v1/query.ts +447 -0
- package/types/generated/ibc/applications/interchain_accounts/host/v1/host.ts +235 -0
- package/types/generated/ibc/applications/interchain_accounts/host/v1/query.ts +265 -0
- package/types/generated/ibc/applications/transfer/v1/query.ts +1135 -0
- package/types/generated/ibc/applications/transfer/v1/transfer.ts +213 -0
- package/types/generated/ibc/core/channel/v1/channel.ts +1329 -0
- package/types/generated/ibc/core/channel/v1/query.ts +4214 -0
- package/types/generated/ibc/core/channel/v1/upgrade.ts +330 -0
- package/types/generated/ibc/core/client/v1/client.ts +726 -0
- package/types/generated/ibc/core/client/v1/query.ts +2208 -0
- package/types/generated/ibc/core/commitment/v1/commitment.ts +329 -0
- package/types/generated/ibc/core/connection/v1/connection.ts +813 -0
- package/types/generated/ibc/core/connection/v1/query.ts +1442 -0
- package/types/generated/ibc/lightclients/wasm/v1/query.ts +484 -0
- package/types/generated/tendermint/abci/types.ts +6429 -0
- package/types/generated/tendermint/crypto/keys.ts +137 -0
- package/types/generated/tendermint/crypto/proof.ts +506 -0
- package/types/generated/tendermint/p2p/types.ts +514 -0
- package/types/generated/tendermint/types/block.ts +151 -0
- package/types/generated/tendermint/types/evidence.ts +493 -0
- package/types/generated/tendermint/types/params.ts +687 -0
- package/types/generated/tendermint/types/types.ts +2069 -0
- package/types/generated/tendermint/types/validator.ts +409 -0
- package/types/generated/tendermint/version/types.ts +202 -0
- package/types/generated/xion/globalfee/v1/genesis.ts +219 -0
- package/types/generated/xion/globalfee/v1/query.ts +269 -0
- package/types/generated/xion/jwk/v1/audience.ts +188 -0
- package/types/generated/xion/jwk/v1/params.ts +118 -0
- package/types/generated/xion/jwk/v1/query.ts +1061 -0
- package/types/generated/xion/mint/v1/mint.ts +273 -0
- package/types/generated/xion/mint/v1/query.ts +589 -0
- package/types/generated/xion/v1/query.ts +878 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: cosmos/slashing/v1beta1/slashing.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import Long from "long";
|
|
9
|
+
import _m0 from "protobufjs/minimal";
|
|
10
|
+
import { Duration } from "../../../google/protobuf/duration";
|
|
11
|
+
import { Timestamp } from "../../../google/protobuf/timestamp";
|
|
12
|
+
|
|
13
|
+
export const protobufPackage = "cosmos.slashing.v1beta1";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ValidatorSigningInfo defines a validator's signing info for monitoring their
|
|
17
|
+
* liveness activity.
|
|
18
|
+
*/
|
|
19
|
+
export interface ValidatorSigningInfo {
|
|
20
|
+
address: string;
|
|
21
|
+
/** Height at which validator was first a candidate OR was un-jailed */
|
|
22
|
+
startHeight: Long;
|
|
23
|
+
/**
|
|
24
|
+
* Index which is incremented every time a validator is bonded in a block and
|
|
25
|
+
* _may_ have signed a pre-commit or not. This in conjunction with the
|
|
26
|
+
* signed_blocks_window param determines the index in the missed block bitmap.
|
|
27
|
+
*/
|
|
28
|
+
indexOffset: Long;
|
|
29
|
+
/** Timestamp until which the validator is jailed due to liveness downtime. */
|
|
30
|
+
jailedUntil?:
|
|
31
|
+
| Date
|
|
32
|
+
| undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Whether or not a validator has been tombstoned (killed out of validator
|
|
35
|
+
* set). It is set once the validator commits an equivocation or for any other
|
|
36
|
+
* configured misbehavior.
|
|
37
|
+
*/
|
|
38
|
+
tombstoned: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* A counter of missed (unsigned) blocks. It is used to avoid unnecessary
|
|
41
|
+
* reads in the missed block bitmap.
|
|
42
|
+
*/
|
|
43
|
+
missedBlocksCounter: Long;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Params represents the parameters used for by the slashing module. */
|
|
47
|
+
export interface Params {
|
|
48
|
+
signedBlocksWindow: Long;
|
|
49
|
+
minSignedPerWindow: Uint8Array;
|
|
50
|
+
downtimeJailDuration?: Duration | undefined;
|
|
51
|
+
slashFractionDoubleSign: Uint8Array;
|
|
52
|
+
slashFractionDowntime: Uint8Array;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function createBaseValidatorSigningInfo(): ValidatorSigningInfo {
|
|
56
|
+
return {
|
|
57
|
+
address: "",
|
|
58
|
+
startHeight: Long.ZERO,
|
|
59
|
+
indexOffset: Long.ZERO,
|
|
60
|
+
jailedUntil: undefined,
|
|
61
|
+
tombstoned: false,
|
|
62
|
+
missedBlocksCounter: Long.ZERO,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const ValidatorSigningInfo = {
|
|
67
|
+
encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
68
|
+
if (message.address !== "") {
|
|
69
|
+
writer.uint32(10).string(message.address);
|
|
70
|
+
}
|
|
71
|
+
if (!message.startHeight.equals(Long.ZERO)) {
|
|
72
|
+
writer.uint32(16).int64(message.startHeight);
|
|
73
|
+
}
|
|
74
|
+
if (!message.indexOffset.equals(Long.ZERO)) {
|
|
75
|
+
writer.uint32(24).int64(message.indexOffset);
|
|
76
|
+
}
|
|
77
|
+
if (message.jailedUntil !== undefined) {
|
|
78
|
+
Timestamp.encode(toTimestamp(message.jailedUntil), writer.uint32(34).fork()).ldelim();
|
|
79
|
+
}
|
|
80
|
+
if (message.tombstoned !== false) {
|
|
81
|
+
writer.uint32(40).bool(message.tombstoned);
|
|
82
|
+
}
|
|
83
|
+
if (!message.missedBlocksCounter.equals(Long.ZERO)) {
|
|
84
|
+
writer.uint32(48).int64(message.missedBlocksCounter);
|
|
85
|
+
}
|
|
86
|
+
return writer;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo {
|
|
90
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
91
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
92
|
+
const message = createBaseValidatorSigningInfo();
|
|
93
|
+
while (reader.pos < end) {
|
|
94
|
+
const tag = reader.uint32();
|
|
95
|
+
switch (tag >>> 3) {
|
|
96
|
+
case 1:
|
|
97
|
+
if (tag !== 10) {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message.address = reader.string();
|
|
102
|
+
continue;
|
|
103
|
+
case 2:
|
|
104
|
+
if (tag !== 16) {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message.startHeight = reader.int64() as Long;
|
|
109
|
+
continue;
|
|
110
|
+
case 3:
|
|
111
|
+
if (tag !== 24) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message.indexOffset = reader.int64() as Long;
|
|
116
|
+
continue;
|
|
117
|
+
case 4:
|
|
118
|
+
if (tag !== 34) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message.jailedUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
123
|
+
continue;
|
|
124
|
+
case 5:
|
|
125
|
+
if (tag !== 40) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message.tombstoned = reader.bool();
|
|
130
|
+
continue;
|
|
131
|
+
case 6:
|
|
132
|
+
if (tag !== 48) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message.missedBlocksCounter = reader.int64() as Long;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
reader.skipType(tag & 7);
|
|
143
|
+
}
|
|
144
|
+
return message;
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
fromJSON(object: any): ValidatorSigningInfo {
|
|
148
|
+
return {
|
|
149
|
+
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
150
|
+
startHeight: isSet(object.startHeight) ? Long.fromValue(object.startHeight) : Long.ZERO,
|
|
151
|
+
indexOffset: isSet(object.indexOffset) ? Long.fromValue(object.indexOffset) : Long.ZERO,
|
|
152
|
+
jailedUntil: isSet(object.jailedUntil) ? fromJsonTimestamp(object.jailedUntil) : undefined,
|
|
153
|
+
tombstoned: isSet(object.tombstoned) ? globalThis.Boolean(object.tombstoned) : false,
|
|
154
|
+
missedBlocksCounter: isSet(object.missedBlocksCounter) ? Long.fromValue(object.missedBlocksCounter) : Long.ZERO,
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
toJSON(message: ValidatorSigningInfo): unknown {
|
|
159
|
+
const obj: any = {};
|
|
160
|
+
if (message.address !== "") {
|
|
161
|
+
obj.address = message.address;
|
|
162
|
+
}
|
|
163
|
+
if (!message.startHeight.equals(Long.ZERO)) {
|
|
164
|
+
obj.startHeight = (message.startHeight || Long.ZERO).toString();
|
|
165
|
+
}
|
|
166
|
+
if (!message.indexOffset.equals(Long.ZERO)) {
|
|
167
|
+
obj.indexOffset = (message.indexOffset || Long.ZERO).toString();
|
|
168
|
+
}
|
|
169
|
+
if (message.jailedUntil !== undefined) {
|
|
170
|
+
obj.jailedUntil = message.jailedUntil.toISOString();
|
|
171
|
+
}
|
|
172
|
+
if (message.tombstoned !== false) {
|
|
173
|
+
obj.tombstoned = message.tombstoned;
|
|
174
|
+
}
|
|
175
|
+
if (!message.missedBlocksCounter.equals(Long.ZERO)) {
|
|
176
|
+
obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString();
|
|
177
|
+
}
|
|
178
|
+
return obj;
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
create<I extends Exact<DeepPartial<ValidatorSigningInfo>, I>>(base?: I): ValidatorSigningInfo {
|
|
182
|
+
return ValidatorSigningInfo.fromPartial(base ?? ({} as any));
|
|
183
|
+
},
|
|
184
|
+
fromPartial<I extends Exact<DeepPartial<ValidatorSigningInfo>, I>>(object: I): ValidatorSigningInfo {
|
|
185
|
+
const message = createBaseValidatorSigningInfo();
|
|
186
|
+
message.address = object.address ?? "";
|
|
187
|
+
message.startHeight = (object.startHeight !== undefined && object.startHeight !== null)
|
|
188
|
+
? Long.fromValue(object.startHeight)
|
|
189
|
+
: Long.ZERO;
|
|
190
|
+
message.indexOffset = (object.indexOffset !== undefined && object.indexOffset !== null)
|
|
191
|
+
? Long.fromValue(object.indexOffset)
|
|
192
|
+
: Long.ZERO;
|
|
193
|
+
message.jailedUntil = object.jailedUntil ?? undefined;
|
|
194
|
+
message.tombstoned = object.tombstoned ?? false;
|
|
195
|
+
message.missedBlocksCounter = (object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null)
|
|
196
|
+
? Long.fromValue(object.missedBlocksCounter)
|
|
197
|
+
: Long.ZERO;
|
|
198
|
+
return message;
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
function createBaseParams(): Params {
|
|
203
|
+
return {
|
|
204
|
+
signedBlocksWindow: Long.ZERO,
|
|
205
|
+
minSignedPerWindow: new Uint8Array(0),
|
|
206
|
+
downtimeJailDuration: undefined,
|
|
207
|
+
slashFractionDoubleSign: new Uint8Array(0),
|
|
208
|
+
slashFractionDowntime: new Uint8Array(0),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export const Params = {
|
|
213
|
+
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
214
|
+
if (!message.signedBlocksWindow.equals(Long.ZERO)) {
|
|
215
|
+
writer.uint32(8).int64(message.signedBlocksWindow);
|
|
216
|
+
}
|
|
217
|
+
if (message.minSignedPerWindow.length !== 0) {
|
|
218
|
+
writer.uint32(18).bytes(message.minSignedPerWindow);
|
|
219
|
+
}
|
|
220
|
+
if (message.downtimeJailDuration !== undefined) {
|
|
221
|
+
Duration.encode(message.downtimeJailDuration, writer.uint32(26).fork()).ldelim();
|
|
222
|
+
}
|
|
223
|
+
if (message.slashFractionDoubleSign.length !== 0) {
|
|
224
|
+
writer.uint32(34).bytes(message.slashFractionDoubleSign);
|
|
225
|
+
}
|
|
226
|
+
if (message.slashFractionDowntime.length !== 0) {
|
|
227
|
+
writer.uint32(42).bytes(message.slashFractionDowntime);
|
|
228
|
+
}
|
|
229
|
+
return writer;
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
|
|
233
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
234
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
235
|
+
const message = createBaseParams();
|
|
236
|
+
while (reader.pos < end) {
|
|
237
|
+
const tag = reader.uint32();
|
|
238
|
+
switch (tag >>> 3) {
|
|
239
|
+
case 1:
|
|
240
|
+
if (tag !== 8) {
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
message.signedBlocksWindow = reader.int64() as Long;
|
|
245
|
+
continue;
|
|
246
|
+
case 2:
|
|
247
|
+
if (tag !== 18) {
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
message.minSignedPerWindow = reader.bytes();
|
|
252
|
+
continue;
|
|
253
|
+
case 3:
|
|
254
|
+
if (tag !== 26) {
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
message.downtimeJailDuration = Duration.decode(reader, reader.uint32());
|
|
259
|
+
continue;
|
|
260
|
+
case 4:
|
|
261
|
+
if (tag !== 34) {
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
message.slashFractionDoubleSign = reader.bytes();
|
|
266
|
+
continue;
|
|
267
|
+
case 5:
|
|
268
|
+
if (tag !== 42) {
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
message.slashFractionDowntime = reader.bytes();
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
reader.skipType(tag & 7);
|
|
279
|
+
}
|
|
280
|
+
return message;
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
fromJSON(object: any): Params {
|
|
284
|
+
return {
|
|
285
|
+
signedBlocksWindow: isSet(object.signedBlocksWindow) ? Long.fromValue(object.signedBlocksWindow) : Long.ZERO,
|
|
286
|
+
minSignedPerWindow: isSet(object.minSignedPerWindow)
|
|
287
|
+
? bytesFromBase64(object.minSignedPerWindow)
|
|
288
|
+
: new Uint8Array(0),
|
|
289
|
+
downtimeJailDuration: isSet(object.downtimeJailDuration)
|
|
290
|
+
? Duration.fromJSON(object.downtimeJailDuration)
|
|
291
|
+
: undefined,
|
|
292
|
+
slashFractionDoubleSign: isSet(object.slashFractionDoubleSign)
|
|
293
|
+
? bytesFromBase64(object.slashFractionDoubleSign)
|
|
294
|
+
: new Uint8Array(0),
|
|
295
|
+
slashFractionDowntime: isSet(object.slashFractionDowntime)
|
|
296
|
+
? bytesFromBase64(object.slashFractionDowntime)
|
|
297
|
+
: new Uint8Array(0),
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
toJSON(message: Params): unknown {
|
|
302
|
+
const obj: any = {};
|
|
303
|
+
if (!message.signedBlocksWindow.equals(Long.ZERO)) {
|
|
304
|
+
obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString();
|
|
305
|
+
}
|
|
306
|
+
if (message.minSignedPerWindow.length !== 0) {
|
|
307
|
+
obj.minSignedPerWindow = base64FromBytes(message.minSignedPerWindow);
|
|
308
|
+
}
|
|
309
|
+
if (message.downtimeJailDuration !== undefined) {
|
|
310
|
+
obj.downtimeJailDuration = Duration.toJSON(message.downtimeJailDuration);
|
|
311
|
+
}
|
|
312
|
+
if (message.slashFractionDoubleSign.length !== 0) {
|
|
313
|
+
obj.slashFractionDoubleSign = base64FromBytes(message.slashFractionDoubleSign);
|
|
314
|
+
}
|
|
315
|
+
if (message.slashFractionDowntime.length !== 0) {
|
|
316
|
+
obj.slashFractionDowntime = base64FromBytes(message.slashFractionDowntime);
|
|
317
|
+
}
|
|
318
|
+
return obj;
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
create<I extends Exact<DeepPartial<Params>, I>>(base?: I): Params {
|
|
322
|
+
return Params.fromPartial(base ?? ({} as any));
|
|
323
|
+
},
|
|
324
|
+
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
|
|
325
|
+
const message = createBaseParams();
|
|
326
|
+
message.signedBlocksWindow = (object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null)
|
|
327
|
+
? Long.fromValue(object.signedBlocksWindow)
|
|
328
|
+
: Long.ZERO;
|
|
329
|
+
message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array(0);
|
|
330
|
+
message.downtimeJailDuration = (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null)
|
|
331
|
+
? Duration.fromPartial(object.downtimeJailDuration)
|
|
332
|
+
: undefined;
|
|
333
|
+
message.slashFractionDoubleSign = object.slashFractionDoubleSign ?? new Uint8Array(0);
|
|
334
|
+
message.slashFractionDowntime = object.slashFractionDowntime ?? new Uint8Array(0);
|
|
335
|
+
return message;
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
function bytesFromBase64(b64: string): Uint8Array {
|
|
340
|
+
if ((globalThis as any).Buffer) {
|
|
341
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
342
|
+
} else {
|
|
343
|
+
const bin = globalThis.atob(b64);
|
|
344
|
+
const arr = new Uint8Array(bin.length);
|
|
345
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
346
|
+
arr[i] = bin.charCodeAt(i);
|
|
347
|
+
}
|
|
348
|
+
return arr;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function base64FromBytes(arr: Uint8Array): string {
|
|
353
|
+
if ((globalThis as any).Buffer) {
|
|
354
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
355
|
+
} else {
|
|
356
|
+
const bin: string[] = [];
|
|
357
|
+
arr.forEach((byte) => {
|
|
358
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
359
|
+
});
|
|
360
|
+
return globalThis.btoa(bin.join(""));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
365
|
+
|
|
366
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
367
|
+
: T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
368
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
369
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
370
|
+
: Partial<T>;
|
|
371
|
+
|
|
372
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
373
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
374
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
375
|
+
|
|
376
|
+
function toTimestamp(date: Date): Timestamp {
|
|
377
|
+
const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
|
|
378
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
379
|
+
return { seconds, nanos };
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function fromTimestamp(t: Timestamp): Date {
|
|
383
|
+
let millis = (t.seconds.toNumber() || 0) * 1_000;
|
|
384
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
385
|
+
return new globalThis.Date(millis);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function fromJsonTimestamp(o: any): Date {
|
|
389
|
+
if (o instanceof globalThis.Date) {
|
|
390
|
+
return o;
|
|
391
|
+
} else if (typeof o === "string") {
|
|
392
|
+
return new globalThis.Date(o);
|
|
393
|
+
} else {
|
|
394
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function numberToLong(number: number) {
|
|
399
|
+
return Long.fromNumber(number);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (_m0.util.Long !== Long) {
|
|
403
|
+
_m0.util.Long = Long as any;
|
|
404
|
+
_m0.configure();
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function isSet(value: any): boolean {
|
|
408
|
+
return value !== null && value !== undefined;
|
|
409
|
+
}
|