@burnt-labs/xion-types 16.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/package.json +7 -20
  2. package/README.md +0 -111
  3. package/types/.gitkeep +0 -0
  4. package/types/generated/amino/amino.ts +0 -9
  5. package/types/generated/cosmos/app/v1alpha1/config.ts +0 -336
  6. package/types/generated/cosmos/app/v1alpha1/query.ts +0 -265
  7. package/types/generated/cosmos/auth/v1beta1/auth.ts +0 -520
  8. package/types/generated/cosmos/auth/v1beta1/query.ts +0 -1852
  9. package/types/generated/cosmos/authz/v1beta1/authz.ts +0 -404
  10. package/types/generated/cosmos/authz/v1beta1/query.ts +0 -774
  11. package/types/generated/cosmos/autocli/v1/options.ts +0 -1016
  12. package/types/generated/cosmos/autocli/v1/query.ts +0 -379
  13. package/types/generated/cosmos/bank/v1beta1/bank.ts +0 -752
  14. package/types/generated/cosmos/bank/v1beta1/query.ts +0 -2789
  15. package/types/generated/cosmos/base/abci/v1beta1/abci.ts +0 -1447
  16. package/types/generated/cosmos/base/node/v1beta1/query.ts +0 -587
  17. package/types/generated/cosmos/base/query/v1beta1/pagination.ts +0 -317
  18. package/types/generated/cosmos/base/tendermint/v1beta1/query.ts +0 -2228
  19. package/types/generated/cosmos/base/tendermint/v1beta1/types.ts +0 -522
  20. package/types/generated/cosmos/base/v1beta1/coin.ts +0 -326
  21. package/types/generated/cosmos/circuit/v1/query.ts +0 -606
  22. package/types/generated/cosmos/circuit/v1/types.ts +0 -353
  23. package/types/generated/cosmos/consensus/v1/query.ts +0 -271
  24. package/types/generated/cosmos/crypto/multisig/v1beta1/multisig.ts +0 -212
  25. package/types/generated/cosmos/distribution/v1beta1/distribution.ts +0 -1143
  26. package/types/generated/cosmos/distribution/v1beta1/query.ts +0 -2005
  27. package/types/generated/cosmos/evidence/v1beta1/query.ts +0 -526
  28. package/types/generated/cosmos/feegrant/v1beta1/feegrant.ts +0 -502
  29. package/types/generated/cosmos/feegrant/v1beta1/query.ts +0 -725
  30. package/types/generated/cosmos/gov/v1/gov.ts +0 -1656
  31. package/types/generated/cosmos/gov/v1/query.ts +0 -1847
  32. package/types/generated/cosmos/gov/v1beta1/gov.ts +0 -1239
  33. package/types/generated/cosmos/gov/v1beta1/query.ts +0 -1658
  34. package/types/generated/cosmos/group/v1/query.ts +0 -2840
  35. package/types/generated/cosmos/group/v1/types.ts +0 -1803
  36. package/types/generated/cosmos/ics23/v1/proofs.ts +0 -1685
  37. package/types/generated/cosmos/mint/v1beta1/mint.ts +0 -273
  38. package/types/generated/cosmos/mint/v1beta1/query.ts +0 -589
  39. package/types/generated/cosmos/msg/v1/msg.ts +0 -9
  40. package/types/generated/cosmos/nft/v1beta1/nft.ts +0 -333
  41. package/types/generated/cosmos/nft/v1beta1/query.ts +0 -1362
  42. package/types/generated/cosmos/orm/query/v1alpha1/query.ts +0 -1016
  43. package/types/generated/cosmos/params/v1beta1/params.ts +0 -227
  44. package/types/generated/cosmos/params/v1beta1/query.ts +0 -545
  45. package/types/generated/cosmos/query/v1/query.ts +0 -9
  46. package/types/generated/cosmos/slashing/v1beta1/query.ts +0 -626
  47. package/types/generated/cosmos/slashing/v1beta1/slashing.ts +0 -409
  48. package/types/generated/cosmos/staking/v1beta1/query.ts +0 -2912
  49. package/types/generated/cosmos/staking/v1beta1/staking.ts +0 -2515
  50. package/types/generated/cosmos/tx/signing/v1beta1/signing.ts +0 -608
  51. package/types/generated/cosmos/tx/v1beta1/service.ts +0 -2111
  52. package/types/generated/cosmos/tx/v1beta1/tx.ts +0 -1613
  53. package/types/generated/cosmos/upgrade/v1beta1/query.ts +0 -1007
  54. package/types/generated/cosmos/upgrade/v1beta1/upgrade.ts +0 -507
  55. package/types/generated/cosmos_proto/cosmos.ts +0 -299
  56. package/types/generated/cosmwasm/wasm/v1/query.ts +0 -2984
  57. package/types/generated/cosmwasm/wasm/v1/types.ts +0 -962
  58. package/types/generated/gogoproto/gogo.ts +0 -9
  59. package/types/generated/google/api/annotations.ts +0 -9
  60. package/types/generated/google/api/http.ts +0 -757
  61. package/types/generated/google/protobuf/any.ts +0 -253
  62. package/types/generated/google/protobuf/descriptor.ts +0 -4958
  63. package/types/generated/google/protobuf/duration.ts +0 -186
  64. package/types/generated/google/protobuf/timestamp.ts +0 -215
  65. package/types/generated/ibc/applications/fee/v1/fee.ts +0 -391
  66. package/types/generated/ibc/applications/fee/v1/genesis.ts +0 -553
  67. package/types/generated/ibc/applications/fee/v1/query.ts +0 -2056
  68. package/types/generated/ibc/applications/interchain_accounts/controller/v1/controller.ts +0 -100
  69. package/types/generated/ibc/applications/interchain_accounts/controller/v1/query.ts +0 -447
  70. package/types/generated/ibc/applications/interchain_accounts/host/v1/host.ts +0 -235
  71. package/types/generated/ibc/applications/interchain_accounts/host/v1/query.ts +0 -265
  72. package/types/generated/ibc/applications/transfer/v1/query.ts +0 -1135
  73. package/types/generated/ibc/applications/transfer/v1/transfer.ts +0 -213
  74. package/types/generated/ibc/core/channel/v1/channel.ts +0 -1329
  75. package/types/generated/ibc/core/channel/v1/query.ts +0 -4214
  76. package/types/generated/ibc/core/channel/v1/upgrade.ts +0 -330
  77. package/types/generated/ibc/core/client/v1/client.ts +0 -726
  78. package/types/generated/ibc/core/client/v1/query.ts +0 -2208
  79. package/types/generated/ibc/core/commitment/v1/commitment.ts +0 -329
  80. package/types/generated/ibc/core/connection/v1/connection.ts +0 -813
  81. package/types/generated/ibc/core/connection/v1/query.ts +0 -1442
  82. package/types/generated/ibc/lightclients/wasm/v1/query.ts +0 -484
  83. package/types/generated/tendermint/abci/types.ts +0 -6429
  84. package/types/generated/tendermint/crypto/keys.ts +0 -137
  85. package/types/generated/tendermint/crypto/proof.ts +0 -506
  86. package/types/generated/tendermint/p2p/types.ts +0 -514
  87. package/types/generated/tendermint/types/block.ts +0 -151
  88. package/types/generated/tendermint/types/evidence.ts +0 -493
  89. package/types/generated/tendermint/types/params.ts +0 -687
  90. package/types/generated/tendermint/types/types.ts +0 -2069
  91. package/types/generated/tendermint/types/validator.ts +0 -409
  92. package/types/generated/tendermint/version/types.ts +0 -202
  93. package/types/generated/xion/globalfee/v1/genesis.ts +0 -219
  94. package/types/generated/xion/globalfee/v1/query.ts +0 -269
  95. package/types/generated/xion/jwk/v1/audience.ts +0 -188
  96. package/types/generated/xion/jwk/v1/params.ts +0 -118
  97. package/types/generated/xion/jwk/v1/query.ts +0 -1061
  98. package/types/generated/xion/mint/v1/mint.ts +0 -273
  99. package/types/generated/xion/mint/v1/query.ts +0 -589
  100. package/types/generated/xion/v1/query.ts +0 -878
@@ -1,1329 +0,0 @@
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: ibc/core/channel/v1/channel.proto
6
-
7
- /* eslint-disable */
8
- import Long from "long";
9
- import _m0 from "protobufjs/minimal";
10
- import { Height } from "../../client/v1/client";
11
-
12
- export const protobufPackage = "ibc.core.channel.v1";
13
-
14
- /**
15
- * State defines if a channel is in one of the following states:
16
- * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED.
17
- */
18
- export enum State {
19
- /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */
20
- STATE_UNINITIALIZED_UNSPECIFIED = 0,
21
- /** STATE_INIT - A channel has just started the opening handshake. */
22
- STATE_INIT = 1,
23
- /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */
24
- STATE_TRYOPEN = 2,
25
- /**
26
- * STATE_OPEN - A channel has completed the handshake. Open channels are
27
- * ready to send and receive packets.
28
- */
29
- STATE_OPEN = 3,
30
- /**
31
- * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive
32
- * packets.
33
- */
34
- STATE_CLOSED = 4,
35
- /** STATE_FLUSHING - A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. */
36
- STATE_FLUSHING = 5,
37
- /** STATE_FLUSHCOMPLETE - A channel has just completed flushing any in-flight packets. */
38
- STATE_FLUSHCOMPLETE = 6,
39
- UNRECOGNIZED = -1,
40
- }
41
-
42
- export function stateFromJSON(object: any): State {
43
- switch (object) {
44
- case 0:
45
- case "STATE_UNINITIALIZED_UNSPECIFIED":
46
- return State.STATE_UNINITIALIZED_UNSPECIFIED;
47
- case 1:
48
- case "STATE_INIT":
49
- return State.STATE_INIT;
50
- case 2:
51
- case "STATE_TRYOPEN":
52
- return State.STATE_TRYOPEN;
53
- case 3:
54
- case "STATE_OPEN":
55
- return State.STATE_OPEN;
56
- case 4:
57
- case "STATE_CLOSED":
58
- return State.STATE_CLOSED;
59
- case 5:
60
- case "STATE_FLUSHING":
61
- return State.STATE_FLUSHING;
62
- case 6:
63
- case "STATE_FLUSHCOMPLETE":
64
- return State.STATE_FLUSHCOMPLETE;
65
- case -1:
66
- case "UNRECOGNIZED":
67
- default:
68
- return State.UNRECOGNIZED;
69
- }
70
- }
71
-
72
- export function stateToJSON(object: State): string {
73
- switch (object) {
74
- case State.STATE_UNINITIALIZED_UNSPECIFIED:
75
- return "STATE_UNINITIALIZED_UNSPECIFIED";
76
- case State.STATE_INIT:
77
- return "STATE_INIT";
78
- case State.STATE_TRYOPEN:
79
- return "STATE_TRYOPEN";
80
- case State.STATE_OPEN:
81
- return "STATE_OPEN";
82
- case State.STATE_CLOSED:
83
- return "STATE_CLOSED";
84
- case State.STATE_FLUSHING:
85
- return "STATE_FLUSHING";
86
- case State.STATE_FLUSHCOMPLETE:
87
- return "STATE_FLUSHCOMPLETE";
88
- case State.UNRECOGNIZED:
89
- default:
90
- return "UNRECOGNIZED";
91
- }
92
- }
93
-
94
- /** Order defines if a channel is ORDERED or UNORDERED */
95
- export enum Order {
96
- /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */
97
- ORDER_NONE_UNSPECIFIED = 0,
98
- /**
99
- * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in
100
- * which they were sent.
101
- */
102
- ORDER_UNORDERED = 1,
103
- /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */
104
- ORDER_ORDERED = 2,
105
- UNRECOGNIZED = -1,
106
- }
107
-
108
- export function orderFromJSON(object: any): Order {
109
- switch (object) {
110
- case 0:
111
- case "ORDER_NONE_UNSPECIFIED":
112
- return Order.ORDER_NONE_UNSPECIFIED;
113
- case 1:
114
- case "ORDER_UNORDERED":
115
- return Order.ORDER_UNORDERED;
116
- case 2:
117
- case "ORDER_ORDERED":
118
- return Order.ORDER_ORDERED;
119
- case -1:
120
- case "UNRECOGNIZED":
121
- default:
122
- return Order.UNRECOGNIZED;
123
- }
124
- }
125
-
126
- export function orderToJSON(object: Order): string {
127
- switch (object) {
128
- case Order.ORDER_NONE_UNSPECIFIED:
129
- return "ORDER_NONE_UNSPECIFIED";
130
- case Order.ORDER_UNORDERED:
131
- return "ORDER_UNORDERED";
132
- case Order.ORDER_ORDERED:
133
- return "ORDER_ORDERED";
134
- case Order.UNRECOGNIZED:
135
- default:
136
- return "UNRECOGNIZED";
137
- }
138
- }
139
-
140
- /**
141
- * Channel defines pipeline for exactly-once packet delivery between specific
142
- * modules on separate blockchains, which has at least one end capable of
143
- * sending packets and one end capable of receiving packets.
144
- */
145
- export interface Channel {
146
- /** current state of the channel end */
147
- state: State;
148
- /** whether the channel is ordered or unordered */
149
- ordering: Order;
150
- /** counterparty channel end */
151
- counterparty?:
152
- | Counterparty
153
- | undefined;
154
- /**
155
- * list of connection identifiers, in order, along which packets sent on
156
- * this channel will travel
157
- */
158
- connectionHops: string[];
159
- /** opaque channel version, which is agreed upon during the handshake */
160
- version: string;
161
- /**
162
- * upgrade sequence indicates the latest upgrade attempt performed by this channel
163
- * the value of 0 indicates the channel has never been upgraded
164
- */
165
- upgradeSequence: Long;
166
- }
167
-
168
- /**
169
- * IdentifiedChannel defines a channel with additional port and channel
170
- * identifier fields.
171
- */
172
- export interface IdentifiedChannel {
173
- /** current state of the channel end */
174
- state: State;
175
- /** whether the channel is ordered or unordered */
176
- ordering: Order;
177
- /** counterparty channel end */
178
- counterparty?:
179
- | Counterparty
180
- | undefined;
181
- /**
182
- * list of connection identifiers, in order, along which packets sent on
183
- * this channel will travel
184
- */
185
- connectionHops: string[];
186
- /** opaque channel version, which is agreed upon during the handshake */
187
- version: string;
188
- /** port identifier */
189
- portId: string;
190
- /** channel identifier */
191
- channelId: string;
192
- /**
193
- * upgrade sequence indicates the latest upgrade attempt performed by this channel
194
- * the value of 0 indicates the channel has never been upgraded
195
- */
196
- upgradeSequence: Long;
197
- }
198
-
199
- /** Counterparty defines a channel end counterparty */
200
- export interface Counterparty {
201
- /** port on the counterparty chain which owns the other end of the channel. */
202
- portId: string;
203
- /** channel end on the counterparty chain */
204
- channelId: string;
205
- }
206
-
207
- /** Packet defines a type that carries data across different chains through IBC */
208
- export interface Packet {
209
- /**
210
- * number corresponds to the order of sends and receives, where a Packet
211
- * with an earlier sequence number must be sent and received before a Packet
212
- * with a later sequence number.
213
- */
214
- sequence: Long;
215
- /** identifies the port on the sending chain. */
216
- sourcePort: string;
217
- /** identifies the channel end on the sending chain. */
218
- sourceChannel: string;
219
- /** identifies the port on the receiving chain. */
220
- destinationPort: string;
221
- /** identifies the channel end on the receiving chain. */
222
- destinationChannel: string;
223
- /** actual opaque bytes transferred directly to the application module */
224
- data: Uint8Array;
225
- /** block height after which the packet times out */
226
- timeoutHeight?:
227
- | Height
228
- | undefined;
229
- /** block timestamp (in nanoseconds) after which the packet times out */
230
- timeoutTimestamp: Long;
231
- }
232
-
233
- /**
234
- * PacketState defines the generic type necessary to retrieve and store
235
- * packet commitments, acknowledgements, and receipts.
236
- * Caller is responsible for knowing the context necessary to interpret this
237
- * state as a commitment, acknowledgement, or a receipt.
238
- */
239
- export interface PacketState {
240
- /** channel port identifier. */
241
- portId: string;
242
- /** channel unique identifier. */
243
- channelId: string;
244
- /** packet sequence. */
245
- sequence: Long;
246
- /** embedded data that represents packet state. */
247
- data: Uint8Array;
248
- }
249
-
250
- /**
251
- * PacketId is an identifer for a unique Packet
252
- * Source chains refer to packets by source port/channel
253
- * Destination chains refer to packets by destination port/channel
254
- */
255
- export interface PacketId {
256
- /** channel port identifier */
257
- portId: string;
258
- /** channel unique identifier */
259
- channelId: string;
260
- /** packet sequence */
261
- sequence: Long;
262
- }
263
-
264
- /**
265
- * Acknowledgement is the recommended acknowledgement format to be used by
266
- * app-specific protocols.
267
- * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
268
- * conflicts with other protobuf message formats used for acknowledgements.
269
- * The first byte of any message with this format will be the non-ASCII values
270
- * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
271
- * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope
272
- */
273
- export interface Acknowledgement {
274
- result?: Uint8Array | undefined;
275
- error?: string | undefined;
276
- }
277
-
278
- /**
279
- * Timeout defines an execution deadline structure for 04-channel handlers.
280
- * This includes packet lifecycle handlers as well as the upgrade handshake handlers.
281
- * A valid Timeout contains either one or both of a timestamp and block height (sequence).
282
- */
283
- export interface Timeout {
284
- /** block height after which the packet or upgrade times out */
285
- height?:
286
- | Height
287
- | undefined;
288
- /** block timestamp (in nanoseconds) after which the packet or upgrade times out */
289
- timestamp: Long;
290
- }
291
-
292
- /** Params defines the set of IBC channel parameters. */
293
- export interface Params {
294
- /** the relative timeout after which channel upgrades will time out. */
295
- upgradeTimeout?: Timeout | undefined;
296
- }
297
-
298
- function createBaseChannel(): Channel {
299
- return {
300
- state: 0,
301
- ordering: 0,
302
- counterparty: undefined,
303
- connectionHops: [],
304
- version: "",
305
- upgradeSequence: Long.UZERO,
306
- };
307
- }
308
-
309
- export const Channel = {
310
- encode(message: Channel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
311
- if (message.state !== 0) {
312
- writer.uint32(8).int32(message.state);
313
- }
314
- if (message.ordering !== 0) {
315
- writer.uint32(16).int32(message.ordering);
316
- }
317
- if (message.counterparty !== undefined) {
318
- Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();
319
- }
320
- for (const v of message.connectionHops) {
321
- writer.uint32(34).string(v!);
322
- }
323
- if (message.version !== "") {
324
- writer.uint32(42).string(message.version);
325
- }
326
- if (!message.upgradeSequence.equals(Long.UZERO)) {
327
- writer.uint32(48).uint64(message.upgradeSequence);
328
- }
329
- return writer;
330
- },
331
-
332
- decode(input: _m0.Reader | Uint8Array, length?: number): Channel {
333
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
334
- let end = length === undefined ? reader.len : reader.pos + length;
335
- const message = createBaseChannel();
336
- while (reader.pos < end) {
337
- const tag = reader.uint32();
338
- switch (tag >>> 3) {
339
- case 1:
340
- if (tag !== 8) {
341
- break;
342
- }
343
-
344
- message.state = reader.int32() as any;
345
- continue;
346
- case 2:
347
- if (tag !== 16) {
348
- break;
349
- }
350
-
351
- message.ordering = reader.int32() as any;
352
- continue;
353
- case 3:
354
- if (tag !== 26) {
355
- break;
356
- }
357
-
358
- message.counterparty = Counterparty.decode(reader, reader.uint32());
359
- continue;
360
- case 4:
361
- if (tag !== 34) {
362
- break;
363
- }
364
-
365
- message.connectionHops.push(reader.string());
366
- continue;
367
- case 5:
368
- if (tag !== 42) {
369
- break;
370
- }
371
-
372
- message.version = reader.string();
373
- continue;
374
- case 6:
375
- if (tag !== 48) {
376
- break;
377
- }
378
-
379
- message.upgradeSequence = reader.uint64() as Long;
380
- continue;
381
- }
382
- if ((tag & 7) === 4 || tag === 0) {
383
- break;
384
- }
385
- reader.skipType(tag & 7);
386
- }
387
- return message;
388
- },
389
-
390
- fromJSON(object: any): Channel {
391
- return {
392
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
393
- ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0,
394
- counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined,
395
- connectionHops: globalThis.Array.isArray(object?.connectionHops)
396
- ? object.connectionHops.map((e: any) => globalThis.String(e))
397
- : [],
398
- version: isSet(object.version) ? globalThis.String(object.version) : "",
399
- upgradeSequence: isSet(object.upgradeSequence) ? Long.fromValue(object.upgradeSequence) : Long.UZERO,
400
- };
401
- },
402
-
403
- toJSON(message: Channel): unknown {
404
- const obj: any = {};
405
- if (message.state !== 0) {
406
- obj.state = stateToJSON(message.state);
407
- }
408
- if (message.ordering !== 0) {
409
- obj.ordering = orderToJSON(message.ordering);
410
- }
411
- if (message.counterparty !== undefined) {
412
- obj.counterparty = Counterparty.toJSON(message.counterparty);
413
- }
414
- if (message.connectionHops?.length) {
415
- obj.connectionHops = message.connectionHops;
416
- }
417
- if (message.version !== "") {
418
- obj.version = message.version;
419
- }
420
- if (!message.upgradeSequence.equals(Long.UZERO)) {
421
- obj.upgradeSequence = (message.upgradeSequence || Long.UZERO).toString();
422
- }
423
- return obj;
424
- },
425
-
426
- create<I extends Exact<DeepPartial<Channel>, I>>(base?: I): Channel {
427
- return Channel.fromPartial(base ?? ({} as any));
428
- },
429
- fromPartial<I extends Exact<DeepPartial<Channel>, I>>(object: I): Channel {
430
- const message = createBaseChannel();
431
- message.state = object.state ?? 0;
432
- message.ordering = object.ordering ?? 0;
433
- message.counterparty = (object.counterparty !== undefined && object.counterparty !== null)
434
- ? Counterparty.fromPartial(object.counterparty)
435
- : undefined;
436
- message.connectionHops = object.connectionHops?.map((e) => e) || [];
437
- message.version = object.version ?? "";
438
- message.upgradeSequence = (object.upgradeSequence !== undefined && object.upgradeSequence !== null)
439
- ? Long.fromValue(object.upgradeSequence)
440
- : Long.UZERO;
441
- return message;
442
- },
443
- };
444
-
445
- function createBaseIdentifiedChannel(): IdentifiedChannel {
446
- return {
447
- state: 0,
448
- ordering: 0,
449
- counterparty: undefined,
450
- connectionHops: [],
451
- version: "",
452
- portId: "",
453
- channelId: "",
454
- upgradeSequence: Long.UZERO,
455
- };
456
- }
457
-
458
- export const IdentifiedChannel = {
459
- encode(message: IdentifiedChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
460
- if (message.state !== 0) {
461
- writer.uint32(8).int32(message.state);
462
- }
463
- if (message.ordering !== 0) {
464
- writer.uint32(16).int32(message.ordering);
465
- }
466
- if (message.counterparty !== undefined) {
467
- Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();
468
- }
469
- for (const v of message.connectionHops) {
470
- writer.uint32(34).string(v!);
471
- }
472
- if (message.version !== "") {
473
- writer.uint32(42).string(message.version);
474
- }
475
- if (message.portId !== "") {
476
- writer.uint32(50).string(message.portId);
477
- }
478
- if (message.channelId !== "") {
479
- writer.uint32(58).string(message.channelId);
480
- }
481
- if (!message.upgradeSequence.equals(Long.UZERO)) {
482
- writer.uint32(64).uint64(message.upgradeSequence);
483
- }
484
- return writer;
485
- },
486
-
487
- decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedChannel {
488
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
489
- let end = length === undefined ? reader.len : reader.pos + length;
490
- const message = createBaseIdentifiedChannel();
491
- while (reader.pos < end) {
492
- const tag = reader.uint32();
493
- switch (tag >>> 3) {
494
- case 1:
495
- if (tag !== 8) {
496
- break;
497
- }
498
-
499
- message.state = reader.int32() as any;
500
- continue;
501
- case 2:
502
- if (tag !== 16) {
503
- break;
504
- }
505
-
506
- message.ordering = reader.int32() as any;
507
- continue;
508
- case 3:
509
- if (tag !== 26) {
510
- break;
511
- }
512
-
513
- message.counterparty = Counterparty.decode(reader, reader.uint32());
514
- continue;
515
- case 4:
516
- if (tag !== 34) {
517
- break;
518
- }
519
-
520
- message.connectionHops.push(reader.string());
521
- continue;
522
- case 5:
523
- if (tag !== 42) {
524
- break;
525
- }
526
-
527
- message.version = reader.string();
528
- continue;
529
- case 6:
530
- if (tag !== 50) {
531
- break;
532
- }
533
-
534
- message.portId = reader.string();
535
- continue;
536
- case 7:
537
- if (tag !== 58) {
538
- break;
539
- }
540
-
541
- message.channelId = reader.string();
542
- continue;
543
- case 8:
544
- if (tag !== 64) {
545
- break;
546
- }
547
-
548
- message.upgradeSequence = reader.uint64() as Long;
549
- continue;
550
- }
551
- if ((tag & 7) === 4 || tag === 0) {
552
- break;
553
- }
554
- reader.skipType(tag & 7);
555
- }
556
- return message;
557
- },
558
-
559
- fromJSON(object: any): IdentifiedChannel {
560
- return {
561
- state: isSet(object.state) ? stateFromJSON(object.state) : 0,
562
- ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : 0,
563
- counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined,
564
- connectionHops: globalThis.Array.isArray(object?.connectionHops)
565
- ? object.connectionHops.map((e: any) => globalThis.String(e))
566
- : [],
567
- version: isSet(object.version) ? globalThis.String(object.version) : "",
568
- portId: isSet(object.portId) ? globalThis.String(object.portId) : "",
569
- channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "",
570
- upgradeSequence: isSet(object.upgradeSequence) ? Long.fromValue(object.upgradeSequence) : Long.UZERO,
571
- };
572
- },
573
-
574
- toJSON(message: IdentifiedChannel): unknown {
575
- const obj: any = {};
576
- if (message.state !== 0) {
577
- obj.state = stateToJSON(message.state);
578
- }
579
- if (message.ordering !== 0) {
580
- obj.ordering = orderToJSON(message.ordering);
581
- }
582
- if (message.counterparty !== undefined) {
583
- obj.counterparty = Counterparty.toJSON(message.counterparty);
584
- }
585
- if (message.connectionHops?.length) {
586
- obj.connectionHops = message.connectionHops;
587
- }
588
- if (message.version !== "") {
589
- obj.version = message.version;
590
- }
591
- if (message.portId !== "") {
592
- obj.portId = message.portId;
593
- }
594
- if (message.channelId !== "") {
595
- obj.channelId = message.channelId;
596
- }
597
- if (!message.upgradeSequence.equals(Long.UZERO)) {
598
- obj.upgradeSequence = (message.upgradeSequence || Long.UZERO).toString();
599
- }
600
- return obj;
601
- },
602
-
603
- create<I extends Exact<DeepPartial<IdentifiedChannel>, I>>(base?: I): IdentifiedChannel {
604
- return IdentifiedChannel.fromPartial(base ?? ({} as any));
605
- },
606
- fromPartial<I extends Exact<DeepPartial<IdentifiedChannel>, I>>(object: I): IdentifiedChannel {
607
- const message = createBaseIdentifiedChannel();
608
- message.state = object.state ?? 0;
609
- message.ordering = object.ordering ?? 0;
610
- message.counterparty = (object.counterparty !== undefined && object.counterparty !== null)
611
- ? Counterparty.fromPartial(object.counterparty)
612
- : undefined;
613
- message.connectionHops = object.connectionHops?.map((e) => e) || [];
614
- message.version = object.version ?? "";
615
- message.portId = object.portId ?? "";
616
- message.channelId = object.channelId ?? "";
617
- message.upgradeSequence = (object.upgradeSequence !== undefined && object.upgradeSequence !== null)
618
- ? Long.fromValue(object.upgradeSequence)
619
- : Long.UZERO;
620
- return message;
621
- },
622
- };
623
-
624
- function createBaseCounterparty(): Counterparty {
625
- return { portId: "", channelId: "" };
626
- }
627
-
628
- export const Counterparty = {
629
- encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
630
- if (message.portId !== "") {
631
- writer.uint32(10).string(message.portId);
632
- }
633
- if (message.channelId !== "") {
634
- writer.uint32(18).string(message.channelId);
635
- }
636
- return writer;
637
- },
638
-
639
- decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty {
640
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
641
- let end = length === undefined ? reader.len : reader.pos + length;
642
- const message = createBaseCounterparty();
643
- while (reader.pos < end) {
644
- const tag = reader.uint32();
645
- switch (tag >>> 3) {
646
- case 1:
647
- if (tag !== 10) {
648
- break;
649
- }
650
-
651
- message.portId = reader.string();
652
- continue;
653
- case 2:
654
- if (tag !== 18) {
655
- break;
656
- }
657
-
658
- message.channelId = reader.string();
659
- continue;
660
- }
661
- if ((tag & 7) === 4 || tag === 0) {
662
- break;
663
- }
664
- reader.skipType(tag & 7);
665
- }
666
- return message;
667
- },
668
-
669
- fromJSON(object: any): Counterparty {
670
- return {
671
- portId: isSet(object.portId) ? globalThis.String(object.portId) : "",
672
- channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "",
673
- };
674
- },
675
-
676
- toJSON(message: Counterparty): unknown {
677
- const obj: any = {};
678
- if (message.portId !== "") {
679
- obj.portId = message.portId;
680
- }
681
- if (message.channelId !== "") {
682
- obj.channelId = message.channelId;
683
- }
684
- return obj;
685
- },
686
-
687
- create<I extends Exact<DeepPartial<Counterparty>, I>>(base?: I): Counterparty {
688
- return Counterparty.fromPartial(base ?? ({} as any));
689
- },
690
- fromPartial<I extends Exact<DeepPartial<Counterparty>, I>>(object: I): Counterparty {
691
- const message = createBaseCounterparty();
692
- message.portId = object.portId ?? "";
693
- message.channelId = object.channelId ?? "";
694
- return message;
695
- },
696
- };
697
-
698
- function createBasePacket(): Packet {
699
- return {
700
- sequence: Long.UZERO,
701
- sourcePort: "",
702
- sourceChannel: "",
703
- destinationPort: "",
704
- destinationChannel: "",
705
- data: new Uint8Array(0),
706
- timeoutHeight: undefined,
707
- timeoutTimestamp: Long.UZERO,
708
- };
709
- }
710
-
711
- export const Packet = {
712
- encode(message: Packet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
713
- if (!message.sequence.equals(Long.UZERO)) {
714
- writer.uint32(8).uint64(message.sequence);
715
- }
716
- if (message.sourcePort !== "") {
717
- writer.uint32(18).string(message.sourcePort);
718
- }
719
- if (message.sourceChannel !== "") {
720
- writer.uint32(26).string(message.sourceChannel);
721
- }
722
- if (message.destinationPort !== "") {
723
- writer.uint32(34).string(message.destinationPort);
724
- }
725
- if (message.destinationChannel !== "") {
726
- writer.uint32(42).string(message.destinationChannel);
727
- }
728
- if (message.data.length !== 0) {
729
- writer.uint32(50).bytes(message.data);
730
- }
731
- if (message.timeoutHeight !== undefined) {
732
- Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim();
733
- }
734
- if (!message.timeoutTimestamp.equals(Long.UZERO)) {
735
- writer.uint32(64).uint64(message.timeoutTimestamp);
736
- }
737
- return writer;
738
- },
739
-
740
- decode(input: _m0.Reader | Uint8Array, length?: number): Packet {
741
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
742
- let end = length === undefined ? reader.len : reader.pos + length;
743
- const message = createBasePacket();
744
- while (reader.pos < end) {
745
- const tag = reader.uint32();
746
- switch (tag >>> 3) {
747
- case 1:
748
- if (tag !== 8) {
749
- break;
750
- }
751
-
752
- message.sequence = reader.uint64() as Long;
753
- continue;
754
- case 2:
755
- if (tag !== 18) {
756
- break;
757
- }
758
-
759
- message.sourcePort = reader.string();
760
- continue;
761
- case 3:
762
- if (tag !== 26) {
763
- break;
764
- }
765
-
766
- message.sourceChannel = reader.string();
767
- continue;
768
- case 4:
769
- if (tag !== 34) {
770
- break;
771
- }
772
-
773
- message.destinationPort = reader.string();
774
- continue;
775
- case 5:
776
- if (tag !== 42) {
777
- break;
778
- }
779
-
780
- message.destinationChannel = reader.string();
781
- continue;
782
- case 6:
783
- if (tag !== 50) {
784
- break;
785
- }
786
-
787
- message.data = reader.bytes();
788
- continue;
789
- case 7:
790
- if (tag !== 58) {
791
- break;
792
- }
793
-
794
- message.timeoutHeight = Height.decode(reader, reader.uint32());
795
- continue;
796
- case 8:
797
- if (tag !== 64) {
798
- break;
799
- }
800
-
801
- message.timeoutTimestamp = reader.uint64() as Long;
802
- continue;
803
- }
804
- if ((tag & 7) === 4 || tag === 0) {
805
- break;
806
- }
807
- reader.skipType(tag & 7);
808
- }
809
- return message;
810
- },
811
-
812
- fromJSON(object: any): Packet {
813
- return {
814
- sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO,
815
- sourcePort: isSet(object.sourcePort) ? globalThis.String(object.sourcePort) : "",
816
- sourceChannel: isSet(object.sourceChannel) ? globalThis.String(object.sourceChannel) : "",
817
- destinationPort: isSet(object.destinationPort) ? globalThis.String(object.destinationPort) : "",
818
- destinationChannel: isSet(object.destinationChannel) ? globalThis.String(object.destinationChannel) : "",
819
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
820
- timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined,
821
- timeoutTimestamp: isSet(object.timeoutTimestamp) ? Long.fromValue(object.timeoutTimestamp) : Long.UZERO,
822
- };
823
- },
824
-
825
- toJSON(message: Packet): unknown {
826
- const obj: any = {};
827
- if (!message.sequence.equals(Long.UZERO)) {
828
- obj.sequence = (message.sequence || Long.UZERO).toString();
829
- }
830
- if (message.sourcePort !== "") {
831
- obj.sourcePort = message.sourcePort;
832
- }
833
- if (message.sourceChannel !== "") {
834
- obj.sourceChannel = message.sourceChannel;
835
- }
836
- if (message.destinationPort !== "") {
837
- obj.destinationPort = message.destinationPort;
838
- }
839
- if (message.destinationChannel !== "") {
840
- obj.destinationChannel = message.destinationChannel;
841
- }
842
- if (message.data.length !== 0) {
843
- obj.data = base64FromBytes(message.data);
844
- }
845
- if (message.timeoutHeight !== undefined) {
846
- obj.timeoutHeight = Height.toJSON(message.timeoutHeight);
847
- }
848
- if (!message.timeoutTimestamp.equals(Long.UZERO)) {
849
- obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString();
850
- }
851
- return obj;
852
- },
853
-
854
- create<I extends Exact<DeepPartial<Packet>, I>>(base?: I): Packet {
855
- return Packet.fromPartial(base ?? ({} as any));
856
- },
857
- fromPartial<I extends Exact<DeepPartial<Packet>, I>>(object: I): Packet {
858
- const message = createBasePacket();
859
- message.sequence = (object.sequence !== undefined && object.sequence !== null)
860
- ? Long.fromValue(object.sequence)
861
- : Long.UZERO;
862
- message.sourcePort = object.sourcePort ?? "";
863
- message.sourceChannel = object.sourceChannel ?? "";
864
- message.destinationPort = object.destinationPort ?? "";
865
- message.destinationChannel = object.destinationChannel ?? "";
866
- message.data = object.data ?? new Uint8Array(0);
867
- message.timeoutHeight = (object.timeoutHeight !== undefined && object.timeoutHeight !== null)
868
- ? Height.fromPartial(object.timeoutHeight)
869
- : undefined;
870
- message.timeoutTimestamp = (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null)
871
- ? Long.fromValue(object.timeoutTimestamp)
872
- : Long.UZERO;
873
- return message;
874
- },
875
- };
876
-
877
- function createBasePacketState(): PacketState {
878
- return { portId: "", channelId: "", sequence: Long.UZERO, data: new Uint8Array(0) };
879
- }
880
-
881
- export const PacketState = {
882
- encode(message: PacketState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
883
- if (message.portId !== "") {
884
- writer.uint32(10).string(message.portId);
885
- }
886
- if (message.channelId !== "") {
887
- writer.uint32(18).string(message.channelId);
888
- }
889
- if (!message.sequence.equals(Long.UZERO)) {
890
- writer.uint32(24).uint64(message.sequence);
891
- }
892
- if (message.data.length !== 0) {
893
- writer.uint32(34).bytes(message.data);
894
- }
895
- return writer;
896
- },
897
-
898
- decode(input: _m0.Reader | Uint8Array, length?: number): PacketState {
899
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
900
- let end = length === undefined ? reader.len : reader.pos + length;
901
- const message = createBasePacketState();
902
- while (reader.pos < end) {
903
- const tag = reader.uint32();
904
- switch (tag >>> 3) {
905
- case 1:
906
- if (tag !== 10) {
907
- break;
908
- }
909
-
910
- message.portId = reader.string();
911
- continue;
912
- case 2:
913
- if (tag !== 18) {
914
- break;
915
- }
916
-
917
- message.channelId = reader.string();
918
- continue;
919
- case 3:
920
- if (tag !== 24) {
921
- break;
922
- }
923
-
924
- message.sequence = reader.uint64() as Long;
925
- continue;
926
- case 4:
927
- if (tag !== 34) {
928
- break;
929
- }
930
-
931
- message.data = reader.bytes();
932
- continue;
933
- }
934
- if ((tag & 7) === 4 || tag === 0) {
935
- break;
936
- }
937
- reader.skipType(tag & 7);
938
- }
939
- return message;
940
- },
941
-
942
- fromJSON(object: any): PacketState {
943
- return {
944
- portId: isSet(object.portId) ? globalThis.String(object.portId) : "",
945
- channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "",
946
- sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO,
947
- data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
948
- };
949
- },
950
-
951
- toJSON(message: PacketState): unknown {
952
- const obj: any = {};
953
- if (message.portId !== "") {
954
- obj.portId = message.portId;
955
- }
956
- if (message.channelId !== "") {
957
- obj.channelId = message.channelId;
958
- }
959
- if (!message.sequence.equals(Long.UZERO)) {
960
- obj.sequence = (message.sequence || Long.UZERO).toString();
961
- }
962
- if (message.data.length !== 0) {
963
- obj.data = base64FromBytes(message.data);
964
- }
965
- return obj;
966
- },
967
-
968
- create<I extends Exact<DeepPartial<PacketState>, I>>(base?: I): PacketState {
969
- return PacketState.fromPartial(base ?? ({} as any));
970
- },
971
- fromPartial<I extends Exact<DeepPartial<PacketState>, I>>(object: I): PacketState {
972
- const message = createBasePacketState();
973
- message.portId = object.portId ?? "";
974
- message.channelId = object.channelId ?? "";
975
- message.sequence = (object.sequence !== undefined && object.sequence !== null)
976
- ? Long.fromValue(object.sequence)
977
- : Long.UZERO;
978
- message.data = object.data ?? new Uint8Array(0);
979
- return message;
980
- },
981
- };
982
-
983
- function createBasePacketId(): PacketId {
984
- return { portId: "", channelId: "", sequence: Long.UZERO };
985
- }
986
-
987
- export const PacketId = {
988
- encode(message: PacketId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
989
- if (message.portId !== "") {
990
- writer.uint32(10).string(message.portId);
991
- }
992
- if (message.channelId !== "") {
993
- writer.uint32(18).string(message.channelId);
994
- }
995
- if (!message.sequence.equals(Long.UZERO)) {
996
- writer.uint32(24).uint64(message.sequence);
997
- }
998
- return writer;
999
- },
1000
-
1001
- decode(input: _m0.Reader | Uint8Array, length?: number): PacketId {
1002
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1003
- let end = length === undefined ? reader.len : reader.pos + length;
1004
- const message = createBasePacketId();
1005
- while (reader.pos < end) {
1006
- const tag = reader.uint32();
1007
- switch (tag >>> 3) {
1008
- case 1:
1009
- if (tag !== 10) {
1010
- break;
1011
- }
1012
-
1013
- message.portId = reader.string();
1014
- continue;
1015
- case 2:
1016
- if (tag !== 18) {
1017
- break;
1018
- }
1019
-
1020
- message.channelId = reader.string();
1021
- continue;
1022
- case 3:
1023
- if (tag !== 24) {
1024
- break;
1025
- }
1026
-
1027
- message.sequence = reader.uint64() as Long;
1028
- continue;
1029
- }
1030
- if ((tag & 7) === 4 || tag === 0) {
1031
- break;
1032
- }
1033
- reader.skipType(tag & 7);
1034
- }
1035
- return message;
1036
- },
1037
-
1038
- fromJSON(object: any): PacketId {
1039
- return {
1040
- portId: isSet(object.portId) ? globalThis.String(object.portId) : "",
1041
- channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "",
1042
- sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO,
1043
- };
1044
- },
1045
-
1046
- toJSON(message: PacketId): unknown {
1047
- const obj: any = {};
1048
- if (message.portId !== "") {
1049
- obj.portId = message.portId;
1050
- }
1051
- if (message.channelId !== "") {
1052
- obj.channelId = message.channelId;
1053
- }
1054
- if (!message.sequence.equals(Long.UZERO)) {
1055
- obj.sequence = (message.sequence || Long.UZERO).toString();
1056
- }
1057
- return obj;
1058
- },
1059
-
1060
- create<I extends Exact<DeepPartial<PacketId>, I>>(base?: I): PacketId {
1061
- return PacketId.fromPartial(base ?? ({} as any));
1062
- },
1063
- fromPartial<I extends Exact<DeepPartial<PacketId>, I>>(object: I): PacketId {
1064
- const message = createBasePacketId();
1065
- message.portId = object.portId ?? "";
1066
- message.channelId = object.channelId ?? "";
1067
- message.sequence = (object.sequence !== undefined && object.sequence !== null)
1068
- ? Long.fromValue(object.sequence)
1069
- : Long.UZERO;
1070
- return message;
1071
- },
1072
- };
1073
-
1074
- function createBaseAcknowledgement(): Acknowledgement {
1075
- return { result: undefined, error: undefined };
1076
- }
1077
-
1078
- export const Acknowledgement = {
1079
- encode(message: Acknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1080
- if (message.result !== undefined) {
1081
- writer.uint32(170).bytes(message.result);
1082
- }
1083
- if (message.error !== undefined) {
1084
- writer.uint32(178).string(message.error);
1085
- }
1086
- return writer;
1087
- },
1088
-
1089
- decode(input: _m0.Reader | Uint8Array, length?: number): Acknowledgement {
1090
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1091
- let end = length === undefined ? reader.len : reader.pos + length;
1092
- const message = createBaseAcknowledgement();
1093
- while (reader.pos < end) {
1094
- const tag = reader.uint32();
1095
- switch (tag >>> 3) {
1096
- case 21:
1097
- if (tag !== 170) {
1098
- break;
1099
- }
1100
-
1101
- message.result = reader.bytes();
1102
- continue;
1103
- case 22:
1104
- if (tag !== 178) {
1105
- break;
1106
- }
1107
-
1108
- message.error = reader.string();
1109
- continue;
1110
- }
1111
- if ((tag & 7) === 4 || tag === 0) {
1112
- break;
1113
- }
1114
- reader.skipType(tag & 7);
1115
- }
1116
- return message;
1117
- },
1118
-
1119
- fromJSON(object: any): Acknowledgement {
1120
- return {
1121
- result: isSet(object.result) ? bytesFromBase64(object.result) : undefined,
1122
- error: isSet(object.error) ? globalThis.String(object.error) : undefined,
1123
- };
1124
- },
1125
-
1126
- toJSON(message: Acknowledgement): unknown {
1127
- const obj: any = {};
1128
- if (message.result !== undefined) {
1129
- obj.result = base64FromBytes(message.result);
1130
- }
1131
- if (message.error !== undefined) {
1132
- obj.error = message.error;
1133
- }
1134
- return obj;
1135
- },
1136
-
1137
- create<I extends Exact<DeepPartial<Acknowledgement>, I>>(base?: I): Acknowledgement {
1138
- return Acknowledgement.fromPartial(base ?? ({} as any));
1139
- },
1140
- fromPartial<I extends Exact<DeepPartial<Acknowledgement>, I>>(object: I): Acknowledgement {
1141
- const message = createBaseAcknowledgement();
1142
- message.result = object.result ?? undefined;
1143
- message.error = object.error ?? undefined;
1144
- return message;
1145
- },
1146
- };
1147
-
1148
- function createBaseTimeout(): Timeout {
1149
- return { height: undefined, timestamp: Long.UZERO };
1150
- }
1151
-
1152
- export const Timeout = {
1153
- encode(message: Timeout, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1154
- if (message.height !== undefined) {
1155
- Height.encode(message.height, writer.uint32(10).fork()).ldelim();
1156
- }
1157
- if (!message.timestamp.equals(Long.UZERO)) {
1158
- writer.uint32(16).uint64(message.timestamp);
1159
- }
1160
- return writer;
1161
- },
1162
-
1163
- decode(input: _m0.Reader | Uint8Array, length?: number): Timeout {
1164
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1165
- let end = length === undefined ? reader.len : reader.pos + length;
1166
- const message = createBaseTimeout();
1167
- while (reader.pos < end) {
1168
- const tag = reader.uint32();
1169
- switch (tag >>> 3) {
1170
- case 1:
1171
- if (tag !== 10) {
1172
- break;
1173
- }
1174
-
1175
- message.height = Height.decode(reader, reader.uint32());
1176
- continue;
1177
- case 2:
1178
- if (tag !== 16) {
1179
- break;
1180
- }
1181
-
1182
- message.timestamp = reader.uint64() as Long;
1183
- continue;
1184
- }
1185
- if ((tag & 7) === 4 || tag === 0) {
1186
- break;
1187
- }
1188
- reader.skipType(tag & 7);
1189
- }
1190
- return message;
1191
- },
1192
-
1193
- fromJSON(object: any): Timeout {
1194
- return {
1195
- height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
1196
- timestamp: isSet(object.timestamp) ? Long.fromValue(object.timestamp) : Long.UZERO,
1197
- };
1198
- },
1199
-
1200
- toJSON(message: Timeout): unknown {
1201
- const obj: any = {};
1202
- if (message.height !== undefined) {
1203
- obj.height = Height.toJSON(message.height);
1204
- }
1205
- if (!message.timestamp.equals(Long.UZERO)) {
1206
- obj.timestamp = (message.timestamp || Long.UZERO).toString();
1207
- }
1208
- return obj;
1209
- },
1210
-
1211
- create<I extends Exact<DeepPartial<Timeout>, I>>(base?: I): Timeout {
1212
- return Timeout.fromPartial(base ?? ({} as any));
1213
- },
1214
- fromPartial<I extends Exact<DeepPartial<Timeout>, I>>(object: I): Timeout {
1215
- const message = createBaseTimeout();
1216
- message.height = (object.height !== undefined && object.height !== null)
1217
- ? Height.fromPartial(object.height)
1218
- : undefined;
1219
- message.timestamp = (object.timestamp !== undefined && object.timestamp !== null)
1220
- ? Long.fromValue(object.timestamp)
1221
- : Long.UZERO;
1222
- return message;
1223
- },
1224
- };
1225
-
1226
- function createBaseParams(): Params {
1227
- return { upgradeTimeout: undefined };
1228
- }
1229
-
1230
- export const Params = {
1231
- encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1232
- if (message.upgradeTimeout !== undefined) {
1233
- Timeout.encode(message.upgradeTimeout, writer.uint32(10).fork()).ldelim();
1234
- }
1235
- return writer;
1236
- },
1237
-
1238
- decode(input: _m0.Reader | Uint8Array, length?: number): Params {
1239
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1240
- let end = length === undefined ? reader.len : reader.pos + length;
1241
- const message = createBaseParams();
1242
- while (reader.pos < end) {
1243
- const tag = reader.uint32();
1244
- switch (tag >>> 3) {
1245
- case 1:
1246
- if (tag !== 10) {
1247
- break;
1248
- }
1249
-
1250
- message.upgradeTimeout = Timeout.decode(reader, reader.uint32());
1251
- continue;
1252
- }
1253
- if ((tag & 7) === 4 || tag === 0) {
1254
- break;
1255
- }
1256
- reader.skipType(tag & 7);
1257
- }
1258
- return message;
1259
- },
1260
-
1261
- fromJSON(object: any): Params {
1262
- return { upgradeTimeout: isSet(object.upgradeTimeout) ? Timeout.fromJSON(object.upgradeTimeout) : undefined };
1263
- },
1264
-
1265
- toJSON(message: Params): unknown {
1266
- const obj: any = {};
1267
- if (message.upgradeTimeout !== undefined) {
1268
- obj.upgradeTimeout = Timeout.toJSON(message.upgradeTimeout);
1269
- }
1270
- return obj;
1271
- },
1272
-
1273
- create<I extends Exact<DeepPartial<Params>, I>>(base?: I): Params {
1274
- return Params.fromPartial(base ?? ({} as any));
1275
- },
1276
- fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
1277
- const message = createBaseParams();
1278
- message.upgradeTimeout = (object.upgradeTimeout !== undefined && object.upgradeTimeout !== null)
1279
- ? Timeout.fromPartial(object.upgradeTimeout)
1280
- : undefined;
1281
- return message;
1282
- },
1283
- };
1284
-
1285
- function bytesFromBase64(b64: string): Uint8Array {
1286
- if ((globalThis as any).Buffer) {
1287
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1288
- } else {
1289
- const bin = globalThis.atob(b64);
1290
- const arr = new Uint8Array(bin.length);
1291
- for (let i = 0; i < bin.length; ++i) {
1292
- arr[i] = bin.charCodeAt(i);
1293
- }
1294
- return arr;
1295
- }
1296
- }
1297
-
1298
- function base64FromBytes(arr: Uint8Array): string {
1299
- if ((globalThis as any).Buffer) {
1300
- return globalThis.Buffer.from(arr).toString("base64");
1301
- } else {
1302
- const bin: string[] = [];
1303
- arr.forEach((byte) => {
1304
- bin.push(globalThis.String.fromCharCode(byte));
1305
- });
1306
- return globalThis.btoa(bin.join(""));
1307
- }
1308
- }
1309
-
1310
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1311
-
1312
- export type DeepPartial<T> = T extends Builtin ? T
1313
- : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
1314
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
1315
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
1316
- : Partial<T>;
1317
-
1318
- type KeysOfUnion<T> = T extends T ? keyof T : never;
1319
- export type Exact<P, I extends P> = P extends Builtin ? P
1320
- : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
1321
-
1322
- if (_m0.util.Long !== Long) {
1323
- _m0.util.Long = Long as any;
1324
- _m0.configure();
1325
- }
1326
-
1327
- function isSet(value: any): boolean {
1328
- return value !== null && value !== undefined;
1329
- }