@burnt-labs/xion-types 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +111 -0
  2. package/package.json +26 -0
  3. package/types/.gitkeep +0 -0
  4. package/types/generated/amino/amino.ts +9 -0
  5. package/types/generated/cosmos/app/v1alpha1/config.ts +336 -0
  6. package/types/generated/cosmos/app/v1alpha1/query.ts +265 -0
  7. package/types/generated/cosmos/auth/v1beta1/auth.ts +520 -0
  8. package/types/generated/cosmos/auth/v1beta1/query.ts +1852 -0
  9. package/types/generated/cosmos/authz/v1beta1/authz.ts +404 -0
  10. package/types/generated/cosmos/authz/v1beta1/query.ts +774 -0
  11. package/types/generated/cosmos/autocli/v1/options.ts +1016 -0
  12. package/types/generated/cosmos/autocli/v1/query.ts +379 -0
  13. package/types/generated/cosmos/bank/v1beta1/bank.ts +752 -0
  14. package/types/generated/cosmos/bank/v1beta1/query.ts +2789 -0
  15. package/types/generated/cosmos/base/abci/v1beta1/abci.ts +1447 -0
  16. package/types/generated/cosmos/base/node/v1beta1/query.ts +587 -0
  17. package/types/generated/cosmos/base/query/v1beta1/pagination.ts +317 -0
  18. package/types/generated/cosmos/base/tendermint/v1beta1/query.ts +2228 -0
  19. package/types/generated/cosmos/base/tendermint/v1beta1/types.ts +522 -0
  20. package/types/generated/cosmos/base/v1beta1/coin.ts +326 -0
  21. package/types/generated/cosmos/circuit/v1/query.ts +606 -0
  22. package/types/generated/cosmos/circuit/v1/types.ts +353 -0
  23. package/types/generated/cosmos/consensus/v1/query.ts +271 -0
  24. package/types/generated/cosmos/crypto/multisig/v1beta1/multisig.ts +212 -0
  25. package/types/generated/cosmos/distribution/v1beta1/distribution.ts +1143 -0
  26. package/types/generated/cosmos/distribution/v1beta1/query.ts +2005 -0
  27. package/types/generated/cosmos/evidence/v1beta1/query.ts +526 -0
  28. package/types/generated/cosmos/feegrant/v1beta1/feegrant.ts +502 -0
  29. package/types/generated/cosmos/feegrant/v1beta1/query.ts +725 -0
  30. package/types/generated/cosmos/gov/v1/gov.ts +1656 -0
  31. package/types/generated/cosmos/gov/v1/query.ts +1847 -0
  32. package/types/generated/cosmos/gov/v1beta1/gov.ts +1239 -0
  33. package/types/generated/cosmos/gov/v1beta1/query.ts +1658 -0
  34. package/types/generated/cosmos/group/v1/query.ts +2840 -0
  35. package/types/generated/cosmos/group/v1/types.ts +1803 -0
  36. package/types/generated/cosmos/ics23/v1/proofs.ts +1685 -0
  37. package/types/generated/cosmos/mint/v1beta1/mint.ts +273 -0
  38. package/types/generated/cosmos/mint/v1beta1/query.ts +589 -0
  39. package/types/generated/cosmos/msg/v1/msg.ts +9 -0
  40. package/types/generated/cosmos/nft/v1beta1/nft.ts +333 -0
  41. package/types/generated/cosmos/nft/v1beta1/query.ts +1362 -0
  42. package/types/generated/cosmos/orm/query/v1alpha1/query.ts +1016 -0
  43. package/types/generated/cosmos/params/v1beta1/params.ts +227 -0
  44. package/types/generated/cosmos/params/v1beta1/query.ts +545 -0
  45. package/types/generated/cosmos/query/v1/query.ts +9 -0
  46. package/types/generated/cosmos/slashing/v1beta1/query.ts +626 -0
  47. package/types/generated/cosmos/slashing/v1beta1/slashing.ts +409 -0
  48. package/types/generated/cosmos/staking/v1beta1/query.ts +2912 -0
  49. package/types/generated/cosmos/staking/v1beta1/staking.ts +2515 -0
  50. package/types/generated/cosmos/tx/signing/v1beta1/signing.ts +608 -0
  51. package/types/generated/cosmos/tx/v1beta1/service.ts +2111 -0
  52. package/types/generated/cosmos/tx/v1beta1/tx.ts +1613 -0
  53. package/types/generated/cosmos/upgrade/v1beta1/query.ts +1007 -0
  54. package/types/generated/cosmos/upgrade/v1beta1/upgrade.ts +507 -0
  55. package/types/generated/cosmos_proto/cosmos.ts +299 -0
  56. package/types/generated/cosmwasm/wasm/v1/query.ts +2984 -0
  57. package/types/generated/cosmwasm/wasm/v1/types.ts +962 -0
  58. package/types/generated/gogoproto/gogo.ts +9 -0
  59. package/types/generated/google/api/annotations.ts +9 -0
  60. package/types/generated/google/api/http.ts +757 -0
  61. package/types/generated/google/protobuf/any.ts +253 -0
  62. package/types/generated/google/protobuf/descriptor.ts +4958 -0
  63. package/types/generated/google/protobuf/duration.ts +186 -0
  64. package/types/generated/google/protobuf/timestamp.ts +215 -0
  65. package/types/generated/ibc/applications/fee/v1/fee.ts +391 -0
  66. package/types/generated/ibc/applications/fee/v1/genesis.ts +553 -0
  67. package/types/generated/ibc/applications/fee/v1/query.ts +2056 -0
  68. package/types/generated/ibc/applications/interchain_accounts/controller/v1/controller.ts +100 -0
  69. package/types/generated/ibc/applications/interchain_accounts/controller/v1/query.ts +447 -0
  70. package/types/generated/ibc/applications/interchain_accounts/host/v1/host.ts +235 -0
  71. package/types/generated/ibc/applications/interchain_accounts/host/v1/query.ts +265 -0
  72. package/types/generated/ibc/applications/transfer/v1/query.ts +1135 -0
  73. package/types/generated/ibc/applications/transfer/v1/transfer.ts +213 -0
  74. package/types/generated/ibc/core/channel/v1/channel.ts +1329 -0
  75. package/types/generated/ibc/core/channel/v1/query.ts +4214 -0
  76. package/types/generated/ibc/core/channel/v1/upgrade.ts +330 -0
  77. package/types/generated/ibc/core/client/v1/client.ts +726 -0
  78. package/types/generated/ibc/core/client/v1/query.ts +2208 -0
  79. package/types/generated/ibc/core/commitment/v1/commitment.ts +329 -0
  80. package/types/generated/ibc/core/connection/v1/connection.ts +813 -0
  81. package/types/generated/ibc/core/connection/v1/query.ts +1442 -0
  82. package/types/generated/ibc/lightclients/wasm/v1/query.ts +484 -0
  83. package/types/generated/tendermint/abci/types.ts +6429 -0
  84. package/types/generated/tendermint/crypto/keys.ts +137 -0
  85. package/types/generated/tendermint/crypto/proof.ts +506 -0
  86. package/types/generated/tendermint/p2p/types.ts +514 -0
  87. package/types/generated/tendermint/types/block.ts +151 -0
  88. package/types/generated/tendermint/types/evidence.ts +493 -0
  89. package/types/generated/tendermint/types/params.ts +687 -0
  90. package/types/generated/tendermint/types/types.ts +2069 -0
  91. package/types/generated/tendermint/types/validator.ts +409 -0
  92. package/types/generated/tendermint/version/types.ts +202 -0
  93. package/types/generated/xion/globalfee/v1/genesis.ts +219 -0
  94. package/types/generated/xion/globalfee/v1/query.ts +269 -0
  95. package/types/generated/xion/jwk/v1/audience.ts +188 -0
  96. package/types/generated/xion/jwk/v1/params.ts +118 -0
  97. package/types/generated/xion/jwk/v1/query.ts +1061 -0
  98. package/types/generated/xion/mint/v1/mint.ts +273 -0
  99. package/types/generated/xion/mint/v1/query.ts +589 -0
  100. package/types/generated/xion/v1/query.ts +878 -0
@@ -0,0 +1,2515 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.181.2
4
+ // protoc unknown
5
+ // source: cosmos/staking/v1beta1/staking.proto
6
+
7
+ /* eslint-disable */
8
+ import Long from "long";
9
+ import _m0 from "protobufjs/minimal";
10
+ import { Any } from "../../../google/protobuf/any";
11
+ import { Duration } from "../../../google/protobuf/duration";
12
+ import { Timestamp } from "../../../google/protobuf/timestamp";
13
+ import { ValidatorUpdate } from "../../../tendermint/abci/types";
14
+ import { Header } from "../../../tendermint/types/types";
15
+ import { Coin } from "../../base/v1beta1/coin";
16
+
17
+ export const protobufPackage = "cosmos.staking.v1beta1";
18
+
19
+ /** BondStatus is the status of a validator. */
20
+ export enum BondStatus {
21
+ /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */
22
+ BOND_STATUS_UNSPECIFIED = 0,
23
+ /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */
24
+ BOND_STATUS_UNBONDED = 1,
25
+ /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */
26
+ BOND_STATUS_UNBONDING = 2,
27
+ /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */
28
+ BOND_STATUS_BONDED = 3,
29
+ UNRECOGNIZED = -1,
30
+ }
31
+
32
+ export function bondStatusFromJSON(object: any): BondStatus {
33
+ switch (object) {
34
+ case 0:
35
+ case "BOND_STATUS_UNSPECIFIED":
36
+ return BondStatus.BOND_STATUS_UNSPECIFIED;
37
+ case 1:
38
+ case "BOND_STATUS_UNBONDED":
39
+ return BondStatus.BOND_STATUS_UNBONDED;
40
+ case 2:
41
+ case "BOND_STATUS_UNBONDING":
42
+ return BondStatus.BOND_STATUS_UNBONDING;
43
+ case 3:
44
+ case "BOND_STATUS_BONDED":
45
+ return BondStatus.BOND_STATUS_BONDED;
46
+ case -1:
47
+ case "UNRECOGNIZED":
48
+ default:
49
+ return BondStatus.UNRECOGNIZED;
50
+ }
51
+ }
52
+
53
+ export function bondStatusToJSON(object: BondStatus): string {
54
+ switch (object) {
55
+ case BondStatus.BOND_STATUS_UNSPECIFIED:
56
+ return "BOND_STATUS_UNSPECIFIED";
57
+ case BondStatus.BOND_STATUS_UNBONDED:
58
+ return "BOND_STATUS_UNBONDED";
59
+ case BondStatus.BOND_STATUS_UNBONDING:
60
+ return "BOND_STATUS_UNBONDING";
61
+ case BondStatus.BOND_STATUS_BONDED:
62
+ return "BOND_STATUS_BONDED";
63
+ case BondStatus.UNRECOGNIZED:
64
+ default:
65
+ return "UNRECOGNIZED";
66
+ }
67
+ }
68
+
69
+ /** Infraction indicates the infraction a validator commited. */
70
+ export enum Infraction {
71
+ /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */
72
+ INFRACTION_UNSPECIFIED = 0,
73
+ /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */
74
+ INFRACTION_DOUBLE_SIGN = 1,
75
+ /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */
76
+ INFRACTION_DOWNTIME = 2,
77
+ UNRECOGNIZED = -1,
78
+ }
79
+
80
+ export function infractionFromJSON(object: any): Infraction {
81
+ switch (object) {
82
+ case 0:
83
+ case "INFRACTION_UNSPECIFIED":
84
+ return Infraction.INFRACTION_UNSPECIFIED;
85
+ case 1:
86
+ case "INFRACTION_DOUBLE_SIGN":
87
+ return Infraction.INFRACTION_DOUBLE_SIGN;
88
+ case 2:
89
+ case "INFRACTION_DOWNTIME":
90
+ return Infraction.INFRACTION_DOWNTIME;
91
+ case -1:
92
+ case "UNRECOGNIZED":
93
+ default:
94
+ return Infraction.UNRECOGNIZED;
95
+ }
96
+ }
97
+
98
+ export function infractionToJSON(object: Infraction): string {
99
+ switch (object) {
100
+ case Infraction.INFRACTION_UNSPECIFIED:
101
+ return "INFRACTION_UNSPECIFIED";
102
+ case Infraction.INFRACTION_DOUBLE_SIGN:
103
+ return "INFRACTION_DOUBLE_SIGN";
104
+ case Infraction.INFRACTION_DOWNTIME:
105
+ return "INFRACTION_DOWNTIME";
106
+ case Infraction.UNRECOGNIZED:
107
+ default:
108
+ return "UNRECOGNIZED";
109
+ }
110
+ }
111
+
112
+ /**
113
+ * HistoricalInfo contains header and validator information for a given block.
114
+ * It is stored as part of staking module's state, which persists the `n` most
115
+ * recent HistoricalInfo
116
+ * (`n` is set by the staking module's `historical_entries` parameter).
117
+ */
118
+ export interface HistoricalInfo {
119
+ header?: Header | undefined;
120
+ valset: Validator[];
121
+ }
122
+
123
+ /**
124
+ * CommissionRates defines the initial commission rates to be used for creating
125
+ * a validator.
126
+ */
127
+ export interface CommissionRates {
128
+ /** rate is the commission rate charged to delegators, as a fraction. */
129
+ rate: string;
130
+ /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */
131
+ maxRate: string;
132
+ /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */
133
+ maxChangeRate: string;
134
+ }
135
+
136
+ /** Commission defines commission parameters for a given validator. */
137
+ export interface Commission {
138
+ /** commission_rates defines the initial commission rates to be used for creating a validator. */
139
+ commissionRates?:
140
+ | CommissionRates
141
+ | undefined;
142
+ /** update_time is the last time the commission rate was changed. */
143
+ updateTime?: Date | undefined;
144
+ }
145
+
146
+ /** Description defines a validator description. */
147
+ export interface Description {
148
+ /** moniker defines a human-readable name for the validator. */
149
+ moniker: string;
150
+ /** identity defines an optional identity signature (ex. UPort or Keybase). */
151
+ identity: string;
152
+ /** website defines an optional website link. */
153
+ website: string;
154
+ /** security_contact defines an optional email for security contact. */
155
+ securityContact: string;
156
+ /** details define other optional details. */
157
+ details: string;
158
+ }
159
+
160
+ /**
161
+ * Validator defines a validator, together with the total amount of the
162
+ * Validator's bond shares and their exchange rate to coins. Slashing results in
163
+ * a decrease in the exchange rate, allowing correct calculation of future
164
+ * undelegations without iterating over delegators. When coins are delegated to
165
+ * this validator, the validator is credited with a delegation whose number of
166
+ * bond shares is based on the amount of coins delegated divided by the current
167
+ * exchange rate. Voting power can be calculated as total bonded shares
168
+ * multiplied by exchange rate.
169
+ */
170
+ export interface Validator {
171
+ /** operator_address defines the address of the validator's operator; bech encoded in JSON. */
172
+ operatorAddress: string;
173
+ /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */
174
+ consensusPubkey?:
175
+ | Any
176
+ | undefined;
177
+ /** jailed defined whether the validator has been jailed from bonded status or not. */
178
+ jailed: boolean;
179
+ /** status is the validator status (bonded/unbonding/unbonded). */
180
+ status: BondStatus;
181
+ /** tokens define the delegated tokens (incl. self-delegation). */
182
+ tokens: string;
183
+ /** delegator_shares defines total shares issued to a validator's delegators. */
184
+ delegatorShares: string;
185
+ /** description defines the description terms for the validator. */
186
+ description?:
187
+ | Description
188
+ | undefined;
189
+ /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */
190
+ unbondingHeight: Long;
191
+ /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */
192
+ unbondingTime?:
193
+ | Date
194
+ | undefined;
195
+ /** commission defines the commission parameters. */
196
+ commission?:
197
+ | Commission
198
+ | undefined;
199
+ /**
200
+ * min_self_delegation is the validator's self declared minimum self delegation.
201
+ *
202
+ * Since: cosmos-sdk 0.46
203
+ */
204
+ minSelfDelegation: string;
205
+ /** strictly positive if this validator's unbonding has been stopped by external modules */
206
+ unbondingOnHoldRefCount: Long;
207
+ /** list of unbonding ids, each uniquely identifing an unbonding of this validator */
208
+ unbondingIds: Long[];
209
+ }
210
+
211
+ /** ValAddresses defines a repeated set of validator addresses. */
212
+ export interface ValAddresses {
213
+ addresses: string[];
214
+ }
215
+
216
+ /**
217
+ * DVPair is struct that just has a delegator-validator pair with no other data.
218
+ * It is intended to be used as a marshalable pointer. For example, a DVPair can
219
+ * be used to construct the key to getting an UnbondingDelegation from state.
220
+ */
221
+ export interface DVPair {
222
+ delegatorAddress: string;
223
+ validatorAddress: string;
224
+ }
225
+
226
+ /** DVPairs defines an array of DVPair objects. */
227
+ export interface DVPairs {
228
+ pairs: DVPair[];
229
+ }
230
+
231
+ /**
232
+ * DVVTriplet is struct that just has a delegator-validator-validator triplet
233
+ * with no other data. It is intended to be used as a marshalable pointer. For
234
+ * example, a DVVTriplet can be used to construct the key to getting a
235
+ * Redelegation from state.
236
+ */
237
+ export interface DVVTriplet {
238
+ delegatorAddress: string;
239
+ validatorSrcAddress: string;
240
+ validatorDstAddress: string;
241
+ }
242
+
243
+ /** DVVTriplets defines an array of DVVTriplet objects. */
244
+ export interface DVVTriplets {
245
+ triplets: DVVTriplet[];
246
+ }
247
+
248
+ /**
249
+ * Delegation represents the bond with tokens held by an account. It is
250
+ * owned by one delegator, and is associated with the voting power of one
251
+ * validator.
252
+ */
253
+ export interface Delegation {
254
+ /** delegator_address is the encoded address of the delegator. */
255
+ delegatorAddress: string;
256
+ /** validator_address is the encoded address of the validator. */
257
+ validatorAddress: string;
258
+ /** shares define the delegation shares received. */
259
+ shares: string;
260
+ }
261
+
262
+ /**
263
+ * UnbondingDelegation stores all of a single delegator's unbonding bonds
264
+ * for a single validator in an time-ordered list.
265
+ */
266
+ export interface UnbondingDelegation {
267
+ /** delegator_address is the encoded address of the delegator. */
268
+ delegatorAddress: string;
269
+ /** validator_address is the encoded address of the validator. */
270
+ validatorAddress: string;
271
+ /** entries are the unbonding delegation entries. */
272
+ entries: UnbondingDelegationEntry[];
273
+ }
274
+
275
+ /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */
276
+ export interface UnbondingDelegationEntry {
277
+ /** creation_height is the height which the unbonding took place. */
278
+ creationHeight: Long;
279
+ /** completion_time is the unix time for unbonding completion. */
280
+ completionTime?:
281
+ | Date
282
+ | undefined;
283
+ /** initial_balance defines the tokens initially scheduled to receive at completion. */
284
+ initialBalance: string;
285
+ /** balance defines the tokens to receive at completion. */
286
+ balance: string;
287
+ /** Incrementing id that uniquely identifies this entry */
288
+ unbondingId: Long;
289
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
290
+ unbondingOnHoldRefCount: Long;
291
+ }
292
+
293
+ /** RedelegationEntry defines a redelegation object with relevant metadata. */
294
+ export interface RedelegationEntry {
295
+ /** creation_height defines the height which the redelegation took place. */
296
+ creationHeight: Long;
297
+ /** completion_time defines the unix time for redelegation completion. */
298
+ completionTime?:
299
+ | Date
300
+ | undefined;
301
+ /** initial_balance defines the initial balance when redelegation started. */
302
+ initialBalance: string;
303
+ /** shares_dst is the amount of destination-validator shares created by redelegation. */
304
+ sharesDst: string;
305
+ /** Incrementing id that uniquely identifies this entry */
306
+ unbondingId: Long;
307
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
308
+ unbondingOnHoldRefCount: Long;
309
+ }
310
+
311
+ /**
312
+ * Redelegation contains the list of a particular delegator's redelegating bonds
313
+ * from a particular source validator to a particular destination validator.
314
+ */
315
+ export interface Redelegation {
316
+ /** delegator_address is the bech32-encoded address of the delegator. */
317
+ delegatorAddress: string;
318
+ /** validator_src_address is the validator redelegation source operator address. */
319
+ validatorSrcAddress: string;
320
+ /** validator_dst_address is the validator redelegation destination operator address. */
321
+ validatorDstAddress: string;
322
+ /** entries are the redelegation entries. */
323
+ entries: RedelegationEntry[];
324
+ }
325
+
326
+ /** Params defines the parameters for the x/staking module. */
327
+ export interface Params {
328
+ /** unbonding_time is the time duration of unbonding. */
329
+ unbondingTime?:
330
+ | Duration
331
+ | undefined;
332
+ /** max_validators is the maximum number of validators. */
333
+ maxValidators: number;
334
+ /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */
335
+ maxEntries: number;
336
+ /** historical_entries is the number of historical entries to persist. */
337
+ historicalEntries: number;
338
+ /** bond_denom defines the bondable coin denomination. */
339
+ bondDenom: string;
340
+ /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */
341
+ minCommissionRate: string;
342
+ }
343
+
344
+ /**
345
+ * DelegationResponse is equivalent to Delegation except that it contains a
346
+ * balance in addition to shares which is more suitable for client responses.
347
+ */
348
+ export interface DelegationResponse {
349
+ delegation?: Delegation | undefined;
350
+ balance?: Coin | undefined;
351
+ }
352
+
353
+ /**
354
+ * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
355
+ * contains a balance in addition to shares which is more suitable for client
356
+ * responses.
357
+ */
358
+ export interface RedelegationEntryResponse {
359
+ redelegationEntry?: RedelegationEntry | undefined;
360
+ balance: string;
361
+ }
362
+
363
+ /**
364
+ * RedelegationResponse is equivalent to a Redelegation except that its entries
365
+ * contain a balance in addition to shares which is more suitable for client
366
+ * responses.
367
+ */
368
+ export interface RedelegationResponse {
369
+ redelegation?: Redelegation | undefined;
370
+ entries: RedelegationEntryResponse[];
371
+ }
372
+
373
+ /**
374
+ * Pool is used for tracking bonded and not-bonded token supply of the bond
375
+ * denomination.
376
+ */
377
+ export interface Pool {
378
+ notBondedTokens: string;
379
+ bondedTokens: string;
380
+ }
381
+
382
+ /**
383
+ * ValidatorUpdates defines an array of abci.ValidatorUpdate objects.
384
+ * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence
385
+ */
386
+ export interface ValidatorUpdates {
387
+ updates: ValidatorUpdate[];
388
+ }
389
+
390
+ function createBaseHistoricalInfo(): HistoricalInfo {
391
+ return { header: undefined, valset: [] };
392
+ }
393
+
394
+ export const HistoricalInfo = {
395
+ encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
396
+ if (message.header !== undefined) {
397
+ Header.encode(message.header, writer.uint32(10).fork()).ldelim();
398
+ }
399
+ for (const v of message.valset) {
400
+ Validator.encode(v!, writer.uint32(18).fork()).ldelim();
401
+ }
402
+ return writer;
403
+ },
404
+
405
+ decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo {
406
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
407
+ let end = length === undefined ? reader.len : reader.pos + length;
408
+ const message = createBaseHistoricalInfo();
409
+ while (reader.pos < end) {
410
+ const tag = reader.uint32();
411
+ switch (tag >>> 3) {
412
+ case 1:
413
+ if (tag !== 10) {
414
+ break;
415
+ }
416
+
417
+ message.header = Header.decode(reader, reader.uint32());
418
+ continue;
419
+ case 2:
420
+ if (tag !== 18) {
421
+ break;
422
+ }
423
+
424
+ message.valset.push(Validator.decode(reader, reader.uint32()));
425
+ continue;
426
+ }
427
+ if ((tag & 7) === 4 || tag === 0) {
428
+ break;
429
+ }
430
+ reader.skipType(tag & 7);
431
+ }
432
+ return message;
433
+ },
434
+
435
+ fromJSON(object: any): HistoricalInfo {
436
+ return {
437
+ header: isSet(object.header) ? Header.fromJSON(object.header) : undefined,
438
+ valset: globalThis.Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromJSON(e)) : [],
439
+ };
440
+ },
441
+
442
+ toJSON(message: HistoricalInfo): unknown {
443
+ const obj: any = {};
444
+ if (message.header !== undefined) {
445
+ obj.header = Header.toJSON(message.header);
446
+ }
447
+ if (message.valset?.length) {
448
+ obj.valset = message.valset.map((e) => Validator.toJSON(e));
449
+ }
450
+ return obj;
451
+ },
452
+
453
+ create<I extends Exact<DeepPartial<HistoricalInfo>, I>>(base?: I): HistoricalInfo {
454
+ return HistoricalInfo.fromPartial(base ?? ({} as any));
455
+ },
456
+ fromPartial<I extends Exact<DeepPartial<HistoricalInfo>, I>>(object: I): HistoricalInfo {
457
+ const message = createBaseHistoricalInfo();
458
+ message.header = (object.header !== undefined && object.header !== null)
459
+ ? Header.fromPartial(object.header)
460
+ : undefined;
461
+ message.valset = object.valset?.map((e) => Validator.fromPartial(e)) || [];
462
+ return message;
463
+ },
464
+ };
465
+
466
+ function createBaseCommissionRates(): CommissionRates {
467
+ return { rate: "", maxRate: "", maxChangeRate: "" };
468
+ }
469
+
470
+ export const CommissionRates = {
471
+ encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
472
+ if (message.rate !== "") {
473
+ writer.uint32(10).string(message.rate);
474
+ }
475
+ if (message.maxRate !== "") {
476
+ writer.uint32(18).string(message.maxRate);
477
+ }
478
+ if (message.maxChangeRate !== "") {
479
+ writer.uint32(26).string(message.maxChangeRate);
480
+ }
481
+ return writer;
482
+ },
483
+
484
+ decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates {
485
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
486
+ let end = length === undefined ? reader.len : reader.pos + length;
487
+ const message = createBaseCommissionRates();
488
+ while (reader.pos < end) {
489
+ const tag = reader.uint32();
490
+ switch (tag >>> 3) {
491
+ case 1:
492
+ if (tag !== 10) {
493
+ break;
494
+ }
495
+
496
+ message.rate = reader.string();
497
+ continue;
498
+ case 2:
499
+ if (tag !== 18) {
500
+ break;
501
+ }
502
+
503
+ message.maxRate = reader.string();
504
+ continue;
505
+ case 3:
506
+ if (tag !== 26) {
507
+ break;
508
+ }
509
+
510
+ message.maxChangeRate = reader.string();
511
+ continue;
512
+ }
513
+ if ((tag & 7) === 4 || tag === 0) {
514
+ break;
515
+ }
516
+ reader.skipType(tag & 7);
517
+ }
518
+ return message;
519
+ },
520
+
521
+ fromJSON(object: any): CommissionRates {
522
+ return {
523
+ rate: isSet(object.rate) ? globalThis.String(object.rate) : "",
524
+ maxRate: isSet(object.maxRate) ? globalThis.String(object.maxRate) : "",
525
+ maxChangeRate: isSet(object.maxChangeRate) ? globalThis.String(object.maxChangeRate) : "",
526
+ };
527
+ },
528
+
529
+ toJSON(message: CommissionRates): unknown {
530
+ const obj: any = {};
531
+ if (message.rate !== "") {
532
+ obj.rate = message.rate;
533
+ }
534
+ if (message.maxRate !== "") {
535
+ obj.maxRate = message.maxRate;
536
+ }
537
+ if (message.maxChangeRate !== "") {
538
+ obj.maxChangeRate = message.maxChangeRate;
539
+ }
540
+ return obj;
541
+ },
542
+
543
+ create<I extends Exact<DeepPartial<CommissionRates>, I>>(base?: I): CommissionRates {
544
+ return CommissionRates.fromPartial(base ?? ({} as any));
545
+ },
546
+ fromPartial<I extends Exact<DeepPartial<CommissionRates>, I>>(object: I): CommissionRates {
547
+ const message = createBaseCommissionRates();
548
+ message.rate = object.rate ?? "";
549
+ message.maxRate = object.maxRate ?? "";
550
+ message.maxChangeRate = object.maxChangeRate ?? "";
551
+ return message;
552
+ },
553
+ };
554
+
555
+ function createBaseCommission(): Commission {
556
+ return { commissionRates: undefined, updateTime: undefined };
557
+ }
558
+
559
+ export const Commission = {
560
+ encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
561
+ if (message.commissionRates !== undefined) {
562
+ CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim();
563
+ }
564
+ if (message.updateTime !== undefined) {
565
+ Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim();
566
+ }
567
+ return writer;
568
+ },
569
+
570
+ decode(input: _m0.Reader | Uint8Array, length?: number): Commission {
571
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
572
+ let end = length === undefined ? reader.len : reader.pos + length;
573
+ const message = createBaseCommission();
574
+ while (reader.pos < end) {
575
+ const tag = reader.uint32();
576
+ switch (tag >>> 3) {
577
+ case 1:
578
+ if (tag !== 10) {
579
+ break;
580
+ }
581
+
582
+ message.commissionRates = CommissionRates.decode(reader, reader.uint32());
583
+ continue;
584
+ case 2:
585
+ if (tag !== 18) {
586
+ break;
587
+ }
588
+
589
+ message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
590
+ continue;
591
+ }
592
+ if ((tag & 7) === 4 || tag === 0) {
593
+ break;
594
+ }
595
+ reader.skipType(tag & 7);
596
+ }
597
+ return message;
598
+ },
599
+
600
+ fromJSON(object: any): Commission {
601
+ return {
602
+ commissionRates: isSet(object.commissionRates) ? CommissionRates.fromJSON(object.commissionRates) : undefined,
603
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
604
+ };
605
+ },
606
+
607
+ toJSON(message: Commission): unknown {
608
+ const obj: any = {};
609
+ if (message.commissionRates !== undefined) {
610
+ obj.commissionRates = CommissionRates.toJSON(message.commissionRates);
611
+ }
612
+ if (message.updateTime !== undefined) {
613
+ obj.updateTime = message.updateTime.toISOString();
614
+ }
615
+ return obj;
616
+ },
617
+
618
+ create<I extends Exact<DeepPartial<Commission>, I>>(base?: I): Commission {
619
+ return Commission.fromPartial(base ?? ({} as any));
620
+ },
621
+ fromPartial<I extends Exact<DeepPartial<Commission>, I>>(object: I): Commission {
622
+ const message = createBaseCommission();
623
+ message.commissionRates = (object.commissionRates !== undefined && object.commissionRates !== null)
624
+ ? CommissionRates.fromPartial(object.commissionRates)
625
+ : undefined;
626
+ message.updateTime = object.updateTime ?? undefined;
627
+ return message;
628
+ },
629
+ };
630
+
631
+ function createBaseDescription(): Description {
632
+ return { moniker: "", identity: "", website: "", securityContact: "", details: "" };
633
+ }
634
+
635
+ export const Description = {
636
+ encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
637
+ if (message.moniker !== "") {
638
+ writer.uint32(10).string(message.moniker);
639
+ }
640
+ if (message.identity !== "") {
641
+ writer.uint32(18).string(message.identity);
642
+ }
643
+ if (message.website !== "") {
644
+ writer.uint32(26).string(message.website);
645
+ }
646
+ if (message.securityContact !== "") {
647
+ writer.uint32(34).string(message.securityContact);
648
+ }
649
+ if (message.details !== "") {
650
+ writer.uint32(42).string(message.details);
651
+ }
652
+ return writer;
653
+ },
654
+
655
+ decode(input: _m0.Reader | Uint8Array, length?: number): Description {
656
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
657
+ let end = length === undefined ? reader.len : reader.pos + length;
658
+ const message = createBaseDescription();
659
+ while (reader.pos < end) {
660
+ const tag = reader.uint32();
661
+ switch (tag >>> 3) {
662
+ case 1:
663
+ if (tag !== 10) {
664
+ break;
665
+ }
666
+
667
+ message.moniker = reader.string();
668
+ continue;
669
+ case 2:
670
+ if (tag !== 18) {
671
+ break;
672
+ }
673
+
674
+ message.identity = reader.string();
675
+ continue;
676
+ case 3:
677
+ if (tag !== 26) {
678
+ break;
679
+ }
680
+
681
+ message.website = reader.string();
682
+ continue;
683
+ case 4:
684
+ if (tag !== 34) {
685
+ break;
686
+ }
687
+
688
+ message.securityContact = reader.string();
689
+ continue;
690
+ case 5:
691
+ if (tag !== 42) {
692
+ break;
693
+ }
694
+
695
+ message.details = reader.string();
696
+ continue;
697
+ }
698
+ if ((tag & 7) === 4 || tag === 0) {
699
+ break;
700
+ }
701
+ reader.skipType(tag & 7);
702
+ }
703
+ return message;
704
+ },
705
+
706
+ fromJSON(object: any): Description {
707
+ return {
708
+ moniker: isSet(object.moniker) ? globalThis.String(object.moniker) : "",
709
+ identity: isSet(object.identity) ? globalThis.String(object.identity) : "",
710
+ website: isSet(object.website) ? globalThis.String(object.website) : "",
711
+ securityContact: isSet(object.securityContact) ? globalThis.String(object.securityContact) : "",
712
+ details: isSet(object.details) ? globalThis.String(object.details) : "",
713
+ };
714
+ },
715
+
716
+ toJSON(message: Description): unknown {
717
+ const obj: any = {};
718
+ if (message.moniker !== "") {
719
+ obj.moniker = message.moniker;
720
+ }
721
+ if (message.identity !== "") {
722
+ obj.identity = message.identity;
723
+ }
724
+ if (message.website !== "") {
725
+ obj.website = message.website;
726
+ }
727
+ if (message.securityContact !== "") {
728
+ obj.securityContact = message.securityContact;
729
+ }
730
+ if (message.details !== "") {
731
+ obj.details = message.details;
732
+ }
733
+ return obj;
734
+ },
735
+
736
+ create<I extends Exact<DeepPartial<Description>, I>>(base?: I): Description {
737
+ return Description.fromPartial(base ?? ({} as any));
738
+ },
739
+ fromPartial<I extends Exact<DeepPartial<Description>, I>>(object: I): Description {
740
+ const message = createBaseDescription();
741
+ message.moniker = object.moniker ?? "";
742
+ message.identity = object.identity ?? "";
743
+ message.website = object.website ?? "";
744
+ message.securityContact = object.securityContact ?? "";
745
+ message.details = object.details ?? "";
746
+ return message;
747
+ },
748
+ };
749
+
750
+ function createBaseValidator(): Validator {
751
+ return {
752
+ operatorAddress: "",
753
+ consensusPubkey: undefined,
754
+ jailed: false,
755
+ status: 0,
756
+ tokens: "",
757
+ delegatorShares: "",
758
+ description: undefined,
759
+ unbondingHeight: Long.ZERO,
760
+ unbondingTime: undefined,
761
+ commission: undefined,
762
+ minSelfDelegation: "",
763
+ unbondingOnHoldRefCount: Long.ZERO,
764
+ unbondingIds: [],
765
+ };
766
+ }
767
+
768
+ export const Validator = {
769
+ encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
770
+ if (message.operatorAddress !== "") {
771
+ writer.uint32(10).string(message.operatorAddress);
772
+ }
773
+ if (message.consensusPubkey !== undefined) {
774
+ Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim();
775
+ }
776
+ if (message.jailed !== false) {
777
+ writer.uint32(24).bool(message.jailed);
778
+ }
779
+ if (message.status !== 0) {
780
+ writer.uint32(32).int32(message.status);
781
+ }
782
+ if (message.tokens !== "") {
783
+ writer.uint32(42).string(message.tokens);
784
+ }
785
+ if (message.delegatorShares !== "") {
786
+ writer.uint32(50).string(message.delegatorShares);
787
+ }
788
+ if (message.description !== undefined) {
789
+ Description.encode(message.description, writer.uint32(58).fork()).ldelim();
790
+ }
791
+ if (!message.unbondingHeight.equals(Long.ZERO)) {
792
+ writer.uint32(64).int64(message.unbondingHeight);
793
+ }
794
+ if (message.unbondingTime !== undefined) {
795
+ Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim();
796
+ }
797
+ if (message.commission !== undefined) {
798
+ Commission.encode(message.commission, writer.uint32(82).fork()).ldelim();
799
+ }
800
+ if (message.minSelfDelegation !== "") {
801
+ writer.uint32(90).string(message.minSelfDelegation);
802
+ }
803
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
804
+ writer.uint32(96).int64(message.unbondingOnHoldRefCount);
805
+ }
806
+ writer.uint32(106).fork();
807
+ for (const v of message.unbondingIds) {
808
+ writer.uint64(v);
809
+ }
810
+ writer.ldelim();
811
+ return writer;
812
+ },
813
+
814
+ decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
815
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
816
+ let end = length === undefined ? reader.len : reader.pos + length;
817
+ const message = createBaseValidator();
818
+ while (reader.pos < end) {
819
+ const tag = reader.uint32();
820
+ switch (tag >>> 3) {
821
+ case 1:
822
+ if (tag !== 10) {
823
+ break;
824
+ }
825
+
826
+ message.operatorAddress = reader.string();
827
+ continue;
828
+ case 2:
829
+ if (tag !== 18) {
830
+ break;
831
+ }
832
+
833
+ message.consensusPubkey = Any.decode(reader, reader.uint32());
834
+ continue;
835
+ case 3:
836
+ if (tag !== 24) {
837
+ break;
838
+ }
839
+
840
+ message.jailed = reader.bool();
841
+ continue;
842
+ case 4:
843
+ if (tag !== 32) {
844
+ break;
845
+ }
846
+
847
+ message.status = reader.int32() as any;
848
+ continue;
849
+ case 5:
850
+ if (tag !== 42) {
851
+ break;
852
+ }
853
+
854
+ message.tokens = reader.string();
855
+ continue;
856
+ case 6:
857
+ if (tag !== 50) {
858
+ break;
859
+ }
860
+
861
+ message.delegatorShares = reader.string();
862
+ continue;
863
+ case 7:
864
+ if (tag !== 58) {
865
+ break;
866
+ }
867
+
868
+ message.description = Description.decode(reader, reader.uint32());
869
+ continue;
870
+ case 8:
871
+ if (tag !== 64) {
872
+ break;
873
+ }
874
+
875
+ message.unbondingHeight = reader.int64() as Long;
876
+ continue;
877
+ case 9:
878
+ if (tag !== 74) {
879
+ break;
880
+ }
881
+
882
+ message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
883
+ continue;
884
+ case 10:
885
+ if (tag !== 82) {
886
+ break;
887
+ }
888
+
889
+ message.commission = Commission.decode(reader, reader.uint32());
890
+ continue;
891
+ case 11:
892
+ if (tag !== 90) {
893
+ break;
894
+ }
895
+
896
+ message.minSelfDelegation = reader.string();
897
+ continue;
898
+ case 12:
899
+ if (tag !== 96) {
900
+ break;
901
+ }
902
+
903
+ message.unbondingOnHoldRefCount = reader.int64() as Long;
904
+ continue;
905
+ case 13:
906
+ if (tag === 104) {
907
+ message.unbondingIds.push(reader.uint64() as Long);
908
+
909
+ continue;
910
+ }
911
+
912
+ if (tag === 106) {
913
+ const end2 = reader.uint32() + reader.pos;
914
+ while (reader.pos < end2) {
915
+ message.unbondingIds.push(reader.uint64() as Long);
916
+ }
917
+
918
+ continue;
919
+ }
920
+
921
+ break;
922
+ }
923
+ if ((tag & 7) === 4 || tag === 0) {
924
+ break;
925
+ }
926
+ reader.skipType(tag & 7);
927
+ }
928
+ return message;
929
+ },
930
+
931
+ fromJSON(object: any): Validator {
932
+ return {
933
+ operatorAddress: isSet(object.operatorAddress) ? globalThis.String(object.operatorAddress) : "",
934
+ consensusPubkey: isSet(object.consensusPubkey) ? Any.fromJSON(object.consensusPubkey) : undefined,
935
+ jailed: isSet(object.jailed) ? globalThis.Boolean(object.jailed) : false,
936
+ status: isSet(object.status) ? bondStatusFromJSON(object.status) : 0,
937
+ tokens: isSet(object.tokens) ? globalThis.String(object.tokens) : "",
938
+ delegatorShares: isSet(object.delegatorShares) ? globalThis.String(object.delegatorShares) : "",
939
+ description: isSet(object.description) ? Description.fromJSON(object.description) : undefined,
940
+ unbondingHeight: isSet(object.unbondingHeight) ? Long.fromValue(object.unbondingHeight) : Long.ZERO,
941
+ unbondingTime: isSet(object.unbondingTime) ? fromJsonTimestamp(object.unbondingTime) : undefined,
942
+ commission: isSet(object.commission) ? Commission.fromJSON(object.commission) : undefined,
943
+ minSelfDelegation: isSet(object.minSelfDelegation) ? globalThis.String(object.minSelfDelegation) : "",
944
+ unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount)
945
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
946
+ : Long.ZERO,
947
+ unbondingIds: globalThis.Array.isArray(object?.unbondingIds)
948
+ ? object.unbondingIds.map((e: any) => Long.fromValue(e))
949
+ : [],
950
+ };
951
+ },
952
+
953
+ toJSON(message: Validator): unknown {
954
+ const obj: any = {};
955
+ if (message.operatorAddress !== "") {
956
+ obj.operatorAddress = message.operatorAddress;
957
+ }
958
+ if (message.consensusPubkey !== undefined) {
959
+ obj.consensusPubkey = Any.toJSON(message.consensusPubkey);
960
+ }
961
+ if (message.jailed !== false) {
962
+ obj.jailed = message.jailed;
963
+ }
964
+ if (message.status !== 0) {
965
+ obj.status = bondStatusToJSON(message.status);
966
+ }
967
+ if (message.tokens !== "") {
968
+ obj.tokens = message.tokens;
969
+ }
970
+ if (message.delegatorShares !== "") {
971
+ obj.delegatorShares = message.delegatorShares;
972
+ }
973
+ if (message.description !== undefined) {
974
+ obj.description = Description.toJSON(message.description);
975
+ }
976
+ if (!message.unbondingHeight.equals(Long.ZERO)) {
977
+ obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString();
978
+ }
979
+ if (message.unbondingTime !== undefined) {
980
+ obj.unbondingTime = message.unbondingTime.toISOString();
981
+ }
982
+ if (message.commission !== undefined) {
983
+ obj.commission = Commission.toJSON(message.commission);
984
+ }
985
+ if (message.minSelfDelegation !== "") {
986
+ obj.minSelfDelegation = message.minSelfDelegation;
987
+ }
988
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
989
+ obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString();
990
+ }
991
+ if (message.unbondingIds?.length) {
992
+ obj.unbondingIds = message.unbondingIds.map((e) => (e || Long.UZERO).toString());
993
+ }
994
+ return obj;
995
+ },
996
+
997
+ create<I extends Exact<DeepPartial<Validator>, I>>(base?: I): Validator {
998
+ return Validator.fromPartial(base ?? ({} as any));
999
+ },
1000
+ fromPartial<I extends Exact<DeepPartial<Validator>, I>>(object: I): Validator {
1001
+ const message = createBaseValidator();
1002
+ message.operatorAddress = object.operatorAddress ?? "";
1003
+ message.consensusPubkey = (object.consensusPubkey !== undefined && object.consensusPubkey !== null)
1004
+ ? Any.fromPartial(object.consensusPubkey)
1005
+ : undefined;
1006
+ message.jailed = object.jailed ?? false;
1007
+ message.status = object.status ?? 0;
1008
+ message.tokens = object.tokens ?? "";
1009
+ message.delegatorShares = object.delegatorShares ?? "";
1010
+ message.description = (object.description !== undefined && object.description !== null)
1011
+ ? Description.fromPartial(object.description)
1012
+ : undefined;
1013
+ message.unbondingHeight = (object.unbondingHeight !== undefined && object.unbondingHeight !== null)
1014
+ ? Long.fromValue(object.unbondingHeight)
1015
+ : Long.ZERO;
1016
+ message.unbondingTime = object.unbondingTime ?? undefined;
1017
+ message.commission = (object.commission !== undefined && object.commission !== null)
1018
+ ? Commission.fromPartial(object.commission)
1019
+ : undefined;
1020
+ message.minSelfDelegation = object.minSelfDelegation ?? "";
1021
+ message.unbondingOnHoldRefCount =
1022
+ (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null)
1023
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
1024
+ : Long.ZERO;
1025
+ message.unbondingIds = object.unbondingIds?.map((e) => Long.fromValue(e)) || [];
1026
+ return message;
1027
+ },
1028
+ };
1029
+
1030
+ function createBaseValAddresses(): ValAddresses {
1031
+ return { addresses: [] };
1032
+ }
1033
+
1034
+ export const ValAddresses = {
1035
+ encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1036
+ for (const v of message.addresses) {
1037
+ writer.uint32(10).string(v!);
1038
+ }
1039
+ return writer;
1040
+ },
1041
+
1042
+ decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses {
1043
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1044
+ let end = length === undefined ? reader.len : reader.pos + length;
1045
+ const message = createBaseValAddresses();
1046
+ while (reader.pos < end) {
1047
+ const tag = reader.uint32();
1048
+ switch (tag >>> 3) {
1049
+ case 1:
1050
+ if (tag !== 10) {
1051
+ break;
1052
+ }
1053
+
1054
+ message.addresses.push(reader.string());
1055
+ continue;
1056
+ }
1057
+ if ((tag & 7) === 4 || tag === 0) {
1058
+ break;
1059
+ }
1060
+ reader.skipType(tag & 7);
1061
+ }
1062
+ return message;
1063
+ },
1064
+
1065
+ fromJSON(object: any): ValAddresses {
1066
+ return {
1067
+ addresses: globalThis.Array.isArray(object?.addresses)
1068
+ ? object.addresses.map((e: any) => globalThis.String(e))
1069
+ : [],
1070
+ };
1071
+ },
1072
+
1073
+ toJSON(message: ValAddresses): unknown {
1074
+ const obj: any = {};
1075
+ if (message.addresses?.length) {
1076
+ obj.addresses = message.addresses;
1077
+ }
1078
+ return obj;
1079
+ },
1080
+
1081
+ create<I extends Exact<DeepPartial<ValAddresses>, I>>(base?: I): ValAddresses {
1082
+ return ValAddresses.fromPartial(base ?? ({} as any));
1083
+ },
1084
+ fromPartial<I extends Exact<DeepPartial<ValAddresses>, I>>(object: I): ValAddresses {
1085
+ const message = createBaseValAddresses();
1086
+ message.addresses = object.addresses?.map((e) => e) || [];
1087
+ return message;
1088
+ },
1089
+ };
1090
+
1091
+ function createBaseDVPair(): DVPair {
1092
+ return { delegatorAddress: "", validatorAddress: "" };
1093
+ }
1094
+
1095
+ export const DVPair = {
1096
+ encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1097
+ if (message.delegatorAddress !== "") {
1098
+ writer.uint32(10).string(message.delegatorAddress);
1099
+ }
1100
+ if (message.validatorAddress !== "") {
1101
+ writer.uint32(18).string(message.validatorAddress);
1102
+ }
1103
+ return writer;
1104
+ },
1105
+
1106
+ decode(input: _m0.Reader | Uint8Array, length?: number): DVPair {
1107
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1108
+ let end = length === undefined ? reader.len : reader.pos + length;
1109
+ const message = createBaseDVPair();
1110
+ while (reader.pos < end) {
1111
+ const tag = reader.uint32();
1112
+ switch (tag >>> 3) {
1113
+ case 1:
1114
+ if (tag !== 10) {
1115
+ break;
1116
+ }
1117
+
1118
+ message.delegatorAddress = reader.string();
1119
+ continue;
1120
+ case 2:
1121
+ if (tag !== 18) {
1122
+ break;
1123
+ }
1124
+
1125
+ message.validatorAddress = reader.string();
1126
+ continue;
1127
+ }
1128
+ if ((tag & 7) === 4 || tag === 0) {
1129
+ break;
1130
+ }
1131
+ reader.skipType(tag & 7);
1132
+ }
1133
+ return message;
1134
+ },
1135
+
1136
+ fromJSON(object: any): DVPair {
1137
+ return {
1138
+ delegatorAddress: isSet(object.delegatorAddress) ? globalThis.String(object.delegatorAddress) : "",
1139
+ validatorAddress: isSet(object.validatorAddress) ? globalThis.String(object.validatorAddress) : "",
1140
+ };
1141
+ },
1142
+
1143
+ toJSON(message: DVPair): unknown {
1144
+ const obj: any = {};
1145
+ if (message.delegatorAddress !== "") {
1146
+ obj.delegatorAddress = message.delegatorAddress;
1147
+ }
1148
+ if (message.validatorAddress !== "") {
1149
+ obj.validatorAddress = message.validatorAddress;
1150
+ }
1151
+ return obj;
1152
+ },
1153
+
1154
+ create<I extends Exact<DeepPartial<DVPair>, I>>(base?: I): DVPair {
1155
+ return DVPair.fromPartial(base ?? ({} as any));
1156
+ },
1157
+ fromPartial<I extends Exact<DeepPartial<DVPair>, I>>(object: I): DVPair {
1158
+ const message = createBaseDVPair();
1159
+ message.delegatorAddress = object.delegatorAddress ?? "";
1160
+ message.validatorAddress = object.validatorAddress ?? "";
1161
+ return message;
1162
+ },
1163
+ };
1164
+
1165
+ function createBaseDVPairs(): DVPairs {
1166
+ return { pairs: [] };
1167
+ }
1168
+
1169
+ export const DVPairs = {
1170
+ encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1171
+ for (const v of message.pairs) {
1172
+ DVPair.encode(v!, writer.uint32(10).fork()).ldelim();
1173
+ }
1174
+ return writer;
1175
+ },
1176
+
1177
+ decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs {
1178
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1179
+ let end = length === undefined ? reader.len : reader.pos + length;
1180
+ const message = createBaseDVPairs();
1181
+ while (reader.pos < end) {
1182
+ const tag = reader.uint32();
1183
+ switch (tag >>> 3) {
1184
+ case 1:
1185
+ if (tag !== 10) {
1186
+ break;
1187
+ }
1188
+
1189
+ message.pairs.push(DVPair.decode(reader, reader.uint32()));
1190
+ continue;
1191
+ }
1192
+ if ((tag & 7) === 4 || tag === 0) {
1193
+ break;
1194
+ }
1195
+ reader.skipType(tag & 7);
1196
+ }
1197
+ return message;
1198
+ },
1199
+
1200
+ fromJSON(object: any): DVPairs {
1201
+ return { pairs: globalThis.Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromJSON(e)) : [] };
1202
+ },
1203
+
1204
+ toJSON(message: DVPairs): unknown {
1205
+ const obj: any = {};
1206
+ if (message.pairs?.length) {
1207
+ obj.pairs = message.pairs.map((e) => DVPair.toJSON(e));
1208
+ }
1209
+ return obj;
1210
+ },
1211
+
1212
+ create<I extends Exact<DeepPartial<DVPairs>, I>>(base?: I): DVPairs {
1213
+ return DVPairs.fromPartial(base ?? ({} as any));
1214
+ },
1215
+ fromPartial<I extends Exact<DeepPartial<DVPairs>, I>>(object: I): DVPairs {
1216
+ const message = createBaseDVPairs();
1217
+ message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || [];
1218
+ return message;
1219
+ },
1220
+ };
1221
+
1222
+ function createBaseDVVTriplet(): DVVTriplet {
1223
+ return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" };
1224
+ }
1225
+
1226
+ export const DVVTriplet = {
1227
+ encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1228
+ if (message.delegatorAddress !== "") {
1229
+ writer.uint32(10).string(message.delegatorAddress);
1230
+ }
1231
+ if (message.validatorSrcAddress !== "") {
1232
+ writer.uint32(18).string(message.validatorSrcAddress);
1233
+ }
1234
+ if (message.validatorDstAddress !== "") {
1235
+ writer.uint32(26).string(message.validatorDstAddress);
1236
+ }
1237
+ return writer;
1238
+ },
1239
+
1240
+ decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet {
1241
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1242
+ let end = length === undefined ? reader.len : reader.pos + length;
1243
+ const message = createBaseDVVTriplet();
1244
+ while (reader.pos < end) {
1245
+ const tag = reader.uint32();
1246
+ switch (tag >>> 3) {
1247
+ case 1:
1248
+ if (tag !== 10) {
1249
+ break;
1250
+ }
1251
+
1252
+ message.delegatorAddress = reader.string();
1253
+ continue;
1254
+ case 2:
1255
+ if (tag !== 18) {
1256
+ break;
1257
+ }
1258
+
1259
+ message.validatorSrcAddress = reader.string();
1260
+ continue;
1261
+ case 3:
1262
+ if (tag !== 26) {
1263
+ break;
1264
+ }
1265
+
1266
+ message.validatorDstAddress = reader.string();
1267
+ continue;
1268
+ }
1269
+ if ((tag & 7) === 4 || tag === 0) {
1270
+ break;
1271
+ }
1272
+ reader.skipType(tag & 7);
1273
+ }
1274
+ return message;
1275
+ },
1276
+
1277
+ fromJSON(object: any): DVVTriplet {
1278
+ return {
1279
+ delegatorAddress: isSet(object.delegatorAddress) ? globalThis.String(object.delegatorAddress) : "",
1280
+ validatorSrcAddress: isSet(object.validatorSrcAddress) ? globalThis.String(object.validatorSrcAddress) : "",
1281
+ validatorDstAddress: isSet(object.validatorDstAddress) ? globalThis.String(object.validatorDstAddress) : "",
1282
+ };
1283
+ },
1284
+
1285
+ toJSON(message: DVVTriplet): unknown {
1286
+ const obj: any = {};
1287
+ if (message.delegatorAddress !== "") {
1288
+ obj.delegatorAddress = message.delegatorAddress;
1289
+ }
1290
+ if (message.validatorSrcAddress !== "") {
1291
+ obj.validatorSrcAddress = message.validatorSrcAddress;
1292
+ }
1293
+ if (message.validatorDstAddress !== "") {
1294
+ obj.validatorDstAddress = message.validatorDstAddress;
1295
+ }
1296
+ return obj;
1297
+ },
1298
+
1299
+ create<I extends Exact<DeepPartial<DVVTriplet>, I>>(base?: I): DVVTriplet {
1300
+ return DVVTriplet.fromPartial(base ?? ({} as any));
1301
+ },
1302
+ fromPartial<I extends Exact<DeepPartial<DVVTriplet>, I>>(object: I): DVVTriplet {
1303
+ const message = createBaseDVVTriplet();
1304
+ message.delegatorAddress = object.delegatorAddress ?? "";
1305
+ message.validatorSrcAddress = object.validatorSrcAddress ?? "";
1306
+ message.validatorDstAddress = object.validatorDstAddress ?? "";
1307
+ return message;
1308
+ },
1309
+ };
1310
+
1311
+ function createBaseDVVTriplets(): DVVTriplets {
1312
+ return { triplets: [] };
1313
+ }
1314
+
1315
+ export const DVVTriplets = {
1316
+ encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1317
+ for (const v of message.triplets) {
1318
+ DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim();
1319
+ }
1320
+ return writer;
1321
+ },
1322
+
1323
+ decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets {
1324
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1325
+ let end = length === undefined ? reader.len : reader.pos + length;
1326
+ const message = createBaseDVVTriplets();
1327
+ while (reader.pos < end) {
1328
+ const tag = reader.uint32();
1329
+ switch (tag >>> 3) {
1330
+ case 1:
1331
+ if (tag !== 10) {
1332
+ break;
1333
+ }
1334
+
1335
+ message.triplets.push(DVVTriplet.decode(reader, reader.uint32()));
1336
+ continue;
1337
+ }
1338
+ if ((tag & 7) === 4 || tag === 0) {
1339
+ break;
1340
+ }
1341
+ reader.skipType(tag & 7);
1342
+ }
1343
+ return message;
1344
+ },
1345
+
1346
+ fromJSON(object: any): DVVTriplets {
1347
+ return {
1348
+ triplets: globalThis.Array.isArray(object?.triplets)
1349
+ ? object.triplets.map((e: any) => DVVTriplet.fromJSON(e))
1350
+ : [],
1351
+ };
1352
+ },
1353
+
1354
+ toJSON(message: DVVTriplets): unknown {
1355
+ const obj: any = {};
1356
+ if (message.triplets?.length) {
1357
+ obj.triplets = message.triplets.map((e) => DVVTriplet.toJSON(e));
1358
+ }
1359
+ return obj;
1360
+ },
1361
+
1362
+ create<I extends Exact<DeepPartial<DVVTriplets>, I>>(base?: I): DVVTriplets {
1363
+ return DVVTriplets.fromPartial(base ?? ({} as any));
1364
+ },
1365
+ fromPartial<I extends Exact<DeepPartial<DVVTriplets>, I>>(object: I): DVVTriplets {
1366
+ const message = createBaseDVVTriplets();
1367
+ message.triplets = object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || [];
1368
+ return message;
1369
+ },
1370
+ };
1371
+
1372
+ function createBaseDelegation(): Delegation {
1373
+ return { delegatorAddress: "", validatorAddress: "", shares: "" };
1374
+ }
1375
+
1376
+ export const Delegation = {
1377
+ encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1378
+ if (message.delegatorAddress !== "") {
1379
+ writer.uint32(10).string(message.delegatorAddress);
1380
+ }
1381
+ if (message.validatorAddress !== "") {
1382
+ writer.uint32(18).string(message.validatorAddress);
1383
+ }
1384
+ if (message.shares !== "") {
1385
+ writer.uint32(26).string(message.shares);
1386
+ }
1387
+ return writer;
1388
+ },
1389
+
1390
+ decode(input: _m0.Reader | Uint8Array, length?: number): Delegation {
1391
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1392
+ let end = length === undefined ? reader.len : reader.pos + length;
1393
+ const message = createBaseDelegation();
1394
+ while (reader.pos < end) {
1395
+ const tag = reader.uint32();
1396
+ switch (tag >>> 3) {
1397
+ case 1:
1398
+ if (tag !== 10) {
1399
+ break;
1400
+ }
1401
+
1402
+ message.delegatorAddress = reader.string();
1403
+ continue;
1404
+ case 2:
1405
+ if (tag !== 18) {
1406
+ break;
1407
+ }
1408
+
1409
+ message.validatorAddress = reader.string();
1410
+ continue;
1411
+ case 3:
1412
+ if (tag !== 26) {
1413
+ break;
1414
+ }
1415
+
1416
+ message.shares = reader.string();
1417
+ continue;
1418
+ }
1419
+ if ((tag & 7) === 4 || tag === 0) {
1420
+ break;
1421
+ }
1422
+ reader.skipType(tag & 7);
1423
+ }
1424
+ return message;
1425
+ },
1426
+
1427
+ fromJSON(object: any): Delegation {
1428
+ return {
1429
+ delegatorAddress: isSet(object.delegatorAddress) ? globalThis.String(object.delegatorAddress) : "",
1430
+ validatorAddress: isSet(object.validatorAddress) ? globalThis.String(object.validatorAddress) : "",
1431
+ shares: isSet(object.shares) ? globalThis.String(object.shares) : "",
1432
+ };
1433
+ },
1434
+
1435
+ toJSON(message: Delegation): unknown {
1436
+ const obj: any = {};
1437
+ if (message.delegatorAddress !== "") {
1438
+ obj.delegatorAddress = message.delegatorAddress;
1439
+ }
1440
+ if (message.validatorAddress !== "") {
1441
+ obj.validatorAddress = message.validatorAddress;
1442
+ }
1443
+ if (message.shares !== "") {
1444
+ obj.shares = message.shares;
1445
+ }
1446
+ return obj;
1447
+ },
1448
+
1449
+ create<I extends Exact<DeepPartial<Delegation>, I>>(base?: I): Delegation {
1450
+ return Delegation.fromPartial(base ?? ({} as any));
1451
+ },
1452
+ fromPartial<I extends Exact<DeepPartial<Delegation>, I>>(object: I): Delegation {
1453
+ const message = createBaseDelegation();
1454
+ message.delegatorAddress = object.delegatorAddress ?? "";
1455
+ message.validatorAddress = object.validatorAddress ?? "";
1456
+ message.shares = object.shares ?? "";
1457
+ return message;
1458
+ },
1459
+ };
1460
+
1461
+ function createBaseUnbondingDelegation(): UnbondingDelegation {
1462
+ return { delegatorAddress: "", validatorAddress: "", entries: [] };
1463
+ }
1464
+
1465
+ export const UnbondingDelegation = {
1466
+ encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1467
+ if (message.delegatorAddress !== "") {
1468
+ writer.uint32(10).string(message.delegatorAddress);
1469
+ }
1470
+ if (message.validatorAddress !== "") {
1471
+ writer.uint32(18).string(message.validatorAddress);
1472
+ }
1473
+ for (const v of message.entries) {
1474
+ UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim();
1475
+ }
1476
+ return writer;
1477
+ },
1478
+
1479
+ decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation {
1480
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1481
+ let end = length === undefined ? reader.len : reader.pos + length;
1482
+ const message = createBaseUnbondingDelegation();
1483
+ while (reader.pos < end) {
1484
+ const tag = reader.uint32();
1485
+ switch (tag >>> 3) {
1486
+ case 1:
1487
+ if (tag !== 10) {
1488
+ break;
1489
+ }
1490
+
1491
+ message.delegatorAddress = reader.string();
1492
+ continue;
1493
+ case 2:
1494
+ if (tag !== 18) {
1495
+ break;
1496
+ }
1497
+
1498
+ message.validatorAddress = reader.string();
1499
+ continue;
1500
+ case 3:
1501
+ if (tag !== 26) {
1502
+ break;
1503
+ }
1504
+
1505
+ message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32()));
1506
+ continue;
1507
+ }
1508
+ if ((tag & 7) === 4 || tag === 0) {
1509
+ break;
1510
+ }
1511
+ reader.skipType(tag & 7);
1512
+ }
1513
+ return message;
1514
+ },
1515
+
1516
+ fromJSON(object: any): UnbondingDelegation {
1517
+ return {
1518
+ delegatorAddress: isSet(object.delegatorAddress) ? globalThis.String(object.delegatorAddress) : "",
1519
+ validatorAddress: isSet(object.validatorAddress) ? globalThis.String(object.validatorAddress) : "",
1520
+ entries: globalThis.Array.isArray(object?.entries)
1521
+ ? object.entries.map((e: any) => UnbondingDelegationEntry.fromJSON(e))
1522
+ : [],
1523
+ };
1524
+ },
1525
+
1526
+ toJSON(message: UnbondingDelegation): unknown {
1527
+ const obj: any = {};
1528
+ if (message.delegatorAddress !== "") {
1529
+ obj.delegatorAddress = message.delegatorAddress;
1530
+ }
1531
+ if (message.validatorAddress !== "") {
1532
+ obj.validatorAddress = message.validatorAddress;
1533
+ }
1534
+ if (message.entries?.length) {
1535
+ obj.entries = message.entries.map((e) => UnbondingDelegationEntry.toJSON(e));
1536
+ }
1537
+ return obj;
1538
+ },
1539
+
1540
+ create<I extends Exact<DeepPartial<UnbondingDelegation>, I>>(base?: I): UnbondingDelegation {
1541
+ return UnbondingDelegation.fromPartial(base ?? ({} as any));
1542
+ },
1543
+ fromPartial<I extends Exact<DeepPartial<UnbondingDelegation>, I>>(object: I): UnbondingDelegation {
1544
+ const message = createBaseUnbondingDelegation();
1545
+ message.delegatorAddress = object.delegatorAddress ?? "";
1546
+ message.validatorAddress = object.validatorAddress ?? "";
1547
+ message.entries = object.entries?.map((e) => UnbondingDelegationEntry.fromPartial(e)) || [];
1548
+ return message;
1549
+ },
1550
+ };
1551
+
1552
+ function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry {
1553
+ return {
1554
+ creationHeight: Long.ZERO,
1555
+ completionTime: undefined,
1556
+ initialBalance: "",
1557
+ balance: "",
1558
+ unbondingId: Long.UZERO,
1559
+ unbondingOnHoldRefCount: Long.ZERO,
1560
+ };
1561
+ }
1562
+
1563
+ export const UnbondingDelegationEntry = {
1564
+ encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1565
+ if (!message.creationHeight.equals(Long.ZERO)) {
1566
+ writer.uint32(8).int64(message.creationHeight);
1567
+ }
1568
+ if (message.completionTime !== undefined) {
1569
+ Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();
1570
+ }
1571
+ if (message.initialBalance !== "") {
1572
+ writer.uint32(26).string(message.initialBalance);
1573
+ }
1574
+ if (message.balance !== "") {
1575
+ writer.uint32(34).string(message.balance);
1576
+ }
1577
+ if (!message.unbondingId.equals(Long.UZERO)) {
1578
+ writer.uint32(40).uint64(message.unbondingId);
1579
+ }
1580
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
1581
+ writer.uint32(48).int64(message.unbondingOnHoldRefCount);
1582
+ }
1583
+ return writer;
1584
+ },
1585
+
1586
+ decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry {
1587
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1588
+ let end = length === undefined ? reader.len : reader.pos + length;
1589
+ const message = createBaseUnbondingDelegationEntry();
1590
+ while (reader.pos < end) {
1591
+ const tag = reader.uint32();
1592
+ switch (tag >>> 3) {
1593
+ case 1:
1594
+ if (tag !== 8) {
1595
+ break;
1596
+ }
1597
+
1598
+ message.creationHeight = reader.int64() as Long;
1599
+ continue;
1600
+ case 2:
1601
+ if (tag !== 18) {
1602
+ break;
1603
+ }
1604
+
1605
+ message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1606
+ continue;
1607
+ case 3:
1608
+ if (tag !== 26) {
1609
+ break;
1610
+ }
1611
+
1612
+ message.initialBalance = reader.string();
1613
+ continue;
1614
+ case 4:
1615
+ if (tag !== 34) {
1616
+ break;
1617
+ }
1618
+
1619
+ message.balance = reader.string();
1620
+ continue;
1621
+ case 5:
1622
+ if (tag !== 40) {
1623
+ break;
1624
+ }
1625
+
1626
+ message.unbondingId = reader.uint64() as Long;
1627
+ continue;
1628
+ case 6:
1629
+ if (tag !== 48) {
1630
+ break;
1631
+ }
1632
+
1633
+ message.unbondingOnHoldRefCount = reader.int64() as Long;
1634
+ continue;
1635
+ }
1636
+ if ((tag & 7) === 4 || tag === 0) {
1637
+ break;
1638
+ }
1639
+ reader.skipType(tag & 7);
1640
+ }
1641
+ return message;
1642
+ },
1643
+
1644
+ fromJSON(object: any): UnbondingDelegationEntry {
1645
+ return {
1646
+ creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO,
1647
+ completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined,
1648
+ initialBalance: isSet(object.initialBalance) ? globalThis.String(object.initialBalance) : "",
1649
+ balance: isSet(object.balance) ? globalThis.String(object.balance) : "",
1650
+ unbondingId: isSet(object.unbondingId) ? Long.fromValue(object.unbondingId) : Long.UZERO,
1651
+ unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount)
1652
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
1653
+ : Long.ZERO,
1654
+ };
1655
+ },
1656
+
1657
+ toJSON(message: UnbondingDelegationEntry): unknown {
1658
+ const obj: any = {};
1659
+ if (!message.creationHeight.equals(Long.ZERO)) {
1660
+ obj.creationHeight = (message.creationHeight || Long.ZERO).toString();
1661
+ }
1662
+ if (message.completionTime !== undefined) {
1663
+ obj.completionTime = message.completionTime.toISOString();
1664
+ }
1665
+ if (message.initialBalance !== "") {
1666
+ obj.initialBalance = message.initialBalance;
1667
+ }
1668
+ if (message.balance !== "") {
1669
+ obj.balance = message.balance;
1670
+ }
1671
+ if (!message.unbondingId.equals(Long.UZERO)) {
1672
+ obj.unbondingId = (message.unbondingId || Long.UZERO).toString();
1673
+ }
1674
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
1675
+ obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString();
1676
+ }
1677
+ return obj;
1678
+ },
1679
+
1680
+ create<I extends Exact<DeepPartial<UnbondingDelegationEntry>, I>>(base?: I): UnbondingDelegationEntry {
1681
+ return UnbondingDelegationEntry.fromPartial(base ?? ({} as any));
1682
+ },
1683
+ fromPartial<I extends Exact<DeepPartial<UnbondingDelegationEntry>, I>>(object: I): UnbondingDelegationEntry {
1684
+ const message = createBaseUnbondingDelegationEntry();
1685
+ message.creationHeight = (object.creationHeight !== undefined && object.creationHeight !== null)
1686
+ ? Long.fromValue(object.creationHeight)
1687
+ : Long.ZERO;
1688
+ message.completionTime = object.completionTime ?? undefined;
1689
+ message.initialBalance = object.initialBalance ?? "";
1690
+ message.balance = object.balance ?? "";
1691
+ message.unbondingId = (object.unbondingId !== undefined && object.unbondingId !== null)
1692
+ ? Long.fromValue(object.unbondingId)
1693
+ : Long.UZERO;
1694
+ message.unbondingOnHoldRefCount =
1695
+ (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null)
1696
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
1697
+ : Long.ZERO;
1698
+ return message;
1699
+ },
1700
+ };
1701
+
1702
+ function createBaseRedelegationEntry(): RedelegationEntry {
1703
+ return {
1704
+ creationHeight: Long.ZERO,
1705
+ completionTime: undefined,
1706
+ initialBalance: "",
1707
+ sharesDst: "",
1708
+ unbondingId: Long.UZERO,
1709
+ unbondingOnHoldRefCount: Long.ZERO,
1710
+ };
1711
+ }
1712
+
1713
+ export const RedelegationEntry = {
1714
+ encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1715
+ if (!message.creationHeight.equals(Long.ZERO)) {
1716
+ writer.uint32(8).int64(message.creationHeight);
1717
+ }
1718
+ if (message.completionTime !== undefined) {
1719
+ Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();
1720
+ }
1721
+ if (message.initialBalance !== "") {
1722
+ writer.uint32(26).string(message.initialBalance);
1723
+ }
1724
+ if (message.sharesDst !== "") {
1725
+ writer.uint32(34).string(message.sharesDst);
1726
+ }
1727
+ if (!message.unbondingId.equals(Long.UZERO)) {
1728
+ writer.uint32(40).uint64(message.unbondingId);
1729
+ }
1730
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
1731
+ writer.uint32(48).int64(message.unbondingOnHoldRefCount);
1732
+ }
1733
+ return writer;
1734
+ },
1735
+
1736
+ decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry {
1737
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1738
+ let end = length === undefined ? reader.len : reader.pos + length;
1739
+ const message = createBaseRedelegationEntry();
1740
+ while (reader.pos < end) {
1741
+ const tag = reader.uint32();
1742
+ switch (tag >>> 3) {
1743
+ case 1:
1744
+ if (tag !== 8) {
1745
+ break;
1746
+ }
1747
+
1748
+ message.creationHeight = reader.int64() as Long;
1749
+ continue;
1750
+ case 2:
1751
+ if (tag !== 18) {
1752
+ break;
1753
+ }
1754
+
1755
+ message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1756
+ continue;
1757
+ case 3:
1758
+ if (tag !== 26) {
1759
+ break;
1760
+ }
1761
+
1762
+ message.initialBalance = reader.string();
1763
+ continue;
1764
+ case 4:
1765
+ if (tag !== 34) {
1766
+ break;
1767
+ }
1768
+
1769
+ message.sharesDst = reader.string();
1770
+ continue;
1771
+ case 5:
1772
+ if (tag !== 40) {
1773
+ break;
1774
+ }
1775
+
1776
+ message.unbondingId = reader.uint64() as Long;
1777
+ continue;
1778
+ case 6:
1779
+ if (tag !== 48) {
1780
+ break;
1781
+ }
1782
+
1783
+ message.unbondingOnHoldRefCount = reader.int64() as Long;
1784
+ continue;
1785
+ }
1786
+ if ((tag & 7) === 4 || tag === 0) {
1787
+ break;
1788
+ }
1789
+ reader.skipType(tag & 7);
1790
+ }
1791
+ return message;
1792
+ },
1793
+
1794
+ fromJSON(object: any): RedelegationEntry {
1795
+ return {
1796
+ creationHeight: isSet(object.creationHeight) ? Long.fromValue(object.creationHeight) : Long.ZERO,
1797
+ completionTime: isSet(object.completionTime) ? fromJsonTimestamp(object.completionTime) : undefined,
1798
+ initialBalance: isSet(object.initialBalance) ? globalThis.String(object.initialBalance) : "",
1799
+ sharesDst: isSet(object.sharesDst) ? globalThis.String(object.sharesDst) : "",
1800
+ unbondingId: isSet(object.unbondingId) ? Long.fromValue(object.unbondingId) : Long.UZERO,
1801
+ unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount)
1802
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
1803
+ : Long.ZERO,
1804
+ };
1805
+ },
1806
+
1807
+ toJSON(message: RedelegationEntry): unknown {
1808
+ const obj: any = {};
1809
+ if (!message.creationHeight.equals(Long.ZERO)) {
1810
+ obj.creationHeight = (message.creationHeight || Long.ZERO).toString();
1811
+ }
1812
+ if (message.completionTime !== undefined) {
1813
+ obj.completionTime = message.completionTime.toISOString();
1814
+ }
1815
+ if (message.initialBalance !== "") {
1816
+ obj.initialBalance = message.initialBalance;
1817
+ }
1818
+ if (message.sharesDst !== "") {
1819
+ obj.sharesDst = message.sharesDst;
1820
+ }
1821
+ if (!message.unbondingId.equals(Long.UZERO)) {
1822
+ obj.unbondingId = (message.unbondingId || Long.UZERO).toString();
1823
+ }
1824
+ if (!message.unbondingOnHoldRefCount.equals(Long.ZERO)) {
1825
+ obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString();
1826
+ }
1827
+ return obj;
1828
+ },
1829
+
1830
+ create<I extends Exact<DeepPartial<RedelegationEntry>, I>>(base?: I): RedelegationEntry {
1831
+ return RedelegationEntry.fromPartial(base ?? ({} as any));
1832
+ },
1833
+ fromPartial<I extends Exact<DeepPartial<RedelegationEntry>, I>>(object: I): RedelegationEntry {
1834
+ const message = createBaseRedelegationEntry();
1835
+ message.creationHeight = (object.creationHeight !== undefined && object.creationHeight !== null)
1836
+ ? Long.fromValue(object.creationHeight)
1837
+ : Long.ZERO;
1838
+ message.completionTime = object.completionTime ?? undefined;
1839
+ message.initialBalance = object.initialBalance ?? "";
1840
+ message.sharesDst = object.sharesDst ?? "";
1841
+ message.unbondingId = (object.unbondingId !== undefined && object.unbondingId !== null)
1842
+ ? Long.fromValue(object.unbondingId)
1843
+ : Long.UZERO;
1844
+ message.unbondingOnHoldRefCount =
1845
+ (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null)
1846
+ ? Long.fromValue(object.unbondingOnHoldRefCount)
1847
+ : Long.ZERO;
1848
+ return message;
1849
+ },
1850
+ };
1851
+
1852
+ function createBaseRedelegation(): Redelegation {
1853
+ return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", entries: [] };
1854
+ }
1855
+
1856
+ export const Redelegation = {
1857
+ encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1858
+ if (message.delegatorAddress !== "") {
1859
+ writer.uint32(10).string(message.delegatorAddress);
1860
+ }
1861
+ if (message.validatorSrcAddress !== "") {
1862
+ writer.uint32(18).string(message.validatorSrcAddress);
1863
+ }
1864
+ if (message.validatorDstAddress !== "") {
1865
+ writer.uint32(26).string(message.validatorDstAddress);
1866
+ }
1867
+ for (const v of message.entries) {
1868
+ RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim();
1869
+ }
1870
+ return writer;
1871
+ },
1872
+
1873
+ decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation {
1874
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1875
+ let end = length === undefined ? reader.len : reader.pos + length;
1876
+ const message = createBaseRedelegation();
1877
+ while (reader.pos < end) {
1878
+ const tag = reader.uint32();
1879
+ switch (tag >>> 3) {
1880
+ case 1:
1881
+ if (tag !== 10) {
1882
+ break;
1883
+ }
1884
+
1885
+ message.delegatorAddress = reader.string();
1886
+ continue;
1887
+ case 2:
1888
+ if (tag !== 18) {
1889
+ break;
1890
+ }
1891
+
1892
+ message.validatorSrcAddress = reader.string();
1893
+ continue;
1894
+ case 3:
1895
+ if (tag !== 26) {
1896
+ break;
1897
+ }
1898
+
1899
+ message.validatorDstAddress = reader.string();
1900
+ continue;
1901
+ case 4:
1902
+ if (tag !== 34) {
1903
+ break;
1904
+ }
1905
+
1906
+ message.entries.push(RedelegationEntry.decode(reader, reader.uint32()));
1907
+ continue;
1908
+ }
1909
+ if ((tag & 7) === 4 || tag === 0) {
1910
+ break;
1911
+ }
1912
+ reader.skipType(tag & 7);
1913
+ }
1914
+ return message;
1915
+ },
1916
+
1917
+ fromJSON(object: any): Redelegation {
1918
+ return {
1919
+ delegatorAddress: isSet(object.delegatorAddress) ? globalThis.String(object.delegatorAddress) : "",
1920
+ validatorSrcAddress: isSet(object.validatorSrcAddress) ? globalThis.String(object.validatorSrcAddress) : "",
1921
+ validatorDstAddress: isSet(object.validatorDstAddress) ? globalThis.String(object.validatorDstAddress) : "",
1922
+ entries: globalThis.Array.isArray(object?.entries)
1923
+ ? object.entries.map((e: any) => RedelegationEntry.fromJSON(e))
1924
+ : [],
1925
+ };
1926
+ },
1927
+
1928
+ toJSON(message: Redelegation): unknown {
1929
+ const obj: any = {};
1930
+ if (message.delegatorAddress !== "") {
1931
+ obj.delegatorAddress = message.delegatorAddress;
1932
+ }
1933
+ if (message.validatorSrcAddress !== "") {
1934
+ obj.validatorSrcAddress = message.validatorSrcAddress;
1935
+ }
1936
+ if (message.validatorDstAddress !== "") {
1937
+ obj.validatorDstAddress = message.validatorDstAddress;
1938
+ }
1939
+ if (message.entries?.length) {
1940
+ obj.entries = message.entries.map((e) => RedelegationEntry.toJSON(e));
1941
+ }
1942
+ return obj;
1943
+ },
1944
+
1945
+ create<I extends Exact<DeepPartial<Redelegation>, I>>(base?: I): Redelegation {
1946
+ return Redelegation.fromPartial(base ?? ({} as any));
1947
+ },
1948
+ fromPartial<I extends Exact<DeepPartial<Redelegation>, I>>(object: I): Redelegation {
1949
+ const message = createBaseRedelegation();
1950
+ message.delegatorAddress = object.delegatorAddress ?? "";
1951
+ message.validatorSrcAddress = object.validatorSrcAddress ?? "";
1952
+ message.validatorDstAddress = object.validatorDstAddress ?? "";
1953
+ message.entries = object.entries?.map((e) => RedelegationEntry.fromPartial(e)) || [];
1954
+ return message;
1955
+ },
1956
+ };
1957
+
1958
+ function createBaseParams(): Params {
1959
+ return {
1960
+ unbondingTime: undefined,
1961
+ maxValidators: 0,
1962
+ maxEntries: 0,
1963
+ historicalEntries: 0,
1964
+ bondDenom: "",
1965
+ minCommissionRate: "",
1966
+ };
1967
+ }
1968
+
1969
+ export const Params = {
1970
+ encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1971
+ if (message.unbondingTime !== undefined) {
1972
+ Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim();
1973
+ }
1974
+ if (message.maxValidators !== 0) {
1975
+ writer.uint32(16).uint32(message.maxValidators);
1976
+ }
1977
+ if (message.maxEntries !== 0) {
1978
+ writer.uint32(24).uint32(message.maxEntries);
1979
+ }
1980
+ if (message.historicalEntries !== 0) {
1981
+ writer.uint32(32).uint32(message.historicalEntries);
1982
+ }
1983
+ if (message.bondDenom !== "") {
1984
+ writer.uint32(42).string(message.bondDenom);
1985
+ }
1986
+ if (message.minCommissionRate !== "") {
1987
+ writer.uint32(50).string(message.minCommissionRate);
1988
+ }
1989
+ return writer;
1990
+ },
1991
+
1992
+ decode(input: _m0.Reader | Uint8Array, length?: number): Params {
1993
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1994
+ let end = length === undefined ? reader.len : reader.pos + length;
1995
+ const message = createBaseParams();
1996
+ while (reader.pos < end) {
1997
+ const tag = reader.uint32();
1998
+ switch (tag >>> 3) {
1999
+ case 1:
2000
+ if (tag !== 10) {
2001
+ break;
2002
+ }
2003
+
2004
+ message.unbondingTime = Duration.decode(reader, reader.uint32());
2005
+ continue;
2006
+ case 2:
2007
+ if (tag !== 16) {
2008
+ break;
2009
+ }
2010
+
2011
+ message.maxValidators = reader.uint32();
2012
+ continue;
2013
+ case 3:
2014
+ if (tag !== 24) {
2015
+ break;
2016
+ }
2017
+
2018
+ message.maxEntries = reader.uint32();
2019
+ continue;
2020
+ case 4:
2021
+ if (tag !== 32) {
2022
+ break;
2023
+ }
2024
+
2025
+ message.historicalEntries = reader.uint32();
2026
+ continue;
2027
+ case 5:
2028
+ if (tag !== 42) {
2029
+ break;
2030
+ }
2031
+
2032
+ message.bondDenom = reader.string();
2033
+ continue;
2034
+ case 6:
2035
+ if (tag !== 50) {
2036
+ break;
2037
+ }
2038
+
2039
+ message.minCommissionRate = reader.string();
2040
+ continue;
2041
+ }
2042
+ if ((tag & 7) === 4 || tag === 0) {
2043
+ break;
2044
+ }
2045
+ reader.skipType(tag & 7);
2046
+ }
2047
+ return message;
2048
+ },
2049
+
2050
+ fromJSON(object: any): Params {
2051
+ return {
2052
+ unbondingTime: isSet(object.unbondingTime) ? Duration.fromJSON(object.unbondingTime) : undefined,
2053
+ maxValidators: isSet(object.maxValidators) ? globalThis.Number(object.maxValidators) : 0,
2054
+ maxEntries: isSet(object.maxEntries) ? globalThis.Number(object.maxEntries) : 0,
2055
+ historicalEntries: isSet(object.historicalEntries) ? globalThis.Number(object.historicalEntries) : 0,
2056
+ bondDenom: isSet(object.bondDenom) ? globalThis.String(object.bondDenom) : "",
2057
+ minCommissionRate: isSet(object.minCommissionRate) ? globalThis.String(object.minCommissionRate) : "",
2058
+ };
2059
+ },
2060
+
2061
+ toJSON(message: Params): unknown {
2062
+ const obj: any = {};
2063
+ if (message.unbondingTime !== undefined) {
2064
+ obj.unbondingTime = Duration.toJSON(message.unbondingTime);
2065
+ }
2066
+ if (message.maxValidators !== 0) {
2067
+ obj.maxValidators = Math.round(message.maxValidators);
2068
+ }
2069
+ if (message.maxEntries !== 0) {
2070
+ obj.maxEntries = Math.round(message.maxEntries);
2071
+ }
2072
+ if (message.historicalEntries !== 0) {
2073
+ obj.historicalEntries = Math.round(message.historicalEntries);
2074
+ }
2075
+ if (message.bondDenom !== "") {
2076
+ obj.bondDenom = message.bondDenom;
2077
+ }
2078
+ if (message.minCommissionRate !== "") {
2079
+ obj.minCommissionRate = message.minCommissionRate;
2080
+ }
2081
+ return obj;
2082
+ },
2083
+
2084
+ create<I extends Exact<DeepPartial<Params>, I>>(base?: I): Params {
2085
+ return Params.fromPartial(base ?? ({} as any));
2086
+ },
2087
+ fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
2088
+ const message = createBaseParams();
2089
+ message.unbondingTime = (object.unbondingTime !== undefined && object.unbondingTime !== null)
2090
+ ? Duration.fromPartial(object.unbondingTime)
2091
+ : undefined;
2092
+ message.maxValidators = object.maxValidators ?? 0;
2093
+ message.maxEntries = object.maxEntries ?? 0;
2094
+ message.historicalEntries = object.historicalEntries ?? 0;
2095
+ message.bondDenom = object.bondDenom ?? "";
2096
+ message.minCommissionRate = object.minCommissionRate ?? "";
2097
+ return message;
2098
+ },
2099
+ };
2100
+
2101
+ function createBaseDelegationResponse(): DelegationResponse {
2102
+ return { delegation: undefined, balance: undefined };
2103
+ }
2104
+
2105
+ export const DelegationResponse = {
2106
+ encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2107
+ if (message.delegation !== undefined) {
2108
+ Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim();
2109
+ }
2110
+ if (message.balance !== undefined) {
2111
+ Coin.encode(message.balance, writer.uint32(18).fork()).ldelim();
2112
+ }
2113
+ return writer;
2114
+ },
2115
+
2116
+ decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse {
2117
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2118
+ let end = length === undefined ? reader.len : reader.pos + length;
2119
+ const message = createBaseDelegationResponse();
2120
+ while (reader.pos < end) {
2121
+ const tag = reader.uint32();
2122
+ switch (tag >>> 3) {
2123
+ case 1:
2124
+ if (tag !== 10) {
2125
+ break;
2126
+ }
2127
+
2128
+ message.delegation = Delegation.decode(reader, reader.uint32());
2129
+ continue;
2130
+ case 2:
2131
+ if (tag !== 18) {
2132
+ break;
2133
+ }
2134
+
2135
+ message.balance = Coin.decode(reader, reader.uint32());
2136
+ continue;
2137
+ }
2138
+ if ((tag & 7) === 4 || tag === 0) {
2139
+ break;
2140
+ }
2141
+ reader.skipType(tag & 7);
2142
+ }
2143
+ return message;
2144
+ },
2145
+
2146
+ fromJSON(object: any): DelegationResponse {
2147
+ return {
2148
+ delegation: isSet(object.delegation) ? Delegation.fromJSON(object.delegation) : undefined,
2149
+ balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined,
2150
+ };
2151
+ },
2152
+
2153
+ toJSON(message: DelegationResponse): unknown {
2154
+ const obj: any = {};
2155
+ if (message.delegation !== undefined) {
2156
+ obj.delegation = Delegation.toJSON(message.delegation);
2157
+ }
2158
+ if (message.balance !== undefined) {
2159
+ obj.balance = Coin.toJSON(message.balance);
2160
+ }
2161
+ return obj;
2162
+ },
2163
+
2164
+ create<I extends Exact<DeepPartial<DelegationResponse>, I>>(base?: I): DelegationResponse {
2165
+ return DelegationResponse.fromPartial(base ?? ({} as any));
2166
+ },
2167
+ fromPartial<I extends Exact<DeepPartial<DelegationResponse>, I>>(object: I): DelegationResponse {
2168
+ const message = createBaseDelegationResponse();
2169
+ message.delegation = (object.delegation !== undefined && object.delegation !== null)
2170
+ ? Delegation.fromPartial(object.delegation)
2171
+ : undefined;
2172
+ message.balance = (object.balance !== undefined && object.balance !== null)
2173
+ ? Coin.fromPartial(object.balance)
2174
+ : undefined;
2175
+ return message;
2176
+ },
2177
+ };
2178
+
2179
+ function createBaseRedelegationEntryResponse(): RedelegationEntryResponse {
2180
+ return { redelegationEntry: undefined, balance: "" };
2181
+ }
2182
+
2183
+ export const RedelegationEntryResponse = {
2184
+ encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2185
+ if (message.redelegationEntry !== undefined) {
2186
+ RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim();
2187
+ }
2188
+ if (message.balance !== "") {
2189
+ writer.uint32(34).string(message.balance);
2190
+ }
2191
+ return writer;
2192
+ },
2193
+
2194
+ decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse {
2195
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2196
+ let end = length === undefined ? reader.len : reader.pos + length;
2197
+ const message = createBaseRedelegationEntryResponse();
2198
+ while (reader.pos < end) {
2199
+ const tag = reader.uint32();
2200
+ switch (tag >>> 3) {
2201
+ case 1:
2202
+ if (tag !== 10) {
2203
+ break;
2204
+ }
2205
+
2206
+ message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32());
2207
+ continue;
2208
+ case 4:
2209
+ if (tag !== 34) {
2210
+ break;
2211
+ }
2212
+
2213
+ message.balance = reader.string();
2214
+ continue;
2215
+ }
2216
+ if ((tag & 7) === 4 || tag === 0) {
2217
+ break;
2218
+ }
2219
+ reader.skipType(tag & 7);
2220
+ }
2221
+ return message;
2222
+ },
2223
+
2224
+ fromJSON(object: any): RedelegationEntryResponse {
2225
+ return {
2226
+ redelegationEntry: isSet(object.redelegationEntry)
2227
+ ? RedelegationEntry.fromJSON(object.redelegationEntry)
2228
+ : undefined,
2229
+ balance: isSet(object.balance) ? globalThis.String(object.balance) : "",
2230
+ };
2231
+ },
2232
+
2233
+ toJSON(message: RedelegationEntryResponse): unknown {
2234
+ const obj: any = {};
2235
+ if (message.redelegationEntry !== undefined) {
2236
+ obj.redelegationEntry = RedelegationEntry.toJSON(message.redelegationEntry);
2237
+ }
2238
+ if (message.balance !== "") {
2239
+ obj.balance = message.balance;
2240
+ }
2241
+ return obj;
2242
+ },
2243
+
2244
+ create<I extends Exact<DeepPartial<RedelegationEntryResponse>, I>>(base?: I): RedelegationEntryResponse {
2245
+ return RedelegationEntryResponse.fromPartial(base ?? ({} as any));
2246
+ },
2247
+ fromPartial<I extends Exact<DeepPartial<RedelegationEntryResponse>, I>>(object: I): RedelegationEntryResponse {
2248
+ const message = createBaseRedelegationEntryResponse();
2249
+ message.redelegationEntry = (object.redelegationEntry !== undefined && object.redelegationEntry !== null)
2250
+ ? RedelegationEntry.fromPartial(object.redelegationEntry)
2251
+ : undefined;
2252
+ message.balance = object.balance ?? "";
2253
+ return message;
2254
+ },
2255
+ };
2256
+
2257
+ function createBaseRedelegationResponse(): RedelegationResponse {
2258
+ return { redelegation: undefined, entries: [] };
2259
+ }
2260
+
2261
+ export const RedelegationResponse = {
2262
+ encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2263
+ if (message.redelegation !== undefined) {
2264
+ Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim();
2265
+ }
2266
+ for (const v of message.entries) {
2267
+ RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim();
2268
+ }
2269
+ return writer;
2270
+ },
2271
+
2272
+ decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse {
2273
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2274
+ let end = length === undefined ? reader.len : reader.pos + length;
2275
+ const message = createBaseRedelegationResponse();
2276
+ while (reader.pos < end) {
2277
+ const tag = reader.uint32();
2278
+ switch (tag >>> 3) {
2279
+ case 1:
2280
+ if (tag !== 10) {
2281
+ break;
2282
+ }
2283
+
2284
+ message.redelegation = Redelegation.decode(reader, reader.uint32());
2285
+ continue;
2286
+ case 2:
2287
+ if (tag !== 18) {
2288
+ break;
2289
+ }
2290
+
2291
+ message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32()));
2292
+ continue;
2293
+ }
2294
+ if ((tag & 7) === 4 || tag === 0) {
2295
+ break;
2296
+ }
2297
+ reader.skipType(tag & 7);
2298
+ }
2299
+ return message;
2300
+ },
2301
+
2302
+ fromJSON(object: any): RedelegationResponse {
2303
+ return {
2304
+ redelegation: isSet(object.redelegation) ? Redelegation.fromJSON(object.redelegation) : undefined,
2305
+ entries: globalThis.Array.isArray(object?.entries)
2306
+ ? object.entries.map((e: any) => RedelegationEntryResponse.fromJSON(e))
2307
+ : [],
2308
+ };
2309
+ },
2310
+
2311
+ toJSON(message: RedelegationResponse): unknown {
2312
+ const obj: any = {};
2313
+ if (message.redelegation !== undefined) {
2314
+ obj.redelegation = Redelegation.toJSON(message.redelegation);
2315
+ }
2316
+ if (message.entries?.length) {
2317
+ obj.entries = message.entries.map((e) => RedelegationEntryResponse.toJSON(e));
2318
+ }
2319
+ return obj;
2320
+ },
2321
+
2322
+ create<I extends Exact<DeepPartial<RedelegationResponse>, I>>(base?: I): RedelegationResponse {
2323
+ return RedelegationResponse.fromPartial(base ?? ({} as any));
2324
+ },
2325
+ fromPartial<I extends Exact<DeepPartial<RedelegationResponse>, I>>(object: I): RedelegationResponse {
2326
+ const message = createBaseRedelegationResponse();
2327
+ message.redelegation = (object.redelegation !== undefined && object.redelegation !== null)
2328
+ ? Redelegation.fromPartial(object.redelegation)
2329
+ : undefined;
2330
+ message.entries = object.entries?.map((e) => RedelegationEntryResponse.fromPartial(e)) || [];
2331
+ return message;
2332
+ },
2333
+ };
2334
+
2335
+ function createBasePool(): Pool {
2336
+ return { notBondedTokens: "", bondedTokens: "" };
2337
+ }
2338
+
2339
+ export const Pool = {
2340
+ encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2341
+ if (message.notBondedTokens !== "") {
2342
+ writer.uint32(10).string(message.notBondedTokens);
2343
+ }
2344
+ if (message.bondedTokens !== "") {
2345
+ writer.uint32(18).string(message.bondedTokens);
2346
+ }
2347
+ return writer;
2348
+ },
2349
+
2350
+ decode(input: _m0.Reader | Uint8Array, length?: number): Pool {
2351
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2352
+ let end = length === undefined ? reader.len : reader.pos + length;
2353
+ const message = createBasePool();
2354
+ while (reader.pos < end) {
2355
+ const tag = reader.uint32();
2356
+ switch (tag >>> 3) {
2357
+ case 1:
2358
+ if (tag !== 10) {
2359
+ break;
2360
+ }
2361
+
2362
+ message.notBondedTokens = reader.string();
2363
+ continue;
2364
+ case 2:
2365
+ if (tag !== 18) {
2366
+ break;
2367
+ }
2368
+
2369
+ message.bondedTokens = reader.string();
2370
+ continue;
2371
+ }
2372
+ if ((tag & 7) === 4 || tag === 0) {
2373
+ break;
2374
+ }
2375
+ reader.skipType(tag & 7);
2376
+ }
2377
+ return message;
2378
+ },
2379
+
2380
+ fromJSON(object: any): Pool {
2381
+ return {
2382
+ notBondedTokens: isSet(object.notBondedTokens) ? globalThis.String(object.notBondedTokens) : "",
2383
+ bondedTokens: isSet(object.bondedTokens) ? globalThis.String(object.bondedTokens) : "",
2384
+ };
2385
+ },
2386
+
2387
+ toJSON(message: Pool): unknown {
2388
+ const obj: any = {};
2389
+ if (message.notBondedTokens !== "") {
2390
+ obj.notBondedTokens = message.notBondedTokens;
2391
+ }
2392
+ if (message.bondedTokens !== "") {
2393
+ obj.bondedTokens = message.bondedTokens;
2394
+ }
2395
+ return obj;
2396
+ },
2397
+
2398
+ create<I extends Exact<DeepPartial<Pool>, I>>(base?: I): Pool {
2399
+ return Pool.fromPartial(base ?? ({} as any));
2400
+ },
2401
+ fromPartial<I extends Exact<DeepPartial<Pool>, I>>(object: I): Pool {
2402
+ const message = createBasePool();
2403
+ message.notBondedTokens = object.notBondedTokens ?? "";
2404
+ message.bondedTokens = object.bondedTokens ?? "";
2405
+ return message;
2406
+ },
2407
+ };
2408
+
2409
+ function createBaseValidatorUpdates(): ValidatorUpdates {
2410
+ return { updates: [] };
2411
+ }
2412
+
2413
+ export const ValidatorUpdates = {
2414
+ encode(message: ValidatorUpdates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2415
+ for (const v of message.updates) {
2416
+ ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim();
2417
+ }
2418
+ return writer;
2419
+ },
2420
+
2421
+ decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdates {
2422
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2423
+ let end = length === undefined ? reader.len : reader.pos + length;
2424
+ const message = createBaseValidatorUpdates();
2425
+ while (reader.pos < end) {
2426
+ const tag = reader.uint32();
2427
+ switch (tag >>> 3) {
2428
+ case 1:
2429
+ if (tag !== 10) {
2430
+ break;
2431
+ }
2432
+
2433
+ message.updates.push(ValidatorUpdate.decode(reader, reader.uint32()));
2434
+ continue;
2435
+ }
2436
+ if ((tag & 7) === 4 || tag === 0) {
2437
+ break;
2438
+ }
2439
+ reader.skipType(tag & 7);
2440
+ }
2441
+ return message;
2442
+ },
2443
+
2444
+ fromJSON(object: any): ValidatorUpdates {
2445
+ return {
2446
+ updates: globalThis.Array.isArray(object?.updates)
2447
+ ? object.updates.map((e: any) => ValidatorUpdate.fromJSON(e))
2448
+ : [],
2449
+ };
2450
+ },
2451
+
2452
+ toJSON(message: ValidatorUpdates): unknown {
2453
+ const obj: any = {};
2454
+ if (message.updates?.length) {
2455
+ obj.updates = message.updates.map((e) => ValidatorUpdate.toJSON(e));
2456
+ }
2457
+ return obj;
2458
+ },
2459
+
2460
+ create<I extends Exact<DeepPartial<ValidatorUpdates>, I>>(base?: I): ValidatorUpdates {
2461
+ return ValidatorUpdates.fromPartial(base ?? ({} as any));
2462
+ },
2463
+ fromPartial<I extends Exact<DeepPartial<ValidatorUpdates>, I>>(object: I): ValidatorUpdates {
2464
+ const message = createBaseValidatorUpdates();
2465
+ message.updates = object.updates?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
2466
+ return message;
2467
+ },
2468
+ };
2469
+
2470
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2471
+
2472
+ export type DeepPartial<T> = T extends Builtin ? T
2473
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2474
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2475
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2476
+ : Partial<T>;
2477
+
2478
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
2479
+ export type Exact<P, I extends P> = P extends Builtin ? P
2480
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
2481
+
2482
+ function toTimestamp(date: Date): Timestamp {
2483
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
2484
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2485
+ return { seconds, nanos };
2486
+ }
2487
+
2488
+ function fromTimestamp(t: Timestamp): Date {
2489
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
2490
+ millis += (t.nanos || 0) / 1_000_000;
2491
+ return new globalThis.Date(millis);
2492
+ }
2493
+
2494
+ function fromJsonTimestamp(o: any): Date {
2495
+ if (o instanceof globalThis.Date) {
2496
+ return o;
2497
+ } else if (typeof o === "string") {
2498
+ return new globalThis.Date(o);
2499
+ } else {
2500
+ return fromTimestamp(Timestamp.fromJSON(o));
2501
+ }
2502
+ }
2503
+
2504
+ function numberToLong(number: number) {
2505
+ return Long.fromNumber(number);
2506
+ }
2507
+
2508
+ if (_m0.util.Long !== Long) {
2509
+ _m0.util.Long = Long as any;
2510
+ _m0.configure();
2511
+ }
2512
+
2513
+ function isSet(value: any): boolean {
2514
+ return value !== null && value !== undefined;
2515
+ }