-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathquery.ts
771 lines (771 loc) · 29 KB
/
query.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination";
import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType } from "./auth";
import { BinaryReader, BinaryWriter } from "../../../binary";
/**
* QueryAccountsRequest is the request type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsRequest {
/** pagination defines an optional pagination for the request. */
pagination?: PageRequest | undefined;
}
export interface QueryAccountsRequestProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest";
value: Uint8Array;
}
/**
* QueryAccountsRequest is the request type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsRequestAmino {
/** pagination defines an optional pagination for the request. */
pagination?: PageRequestAmino | undefined;
}
export interface QueryAccountsRequestAminoMsg {
type: "cosmos-sdk/QueryAccountsRequest";
value: QueryAccountsRequestAmino;
}
/**
* QueryAccountsRequest is the request type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsRequestSDKType {
pagination?: PageRequestSDKType | undefined;
}
/**
* QueryAccountsResponse is the response type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsResponse {
/** accounts are the existing accounts */
accounts: (BaseAccount | Any)[] | Any[];
/** pagination defines the pagination in the response. */
pagination?: PageResponse | undefined;
}
export interface QueryAccountsResponseProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse";
value: Uint8Array;
}
export type QueryAccountsResponseEncoded = Omit<QueryAccountsResponse, "accounts"> & {
/** accounts are the existing accounts */accounts: (BaseAccountProtoMsg | AnyProtoMsg)[];
};
/**
* QueryAccountsResponse is the response type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsResponseAmino {
/** accounts are the existing accounts */
accounts?: AnyAmino[];
/** pagination defines the pagination in the response. */
pagination?: PageResponseAmino | undefined;
}
export interface QueryAccountsResponseAminoMsg {
type: "cosmos-sdk/QueryAccountsResponse";
value: QueryAccountsResponseAmino;
}
/**
* QueryAccountsResponse is the response type for the Query/Accounts RPC method.
*
* Since: cosmos-sdk 0.43
*/
export interface QueryAccountsResponseSDKType {
accounts: (BaseAccountSDKType | AnySDKType)[];
pagination?: PageResponseSDKType | undefined;
}
/** QueryAccountRequest is the request type for the Query/Account RPC method. */
export interface QueryAccountRequest {
/** address defines the address to query for. */
address: string;
}
export interface QueryAccountRequestProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest";
value: Uint8Array;
}
/** QueryAccountRequest is the request type for the Query/Account RPC method. */
export interface QueryAccountRequestAmino {
/** address defines the address to query for. */
address?: string;
}
export interface QueryAccountRequestAminoMsg {
type: "cosmos-sdk/QueryAccountRequest";
value: QueryAccountRequestAmino;
}
/** QueryAccountRequest is the request type for the Query/Account RPC method. */
export interface QueryAccountRequestSDKType {
address: string;
}
/** QueryAccountResponse is the response type for the Query/Account RPC method. */
export interface QueryAccountResponse {
/** account defines the account of the corresponding address. */
account?: BaseAccount | Any | undefined;
}
export interface QueryAccountResponseProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse";
value: Uint8Array;
}
export type QueryAccountResponseEncoded = Omit<QueryAccountResponse, "account"> & {
/** account defines the account of the corresponding address. */account?: BaseAccountProtoMsg | AnyProtoMsg | undefined;
};
/** QueryAccountResponse is the response type for the Query/Account RPC method. */
export interface QueryAccountResponseAmino {
/** account defines the account of the corresponding address. */
account?: AnyAmino | undefined;
}
export interface QueryAccountResponseAminoMsg {
type: "cosmos-sdk/QueryAccountResponse";
value: QueryAccountResponseAmino;
}
/** QueryAccountResponse is the response type for the Query/Account RPC method. */
export interface QueryAccountResponseSDKType {
account?: BaseAccountSDKType | AnySDKType | undefined;
}
/** QueryParamsRequest is the request type for the Query/Params RPC method. */
export interface QueryParamsRequest {}
export interface QueryParamsRequestProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest";
value: Uint8Array;
}
/** QueryParamsRequest is the request type for the Query/Params RPC method. */
export interface QueryParamsRequestAmino {}
export interface QueryParamsRequestAminoMsg {
type: "cosmos-sdk/QueryParamsRequest";
value: QueryParamsRequestAmino;
}
/** QueryParamsRequest is the request type for the Query/Params RPC method. */
export interface QueryParamsRequestSDKType {}
/** QueryParamsResponse is the response type for the Query/Params RPC method. */
export interface QueryParamsResponse {
/** params defines the parameters of the module. */
params: Params | undefined;
}
export interface QueryParamsResponseProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse";
value: Uint8Array;
}
/** QueryParamsResponse is the response type for the Query/Params RPC method. */
export interface QueryParamsResponseAmino {
/** params defines the parameters of the module. */
params?: ParamsAmino | undefined;
}
export interface QueryParamsResponseAminoMsg {
type: "cosmos-sdk/QueryParamsResponse";
value: QueryParamsResponseAmino;
}
/** QueryParamsResponse is the response type for the Query/Params RPC method. */
export interface QueryParamsResponseSDKType {
params: ParamsSDKType | undefined;
}
/** QueryNextAccountRequest is the request type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberRequest {}
export interface QueryNextAccountNumberRequestProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberRequest";
value: Uint8Array;
}
/** QueryNextAccountRequest is the request type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberRequestAmino {}
export interface QueryNextAccountNumberRequestAminoMsg {
type: "cosmos-sdk/QueryNextAccountNumberRequest";
value: QueryNextAccountNumberRequestAmino;
}
/** QueryNextAccountRequest is the request type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberRequestSDKType {}
/** QueryNextAccountResponse is the response type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberResponse {
/** count defines the next account number. */
count: bigint;
}
export interface QueryNextAccountNumberResponseProtoMsg {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberResponse";
value: Uint8Array;
}
/** QueryNextAccountResponse is the response type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberResponseAmino {
/** count defines the next account number. */
count?: string;
}
export interface QueryNextAccountNumberResponseAminoMsg {
type: "cosmos-sdk/QueryNextAccountNumberResponse";
value: QueryNextAccountNumberResponseAmino;
}
/** QueryNextAccountResponse is the response type for the Query/NextAccountNumber RPC method. */
export interface QueryNextAccountNumberResponseSDKType {
count: bigint;
}
function createBaseQueryAccountsRequest(): QueryAccountsRequest {
return {
pagination: undefined
};
}
export const QueryAccountsRequest = {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest",
encode(message: QueryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryAccountsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.pagination = PageRequest.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryAccountsRequest>): QueryAccountsRequest {
const message = createBaseQueryAccountsRequest();
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest {
const message = createBaseQueryAccountsRequest();
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino {
const obj: any = {};
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object: QueryAccountsRequestAminoMsg): QueryAccountsRequest {
return QueryAccountsRequest.fromAmino(object.value);
},
toAminoMsg(message: QueryAccountsRequest): QueryAccountsRequestAminoMsg {
return {
type: "cosmos-sdk/QueryAccountsRequest",
value: QueryAccountsRequest.toAmino(message)
};
},
fromProtoMsg(message: QueryAccountsRequestProtoMsg): QueryAccountsRequest {
return QueryAccountsRequest.decode(message.value);
},
toProto(message: QueryAccountsRequest): Uint8Array {
return QueryAccountsRequest.encode(message).finish();
},
toProtoMsg(message: QueryAccountsRequest): QueryAccountsRequestProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest",
value: QueryAccountsRequest.encode(message).finish()
};
}
};
function createBaseQueryAccountsResponse(): QueryAccountsResponse {
return {
accounts: [],
pagination: undefined
};
}
export const QueryAccountsResponse = {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse",
encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
for (const v of message.accounts) {
Any.encode((v! as Any), writer.uint32(10).fork()).ldelim();
}
if (message.pagination !== undefined) {
PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryAccountsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.accounts.push((Any.decode(reader, reader.uint32()) as Any));
break;
case 2:
message.pagination = PageResponse.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryAccountsResponse>): QueryAccountsResponse {
const message = createBaseQueryAccountsResponse();
message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse {
const message = createBaseQueryAccountsResponse();
message.accounts = object.accounts?.map(e => AccountI_FromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromAmino(object.pagination);
}
return message;
},
toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino {
const obj: any = {};
if (message.accounts) {
obj.accounts = message.accounts.map(e => e ? AccountI_ToAmino((e as Any)) : undefined);
} else {
obj.accounts = message.accounts;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse {
return QueryAccountsResponse.fromAmino(object.value);
},
toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg {
return {
type: "cosmos-sdk/QueryAccountsResponse",
value: QueryAccountsResponse.toAmino(message)
};
},
fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse {
return QueryAccountsResponse.decode(message.value);
},
toProto(message: QueryAccountsResponse): Uint8Array {
return QueryAccountsResponse.encode(message).finish();
},
toProtoMsg(message: QueryAccountsResponse): QueryAccountsResponseProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse",
value: QueryAccountsResponse.encode(message).finish()
};
}
};
function createBaseQueryAccountRequest(): QueryAccountRequest {
return {
address: ""
};
}
export const QueryAccountRequest = {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest",
encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryAccountRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.address = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryAccountRequest>): QueryAccountRequest {
const message = createBaseQueryAccountRequest();
message.address = object.address ?? "";
return message;
},
fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest {
const message = createBaseQueryAccountRequest();
if (object.address !== undefined && object.address !== null) {
message.address = object.address;
}
return message;
},
toAmino(message: QueryAccountRequest): QueryAccountRequestAmino {
const obj: any = {};
obj.address = message.address === "" ? undefined : message.address;
return obj;
},
fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest {
return QueryAccountRequest.fromAmino(object.value);
},
toAminoMsg(message: QueryAccountRequest): QueryAccountRequestAminoMsg {
return {
type: "cosmos-sdk/QueryAccountRequest",
value: QueryAccountRequest.toAmino(message)
};
},
fromProtoMsg(message: QueryAccountRequestProtoMsg): QueryAccountRequest {
return QueryAccountRequest.decode(message.value);
},
toProto(message: QueryAccountRequest): Uint8Array {
return QueryAccountRequest.encode(message).finish();
},
toProtoMsg(message: QueryAccountRequest): QueryAccountRequestProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest",
value: QueryAccountRequest.encode(message).finish()
};
}
};
function createBaseQueryAccountResponse(): QueryAccountResponse {
return {
account: undefined
};
}
export const QueryAccountResponse = {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse",
encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.account !== undefined) {
Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryAccountResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.account = (AccountI_InterfaceDecoder(reader) as Any);
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryAccountResponse>): QueryAccountResponse {
const message = createBaseQueryAccountResponse();
message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined;
return message;
},
fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse {
const message = createBaseQueryAccountResponse();
if (object.account !== undefined && object.account !== null) {
message.account = AccountI_FromAmino(object.account);
}
return message;
},
toAmino(message: QueryAccountResponse): QueryAccountResponseAmino {
const obj: any = {};
obj.account = message.account ? AccountI_ToAmino((message.account as Any)) : undefined;
return obj;
},
fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse {
return QueryAccountResponse.fromAmino(object.value);
},
toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg {
return {
type: "cosmos-sdk/QueryAccountResponse",
value: QueryAccountResponse.toAmino(message)
};
},
fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse {
return QueryAccountResponse.decode(message.value);
},
toProto(message: QueryAccountResponse): Uint8Array {
return QueryAccountResponse.encode(message).finish();
},
toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse",
value: QueryAccountResponse.encode(message).finish()
};
}
};
function createBaseQueryParamsRequest(): QueryParamsRequest {
return {};
}
export const QueryParamsRequest = {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest",
encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryParamsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_: Partial<QueryParamsRequest>): QueryParamsRequest {
const message = createBaseQueryParamsRequest();
return message;
},
fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest {
const message = createBaseQueryParamsRequest();
return message;
},
toAmino(_: QueryParamsRequest): QueryParamsRequestAmino {
const obj: any = {};
return obj;
},
fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest {
return QueryParamsRequest.fromAmino(object.value);
},
toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg {
return {
type: "cosmos-sdk/QueryParamsRequest",
value: QueryParamsRequest.toAmino(message)
};
},
fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest {
return QueryParamsRequest.decode(message.value);
},
toProto(message: QueryParamsRequest): Uint8Array {
return QueryParamsRequest.encode(message).finish();
},
toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest",
value: QueryParamsRequest.encode(message).finish()
};
}
};
function createBaseQueryParamsResponse(): QueryParamsResponse {
return {
params: Params.fromPartial({})
};
}
export const QueryParamsResponse = {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse",
encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryParamsResponse>): QueryParamsResponse {
const message = createBaseQueryParamsResponse();
message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
return message;
},
fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse {
const message = createBaseQueryParamsResponse();
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromAmino(object.params);
}
return message;
},
toAmino(message: QueryParamsResponse): QueryParamsResponseAmino {
const obj: any = {};
obj.params = message.params ? Params.toAmino(message.params) : undefined;
return obj;
},
fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse {
return QueryParamsResponse.fromAmino(object.value);
},
toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg {
return {
type: "cosmos-sdk/QueryParamsResponse",
value: QueryParamsResponse.toAmino(message)
};
},
fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse {
return QueryParamsResponse.decode(message.value);
},
toProto(message: QueryParamsResponse): Uint8Array {
return QueryParamsResponse.encode(message).finish();
},
toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse",
value: QueryParamsResponse.encode(message).finish()
};
}
};
function createBaseQueryNextAccountNumberRequest(): QueryNextAccountNumberRequest {
return {};
}
export const QueryNextAccountNumberRequest = {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberRequest",
encode(_: QueryNextAccountNumberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryNextAccountNumberRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryNextAccountNumberRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_: Partial<QueryNextAccountNumberRequest>): QueryNextAccountNumberRequest {
const message = createBaseQueryNextAccountNumberRequest();
return message;
},
fromAmino(_: QueryNextAccountNumberRequestAmino): QueryNextAccountNumberRequest {
const message = createBaseQueryNextAccountNumberRequest();
return message;
},
toAmino(_: QueryNextAccountNumberRequest): QueryNextAccountNumberRequestAmino {
const obj: any = {};
return obj;
},
fromAminoMsg(object: QueryNextAccountNumberRequestAminoMsg): QueryNextAccountNumberRequest {
return QueryNextAccountNumberRequest.fromAmino(object.value);
},
toAminoMsg(message: QueryNextAccountNumberRequest): QueryNextAccountNumberRequestAminoMsg {
return {
type: "cosmos-sdk/QueryNextAccountNumberRequest",
value: QueryNextAccountNumberRequest.toAmino(message)
};
},
fromProtoMsg(message: QueryNextAccountNumberRequestProtoMsg): QueryNextAccountNumberRequest {
return QueryNextAccountNumberRequest.decode(message.value);
},
toProto(message: QueryNextAccountNumberRequest): Uint8Array {
return QueryNextAccountNumberRequest.encode(message).finish();
},
toProtoMsg(message: QueryNextAccountNumberRequest): QueryNextAccountNumberRequestProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberRequest",
value: QueryNextAccountNumberRequest.encode(message).finish()
};
}
};
function createBaseQueryNextAccountNumberResponse(): QueryNextAccountNumberResponse {
return {
count: BigInt(0)
};
}
export const QueryNextAccountNumberResponse = {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberResponse",
encode(message: QueryNextAccountNumberResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.count !== BigInt(0)) {
writer.uint32(8).uint64(message.count);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): QueryNextAccountNumberResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryNextAccountNumberResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.count = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<QueryNextAccountNumberResponse>): QueryNextAccountNumberResponse {
const message = createBaseQueryNextAccountNumberResponse();
message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0);
return message;
},
fromAmino(object: QueryNextAccountNumberResponseAmino): QueryNextAccountNumberResponse {
const message = createBaseQueryNextAccountNumberResponse();
if (object.count !== undefined && object.count !== null) {
message.count = BigInt(object.count);
}
return message;
},
toAmino(message: QueryNextAccountNumberResponse): QueryNextAccountNumberResponseAmino {
const obj: any = {};
obj.count = message.count !== BigInt(0) ? message.count.toString() : undefined;
return obj;
},
fromAminoMsg(object: QueryNextAccountNumberResponseAminoMsg): QueryNextAccountNumberResponse {
return QueryNextAccountNumberResponse.fromAmino(object.value);
},
toAminoMsg(message: QueryNextAccountNumberResponse): QueryNextAccountNumberResponseAminoMsg {
return {
type: "cosmos-sdk/QueryNextAccountNumberResponse",
value: QueryNextAccountNumberResponse.toAmino(message)
};
},
fromProtoMsg(message: QueryNextAccountNumberResponseProtoMsg): QueryNextAccountNumberResponse {
return QueryNextAccountNumberResponse.decode(message.value);
},
toProto(message: QueryNextAccountNumberResponse): Uint8Array {
return QueryNextAccountNumberResponse.encode(message).finish();
},
toProtoMsg(message: QueryNextAccountNumberResponse): QueryNextAccountNumberResponseProtoMsg {
return {
typeUrl: "/cosmos.auth.v1beta1.QueryNextAccountNumberResponse",
value: QueryNextAccountNumberResponse.encode(message).finish()
};
}
};
export const AccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const data = Any.decode(reader, reader.uint32());
switch (data.typeUrl) {
case "/cosmos.auth.v1beta1.BaseAccount":
return BaseAccount.decode(data.value);
default:
return data;
}
};
export const AccountI_FromAmino = (content: AnyAmino): Any => {
switch (content.type) {
case "cosmos-sdk/BaseAccount":
return Any.fromPartial({
typeUrl: "/cosmos.auth.v1beta1.BaseAccount",
value: BaseAccount.encode(BaseAccount.fromPartial(BaseAccount.fromAmino(content.value))).finish()
});
default:
return Any.fromAmino(content);
}
};
export const AccountI_ToAmino = (content: Any) => {
switch (content.typeUrl) {
case "/cosmos.auth.v1beta1.BaseAccount":
return {
type: "cosmos-sdk/BaseAccount",
value: BaseAccount.toAmino(BaseAccount.decode(content.value, undefined))
};
default:
return Any.toAmino(content);
}
};