@agoric/cosmic-proto 0.4.1-dev-841f246.0 → 0.4.1-dev-203d4d7.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 (110) hide show
  1. package/dist/codegen/cosmos/authz/v1beta1/authz.d.ts +6 -5
  2. package/dist/codegen/cosmos/authz/v1beta1/authz.js +3 -0
  3. package/dist/codegen/cosmos/authz/v1beta1/authz.js.map +1 -1
  4. package/dist/codegen/cosmos/bundle.d.ts +1 -1
  5. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/controller.d.ts +31 -0
  6. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/controller.js +65 -0
  7. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/controller.js.map +1 -0
  8. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/query.d.ts +95 -0
  9. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/query.js +242 -0
  10. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/query.js.map +1 -0
  11. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +108 -0
  12. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/tx.js +313 -0
  13. package/dist/codegen/ibc/applications/interchain_accounts/controller/v1/tx.js.map +1 -0
  14. package/dist/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +150 -0
  15. package/dist/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.js +500 -0
  16. package/dist/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.js.map +1 -0
  17. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/host.d.ts +34 -0
  18. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/host.js +82 -0
  19. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/host.js.map +1 -0
  20. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/query.d.ts +47 -0
  21. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/query.js +113 -0
  22. package/dist/codegen/ibc/applications/interchain_accounts/host/v1/query.js.map +1 -0
  23. package/dist/codegen/ibc/applications/interchain_accounts/v1/account.d.ts +29 -0
  24. package/dist/codegen/ibc/applications/interchain_accounts/v1/account.js +85 -0
  25. package/dist/codegen/ibc/applications/interchain_accounts/v1/account.js.map +1 -0
  26. package/dist/codegen/ibc/applications/interchain_accounts/v1/metadata.d.ts +49 -0
  27. package/dist/codegen/ibc/applications/interchain_accounts/v1/metadata.js +118 -0
  28. package/dist/codegen/ibc/applications/interchain_accounts/v1/metadata.js.map +1 -0
  29. package/dist/codegen/ibc/applications/interchain_accounts/v1/packet.d.ts +66 -0
  30. package/dist/codegen/ibc/applications/interchain_accounts/v1/packet.js +189 -0
  31. package/dist/codegen/ibc/applications/interchain_accounts/v1/packet.js.map +1 -0
  32. package/dist/codegen/ibc/applications/transfer/v1/authz.d.ts +67 -0
  33. package/dist/codegen/ibc/applications/transfer/v1/authz.js +177 -0
  34. package/dist/codegen/ibc/applications/transfer/v1/authz.js.map +1 -0
  35. package/dist/codegen/ibc/applications/transfer/v1/genesis.d.ts +29 -0
  36. package/dist/codegen/ibc/applications/transfer/v1/genesis.js +95 -0
  37. package/dist/codegen/ibc/applications/transfer/v1/genesis.js.map +1 -0
  38. package/dist/codegen/ibc/applications/transfer/v1/query.d.ts +282 -0
  39. package/dist/codegen/ibc/applications/transfer/v1/query.js +633 -0
  40. package/dist/codegen/ibc/applications/transfer/v1/query.js.map +1 -0
  41. package/dist/codegen/ibc/applications/transfer/v1/transfer.d.ts +80 -0
  42. package/dist/codegen/ibc/applications/transfer/v1/transfer.js +146 -0
  43. package/dist/codegen/ibc/applications/transfer/v1/transfer.js.map +1 -0
  44. package/dist/codegen/ibc/applications/transfer/v1/tx.d.ts +86 -0
  45. package/dist/codegen/ibc/applications/transfer/v1/tx.js +219 -0
  46. package/dist/codegen/ibc/applications/transfer/v1/tx.js.map +1 -0
  47. package/dist/codegen/ibc/applications/transfer/v2/packet.d.ts +45 -0
  48. package/dist/codegen/ibc/applications/transfer/v2/packet.js +102 -0
  49. package/dist/codegen/ibc/applications/transfer/v2/packet.js.map +1 -0
  50. package/dist/codegen/ibc/bundle.d.ts +2266 -122
  51. package/dist/codegen/ibc/bundle.js +124 -4
  52. package/dist/codegen/ibc/bundle.js.map +1 -1
  53. package/dist/codegen/ibc/core/channel/v1/genesis.d.ts +73 -0
  54. package/dist/codegen/ibc/core/channel/v1/genesis.js +280 -0
  55. package/dist/codegen/ibc/core/channel/v1/genesis.js.map +1 -0
  56. package/dist/codegen/ibc/core/channel/v1/query.d.ts +914 -0
  57. package/dist/codegen/ibc/core/channel/v1/query.js +2343 -0
  58. package/dist/codegen/ibc/core/channel/v1/query.js.map +1 -0
  59. package/dist/codegen/ibc/core/channel/v1/tx.d.ts +604 -0
  60. package/dist/codegen/ibc/core/channel/v1/tx.js +1744 -0
  61. package/dist/codegen/ibc/core/channel/v1/tx.js.map +1 -0
  62. package/dist/codegen/ibc/core/client/v1/genesis.d.ts +104 -0
  63. package/dist/codegen/ibc/core/client/v1/genesis.js +300 -0
  64. package/dist/codegen/ibc/core/client/v1/genesis.js.map +1 -0
  65. package/dist/codegen/ibc/core/client/v1/query.d.ts +577 -0
  66. package/dist/codegen/ibc/core/client/v1/query.js +1282 -0
  67. package/dist/codegen/ibc/core/client/v1/query.js.map +1 -0
  68. package/dist/codegen/ibc/core/client/v1/tx.d.ts +245 -0
  69. package/dist/codegen/ibc/core/client/v1/tx.js +586 -0
  70. package/dist/codegen/ibc/core/client/v1/tx.js.map +1 -0
  71. package/dist/codegen/ibc/core/commitment/v1/commitment.d.ts +128 -0
  72. package/dist/codegen/ibc/core/commitment/v1/commitment.js +258 -0
  73. package/dist/codegen/ibc/core/commitment/v1/commitment.js.map +1 -0
  74. package/dist/codegen/ibc/core/connection/v1/connection.d.ts +272 -0
  75. package/dist/codegen/ibc/core/connection/v1/connection.js +677 -0
  76. package/dist/codegen/ibc/core/connection/v1/connection.js.map +1 -0
  77. package/dist/codegen/ibc/core/connection/v1/genesis.d.ts +32 -0
  78. package/dist/codegen/ibc/core/connection/v1/genesis.js +121 -0
  79. package/dist/codegen/ibc/core/connection/v1/genesis.js.map +1 -0
  80. package/dist/codegen/ibc/core/connection/v1/query.d.ts +388 -0
  81. package/dist/codegen/ibc/core/connection/v1/query.js +951 -0
  82. package/dist/codegen/ibc/core/connection/v1/query.js.map +1 -0
  83. package/dist/codegen/ibc/core/connection/v1/tx.d.ts +286 -0
  84. package/dist/codegen/ibc/core/connection/v1/tx.js +842 -0
  85. package/dist/codegen/ibc/core/connection/v1/tx.js.map +1 -0
  86. package/dist/codegen/ibc/lightclients/localhost/v1/localhost.d.ts +35 -0
  87. package/dist/codegen/ibc/lightclients/localhost/v1/localhost.js +77 -0
  88. package/dist/codegen/ibc/lightclients/localhost/v1/localhost.js.map +1 -0
  89. package/dist/codegen/ibc/lightclients/solomachine/v1/solomachine.d.ts +549 -0
  90. package/dist/codegen/ibc/lightclients/solomachine/v1/solomachine.js +1519 -0
  91. package/dist/codegen/ibc/lightclients/solomachine/v1/solomachine.js.map +1 -0
  92. package/dist/codegen/ibc/lightclients/solomachine/v2/solomachine.d.ts +549 -0
  93. package/dist/codegen/ibc/lightclients/solomachine/v2/solomachine.js +1513 -0
  94. package/dist/codegen/ibc/lightclients/solomachine/v2/solomachine.js.map +1 -0
  95. package/dist/codegen/ibc/lightclients/tendermint/v1/tendermint.d.ts +231 -0
  96. package/dist/codegen/ibc/lightclients/tendermint/v1/tendermint.js +624 -0
  97. package/dist/codegen/ibc/lightclients/tendermint/v1/tendermint.js.map +1 -0
  98. package/dist/codegen/ics23/bundle.d.ts +154 -0
  99. package/dist/codegen/ics23/bundle.js +6 -0
  100. package/dist/codegen/ics23/bundle.js.map +1 -0
  101. package/dist/codegen/index.d.ts +1 -0
  102. package/dist/codegen/index.js +1 -0
  103. package/dist/codegen/index.js.map +1 -1
  104. package/dist/codegen/proofs.d.ts +569 -0
  105. package/dist/codegen/proofs.js +1435 -0
  106. package/dist/codegen/proofs.js.map +1 -0
  107. package/dist/codegen/tendermint/bundle.d.ts +716 -716
  108. package/dist/codegen/tendermint/bundle.js +22 -22
  109. package/dist/codegen/tendermint/bundle.js.map +1 -1
  110. package/package.json +7 -3
@@ -0,0 +1,2343 @@
1
+ //@ts-nocheck
2
+ import { PageRequest, PageResponse, } from '../../../../cosmos/base/query/v1beta1/pagination.js';
3
+ import { Channel, IdentifiedChannel, PacketState, } from './channel.js';
4
+ import { Height, IdentifiedClientState, } from '../../client/v1/client.js';
5
+ import { Any } from '../../../../google/protobuf/any.js';
6
+ import { BinaryReader, BinaryWriter } from '../../../../binary.js';
7
+ import { isSet, bytesFromBase64, base64FromBytes, } from '../../../../helpers.js';
8
+ function createBaseQueryChannelRequest() {
9
+ return {
10
+ portId: '',
11
+ channelId: '',
12
+ };
13
+ }
14
+ export const QueryChannelRequest = {
15
+ typeUrl: '/ibc.core.channel.v1.QueryChannelRequest',
16
+ encode(message, writer = BinaryWriter.create()) {
17
+ if (message.portId !== '') {
18
+ writer.uint32(10).string(message.portId);
19
+ }
20
+ if (message.channelId !== '') {
21
+ writer.uint32(18).string(message.channelId);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
27
+ let end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseQueryChannelRequest();
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1:
33
+ message.portId = reader.string();
34
+ break;
35
+ case 2:
36
+ message.channelId = reader.string();
37
+ break;
38
+ default:
39
+ reader.skipType(tag & 7);
40
+ break;
41
+ }
42
+ }
43
+ return message;
44
+ },
45
+ fromJSON(object) {
46
+ return {
47
+ portId: isSet(object.portId) ? String(object.portId) : '',
48
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
49
+ };
50
+ },
51
+ toJSON(message) {
52
+ const obj = {};
53
+ message.portId !== undefined && (obj.portId = message.portId);
54
+ message.channelId !== undefined && (obj.channelId = message.channelId);
55
+ return obj;
56
+ },
57
+ fromPartial(object) {
58
+ const message = createBaseQueryChannelRequest();
59
+ message.portId = object.portId ?? '';
60
+ message.channelId = object.channelId ?? '';
61
+ return message;
62
+ },
63
+ fromProtoMsg(message) {
64
+ return QueryChannelRequest.decode(message.value);
65
+ },
66
+ toProto(message) {
67
+ return QueryChannelRequest.encode(message).finish();
68
+ },
69
+ toProtoMsg(message) {
70
+ return {
71
+ typeUrl: '/ibc.core.channel.v1.QueryChannelRequest',
72
+ value: QueryChannelRequest.encode(message).finish(),
73
+ };
74
+ },
75
+ };
76
+ function createBaseQueryChannelResponse() {
77
+ return {
78
+ channel: undefined,
79
+ proof: new Uint8Array(),
80
+ proofHeight: Height.fromPartial({}),
81
+ };
82
+ }
83
+ export const QueryChannelResponse = {
84
+ typeUrl: '/ibc.core.channel.v1.QueryChannelResponse',
85
+ encode(message, writer = BinaryWriter.create()) {
86
+ if (message.channel !== undefined) {
87
+ Channel.encode(message.channel, writer.uint32(10).fork()).ldelim();
88
+ }
89
+ if (message.proof.length !== 0) {
90
+ writer.uint32(18).bytes(message.proof);
91
+ }
92
+ if (message.proofHeight !== undefined) {
93
+ Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
94
+ }
95
+ return writer;
96
+ },
97
+ decode(input, length) {
98
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
99
+ let end = length === undefined ? reader.len : reader.pos + length;
100
+ const message = createBaseQueryChannelResponse();
101
+ while (reader.pos < end) {
102
+ const tag = reader.uint32();
103
+ switch (tag >>> 3) {
104
+ case 1:
105
+ message.channel = Channel.decode(reader, reader.uint32());
106
+ break;
107
+ case 2:
108
+ message.proof = reader.bytes();
109
+ break;
110
+ case 3:
111
+ message.proofHeight = Height.decode(reader, reader.uint32());
112
+ break;
113
+ default:
114
+ reader.skipType(tag & 7);
115
+ break;
116
+ }
117
+ }
118
+ return message;
119
+ },
120
+ fromJSON(object) {
121
+ return {
122
+ channel: isSet(object.channel)
123
+ ? Channel.fromJSON(object.channel)
124
+ : undefined,
125
+ proof: isSet(object.proof)
126
+ ? bytesFromBase64(object.proof)
127
+ : new Uint8Array(),
128
+ proofHeight: isSet(object.proofHeight)
129
+ ? Height.fromJSON(object.proofHeight)
130
+ : undefined,
131
+ };
132
+ },
133
+ toJSON(message) {
134
+ const obj = {};
135
+ message.channel !== undefined &&
136
+ (obj.channel = message.channel
137
+ ? Channel.toJSON(message.channel)
138
+ : undefined);
139
+ message.proof !== undefined &&
140
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
141
+ message.proofHeight !== undefined &&
142
+ (obj.proofHeight = message.proofHeight
143
+ ? Height.toJSON(message.proofHeight)
144
+ : undefined);
145
+ return obj;
146
+ },
147
+ fromPartial(object) {
148
+ const message = createBaseQueryChannelResponse();
149
+ message.channel =
150
+ object.channel !== undefined && object.channel !== null
151
+ ? Channel.fromPartial(object.channel)
152
+ : undefined;
153
+ message.proof = object.proof ?? new Uint8Array();
154
+ message.proofHeight =
155
+ object.proofHeight !== undefined && object.proofHeight !== null
156
+ ? Height.fromPartial(object.proofHeight)
157
+ : undefined;
158
+ return message;
159
+ },
160
+ fromProtoMsg(message) {
161
+ return QueryChannelResponse.decode(message.value);
162
+ },
163
+ toProto(message) {
164
+ return QueryChannelResponse.encode(message).finish();
165
+ },
166
+ toProtoMsg(message) {
167
+ return {
168
+ typeUrl: '/ibc.core.channel.v1.QueryChannelResponse',
169
+ value: QueryChannelResponse.encode(message).finish(),
170
+ };
171
+ },
172
+ };
173
+ function createBaseQueryChannelsRequest() {
174
+ return {
175
+ pagination: undefined,
176
+ };
177
+ }
178
+ export const QueryChannelsRequest = {
179
+ typeUrl: '/ibc.core.channel.v1.QueryChannelsRequest',
180
+ encode(message, writer = BinaryWriter.create()) {
181
+ if (message.pagination !== undefined) {
182
+ PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
183
+ }
184
+ return writer;
185
+ },
186
+ decode(input, length) {
187
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
188
+ let end = length === undefined ? reader.len : reader.pos + length;
189
+ const message = createBaseQueryChannelsRequest();
190
+ while (reader.pos < end) {
191
+ const tag = reader.uint32();
192
+ switch (tag >>> 3) {
193
+ case 1:
194
+ message.pagination = PageRequest.decode(reader, reader.uint32());
195
+ break;
196
+ default:
197
+ reader.skipType(tag & 7);
198
+ break;
199
+ }
200
+ }
201
+ return message;
202
+ },
203
+ fromJSON(object) {
204
+ return {
205
+ pagination: isSet(object.pagination)
206
+ ? PageRequest.fromJSON(object.pagination)
207
+ : undefined,
208
+ };
209
+ },
210
+ toJSON(message) {
211
+ const obj = {};
212
+ message.pagination !== undefined &&
213
+ (obj.pagination = message.pagination
214
+ ? PageRequest.toJSON(message.pagination)
215
+ : undefined);
216
+ return obj;
217
+ },
218
+ fromPartial(object) {
219
+ const message = createBaseQueryChannelsRequest();
220
+ message.pagination =
221
+ object.pagination !== undefined && object.pagination !== null
222
+ ? PageRequest.fromPartial(object.pagination)
223
+ : undefined;
224
+ return message;
225
+ },
226
+ fromProtoMsg(message) {
227
+ return QueryChannelsRequest.decode(message.value);
228
+ },
229
+ toProto(message) {
230
+ return QueryChannelsRequest.encode(message).finish();
231
+ },
232
+ toProtoMsg(message) {
233
+ return {
234
+ typeUrl: '/ibc.core.channel.v1.QueryChannelsRequest',
235
+ value: QueryChannelsRequest.encode(message).finish(),
236
+ };
237
+ },
238
+ };
239
+ function createBaseQueryChannelsResponse() {
240
+ return {
241
+ channels: [],
242
+ pagination: undefined,
243
+ height: Height.fromPartial({}),
244
+ };
245
+ }
246
+ export const QueryChannelsResponse = {
247
+ typeUrl: '/ibc.core.channel.v1.QueryChannelsResponse',
248
+ encode(message, writer = BinaryWriter.create()) {
249
+ for (const v of message.channels) {
250
+ IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim();
251
+ }
252
+ if (message.pagination !== undefined) {
253
+ PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
254
+ }
255
+ if (message.height !== undefined) {
256
+ Height.encode(message.height, writer.uint32(26).fork()).ldelim();
257
+ }
258
+ return writer;
259
+ },
260
+ decode(input, length) {
261
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
262
+ let end = length === undefined ? reader.len : reader.pos + length;
263
+ const message = createBaseQueryChannelsResponse();
264
+ while (reader.pos < end) {
265
+ const tag = reader.uint32();
266
+ switch (tag >>> 3) {
267
+ case 1:
268
+ message.channels.push(IdentifiedChannel.decode(reader, reader.uint32()));
269
+ break;
270
+ case 2:
271
+ message.pagination = PageResponse.decode(reader, reader.uint32());
272
+ break;
273
+ case 3:
274
+ message.height = Height.decode(reader, reader.uint32());
275
+ break;
276
+ default:
277
+ reader.skipType(tag & 7);
278
+ break;
279
+ }
280
+ }
281
+ return message;
282
+ },
283
+ fromJSON(object) {
284
+ return {
285
+ channels: Array.isArray(object?.channels)
286
+ ? object.channels.map((e) => IdentifiedChannel.fromJSON(e))
287
+ : [],
288
+ pagination: isSet(object.pagination)
289
+ ? PageResponse.fromJSON(object.pagination)
290
+ : undefined,
291
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
292
+ };
293
+ },
294
+ toJSON(message) {
295
+ const obj = {};
296
+ if (message.channels) {
297
+ obj.channels = message.channels.map(e => e ? IdentifiedChannel.toJSON(e) : undefined);
298
+ }
299
+ else {
300
+ obj.channels = [];
301
+ }
302
+ message.pagination !== undefined &&
303
+ (obj.pagination = message.pagination
304
+ ? PageResponse.toJSON(message.pagination)
305
+ : undefined);
306
+ message.height !== undefined &&
307
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
308
+ return obj;
309
+ },
310
+ fromPartial(object) {
311
+ const message = createBaseQueryChannelsResponse();
312
+ message.channels =
313
+ object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || [];
314
+ message.pagination =
315
+ object.pagination !== undefined && object.pagination !== null
316
+ ? PageResponse.fromPartial(object.pagination)
317
+ : undefined;
318
+ message.height =
319
+ object.height !== undefined && object.height !== null
320
+ ? Height.fromPartial(object.height)
321
+ : undefined;
322
+ return message;
323
+ },
324
+ fromProtoMsg(message) {
325
+ return QueryChannelsResponse.decode(message.value);
326
+ },
327
+ toProto(message) {
328
+ return QueryChannelsResponse.encode(message).finish();
329
+ },
330
+ toProtoMsg(message) {
331
+ return {
332
+ typeUrl: '/ibc.core.channel.v1.QueryChannelsResponse',
333
+ value: QueryChannelsResponse.encode(message).finish(),
334
+ };
335
+ },
336
+ };
337
+ function createBaseQueryConnectionChannelsRequest() {
338
+ return {
339
+ connection: '',
340
+ pagination: undefined,
341
+ };
342
+ }
343
+ export const QueryConnectionChannelsRequest = {
344
+ typeUrl: '/ibc.core.channel.v1.QueryConnectionChannelsRequest',
345
+ encode(message, writer = BinaryWriter.create()) {
346
+ if (message.connection !== '') {
347
+ writer.uint32(10).string(message.connection);
348
+ }
349
+ if (message.pagination !== undefined) {
350
+ PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
351
+ }
352
+ return writer;
353
+ },
354
+ decode(input, length) {
355
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
356
+ let end = length === undefined ? reader.len : reader.pos + length;
357
+ const message = createBaseQueryConnectionChannelsRequest();
358
+ while (reader.pos < end) {
359
+ const tag = reader.uint32();
360
+ switch (tag >>> 3) {
361
+ case 1:
362
+ message.connection = reader.string();
363
+ break;
364
+ case 2:
365
+ message.pagination = PageRequest.decode(reader, reader.uint32());
366
+ break;
367
+ default:
368
+ reader.skipType(tag & 7);
369
+ break;
370
+ }
371
+ }
372
+ return message;
373
+ },
374
+ fromJSON(object) {
375
+ return {
376
+ connection: isSet(object.connection) ? String(object.connection) : '',
377
+ pagination: isSet(object.pagination)
378
+ ? PageRequest.fromJSON(object.pagination)
379
+ : undefined,
380
+ };
381
+ },
382
+ toJSON(message) {
383
+ const obj = {};
384
+ message.connection !== undefined && (obj.connection = message.connection);
385
+ message.pagination !== undefined &&
386
+ (obj.pagination = message.pagination
387
+ ? PageRequest.toJSON(message.pagination)
388
+ : undefined);
389
+ return obj;
390
+ },
391
+ fromPartial(object) {
392
+ const message = createBaseQueryConnectionChannelsRequest();
393
+ message.connection = object.connection ?? '';
394
+ message.pagination =
395
+ object.pagination !== undefined && object.pagination !== null
396
+ ? PageRequest.fromPartial(object.pagination)
397
+ : undefined;
398
+ return message;
399
+ },
400
+ fromProtoMsg(message) {
401
+ return QueryConnectionChannelsRequest.decode(message.value);
402
+ },
403
+ toProto(message) {
404
+ return QueryConnectionChannelsRequest.encode(message).finish();
405
+ },
406
+ toProtoMsg(message) {
407
+ return {
408
+ typeUrl: '/ibc.core.channel.v1.QueryConnectionChannelsRequest',
409
+ value: QueryConnectionChannelsRequest.encode(message).finish(),
410
+ };
411
+ },
412
+ };
413
+ function createBaseQueryConnectionChannelsResponse() {
414
+ return {
415
+ channels: [],
416
+ pagination: undefined,
417
+ height: Height.fromPartial({}),
418
+ };
419
+ }
420
+ export const QueryConnectionChannelsResponse = {
421
+ typeUrl: '/ibc.core.channel.v1.QueryConnectionChannelsResponse',
422
+ encode(message, writer = BinaryWriter.create()) {
423
+ for (const v of message.channels) {
424
+ IdentifiedChannel.encode(v, writer.uint32(10).fork()).ldelim();
425
+ }
426
+ if (message.pagination !== undefined) {
427
+ PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
428
+ }
429
+ if (message.height !== undefined) {
430
+ Height.encode(message.height, writer.uint32(26).fork()).ldelim();
431
+ }
432
+ return writer;
433
+ },
434
+ decode(input, length) {
435
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
436
+ let end = length === undefined ? reader.len : reader.pos + length;
437
+ const message = createBaseQueryConnectionChannelsResponse();
438
+ while (reader.pos < end) {
439
+ const tag = reader.uint32();
440
+ switch (tag >>> 3) {
441
+ case 1:
442
+ message.channels.push(IdentifiedChannel.decode(reader, reader.uint32()));
443
+ break;
444
+ case 2:
445
+ message.pagination = PageResponse.decode(reader, reader.uint32());
446
+ break;
447
+ case 3:
448
+ message.height = Height.decode(reader, reader.uint32());
449
+ break;
450
+ default:
451
+ reader.skipType(tag & 7);
452
+ break;
453
+ }
454
+ }
455
+ return message;
456
+ },
457
+ fromJSON(object) {
458
+ return {
459
+ channels: Array.isArray(object?.channels)
460
+ ? object.channels.map((e) => IdentifiedChannel.fromJSON(e))
461
+ : [],
462
+ pagination: isSet(object.pagination)
463
+ ? PageResponse.fromJSON(object.pagination)
464
+ : undefined,
465
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
466
+ };
467
+ },
468
+ toJSON(message) {
469
+ const obj = {};
470
+ if (message.channels) {
471
+ obj.channels = message.channels.map(e => e ? IdentifiedChannel.toJSON(e) : undefined);
472
+ }
473
+ else {
474
+ obj.channels = [];
475
+ }
476
+ message.pagination !== undefined &&
477
+ (obj.pagination = message.pagination
478
+ ? PageResponse.toJSON(message.pagination)
479
+ : undefined);
480
+ message.height !== undefined &&
481
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
482
+ return obj;
483
+ },
484
+ fromPartial(object) {
485
+ const message = createBaseQueryConnectionChannelsResponse();
486
+ message.channels =
487
+ object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || [];
488
+ message.pagination =
489
+ object.pagination !== undefined && object.pagination !== null
490
+ ? PageResponse.fromPartial(object.pagination)
491
+ : undefined;
492
+ message.height =
493
+ object.height !== undefined && object.height !== null
494
+ ? Height.fromPartial(object.height)
495
+ : undefined;
496
+ return message;
497
+ },
498
+ fromProtoMsg(message) {
499
+ return QueryConnectionChannelsResponse.decode(message.value);
500
+ },
501
+ toProto(message) {
502
+ return QueryConnectionChannelsResponse.encode(message).finish();
503
+ },
504
+ toProtoMsg(message) {
505
+ return {
506
+ typeUrl: '/ibc.core.channel.v1.QueryConnectionChannelsResponse',
507
+ value: QueryConnectionChannelsResponse.encode(message).finish(),
508
+ };
509
+ },
510
+ };
511
+ function createBaseQueryChannelClientStateRequest() {
512
+ return {
513
+ portId: '',
514
+ channelId: '',
515
+ };
516
+ }
517
+ export const QueryChannelClientStateRequest = {
518
+ typeUrl: '/ibc.core.channel.v1.QueryChannelClientStateRequest',
519
+ encode(message, writer = BinaryWriter.create()) {
520
+ if (message.portId !== '') {
521
+ writer.uint32(10).string(message.portId);
522
+ }
523
+ if (message.channelId !== '') {
524
+ writer.uint32(18).string(message.channelId);
525
+ }
526
+ return writer;
527
+ },
528
+ decode(input, length) {
529
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
530
+ let end = length === undefined ? reader.len : reader.pos + length;
531
+ const message = createBaseQueryChannelClientStateRequest();
532
+ while (reader.pos < end) {
533
+ const tag = reader.uint32();
534
+ switch (tag >>> 3) {
535
+ case 1:
536
+ message.portId = reader.string();
537
+ break;
538
+ case 2:
539
+ message.channelId = reader.string();
540
+ break;
541
+ default:
542
+ reader.skipType(tag & 7);
543
+ break;
544
+ }
545
+ }
546
+ return message;
547
+ },
548
+ fromJSON(object) {
549
+ return {
550
+ portId: isSet(object.portId) ? String(object.portId) : '',
551
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
552
+ };
553
+ },
554
+ toJSON(message) {
555
+ const obj = {};
556
+ message.portId !== undefined && (obj.portId = message.portId);
557
+ message.channelId !== undefined && (obj.channelId = message.channelId);
558
+ return obj;
559
+ },
560
+ fromPartial(object) {
561
+ const message = createBaseQueryChannelClientStateRequest();
562
+ message.portId = object.portId ?? '';
563
+ message.channelId = object.channelId ?? '';
564
+ return message;
565
+ },
566
+ fromProtoMsg(message) {
567
+ return QueryChannelClientStateRequest.decode(message.value);
568
+ },
569
+ toProto(message) {
570
+ return QueryChannelClientStateRequest.encode(message).finish();
571
+ },
572
+ toProtoMsg(message) {
573
+ return {
574
+ typeUrl: '/ibc.core.channel.v1.QueryChannelClientStateRequest',
575
+ value: QueryChannelClientStateRequest.encode(message).finish(),
576
+ };
577
+ },
578
+ };
579
+ function createBaseQueryChannelClientStateResponse() {
580
+ return {
581
+ identifiedClientState: undefined,
582
+ proof: new Uint8Array(),
583
+ proofHeight: Height.fromPartial({}),
584
+ };
585
+ }
586
+ export const QueryChannelClientStateResponse = {
587
+ typeUrl: '/ibc.core.channel.v1.QueryChannelClientStateResponse',
588
+ encode(message, writer = BinaryWriter.create()) {
589
+ if (message.identifiedClientState !== undefined) {
590
+ IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim();
591
+ }
592
+ if (message.proof.length !== 0) {
593
+ writer.uint32(18).bytes(message.proof);
594
+ }
595
+ if (message.proofHeight !== undefined) {
596
+ Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
597
+ }
598
+ return writer;
599
+ },
600
+ decode(input, length) {
601
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
602
+ let end = length === undefined ? reader.len : reader.pos + length;
603
+ const message = createBaseQueryChannelClientStateResponse();
604
+ while (reader.pos < end) {
605
+ const tag = reader.uint32();
606
+ switch (tag >>> 3) {
607
+ case 1:
608
+ message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32());
609
+ break;
610
+ case 2:
611
+ message.proof = reader.bytes();
612
+ break;
613
+ case 3:
614
+ message.proofHeight = Height.decode(reader, reader.uint32());
615
+ break;
616
+ default:
617
+ reader.skipType(tag & 7);
618
+ break;
619
+ }
620
+ }
621
+ return message;
622
+ },
623
+ fromJSON(object) {
624
+ return {
625
+ identifiedClientState: isSet(object.identifiedClientState)
626
+ ? IdentifiedClientState.fromJSON(object.identifiedClientState)
627
+ : undefined,
628
+ proof: isSet(object.proof)
629
+ ? bytesFromBase64(object.proof)
630
+ : new Uint8Array(),
631
+ proofHeight: isSet(object.proofHeight)
632
+ ? Height.fromJSON(object.proofHeight)
633
+ : undefined,
634
+ };
635
+ },
636
+ toJSON(message) {
637
+ const obj = {};
638
+ message.identifiedClientState !== undefined &&
639
+ (obj.identifiedClientState = message.identifiedClientState
640
+ ? IdentifiedClientState.toJSON(message.identifiedClientState)
641
+ : undefined);
642
+ message.proof !== undefined &&
643
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
644
+ message.proofHeight !== undefined &&
645
+ (obj.proofHeight = message.proofHeight
646
+ ? Height.toJSON(message.proofHeight)
647
+ : undefined);
648
+ return obj;
649
+ },
650
+ fromPartial(object) {
651
+ const message = createBaseQueryChannelClientStateResponse();
652
+ message.identifiedClientState =
653
+ object.identifiedClientState !== undefined &&
654
+ object.identifiedClientState !== null
655
+ ? IdentifiedClientState.fromPartial(object.identifiedClientState)
656
+ : undefined;
657
+ message.proof = object.proof ?? new Uint8Array();
658
+ message.proofHeight =
659
+ object.proofHeight !== undefined && object.proofHeight !== null
660
+ ? Height.fromPartial(object.proofHeight)
661
+ : undefined;
662
+ return message;
663
+ },
664
+ fromProtoMsg(message) {
665
+ return QueryChannelClientStateResponse.decode(message.value);
666
+ },
667
+ toProto(message) {
668
+ return QueryChannelClientStateResponse.encode(message).finish();
669
+ },
670
+ toProtoMsg(message) {
671
+ return {
672
+ typeUrl: '/ibc.core.channel.v1.QueryChannelClientStateResponse',
673
+ value: QueryChannelClientStateResponse.encode(message).finish(),
674
+ };
675
+ },
676
+ };
677
+ function createBaseQueryChannelConsensusStateRequest() {
678
+ return {
679
+ portId: '',
680
+ channelId: '',
681
+ revisionNumber: BigInt(0),
682
+ revisionHeight: BigInt(0),
683
+ };
684
+ }
685
+ export const QueryChannelConsensusStateRequest = {
686
+ typeUrl: '/ibc.core.channel.v1.QueryChannelConsensusStateRequest',
687
+ encode(message, writer = BinaryWriter.create()) {
688
+ if (message.portId !== '') {
689
+ writer.uint32(10).string(message.portId);
690
+ }
691
+ if (message.channelId !== '') {
692
+ writer.uint32(18).string(message.channelId);
693
+ }
694
+ if (message.revisionNumber !== BigInt(0)) {
695
+ writer.uint32(24).uint64(message.revisionNumber);
696
+ }
697
+ if (message.revisionHeight !== BigInt(0)) {
698
+ writer.uint32(32).uint64(message.revisionHeight);
699
+ }
700
+ return writer;
701
+ },
702
+ decode(input, length) {
703
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
704
+ let end = length === undefined ? reader.len : reader.pos + length;
705
+ const message = createBaseQueryChannelConsensusStateRequest();
706
+ while (reader.pos < end) {
707
+ const tag = reader.uint32();
708
+ switch (tag >>> 3) {
709
+ case 1:
710
+ message.portId = reader.string();
711
+ break;
712
+ case 2:
713
+ message.channelId = reader.string();
714
+ break;
715
+ case 3:
716
+ message.revisionNumber = reader.uint64();
717
+ break;
718
+ case 4:
719
+ message.revisionHeight = reader.uint64();
720
+ break;
721
+ default:
722
+ reader.skipType(tag & 7);
723
+ break;
724
+ }
725
+ }
726
+ return message;
727
+ },
728
+ fromJSON(object) {
729
+ return {
730
+ portId: isSet(object.portId) ? String(object.portId) : '',
731
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
732
+ revisionNumber: isSet(object.revisionNumber)
733
+ ? BigInt(object.revisionNumber.toString())
734
+ : BigInt(0),
735
+ revisionHeight: isSet(object.revisionHeight)
736
+ ? BigInt(object.revisionHeight.toString())
737
+ : BigInt(0),
738
+ };
739
+ },
740
+ toJSON(message) {
741
+ const obj = {};
742
+ message.portId !== undefined && (obj.portId = message.portId);
743
+ message.channelId !== undefined && (obj.channelId = message.channelId);
744
+ message.revisionNumber !== undefined &&
745
+ (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString());
746
+ message.revisionHeight !== undefined &&
747
+ (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString());
748
+ return obj;
749
+ },
750
+ fromPartial(object) {
751
+ const message = createBaseQueryChannelConsensusStateRequest();
752
+ message.portId = object.portId ?? '';
753
+ message.channelId = object.channelId ?? '';
754
+ message.revisionNumber =
755
+ object.revisionNumber !== undefined && object.revisionNumber !== null
756
+ ? BigInt(object.revisionNumber.toString())
757
+ : BigInt(0);
758
+ message.revisionHeight =
759
+ object.revisionHeight !== undefined && object.revisionHeight !== null
760
+ ? BigInt(object.revisionHeight.toString())
761
+ : BigInt(0);
762
+ return message;
763
+ },
764
+ fromProtoMsg(message) {
765
+ return QueryChannelConsensusStateRequest.decode(message.value);
766
+ },
767
+ toProto(message) {
768
+ return QueryChannelConsensusStateRequest.encode(message).finish();
769
+ },
770
+ toProtoMsg(message) {
771
+ return {
772
+ typeUrl: '/ibc.core.channel.v1.QueryChannelConsensusStateRequest',
773
+ value: QueryChannelConsensusStateRequest.encode(message).finish(),
774
+ };
775
+ },
776
+ };
777
+ function createBaseQueryChannelConsensusStateResponse() {
778
+ return {
779
+ consensusState: undefined,
780
+ clientId: '',
781
+ proof: new Uint8Array(),
782
+ proofHeight: Height.fromPartial({}),
783
+ };
784
+ }
785
+ export const QueryChannelConsensusStateResponse = {
786
+ typeUrl: '/ibc.core.channel.v1.QueryChannelConsensusStateResponse',
787
+ encode(message, writer = BinaryWriter.create()) {
788
+ if (message.consensusState !== undefined) {
789
+ Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim();
790
+ }
791
+ if (message.clientId !== '') {
792
+ writer.uint32(18).string(message.clientId);
793
+ }
794
+ if (message.proof.length !== 0) {
795
+ writer.uint32(26).bytes(message.proof);
796
+ }
797
+ if (message.proofHeight !== undefined) {
798
+ Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();
799
+ }
800
+ return writer;
801
+ },
802
+ decode(input, length) {
803
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
804
+ let end = length === undefined ? reader.len : reader.pos + length;
805
+ const message = createBaseQueryChannelConsensusStateResponse();
806
+ while (reader.pos < end) {
807
+ const tag = reader.uint32();
808
+ switch (tag >>> 3) {
809
+ case 1:
810
+ message.consensusState = Any.decode(reader, reader.uint32());
811
+ break;
812
+ case 2:
813
+ message.clientId = reader.string();
814
+ break;
815
+ case 3:
816
+ message.proof = reader.bytes();
817
+ break;
818
+ case 4:
819
+ message.proofHeight = Height.decode(reader, reader.uint32());
820
+ break;
821
+ default:
822
+ reader.skipType(tag & 7);
823
+ break;
824
+ }
825
+ }
826
+ return message;
827
+ },
828
+ fromJSON(object) {
829
+ return {
830
+ consensusState: isSet(object.consensusState)
831
+ ? Any.fromJSON(object.consensusState)
832
+ : undefined,
833
+ clientId: isSet(object.clientId) ? String(object.clientId) : '',
834
+ proof: isSet(object.proof)
835
+ ? bytesFromBase64(object.proof)
836
+ : new Uint8Array(),
837
+ proofHeight: isSet(object.proofHeight)
838
+ ? Height.fromJSON(object.proofHeight)
839
+ : undefined,
840
+ };
841
+ },
842
+ toJSON(message) {
843
+ const obj = {};
844
+ message.consensusState !== undefined &&
845
+ (obj.consensusState = message.consensusState
846
+ ? Any.toJSON(message.consensusState)
847
+ : undefined);
848
+ message.clientId !== undefined && (obj.clientId = message.clientId);
849
+ message.proof !== undefined &&
850
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
851
+ message.proofHeight !== undefined &&
852
+ (obj.proofHeight = message.proofHeight
853
+ ? Height.toJSON(message.proofHeight)
854
+ : undefined);
855
+ return obj;
856
+ },
857
+ fromPartial(object) {
858
+ const message = createBaseQueryChannelConsensusStateResponse();
859
+ message.consensusState =
860
+ object.consensusState !== undefined && object.consensusState !== null
861
+ ? Any.fromPartial(object.consensusState)
862
+ : undefined;
863
+ message.clientId = object.clientId ?? '';
864
+ message.proof = object.proof ?? new Uint8Array();
865
+ message.proofHeight =
866
+ object.proofHeight !== undefined && object.proofHeight !== null
867
+ ? Height.fromPartial(object.proofHeight)
868
+ : undefined;
869
+ return message;
870
+ },
871
+ fromProtoMsg(message) {
872
+ return QueryChannelConsensusStateResponse.decode(message.value);
873
+ },
874
+ toProto(message) {
875
+ return QueryChannelConsensusStateResponse.encode(message).finish();
876
+ },
877
+ toProtoMsg(message) {
878
+ return {
879
+ typeUrl: '/ibc.core.channel.v1.QueryChannelConsensusStateResponse',
880
+ value: QueryChannelConsensusStateResponse.encode(message).finish(),
881
+ };
882
+ },
883
+ };
884
+ function createBaseQueryPacketCommitmentRequest() {
885
+ return {
886
+ portId: '',
887
+ channelId: '',
888
+ sequence: BigInt(0),
889
+ };
890
+ }
891
+ export const QueryPacketCommitmentRequest = {
892
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentRequest',
893
+ encode(message, writer = BinaryWriter.create()) {
894
+ if (message.portId !== '') {
895
+ writer.uint32(10).string(message.portId);
896
+ }
897
+ if (message.channelId !== '') {
898
+ writer.uint32(18).string(message.channelId);
899
+ }
900
+ if (message.sequence !== BigInt(0)) {
901
+ writer.uint32(24).uint64(message.sequence);
902
+ }
903
+ return writer;
904
+ },
905
+ decode(input, length) {
906
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
907
+ let end = length === undefined ? reader.len : reader.pos + length;
908
+ const message = createBaseQueryPacketCommitmentRequest();
909
+ while (reader.pos < end) {
910
+ const tag = reader.uint32();
911
+ switch (tag >>> 3) {
912
+ case 1:
913
+ message.portId = reader.string();
914
+ break;
915
+ case 2:
916
+ message.channelId = reader.string();
917
+ break;
918
+ case 3:
919
+ message.sequence = reader.uint64();
920
+ break;
921
+ default:
922
+ reader.skipType(tag & 7);
923
+ break;
924
+ }
925
+ }
926
+ return message;
927
+ },
928
+ fromJSON(object) {
929
+ return {
930
+ portId: isSet(object.portId) ? String(object.portId) : '',
931
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
932
+ sequence: isSet(object.sequence)
933
+ ? BigInt(object.sequence.toString())
934
+ : BigInt(0),
935
+ };
936
+ },
937
+ toJSON(message) {
938
+ const obj = {};
939
+ message.portId !== undefined && (obj.portId = message.portId);
940
+ message.channelId !== undefined && (obj.channelId = message.channelId);
941
+ message.sequence !== undefined &&
942
+ (obj.sequence = (message.sequence || BigInt(0)).toString());
943
+ return obj;
944
+ },
945
+ fromPartial(object) {
946
+ const message = createBaseQueryPacketCommitmentRequest();
947
+ message.portId = object.portId ?? '';
948
+ message.channelId = object.channelId ?? '';
949
+ message.sequence =
950
+ object.sequence !== undefined && object.sequence !== null
951
+ ? BigInt(object.sequence.toString())
952
+ : BigInt(0);
953
+ return message;
954
+ },
955
+ fromProtoMsg(message) {
956
+ return QueryPacketCommitmentRequest.decode(message.value);
957
+ },
958
+ toProto(message) {
959
+ return QueryPacketCommitmentRequest.encode(message).finish();
960
+ },
961
+ toProtoMsg(message) {
962
+ return {
963
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentRequest',
964
+ value: QueryPacketCommitmentRequest.encode(message).finish(),
965
+ };
966
+ },
967
+ };
968
+ function createBaseQueryPacketCommitmentResponse() {
969
+ return {
970
+ commitment: new Uint8Array(),
971
+ proof: new Uint8Array(),
972
+ proofHeight: Height.fromPartial({}),
973
+ };
974
+ }
975
+ export const QueryPacketCommitmentResponse = {
976
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentResponse',
977
+ encode(message, writer = BinaryWriter.create()) {
978
+ if (message.commitment.length !== 0) {
979
+ writer.uint32(10).bytes(message.commitment);
980
+ }
981
+ if (message.proof.length !== 0) {
982
+ writer.uint32(18).bytes(message.proof);
983
+ }
984
+ if (message.proofHeight !== undefined) {
985
+ Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
986
+ }
987
+ return writer;
988
+ },
989
+ decode(input, length) {
990
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
991
+ let end = length === undefined ? reader.len : reader.pos + length;
992
+ const message = createBaseQueryPacketCommitmentResponse();
993
+ while (reader.pos < end) {
994
+ const tag = reader.uint32();
995
+ switch (tag >>> 3) {
996
+ case 1:
997
+ message.commitment = reader.bytes();
998
+ break;
999
+ case 2:
1000
+ message.proof = reader.bytes();
1001
+ break;
1002
+ case 3:
1003
+ message.proofHeight = Height.decode(reader, reader.uint32());
1004
+ break;
1005
+ default:
1006
+ reader.skipType(tag & 7);
1007
+ break;
1008
+ }
1009
+ }
1010
+ return message;
1011
+ },
1012
+ fromJSON(object) {
1013
+ return {
1014
+ commitment: isSet(object.commitment)
1015
+ ? bytesFromBase64(object.commitment)
1016
+ : new Uint8Array(),
1017
+ proof: isSet(object.proof)
1018
+ ? bytesFromBase64(object.proof)
1019
+ : new Uint8Array(),
1020
+ proofHeight: isSet(object.proofHeight)
1021
+ ? Height.fromJSON(object.proofHeight)
1022
+ : undefined,
1023
+ };
1024
+ },
1025
+ toJSON(message) {
1026
+ const obj = {};
1027
+ message.commitment !== undefined &&
1028
+ (obj.commitment = base64FromBytes(message.commitment !== undefined
1029
+ ? message.commitment
1030
+ : new Uint8Array()));
1031
+ message.proof !== undefined &&
1032
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
1033
+ message.proofHeight !== undefined &&
1034
+ (obj.proofHeight = message.proofHeight
1035
+ ? Height.toJSON(message.proofHeight)
1036
+ : undefined);
1037
+ return obj;
1038
+ },
1039
+ fromPartial(object) {
1040
+ const message = createBaseQueryPacketCommitmentResponse();
1041
+ message.commitment = object.commitment ?? new Uint8Array();
1042
+ message.proof = object.proof ?? new Uint8Array();
1043
+ message.proofHeight =
1044
+ object.proofHeight !== undefined && object.proofHeight !== null
1045
+ ? Height.fromPartial(object.proofHeight)
1046
+ : undefined;
1047
+ return message;
1048
+ },
1049
+ fromProtoMsg(message) {
1050
+ return QueryPacketCommitmentResponse.decode(message.value);
1051
+ },
1052
+ toProto(message) {
1053
+ return QueryPacketCommitmentResponse.encode(message).finish();
1054
+ },
1055
+ toProtoMsg(message) {
1056
+ return {
1057
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentResponse',
1058
+ value: QueryPacketCommitmentResponse.encode(message).finish(),
1059
+ };
1060
+ },
1061
+ };
1062
+ function createBaseQueryPacketCommitmentsRequest() {
1063
+ return {
1064
+ portId: '',
1065
+ channelId: '',
1066
+ pagination: undefined,
1067
+ };
1068
+ }
1069
+ export const QueryPacketCommitmentsRequest = {
1070
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentsRequest',
1071
+ encode(message, writer = BinaryWriter.create()) {
1072
+ if (message.portId !== '') {
1073
+ writer.uint32(10).string(message.portId);
1074
+ }
1075
+ if (message.channelId !== '') {
1076
+ writer.uint32(18).string(message.channelId);
1077
+ }
1078
+ if (message.pagination !== undefined) {
1079
+ PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim();
1080
+ }
1081
+ return writer;
1082
+ },
1083
+ decode(input, length) {
1084
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1085
+ let end = length === undefined ? reader.len : reader.pos + length;
1086
+ const message = createBaseQueryPacketCommitmentsRequest();
1087
+ while (reader.pos < end) {
1088
+ const tag = reader.uint32();
1089
+ switch (tag >>> 3) {
1090
+ case 1:
1091
+ message.portId = reader.string();
1092
+ break;
1093
+ case 2:
1094
+ message.channelId = reader.string();
1095
+ break;
1096
+ case 3:
1097
+ message.pagination = PageRequest.decode(reader, reader.uint32());
1098
+ break;
1099
+ default:
1100
+ reader.skipType(tag & 7);
1101
+ break;
1102
+ }
1103
+ }
1104
+ return message;
1105
+ },
1106
+ fromJSON(object) {
1107
+ return {
1108
+ portId: isSet(object.portId) ? String(object.portId) : '',
1109
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
1110
+ pagination: isSet(object.pagination)
1111
+ ? PageRequest.fromJSON(object.pagination)
1112
+ : undefined,
1113
+ };
1114
+ },
1115
+ toJSON(message) {
1116
+ const obj = {};
1117
+ message.portId !== undefined && (obj.portId = message.portId);
1118
+ message.channelId !== undefined && (obj.channelId = message.channelId);
1119
+ message.pagination !== undefined &&
1120
+ (obj.pagination = message.pagination
1121
+ ? PageRequest.toJSON(message.pagination)
1122
+ : undefined);
1123
+ return obj;
1124
+ },
1125
+ fromPartial(object) {
1126
+ const message = createBaseQueryPacketCommitmentsRequest();
1127
+ message.portId = object.portId ?? '';
1128
+ message.channelId = object.channelId ?? '';
1129
+ message.pagination =
1130
+ object.pagination !== undefined && object.pagination !== null
1131
+ ? PageRequest.fromPartial(object.pagination)
1132
+ : undefined;
1133
+ return message;
1134
+ },
1135
+ fromProtoMsg(message) {
1136
+ return QueryPacketCommitmentsRequest.decode(message.value);
1137
+ },
1138
+ toProto(message) {
1139
+ return QueryPacketCommitmentsRequest.encode(message).finish();
1140
+ },
1141
+ toProtoMsg(message) {
1142
+ return {
1143
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentsRequest',
1144
+ value: QueryPacketCommitmentsRequest.encode(message).finish(),
1145
+ };
1146
+ },
1147
+ };
1148
+ function createBaseQueryPacketCommitmentsResponse() {
1149
+ return {
1150
+ commitments: [],
1151
+ pagination: undefined,
1152
+ height: Height.fromPartial({}),
1153
+ };
1154
+ }
1155
+ export const QueryPacketCommitmentsResponse = {
1156
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentsResponse',
1157
+ encode(message, writer = BinaryWriter.create()) {
1158
+ for (const v of message.commitments) {
1159
+ PacketState.encode(v, writer.uint32(10).fork()).ldelim();
1160
+ }
1161
+ if (message.pagination !== undefined) {
1162
+ PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1163
+ }
1164
+ if (message.height !== undefined) {
1165
+ Height.encode(message.height, writer.uint32(26).fork()).ldelim();
1166
+ }
1167
+ return writer;
1168
+ },
1169
+ decode(input, length) {
1170
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1171
+ let end = length === undefined ? reader.len : reader.pos + length;
1172
+ const message = createBaseQueryPacketCommitmentsResponse();
1173
+ while (reader.pos < end) {
1174
+ const tag = reader.uint32();
1175
+ switch (tag >>> 3) {
1176
+ case 1:
1177
+ message.commitments.push(PacketState.decode(reader, reader.uint32()));
1178
+ break;
1179
+ case 2:
1180
+ message.pagination = PageResponse.decode(reader, reader.uint32());
1181
+ break;
1182
+ case 3:
1183
+ message.height = Height.decode(reader, reader.uint32());
1184
+ break;
1185
+ default:
1186
+ reader.skipType(tag & 7);
1187
+ break;
1188
+ }
1189
+ }
1190
+ return message;
1191
+ },
1192
+ fromJSON(object) {
1193
+ return {
1194
+ commitments: Array.isArray(object?.commitments)
1195
+ ? object.commitments.map((e) => PacketState.fromJSON(e))
1196
+ : [],
1197
+ pagination: isSet(object.pagination)
1198
+ ? PageResponse.fromJSON(object.pagination)
1199
+ : undefined,
1200
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
1201
+ };
1202
+ },
1203
+ toJSON(message) {
1204
+ const obj = {};
1205
+ if (message.commitments) {
1206
+ obj.commitments = message.commitments.map(e => e ? PacketState.toJSON(e) : undefined);
1207
+ }
1208
+ else {
1209
+ obj.commitments = [];
1210
+ }
1211
+ message.pagination !== undefined &&
1212
+ (obj.pagination = message.pagination
1213
+ ? PageResponse.toJSON(message.pagination)
1214
+ : undefined);
1215
+ message.height !== undefined &&
1216
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
1217
+ return obj;
1218
+ },
1219
+ fromPartial(object) {
1220
+ const message = createBaseQueryPacketCommitmentsResponse();
1221
+ message.commitments =
1222
+ object.commitments?.map(e => PacketState.fromPartial(e)) || [];
1223
+ message.pagination =
1224
+ object.pagination !== undefined && object.pagination !== null
1225
+ ? PageResponse.fromPartial(object.pagination)
1226
+ : undefined;
1227
+ message.height =
1228
+ object.height !== undefined && object.height !== null
1229
+ ? Height.fromPartial(object.height)
1230
+ : undefined;
1231
+ return message;
1232
+ },
1233
+ fromProtoMsg(message) {
1234
+ return QueryPacketCommitmentsResponse.decode(message.value);
1235
+ },
1236
+ toProto(message) {
1237
+ return QueryPacketCommitmentsResponse.encode(message).finish();
1238
+ },
1239
+ toProtoMsg(message) {
1240
+ return {
1241
+ typeUrl: '/ibc.core.channel.v1.QueryPacketCommitmentsResponse',
1242
+ value: QueryPacketCommitmentsResponse.encode(message).finish(),
1243
+ };
1244
+ },
1245
+ };
1246
+ function createBaseQueryPacketReceiptRequest() {
1247
+ return {
1248
+ portId: '',
1249
+ channelId: '',
1250
+ sequence: BigInt(0),
1251
+ };
1252
+ }
1253
+ export const QueryPacketReceiptRequest = {
1254
+ typeUrl: '/ibc.core.channel.v1.QueryPacketReceiptRequest',
1255
+ encode(message, writer = BinaryWriter.create()) {
1256
+ if (message.portId !== '') {
1257
+ writer.uint32(10).string(message.portId);
1258
+ }
1259
+ if (message.channelId !== '') {
1260
+ writer.uint32(18).string(message.channelId);
1261
+ }
1262
+ if (message.sequence !== BigInt(0)) {
1263
+ writer.uint32(24).uint64(message.sequence);
1264
+ }
1265
+ return writer;
1266
+ },
1267
+ decode(input, length) {
1268
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1269
+ let end = length === undefined ? reader.len : reader.pos + length;
1270
+ const message = createBaseQueryPacketReceiptRequest();
1271
+ while (reader.pos < end) {
1272
+ const tag = reader.uint32();
1273
+ switch (tag >>> 3) {
1274
+ case 1:
1275
+ message.portId = reader.string();
1276
+ break;
1277
+ case 2:
1278
+ message.channelId = reader.string();
1279
+ break;
1280
+ case 3:
1281
+ message.sequence = reader.uint64();
1282
+ break;
1283
+ default:
1284
+ reader.skipType(tag & 7);
1285
+ break;
1286
+ }
1287
+ }
1288
+ return message;
1289
+ },
1290
+ fromJSON(object) {
1291
+ return {
1292
+ portId: isSet(object.portId) ? String(object.portId) : '',
1293
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
1294
+ sequence: isSet(object.sequence)
1295
+ ? BigInt(object.sequence.toString())
1296
+ : BigInt(0),
1297
+ };
1298
+ },
1299
+ toJSON(message) {
1300
+ const obj = {};
1301
+ message.portId !== undefined && (obj.portId = message.portId);
1302
+ message.channelId !== undefined && (obj.channelId = message.channelId);
1303
+ message.sequence !== undefined &&
1304
+ (obj.sequence = (message.sequence || BigInt(0)).toString());
1305
+ return obj;
1306
+ },
1307
+ fromPartial(object) {
1308
+ const message = createBaseQueryPacketReceiptRequest();
1309
+ message.portId = object.portId ?? '';
1310
+ message.channelId = object.channelId ?? '';
1311
+ message.sequence =
1312
+ object.sequence !== undefined && object.sequence !== null
1313
+ ? BigInt(object.sequence.toString())
1314
+ : BigInt(0);
1315
+ return message;
1316
+ },
1317
+ fromProtoMsg(message) {
1318
+ return QueryPacketReceiptRequest.decode(message.value);
1319
+ },
1320
+ toProto(message) {
1321
+ return QueryPacketReceiptRequest.encode(message).finish();
1322
+ },
1323
+ toProtoMsg(message) {
1324
+ return {
1325
+ typeUrl: '/ibc.core.channel.v1.QueryPacketReceiptRequest',
1326
+ value: QueryPacketReceiptRequest.encode(message).finish(),
1327
+ };
1328
+ },
1329
+ };
1330
+ function createBaseQueryPacketReceiptResponse() {
1331
+ return {
1332
+ received: false,
1333
+ proof: new Uint8Array(),
1334
+ proofHeight: Height.fromPartial({}),
1335
+ };
1336
+ }
1337
+ export const QueryPacketReceiptResponse = {
1338
+ typeUrl: '/ibc.core.channel.v1.QueryPacketReceiptResponse',
1339
+ encode(message, writer = BinaryWriter.create()) {
1340
+ if (message.received === true) {
1341
+ writer.uint32(16).bool(message.received);
1342
+ }
1343
+ if (message.proof.length !== 0) {
1344
+ writer.uint32(26).bytes(message.proof);
1345
+ }
1346
+ if (message.proofHeight !== undefined) {
1347
+ Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();
1348
+ }
1349
+ return writer;
1350
+ },
1351
+ decode(input, length) {
1352
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1353
+ let end = length === undefined ? reader.len : reader.pos + length;
1354
+ const message = createBaseQueryPacketReceiptResponse();
1355
+ while (reader.pos < end) {
1356
+ const tag = reader.uint32();
1357
+ switch (tag >>> 3) {
1358
+ case 2:
1359
+ message.received = reader.bool();
1360
+ break;
1361
+ case 3:
1362
+ message.proof = reader.bytes();
1363
+ break;
1364
+ case 4:
1365
+ message.proofHeight = Height.decode(reader, reader.uint32());
1366
+ break;
1367
+ default:
1368
+ reader.skipType(tag & 7);
1369
+ break;
1370
+ }
1371
+ }
1372
+ return message;
1373
+ },
1374
+ fromJSON(object) {
1375
+ return {
1376
+ received: isSet(object.received) ? Boolean(object.received) : false,
1377
+ proof: isSet(object.proof)
1378
+ ? bytesFromBase64(object.proof)
1379
+ : new Uint8Array(),
1380
+ proofHeight: isSet(object.proofHeight)
1381
+ ? Height.fromJSON(object.proofHeight)
1382
+ : undefined,
1383
+ };
1384
+ },
1385
+ toJSON(message) {
1386
+ const obj = {};
1387
+ message.received !== undefined && (obj.received = message.received);
1388
+ message.proof !== undefined &&
1389
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
1390
+ message.proofHeight !== undefined &&
1391
+ (obj.proofHeight = message.proofHeight
1392
+ ? Height.toJSON(message.proofHeight)
1393
+ : undefined);
1394
+ return obj;
1395
+ },
1396
+ fromPartial(object) {
1397
+ const message = createBaseQueryPacketReceiptResponse();
1398
+ message.received = object.received ?? false;
1399
+ message.proof = object.proof ?? new Uint8Array();
1400
+ message.proofHeight =
1401
+ object.proofHeight !== undefined && object.proofHeight !== null
1402
+ ? Height.fromPartial(object.proofHeight)
1403
+ : undefined;
1404
+ return message;
1405
+ },
1406
+ fromProtoMsg(message) {
1407
+ return QueryPacketReceiptResponse.decode(message.value);
1408
+ },
1409
+ toProto(message) {
1410
+ return QueryPacketReceiptResponse.encode(message).finish();
1411
+ },
1412
+ toProtoMsg(message) {
1413
+ return {
1414
+ typeUrl: '/ibc.core.channel.v1.QueryPacketReceiptResponse',
1415
+ value: QueryPacketReceiptResponse.encode(message).finish(),
1416
+ };
1417
+ },
1418
+ };
1419
+ function createBaseQueryPacketAcknowledgementRequest() {
1420
+ return {
1421
+ portId: '',
1422
+ channelId: '',
1423
+ sequence: BigInt(0),
1424
+ };
1425
+ }
1426
+ export const QueryPacketAcknowledgementRequest = {
1427
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementRequest',
1428
+ encode(message, writer = BinaryWriter.create()) {
1429
+ if (message.portId !== '') {
1430
+ writer.uint32(10).string(message.portId);
1431
+ }
1432
+ if (message.channelId !== '') {
1433
+ writer.uint32(18).string(message.channelId);
1434
+ }
1435
+ if (message.sequence !== BigInt(0)) {
1436
+ writer.uint32(24).uint64(message.sequence);
1437
+ }
1438
+ return writer;
1439
+ },
1440
+ decode(input, length) {
1441
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1442
+ let end = length === undefined ? reader.len : reader.pos + length;
1443
+ const message = createBaseQueryPacketAcknowledgementRequest();
1444
+ while (reader.pos < end) {
1445
+ const tag = reader.uint32();
1446
+ switch (tag >>> 3) {
1447
+ case 1:
1448
+ message.portId = reader.string();
1449
+ break;
1450
+ case 2:
1451
+ message.channelId = reader.string();
1452
+ break;
1453
+ case 3:
1454
+ message.sequence = reader.uint64();
1455
+ break;
1456
+ default:
1457
+ reader.skipType(tag & 7);
1458
+ break;
1459
+ }
1460
+ }
1461
+ return message;
1462
+ },
1463
+ fromJSON(object) {
1464
+ return {
1465
+ portId: isSet(object.portId) ? String(object.portId) : '',
1466
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
1467
+ sequence: isSet(object.sequence)
1468
+ ? BigInt(object.sequence.toString())
1469
+ : BigInt(0),
1470
+ };
1471
+ },
1472
+ toJSON(message) {
1473
+ const obj = {};
1474
+ message.portId !== undefined && (obj.portId = message.portId);
1475
+ message.channelId !== undefined && (obj.channelId = message.channelId);
1476
+ message.sequence !== undefined &&
1477
+ (obj.sequence = (message.sequence || BigInt(0)).toString());
1478
+ return obj;
1479
+ },
1480
+ fromPartial(object) {
1481
+ const message = createBaseQueryPacketAcknowledgementRequest();
1482
+ message.portId = object.portId ?? '';
1483
+ message.channelId = object.channelId ?? '';
1484
+ message.sequence =
1485
+ object.sequence !== undefined && object.sequence !== null
1486
+ ? BigInt(object.sequence.toString())
1487
+ : BigInt(0);
1488
+ return message;
1489
+ },
1490
+ fromProtoMsg(message) {
1491
+ return QueryPacketAcknowledgementRequest.decode(message.value);
1492
+ },
1493
+ toProto(message) {
1494
+ return QueryPacketAcknowledgementRequest.encode(message).finish();
1495
+ },
1496
+ toProtoMsg(message) {
1497
+ return {
1498
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementRequest',
1499
+ value: QueryPacketAcknowledgementRequest.encode(message).finish(),
1500
+ };
1501
+ },
1502
+ };
1503
+ function createBaseQueryPacketAcknowledgementResponse() {
1504
+ return {
1505
+ acknowledgement: new Uint8Array(),
1506
+ proof: new Uint8Array(),
1507
+ proofHeight: Height.fromPartial({}),
1508
+ };
1509
+ }
1510
+ export const QueryPacketAcknowledgementResponse = {
1511
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementResponse',
1512
+ encode(message, writer = BinaryWriter.create()) {
1513
+ if (message.acknowledgement.length !== 0) {
1514
+ writer.uint32(10).bytes(message.acknowledgement);
1515
+ }
1516
+ if (message.proof.length !== 0) {
1517
+ writer.uint32(18).bytes(message.proof);
1518
+ }
1519
+ if (message.proofHeight !== undefined) {
1520
+ Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
1521
+ }
1522
+ return writer;
1523
+ },
1524
+ decode(input, length) {
1525
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1526
+ let end = length === undefined ? reader.len : reader.pos + length;
1527
+ const message = createBaseQueryPacketAcknowledgementResponse();
1528
+ while (reader.pos < end) {
1529
+ const tag = reader.uint32();
1530
+ switch (tag >>> 3) {
1531
+ case 1:
1532
+ message.acknowledgement = reader.bytes();
1533
+ break;
1534
+ case 2:
1535
+ message.proof = reader.bytes();
1536
+ break;
1537
+ case 3:
1538
+ message.proofHeight = Height.decode(reader, reader.uint32());
1539
+ break;
1540
+ default:
1541
+ reader.skipType(tag & 7);
1542
+ break;
1543
+ }
1544
+ }
1545
+ return message;
1546
+ },
1547
+ fromJSON(object) {
1548
+ return {
1549
+ acknowledgement: isSet(object.acknowledgement)
1550
+ ? bytesFromBase64(object.acknowledgement)
1551
+ : new Uint8Array(),
1552
+ proof: isSet(object.proof)
1553
+ ? bytesFromBase64(object.proof)
1554
+ : new Uint8Array(),
1555
+ proofHeight: isSet(object.proofHeight)
1556
+ ? Height.fromJSON(object.proofHeight)
1557
+ : undefined,
1558
+ };
1559
+ },
1560
+ toJSON(message) {
1561
+ const obj = {};
1562
+ message.acknowledgement !== undefined &&
1563
+ (obj.acknowledgement = base64FromBytes(message.acknowledgement !== undefined
1564
+ ? message.acknowledgement
1565
+ : new Uint8Array()));
1566
+ message.proof !== undefined &&
1567
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
1568
+ message.proofHeight !== undefined &&
1569
+ (obj.proofHeight = message.proofHeight
1570
+ ? Height.toJSON(message.proofHeight)
1571
+ : undefined);
1572
+ return obj;
1573
+ },
1574
+ fromPartial(object) {
1575
+ const message = createBaseQueryPacketAcknowledgementResponse();
1576
+ message.acknowledgement = object.acknowledgement ?? new Uint8Array();
1577
+ message.proof = object.proof ?? new Uint8Array();
1578
+ message.proofHeight =
1579
+ object.proofHeight !== undefined && object.proofHeight !== null
1580
+ ? Height.fromPartial(object.proofHeight)
1581
+ : undefined;
1582
+ return message;
1583
+ },
1584
+ fromProtoMsg(message) {
1585
+ return QueryPacketAcknowledgementResponse.decode(message.value);
1586
+ },
1587
+ toProto(message) {
1588
+ return QueryPacketAcknowledgementResponse.encode(message).finish();
1589
+ },
1590
+ toProtoMsg(message) {
1591
+ return {
1592
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementResponse',
1593
+ value: QueryPacketAcknowledgementResponse.encode(message).finish(),
1594
+ };
1595
+ },
1596
+ };
1597
+ function createBaseQueryPacketAcknowledgementsRequest() {
1598
+ return {
1599
+ portId: '',
1600
+ channelId: '',
1601
+ pagination: undefined,
1602
+ packetCommitmentSequences: [],
1603
+ };
1604
+ }
1605
+ export const QueryPacketAcknowledgementsRequest = {
1606
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest',
1607
+ encode(message, writer = BinaryWriter.create()) {
1608
+ if (message.portId !== '') {
1609
+ writer.uint32(10).string(message.portId);
1610
+ }
1611
+ if (message.channelId !== '') {
1612
+ writer.uint32(18).string(message.channelId);
1613
+ }
1614
+ if (message.pagination !== undefined) {
1615
+ PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim();
1616
+ }
1617
+ writer.uint32(34).fork();
1618
+ for (const v of message.packetCommitmentSequences) {
1619
+ writer.uint64(v);
1620
+ }
1621
+ writer.ldelim();
1622
+ return writer;
1623
+ },
1624
+ decode(input, length) {
1625
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1626
+ let end = length === undefined ? reader.len : reader.pos + length;
1627
+ const message = createBaseQueryPacketAcknowledgementsRequest();
1628
+ while (reader.pos < end) {
1629
+ const tag = reader.uint32();
1630
+ switch (tag >>> 3) {
1631
+ case 1:
1632
+ message.portId = reader.string();
1633
+ break;
1634
+ case 2:
1635
+ message.channelId = reader.string();
1636
+ break;
1637
+ case 3:
1638
+ message.pagination = PageRequest.decode(reader, reader.uint32());
1639
+ break;
1640
+ case 4:
1641
+ if ((tag & 7) === 2) {
1642
+ const end2 = reader.uint32() + reader.pos;
1643
+ while (reader.pos < end2) {
1644
+ message.packetCommitmentSequences.push(reader.uint64());
1645
+ }
1646
+ }
1647
+ else {
1648
+ message.packetCommitmentSequences.push(reader.uint64());
1649
+ }
1650
+ break;
1651
+ default:
1652
+ reader.skipType(tag & 7);
1653
+ break;
1654
+ }
1655
+ }
1656
+ return message;
1657
+ },
1658
+ fromJSON(object) {
1659
+ return {
1660
+ portId: isSet(object.portId) ? String(object.portId) : '',
1661
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
1662
+ pagination: isSet(object.pagination)
1663
+ ? PageRequest.fromJSON(object.pagination)
1664
+ : undefined,
1665
+ packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences)
1666
+ ? object.packetCommitmentSequences.map((e) => BigInt(e.toString()))
1667
+ : [],
1668
+ };
1669
+ },
1670
+ toJSON(message) {
1671
+ const obj = {};
1672
+ message.portId !== undefined && (obj.portId = message.portId);
1673
+ message.channelId !== undefined && (obj.channelId = message.channelId);
1674
+ message.pagination !== undefined &&
1675
+ (obj.pagination = message.pagination
1676
+ ? PageRequest.toJSON(message.pagination)
1677
+ : undefined);
1678
+ if (message.packetCommitmentSequences) {
1679
+ obj.packetCommitmentSequences = message.packetCommitmentSequences.map(e => (e || BigInt(0)).toString());
1680
+ }
1681
+ else {
1682
+ obj.packetCommitmentSequences = [];
1683
+ }
1684
+ return obj;
1685
+ },
1686
+ fromPartial(object) {
1687
+ const message = createBaseQueryPacketAcknowledgementsRequest();
1688
+ message.portId = object.portId ?? '';
1689
+ message.channelId = object.channelId ?? '';
1690
+ message.pagination =
1691
+ object.pagination !== undefined && object.pagination !== null
1692
+ ? PageRequest.fromPartial(object.pagination)
1693
+ : undefined;
1694
+ message.packetCommitmentSequences =
1695
+ object.packetCommitmentSequences?.map(e => BigInt(e.toString())) || [];
1696
+ return message;
1697
+ },
1698
+ fromProtoMsg(message) {
1699
+ return QueryPacketAcknowledgementsRequest.decode(message.value);
1700
+ },
1701
+ toProto(message) {
1702
+ return QueryPacketAcknowledgementsRequest.encode(message).finish();
1703
+ },
1704
+ toProtoMsg(message) {
1705
+ return {
1706
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest',
1707
+ value: QueryPacketAcknowledgementsRequest.encode(message).finish(),
1708
+ };
1709
+ },
1710
+ };
1711
+ function createBaseQueryPacketAcknowledgementsResponse() {
1712
+ return {
1713
+ acknowledgements: [],
1714
+ pagination: undefined,
1715
+ height: Height.fromPartial({}),
1716
+ };
1717
+ }
1718
+ export const QueryPacketAcknowledgementsResponse = {
1719
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse',
1720
+ encode(message, writer = BinaryWriter.create()) {
1721
+ for (const v of message.acknowledgements) {
1722
+ PacketState.encode(v, writer.uint32(10).fork()).ldelim();
1723
+ }
1724
+ if (message.pagination !== undefined) {
1725
+ PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
1726
+ }
1727
+ if (message.height !== undefined) {
1728
+ Height.encode(message.height, writer.uint32(26).fork()).ldelim();
1729
+ }
1730
+ return writer;
1731
+ },
1732
+ decode(input, length) {
1733
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1734
+ let end = length === undefined ? reader.len : reader.pos + length;
1735
+ const message = createBaseQueryPacketAcknowledgementsResponse();
1736
+ while (reader.pos < end) {
1737
+ const tag = reader.uint32();
1738
+ switch (tag >>> 3) {
1739
+ case 1:
1740
+ message.acknowledgements.push(PacketState.decode(reader, reader.uint32()));
1741
+ break;
1742
+ case 2:
1743
+ message.pagination = PageResponse.decode(reader, reader.uint32());
1744
+ break;
1745
+ case 3:
1746
+ message.height = Height.decode(reader, reader.uint32());
1747
+ break;
1748
+ default:
1749
+ reader.skipType(tag & 7);
1750
+ break;
1751
+ }
1752
+ }
1753
+ return message;
1754
+ },
1755
+ fromJSON(object) {
1756
+ return {
1757
+ acknowledgements: Array.isArray(object?.acknowledgements)
1758
+ ? object.acknowledgements.map((e) => PacketState.fromJSON(e))
1759
+ : [],
1760
+ pagination: isSet(object.pagination)
1761
+ ? PageResponse.fromJSON(object.pagination)
1762
+ : undefined,
1763
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
1764
+ };
1765
+ },
1766
+ toJSON(message) {
1767
+ const obj = {};
1768
+ if (message.acknowledgements) {
1769
+ obj.acknowledgements = message.acknowledgements.map(e => e ? PacketState.toJSON(e) : undefined);
1770
+ }
1771
+ else {
1772
+ obj.acknowledgements = [];
1773
+ }
1774
+ message.pagination !== undefined &&
1775
+ (obj.pagination = message.pagination
1776
+ ? PageResponse.toJSON(message.pagination)
1777
+ : undefined);
1778
+ message.height !== undefined &&
1779
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
1780
+ return obj;
1781
+ },
1782
+ fromPartial(object) {
1783
+ const message = createBaseQueryPacketAcknowledgementsResponse();
1784
+ message.acknowledgements =
1785
+ object.acknowledgements?.map(e => PacketState.fromPartial(e)) || [];
1786
+ message.pagination =
1787
+ object.pagination !== undefined && object.pagination !== null
1788
+ ? PageResponse.fromPartial(object.pagination)
1789
+ : undefined;
1790
+ message.height =
1791
+ object.height !== undefined && object.height !== null
1792
+ ? Height.fromPartial(object.height)
1793
+ : undefined;
1794
+ return message;
1795
+ },
1796
+ fromProtoMsg(message) {
1797
+ return QueryPacketAcknowledgementsResponse.decode(message.value);
1798
+ },
1799
+ toProto(message) {
1800
+ return QueryPacketAcknowledgementsResponse.encode(message).finish();
1801
+ },
1802
+ toProtoMsg(message) {
1803
+ return {
1804
+ typeUrl: '/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse',
1805
+ value: QueryPacketAcknowledgementsResponse.encode(message).finish(),
1806
+ };
1807
+ },
1808
+ };
1809
+ function createBaseQueryUnreceivedPacketsRequest() {
1810
+ return {
1811
+ portId: '',
1812
+ channelId: '',
1813
+ packetCommitmentSequences: [],
1814
+ };
1815
+ }
1816
+ export const QueryUnreceivedPacketsRequest = {
1817
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedPacketsRequest',
1818
+ encode(message, writer = BinaryWriter.create()) {
1819
+ if (message.portId !== '') {
1820
+ writer.uint32(10).string(message.portId);
1821
+ }
1822
+ if (message.channelId !== '') {
1823
+ writer.uint32(18).string(message.channelId);
1824
+ }
1825
+ writer.uint32(26).fork();
1826
+ for (const v of message.packetCommitmentSequences) {
1827
+ writer.uint64(v);
1828
+ }
1829
+ writer.ldelim();
1830
+ return writer;
1831
+ },
1832
+ decode(input, length) {
1833
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1834
+ let end = length === undefined ? reader.len : reader.pos + length;
1835
+ const message = createBaseQueryUnreceivedPacketsRequest();
1836
+ while (reader.pos < end) {
1837
+ const tag = reader.uint32();
1838
+ switch (tag >>> 3) {
1839
+ case 1:
1840
+ message.portId = reader.string();
1841
+ break;
1842
+ case 2:
1843
+ message.channelId = reader.string();
1844
+ break;
1845
+ case 3:
1846
+ if ((tag & 7) === 2) {
1847
+ const end2 = reader.uint32() + reader.pos;
1848
+ while (reader.pos < end2) {
1849
+ message.packetCommitmentSequences.push(reader.uint64());
1850
+ }
1851
+ }
1852
+ else {
1853
+ message.packetCommitmentSequences.push(reader.uint64());
1854
+ }
1855
+ break;
1856
+ default:
1857
+ reader.skipType(tag & 7);
1858
+ break;
1859
+ }
1860
+ }
1861
+ return message;
1862
+ },
1863
+ fromJSON(object) {
1864
+ return {
1865
+ portId: isSet(object.portId) ? String(object.portId) : '',
1866
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
1867
+ packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences)
1868
+ ? object.packetCommitmentSequences.map((e) => BigInt(e.toString()))
1869
+ : [],
1870
+ };
1871
+ },
1872
+ toJSON(message) {
1873
+ const obj = {};
1874
+ message.portId !== undefined && (obj.portId = message.portId);
1875
+ message.channelId !== undefined && (obj.channelId = message.channelId);
1876
+ if (message.packetCommitmentSequences) {
1877
+ obj.packetCommitmentSequences = message.packetCommitmentSequences.map(e => (e || BigInt(0)).toString());
1878
+ }
1879
+ else {
1880
+ obj.packetCommitmentSequences = [];
1881
+ }
1882
+ return obj;
1883
+ },
1884
+ fromPartial(object) {
1885
+ const message = createBaseQueryUnreceivedPacketsRequest();
1886
+ message.portId = object.portId ?? '';
1887
+ message.channelId = object.channelId ?? '';
1888
+ message.packetCommitmentSequences =
1889
+ object.packetCommitmentSequences?.map(e => BigInt(e.toString())) || [];
1890
+ return message;
1891
+ },
1892
+ fromProtoMsg(message) {
1893
+ return QueryUnreceivedPacketsRequest.decode(message.value);
1894
+ },
1895
+ toProto(message) {
1896
+ return QueryUnreceivedPacketsRequest.encode(message).finish();
1897
+ },
1898
+ toProtoMsg(message) {
1899
+ return {
1900
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedPacketsRequest',
1901
+ value: QueryUnreceivedPacketsRequest.encode(message).finish(),
1902
+ };
1903
+ },
1904
+ };
1905
+ function createBaseQueryUnreceivedPacketsResponse() {
1906
+ return {
1907
+ sequences: [],
1908
+ height: Height.fromPartial({}),
1909
+ };
1910
+ }
1911
+ export const QueryUnreceivedPacketsResponse = {
1912
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedPacketsResponse',
1913
+ encode(message, writer = BinaryWriter.create()) {
1914
+ writer.uint32(10).fork();
1915
+ for (const v of message.sequences) {
1916
+ writer.uint64(v);
1917
+ }
1918
+ writer.ldelim();
1919
+ if (message.height !== undefined) {
1920
+ Height.encode(message.height, writer.uint32(18).fork()).ldelim();
1921
+ }
1922
+ return writer;
1923
+ },
1924
+ decode(input, length) {
1925
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1926
+ let end = length === undefined ? reader.len : reader.pos + length;
1927
+ const message = createBaseQueryUnreceivedPacketsResponse();
1928
+ while (reader.pos < end) {
1929
+ const tag = reader.uint32();
1930
+ switch (tag >>> 3) {
1931
+ case 1:
1932
+ if ((tag & 7) === 2) {
1933
+ const end2 = reader.uint32() + reader.pos;
1934
+ while (reader.pos < end2) {
1935
+ message.sequences.push(reader.uint64());
1936
+ }
1937
+ }
1938
+ else {
1939
+ message.sequences.push(reader.uint64());
1940
+ }
1941
+ break;
1942
+ case 2:
1943
+ message.height = Height.decode(reader, reader.uint32());
1944
+ break;
1945
+ default:
1946
+ reader.skipType(tag & 7);
1947
+ break;
1948
+ }
1949
+ }
1950
+ return message;
1951
+ },
1952
+ fromJSON(object) {
1953
+ return {
1954
+ sequences: Array.isArray(object?.sequences)
1955
+ ? object.sequences.map((e) => BigInt(e.toString()))
1956
+ : [],
1957
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
1958
+ };
1959
+ },
1960
+ toJSON(message) {
1961
+ const obj = {};
1962
+ if (message.sequences) {
1963
+ obj.sequences = message.sequences.map(e => (e || BigInt(0)).toString());
1964
+ }
1965
+ else {
1966
+ obj.sequences = [];
1967
+ }
1968
+ message.height !== undefined &&
1969
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
1970
+ return obj;
1971
+ },
1972
+ fromPartial(object) {
1973
+ const message = createBaseQueryUnreceivedPacketsResponse();
1974
+ message.sequences = object.sequences?.map(e => BigInt(e.toString())) || [];
1975
+ message.height =
1976
+ object.height !== undefined && object.height !== null
1977
+ ? Height.fromPartial(object.height)
1978
+ : undefined;
1979
+ return message;
1980
+ },
1981
+ fromProtoMsg(message) {
1982
+ return QueryUnreceivedPacketsResponse.decode(message.value);
1983
+ },
1984
+ toProto(message) {
1985
+ return QueryUnreceivedPacketsResponse.encode(message).finish();
1986
+ },
1987
+ toProtoMsg(message) {
1988
+ return {
1989
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedPacketsResponse',
1990
+ value: QueryUnreceivedPacketsResponse.encode(message).finish(),
1991
+ };
1992
+ },
1993
+ };
1994
+ function createBaseQueryUnreceivedAcksRequest() {
1995
+ return {
1996
+ portId: '',
1997
+ channelId: '',
1998
+ packetAckSequences: [],
1999
+ };
2000
+ }
2001
+ export const QueryUnreceivedAcksRequest = {
2002
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedAcksRequest',
2003
+ encode(message, writer = BinaryWriter.create()) {
2004
+ if (message.portId !== '') {
2005
+ writer.uint32(10).string(message.portId);
2006
+ }
2007
+ if (message.channelId !== '') {
2008
+ writer.uint32(18).string(message.channelId);
2009
+ }
2010
+ writer.uint32(26).fork();
2011
+ for (const v of message.packetAckSequences) {
2012
+ writer.uint64(v);
2013
+ }
2014
+ writer.ldelim();
2015
+ return writer;
2016
+ },
2017
+ decode(input, length) {
2018
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2019
+ let end = length === undefined ? reader.len : reader.pos + length;
2020
+ const message = createBaseQueryUnreceivedAcksRequest();
2021
+ while (reader.pos < end) {
2022
+ const tag = reader.uint32();
2023
+ switch (tag >>> 3) {
2024
+ case 1:
2025
+ message.portId = reader.string();
2026
+ break;
2027
+ case 2:
2028
+ message.channelId = reader.string();
2029
+ break;
2030
+ case 3:
2031
+ if ((tag & 7) === 2) {
2032
+ const end2 = reader.uint32() + reader.pos;
2033
+ while (reader.pos < end2) {
2034
+ message.packetAckSequences.push(reader.uint64());
2035
+ }
2036
+ }
2037
+ else {
2038
+ message.packetAckSequences.push(reader.uint64());
2039
+ }
2040
+ break;
2041
+ default:
2042
+ reader.skipType(tag & 7);
2043
+ break;
2044
+ }
2045
+ }
2046
+ return message;
2047
+ },
2048
+ fromJSON(object) {
2049
+ return {
2050
+ portId: isSet(object.portId) ? String(object.portId) : '',
2051
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
2052
+ packetAckSequences: Array.isArray(object?.packetAckSequences)
2053
+ ? object.packetAckSequences.map((e) => BigInt(e.toString()))
2054
+ : [],
2055
+ };
2056
+ },
2057
+ toJSON(message) {
2058
+ const obj = {};
2059
+ message.portId !== undefined && (obj.portId = message.portId);
2060
+ message.channelId !== undefined && (obj.channelId = message.channelId);
2061
+ if (message.packetAckSequences) {
2062
+ obj.packetAckSequences = message.packetAckSequences.map(e => (e || BigInt(0)).toString());
2063
+ }
2064
+ else {
2065
+ obj.packetAckSequences = [];
2066
+ }
2067
+ return obj;
2068
+ },
2069
+ fromPartial(object) {
2070
+ const message = createBaseQueryUnreceivedAcksRequest();
2071
+ message.portId = object.portId ?? '';
2072
+ message.channelId = object.channelId ?? '';
2073
+ message.packetAckSequences =
2074
+ object.packetAckSequences?.map(e => BigInt(e.toString())) || [];
2075
+ return message;
2076
+ },
2077
+ fromProtoMsg(message) {
2078
+ return QueryUnreceivedAcksRequest.decode(message.value);
2079
+ },
2080
+ toProto(message) {
2081
+ return QueryUnreceivedAcksRequest.encode(message).finish();
2082
+ },
2083
+ toProtoMsg(message) {
2084
+ return {
2085
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedAcksRequest',
2086
+ value: QueryUnreceivedAcksRequest.encode(message).finish(),
2087
+ };
2088
+ },
2089
+ };
2090
+ function createBaseQueryUnreceivedAcksResponse() {
2091
+ return {
2092
+ sequences: [],
2093
+ height: Height.fromPartial({}),
2094
+ };
2095
+ }
2096
+ export const QueryUnreceivedAcksResponse = {
2097
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedAcksResponse',
2098
+ encode(message, writer = BinaryWriter.create()) {
2099
+ writer.uint32(10).fork();
2100
+ for (const v of message.sequences) {
2101
+ writer.uint64(v);
2102
+ }
2103
+ writer.ldelim();
2104
+ if (message.height !== undefined) {
2105
+ Height.encode(message.height, writer.uint32(18).fork()).ldelim();
2106
+ }
2107
+ return writer;
2108
+ },
2109
+ decode(input, length) {
2110
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2111
+ let end = length === undefined ? reader.len : reader.pos + length;
2112
+ const message = createBaseQueryUnreceivedAcksResponse();
2113
+ while (reader.pos < end) {
2114
+ const tag = reader.uint32();
2115
+ switch (tag >>> 3) {
2116
+ case 1:
2117
+ if ((tag & 7) === 2) {
2118
+ const end2 = reader.uint32() + reader.pos;
2119
+ while (reader.pos < end2) {
2120
+ message.sequences.push(reader.uint64());
2121
+ }
2122
+ }
2123
+ else {
2124
+ message.sequences.push(reader.uint64());
2125
+ }
2126
+ break;
2127
+ case 2:
2128
+ message.height = Height.decode(reader, reader.uint32());
2129
+ break;
2130
+ default:
2131
+ reader.skipType(tag & 7);
2132
+ break;
2133
+ }
2134
+ }
2135
+ return message;
2136
+ },
2137
+ fromJSON(object) {
2138
+ return {
2139
+ sequences: Array.isArray(object?.sequences)
2140
+ ? object.sequences.map((e) => BigInt(e.toString()))
2141
+ : [],
2142
+ height: isSet(object.height) ? Height.fromJSON(object.height) : undefined,
2143
+ };
2144
+ },
2145
+ toJSON(message) {
2146
+ const obj = {};
2147
+ if (message.sequences) {
2148
+ obj.sequences = message.sequences.map(e => (e || BigInt(0)).toString());
2149
+ }
2150
+ else {
2151
+ obj.sequences = [];
2152
+ }
2153
+ message.height !== undefined &&
2154
+ (obj.height = message.height ? Height.toJSON(message.height) : undefined);
2155
+ return obj;
2156
+ },
2157
+ fromPartial(object) {
2158
+ const message = createBaseQueryUnreceivedAcksResponse();
2159
+ message.sequences = object.sequences?.map(e => BigInt(e.toString())) || [];
2160
+ message.height =
2161
+ object.height !== undefined && object.height !== null
2162
+ ? Height.fromPartial(object.height)
2163
+ : undefined;
2164
+ return message;
2165
+ },
2166
+ fromProtoMsg(message) {
2167
+ return QueryUnreceivedAcksResponse.decode(message.value);
2168
+ },
2169
+ toProto(message) {
2170
+ return QueryUnreceivedAcksResponse.encode(message).finish();
2171
+ },
2172
+ toProtoMsg(message) {
2173
+ return {
2174
+ typeUrl: '/ibc.core.channel.v1.QueryUnreceivedAcksResponse',
2175
+ value: QueryUnreceivedAcksResponse.encode(message).finish(),
2176
+ };
2177
+ },
2178
+ };
2179
+ function createBaseQueryNextSequenceReceiveRequest() {
2180
+ return {
2181
+ portId: '',
2182
+ channelId: '',
2183
+ };
2184
+ }
2185
+ export const QueryNextSequenceReceiveRequest = {
2186
+ typeUrl: '/ibc.core.channel.v1.QueryNextSequenceReceiveRequest',
2187
+ encode(message, writer = BinaryWriter.create()) {
2188
+ if (message.portId !== '') {
2189
+ writer.uint32(10).string(message.portId);
2190
+ }
2191
+ if (message.channelId !== '') {
2192
+ writer.uint32(18).string(message.channelId);
2193
+ }
2194
+ return writer;
2195
+ },
2196
+ decode(input, length) {
2197
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2198
+ let end = length === undefined ? reader.len : reader.pos + length;
2199
+ const message = createBaseQueryNextSequenceReceiveRequest();
2200
+ while (reader.pos < end) {
2201
+ const tag = reader.uint32();
2202
+ switch (tag >>> 3) {
2203
+ case 1:
2204
+ message.portId = reader.string();
2205
+ break;
2206
+ case 2:
2207
+ message.channelId = reader.string();
2208
+ break;
2209
+ default:
2210
+ reader.skipType(tag & 7);
2211
+ break;
2212
+ }
2213
+ }
2214
+ return message;
2215
+ },
2216
+ fromJSON(object) {
2217
+ return {
2218
+ portId: isSet(object.portId) ? String(object.portId) : '',
2219
+ channelId: isSet(object.channelId) ? String(object.channelId) : '',
2220
+ };
2221
+ },
2222
+ toJSON(message) {
2223
+ const obj = {};
2224
+ message.portId !== undefined && (obj.portId = message.portId);
2225
+ message.channelId !== undefined && (obj.channelId = message.channelId);
2226
+ return obj;
2227
+ },
2228
+ fromPartial(object) {
2229
+ const message = createBaseQueryNextSequenceReceiveRequest();
2230
+ message.portId = object.portId ?? '';
2231
+ message.channelId = object.channelId ?? '';
2232
+ return message;
2233
+ },
2234
+ fromProtoMsg(message) {
2235
+ return QueryNextSequenceReceiveRequest.decode(message.value);
2236
+ },
2237
+ toProto(message) {
2238
+ return QueryNextSequenceReceiveRequest.encode(message).finish();
2239
+ },
2240
+ toProtoMsg(message) {
2241
+ return {
2242
+ typeUrl: '/ibc.core.channel.v1.QueryNextSequenceReceiveRequest',
2243
+ value: QueryNextSequenceReceiveRequest.encode(message).finish(),
2244
+ };
2245
+ },
2246
+ };
2247
+ function createBaseQueryNextSequenceReceiveResponse() {
2248
+ return {
2249
+ nextSequenceReceive: BigInt(0),
2250
+ proof: new Uint8Array(),
2251
+ proofHeight: Height.fromPartial({}),
2252
+ };
2253
+ }
2254
+ export const QueryNextSequenceReceiveResponse = {
2255
+ typeUrl: '/ibc.core.channel.v1.QueryNextSequenceReceiveResponse',
2256
+ encode(message, writer = BinaryWriter.create()) {
2257
+ if (message.nextSequenceReceive !== BigInt(0)) {
2258
+ writer.uint32(8).uint64(message.nextSequenceReceive);
2259
+ }
2260
+ if (message.proof.length !== 0) {
2261
+ writer.uint32(18).bytes(message.proof);
2262
+ }
2263
+ if (message.proofHeight !== undefined) {
2264
+ Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
2265
+ }
2266
+ return writer;
2267
+ },
2268
+ decode(input, length) {
2269
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2270
+ let end = length === undefined ? reader.len : reader.pos + length;
2271
+ const message = createBaseQueryNextSequenceReceiveResponse();
2272
+ while (reader.pos < end) {
2273
+ const tag = reader.uint32();
2274
+ switch (tag >>> 3) {
2275
+ case 1:
2276
+ message.nextSequenceReceive = reader.uint64();
2277
+ break;
2278
+ case 2:
2279
+ message.proof = reader.bytes();
2280
+ break;
2281
+ case 3:
2282
+ message.proofHeight = Height.decode(reader, reader.uint32());
2283
+ break;
2284
+ default:
2285
+ reader.skipType(tag & 7);
2286
+ break;
2287
+ }
2288
+ }
2289
+ return message;
2290
+ },
2291
+ fromJSON(object) {
2292
+ return {
2293
+ nextSequenceReceive: isSet(object.nextSequenceReceive)
2294
+ ? BigInt(object.nextSequenceReceive.toString())
2295
+ : BigInt(0),
2296
+ proof: isSet(object.proof)
2297
+ ? bytesFromBase64(object.proof)
2298
+ : new Uint8Array(),
2299
+ proofHeight: isSet(object.proofHeight)
2300
+ ? Height.fromJSON(object.proofHeight)
2301
+ : undefined,
2302
+ };
2303
+ },
2304
+ toJSON(message) {
2305
+ const obj = {};
2306
+ message.nextSequenceReceive !== undefined &&
2307
+ (obj.nextSequenceReceive = (message.nextSequenceReceive || BigInt(0)).toString());
2308
+ message.proof !== undefined &&
2309
+ (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
2310
+ message.proofHeight !== undefined &&
2311
+ (obj.proofHeight = message.proofHeight
2312
+ ? Height.toJSON(message.proofHeight)
2313
+ : undefined);
2314
+ return obj;
2315
+ },
2316
+ fromPartial(object) {
2317
+ const message = createBaseQueryNextSequenceReceiveResponse();
2318
+ message.nextSequenceReceive =
2319
+ object.nextSequenceReceive !== undefined &&
2320
+ object.nextSequenceReceive !== null
2321
+ ? BigInt(object.nextSequenceReceive.toString())
2322
+ : BigInt(0);
2323
+ message.proof = object.proof ?? new Uint8Array();
2324
+ message.proofHeight =
2325
+ object.proofHeight !== undefined && object.proofHeight !== null
2326
+ ? Height.fromPartial(object.proofHeight)
2327
+ : undefined;
2328
+ return message;
2329
+ },
2330
+ fromProtoMsg(message) {
2331
+ return QueryNextSequenceReceiveResponse.decode(message.value);
2332
+ },
2333
+ toProto(message) {
2334
+ return QueryNextSequenceReceiveResponse.encode(message).finish();
2335
+ },
2336
+ toProtoMsg(message) {
2337
+ return {
2338
+ typeUrl: '/ibc.core.channel.v1.QueryNextSequenceReceiveResponse',
2339
+ value: QueryNextSequenceReceiveResponse.encode(message).finish(),
2340
+ };
2341
+ },
2342
+ };
2343
+ //# sourceMappingURL=query.js.map