@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,1613 @@
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/tx/v1beta1/tx.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 { Coin } from "../../base/v1beta1/coin";
12
+ import { CompactBitArray } from "../../crypto/multisig/v1beta1/multisig";
13
+ import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing";
14
+
15
+ export const protobufPackage = "cosmos.tx.v1beta1";
16
+
17
+ /** Tx is the standard type used for broadcasting transactions. */
18
+ export interface Tx {
19
+ /** body is the processable content of the transaction */
20
+ body?:
21
+ | TxBody
22
+ | undefined;
23
+ /**
24
+ * auth_info is the authorization related content of the transaction,
25
+ * specifically signers, signer modes and fee
26
+ */
27
+ authInfo?:
28
+ | AuthInfo
29
+ | undefined;
30
+ /**
31
+ * signatures is a list of signatures that matches the length and order of
32
+ * AuthInfo's signer_infos to allow connecting signature meta information like
33
+ * public key and signing mode by position.
34
+ */
35
+ signatures: Uint8Array[];
36
+ }
37
+
38
+ /**
39
+ * TxRaw is a variant of Tx that pins the signer's exact binary representation
40
+ * of body and auth_info. This is used for signing, broadcasting and
41
+ * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
42
+ * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
43
+ * as the transaction ID.
44
+ */
45
+ export interface TxRaw {
46
+ /**
47
+ * body_bytes is a protobuf serialization of a TxBody that matches the
48
+ * representation in SignDoc.
49
+ */
50
+ bodyBytes: Uint8Array;
51
+ /**
52
+ * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
53
+ * representation in SignDoc.
54
+ */
55
+ authInfoBytes: Uint8Array;
56
+ /**
57
+ * signatures is a list of signatures that matches the length and order of
58
+ * AuthInfo's signer_infos to allow connecting signature meta information like
59
+ * public key and signing mode by position.
60
+ */
61
+ signatures: Uint8Array[];
62
+ }
63
+
64
+ /** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */
65
+ export interface SignDoc {
66
+ /**
67
+ * body_bytes is protobuf serialization of a TxBody that matches the
68
+ * representation in TxRaw.
69
+ */
70
+ bodyBytes: Uint8Array;
71
+ /**
72
+ * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
73
+ * representation in TxRaw.
74
+ */
75
+ authInfoBytes: Uint8Array;
76
+ /**
77
+ * chain_id is the unique identifier of the chain this transaction targets.
78
+ * It prevents signed transactions from being used on another chain by an
79
+ * attacker
80
+ */
81
+ chainId: string;
82
+ /** account_number is the account number of the account in state */
83
+ accountNumber: Long;
84
+ }
85
+
86
+ /**
87
+ * SignDocDirectAux is the type used for generating sign bytes for
88
+ * SIGN_MODE_DIRECT_AUX.
89
+ *
90
+ * Since: cosmos-sdk 0.46
91
+ */
92
+ export interface SignDocDirectAux {
93
+ /**
94
+ * body_bytes is protobuf serialization of a TxBody that matches the
95
+ * representation in TxRaw.
96
+ */
97
+ bodyBytes: Uint8Array;
98
+ /** public_key is the public key of the signing account. */
99
+ publicKey?:
100
+ | Any
101
+ | undefined;
102
+ /**
103
+ * chain_id is the identifier of the chain this transaction targets.
104
+ * It prevents signed transactions from being used on another chain by an
105
+ * attacker.
106
+ */
107
+ chainId: string;
108
+ /** account_number is the account number of the account in state. */
109
+ accountNumber: Long;
110
+ /** sequence is the sequence number of the signing account. */
111
+ sequence: Long;
112
+ /**
113
+ * tips have been depreacted and should not be used
114
+ *
115
+ * @deprecated
116
+ */
117
+ tip?: Tip | undefined;
118
+ }
119
+
120
+ /** TxBody is the body of a transaction that all signers sign over. */
121
+ export interface TxBody {
122
+ /**
123
+ * messages is a list of messages to be executed. The required signers of
124
+ * those messages define the number and order of elements in AuthInfo's
125
+ * signer_infos and Tx's signatures. Each required signer address is added to
126
+ * the list only the first time it occurs.
127
+ * By convention, the first required signer (usually from the first message)
128
+ * is referred to as the primary signer and pays the fee for the whole
129
+ * transaction.
130
+ */
131
+ messages: Any[];
132
+ /**
133
+ * memo is any arbitrary note/comment to be added to the transaction.
134
+ * WARNING: in clients, any publicly exposed text should not be called memo,
135
+ * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122).
136
+ */
137
+ memo: string;
138
+ /**
139
+ * timeout is the block height after which this transaction will not
140
+ * be processed by the chain
141
+ */
142
+ timeoutHeight: Long;
143
+ /**
144
+ * extension_options are arbitrary options that can be added by chains
145
+ * when the default options are not sufficient. If any of these are present
146
+ * and can't be handled, the transaction will be rejected
147
+ */
148
+ extensionOptions: Any[];
149
+ /**
150
+ * extension_options are arbitrary options that can be added by chains
151
+ * when the default options are not sufficient. If any of these are present
152
+ * and can't be handled, they will be ignored
153
+ */
154
+ nonCriticalExtensionOptions: Any[];
155
+ }
156
+
157
+ /**
158
+ * AuthInfo describes the fee and signer modes that are used to sign a
159
+ * transaction.
160
+ */
161
+ export interface AuthInfo {
162
+ /**
163
+ * signer_infos defines the signing modes for the required signers. The number
164
+ * and order of elements must match the required signers from TxBody's
165
+ * messages. The first element is the primary signer and the one which pays
166
+ * the fee.
167
+ */
168
+ signerInfos: SignerInfo[];
169
+ /**
170
+ * Fee is the fee and gas limit for the transaction. The first signer is the
171
+ * primary signer and the one which pays the fee. The fee can be calculated
172
+ * based on the cost of evaluating the body and doing signature verification
173
+ * of the signers. This can be estimated via simulation.
174
+ */
175
+ fee?:
176
+ | Fee
177
+ | undefined;
178
+ /**
179
+ * Tip is the optional tip used for transactions fees paid in another denom.
180
+ *
181
+ * This field is ignored if the chain didn't enable tips, i.e. didn't add the
182
+ * `TipDecorator` in its posthandler.
183
+ *
184
+ * Since: cosmos-sdk 0.46
185
+ *
186
+ * @deprecated
187
+ */
188
+ tip?: Tip | undefined;
189
+ }
190
+
191
+ /**
192
+ * SignerInfo describes the public key and signing mode of a single top-level
193
+ * signer.
194
+ */
195
+ export interface SignerInfo {
196
+ /**
197
+ * public_key is the public key of the signer. It is optional for accounts
198
+ * that already exist in state. If unset, the verifier can use the required \
199
+ * signer address for this position and lookup the public key.
200
+ */
201
+ publicKey?:
202
+ | Any
203
+ | undefined;
204
+ /**
205
+ * mode_info describes the signing mode of the signer and is a nested
206
+ * structure to support nested multisig pubkey's
207
+ */
208
+ modeInfo?:
209
+ | ModeInfo
210
+ | undefined;
211
+ /**
212
+ * sequence is the sequence of the account, which describes the
213
+ * number of committed transactions signed by a given address. It is used to
214
+ * prevent replay attacks.
215
+ */
216
+ sequence: Long;
217
+ }
218
+
219
+ /** ModeInfo describes the signing mode of a single or nested multisig signer. */
220
+ export interface ModeInfo {
221
+ /** single represents a single signer */
222
+ single?:
223
+ | ModeInfo_Single
224
+ | undefined;
225
+ /** multi represents a nested multisig signer */
226
+ multi?: ModeInfo_Multi | undefined;
227
+ }
228
+
229
+ /**
230
+ * Single is the mode info for a single signer. It is structured as a message
231
+ * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
232
+ * future
233
+ */
234
+ export interface ModeInfo_Single {
235
+ /** mode is the signing mode of the single signer */
236
+ mode: SignMode;
237
+ }
238
+
239
+ /** Multi is the mode info for a multisig public key */
240
+ export interface ModeInfo_Multi {
241
+ /** bitarray specifies which keys within the multisig are signing */
242
+ bitarray?:
243
+ | CompactBitArray
244
+ | undefined;
245
+ /**
246
+ * mode_infos is the corresponding modes of the signers of the multisig
247
+ * which could include nested multisig public keys
248
+ */
249
+ modeInfos: ModeInfo[];
250
+ }
251
+
252
+ /**
253
+ * Fee includes the amount of coins paid in fees and the maximum
254
+ * gas to be used by the transaction. The ratio yields an effective "gasprice",
255
+ * which must be above some miminum to be accepted into the mempool.
256
+ */
257
+ export interface Fee {
258
+ /** amount is the amount of coins to be paid as a fee */
259
+ amount: Coin[];
260
+ /**
261
+ * gas_limit is the maximum gas that can be used in transaction processing
262
+ * before an out of gas error occurs
263
+ */
264
+ gasLimit: Long;
265
+ /**
266
+ * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
267
+ * the payer must be a tx signer (and thus have signed this field in AuthInfo).
268
+ * setting this field does *not* change the ordering of required signers for the transaction.
269
+ */
270
+ payer: string;
271
+ /**
272
+ * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
273
+ * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
274
+ * not support fee grants, this will fail
275
+ */
276
+ granter: string;
277
+ }
278
+
279
+ /**
280
+ * Tip is the tip used for meta-transactions.
281
+ *
282
+ * Since: cosmos-sdk 0.46
283
+ *
284
+ * @deprecated
285
+ */
286
+ export interface Tip {
287
+ /** amount is the amount of the tip */
288
+ amount: Coin[];
289
+ /** tipper is the address of the account paying for the tip */
290
+ tipper: string;
291
+ }
292
+
293
+ /**
294
+ * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a
295
+ * tipper) builds and sends to the fee payer (who will build and broadcast the
296
+ * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected
297
+ * by the node if sent directly as-is.
298
+ *
299
+ * Since: cosmos-sdk 0.46
300
+ */
301
+ export interface AuxSignerData {
302
+ /**
303
+ * address is the bech32-encoded address of the auxiliary signer. If using
304
+ * AuxSignerData across different chains, the bech32 prefix of the target
305
+ * chain (where the final transaction is broadcasted) should be used.
306
+ */
307
+ address: string;
308
+ /**
309
+ * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer
310
+ * signs. Note: we use the same sign doc even if we're signing with
311
+ * LEGACY_AMINO_JSON.
312
+ */
313
+ signDoc?:
314
+ | SignDocDirectAux
315
+ | undefined;
316
+ /** mode is the signing mode of the single signer. */
317
+ mode: SignMode;
318
+ /** sig is the signature of the sign doc. */
319
+ sig: Uint8Array;
320
+ }
321
+
322
+ function createBaseTx(): Tx {
323
+ return { body: undefined, authInfo: undefined, signatures: [] };
324
+ }
325
+
326
+ export const Tx = {
327
+ encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
328
+ if (message.body !== undefined) {
329
+ TxBody.encode(message.body, writer.uint32(10).fork()).ldelim();
330
+ }
331
+ if (message.authInfo !== undefined) {
332
+ AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim();
333
+ }
334
+ for (const v of message.signatures) {
335
+ writer.uint32(26).bytes(v!);
336
+ }
337
+ return writer;
338
+ },
339
+
340
+ decode(input: _m0.Reader | Uint8Array, length?: number): Tx {
341
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
342
+ let end = length === undefined ? reader.len : reader.pos + length;
343
+ const message = createBaseTx();
344
+ while (reader.pos < end) {
345
+ const tag = reader.uint32();
346
+ switch (tag >>> 3) {
347
+ case 1:
348
+ if (tag !== 10) {
349
+ break;
350
+ }
351
+
352
+ message.body = TxBody.decode(reader, reader.uint32());
353
+ continue;
354
+ case 2:
355
+ if (tag !== 18) {
356
+ break;
357
+ }
358
+
359
+ message.authInfo = AuthInfo.decode(reader, reader.uint32());
360
+ continue;
361
+ case 3:
362
+ if (tag !== 26) {
363
+ break;
364
+ }
365
+
366
+ message.signatures.push(reader.bytes());
367
+ continue;
368
+ }
369
+ if ((tag & 7) === 4 || tag === 0) {
370
+ break;
371
+ }
372
+ reader.skipType(tag & 7);
373
+ }
374
+ return message;
375
+ },
376
+
377
+ fromJSON(object: any): Tx {
378
+ return {
379
+ body: isSet(object.body) ? TxBody.fromJSON(object.body) : undefined,
380
+ authInfo: isSet(object.authInfo) ? AuthInfo.fromJSON(object.authInfo) : undefined,
381
+ signatures: globalThis.Array.isArray(object?.signatures)
382
+ ? object.signatures.map((e: any) => bytesFromBase64(e))
383
+ : [],
384
+ };
385
+ },
386
+
387
+ toJSON(message: Tx): unknown {
388
+ const obj: any = {};
389
+ if (message.body !== undefined) {
390
+ obj.body = TxBody.toJSON(message.body);
391
+ }
392
+ if (message.authInfo !== undefined) {
393
+ obj.authInfo = AuthInfo.toJSON(message.authInfo);
394
+ }
395
+ if (message.signatures?.length) {
396
+ obj.signatures = message.signatures.map((e) => base64FromBytes(e));
397
+ }
398
+ return obj;
399
+ },
400
+
401
+ create<I extends Exact<DeepPartial<Tx>, I>>(base?: I): Tx {
402
+ return Tx.fromPartial(base ?? ({} as any));
403
+ },
404
+ fromPartial<I extends Exact<DeepPartial<Tx>, I>>(object: I): Tx {
405
+ const message = createBaseTx();
406
+ message.body = (object.body !== undefined && object.body !== null) ? TxBody.fromPartial(object.body) : undefined;
407
+ message.authInfo = (object.authInfo !== undefined && object.authInfo !== null)
408
+ ? AuthInfo.fromPartial(object.authInfo)
409
+ : undefined;
410
+ message.signatures = object.signatures?.map((e) => e) || [];
411
+ return message;
412
+ },
413
+ };
414
+
415
+ function createBaseTxRaw(): TxRaw {
416
+ return { bodyBytes: new Uint8Array(0), authInfoBytes: new Uint8Array(0), signatures: [] };
417
+ }
418
+
419
+ export const TxRaw = {
420
+ encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
421
+ if (message.bodyBytes.length !== 0) {
422
+ writer.uint32(10).bytes(message.bodyBytes);
423
+ }
424
+ if (message.authInfoBytes.length !== 0) {
425
+ writer.uint32(18).bytes(message.authInfoBytes);
426
+ }
427
+ for (const v of message.signatures) {
428
+ writer.uint32(26).bytes(v!);
429
+ }
430
+ return writer;
431
+ },
432
+
433
+ decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw {
434
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
435
+ let end = length === undefined ? reader.len : reader.pos + length;
436
+ const message = createBaseTxRaw();
437
+ while (reader.pos < end) {
438
+ const tag = reader.uint32();
439
+ switch (tag >>> 3) {
440
+ case 1:
441
+ if (tag !== 10) {
442
+ break;
443
+ }
444
+
445
+ message.bodyBytes = reader.bytes();
446
+ continue;
447
+ case 2:
448
+ if (tag !== 18) {
449
+ break;
450
+ }
451
+
452
+ message.authInfoBytes = reader.bytes();
453
+ continue;
454
+ case 3:
455
+ if (tag !== 26) {
456
+ break;
457
+ }
458
+
459
+ message.signatures.push(reader.bytes());
460
+ continue;
461
+ }
462
+ if ((tag & 7) === 4 || tag === 0) {
463
+ break;
464
+ }
465
+ reader.skipType(tag & 7);
466
+ }
467
+ return message;
468
+ },
469
+
470
+ fromJSON(object: any): TxRaw {
471
+ return {
472
+ bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(0),
473
+ authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(0),
474
+ signatures: globalThis.Array.isArray(object?.signatures)
475
+ ? object.signatures.map((e: any) => bytesFromBase64(e))
476
+ : [],
477
+ };
478
+ },
479
+
480
+ toJSON(message: TxRaw): unknown {
481
+ const obj: any = {};
482
+ if (message.bodyBytes.length !== 0) {
483
+ obj.bodyBytes = base64FromBytes(message.bodyBytes);
484
+ }
485
+ if (message.authInfoBytes.length !== 0) {
486
+ obj.authInfoBytes = base64FromBytes(message.authInfoBytes);
487
+ }
488
+ if (message.signatures?.length) {
489
+ obj.signatures = message.signatures.map((e) => base64FromBytes(e));
490
+ }
491
+ return obj;
492
+ },
493
+
494
+ create<I extends Exact<DeepPartial<TxRaw>, I>>(base?: I): TxRaw {
495
+ return TxRaw.fromPartial(base ?? ({} as any));
496
+ },
497
+ fromPartial<I extends Exact<DeepPartial<TxRaw>, I>>(object: I): TxRaw {
498
+ const message = createBaseTxRaw();
499
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array(0);
500
+ message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(0);
501
+ message.signatures = object.signatures?.map((e) => e) || [];
502
+ return message;
503
+ },
504
+ };
505
+
506
+ function createBaseSignDoc(): SignDoc {
507
+ return { bodyBytes: new Uint8Array(0), authInfoBytes: new Uint8Array(0), chainId: "", accountNumber: Long.UZERO };
508
+ }
509
+
510
+ export const SignDoc = {
511
+ encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
512
+ if (message.bodyBytes.length !== 0) {
513
+ writer.uint32(10).bytes(message.bodyBytes);
514
+ }
515
+ if (message.authInfoBytes.length !== 0) {
516
+ writer.uint32(18).bytes(message.authInfoBytes);
517
+ }
518
+ if (message.chainId !== "") {
519
+ writer.uint32(26).string(message.chainId);
520
+ }
521
+ if (!message.accountNumber.equals(Long.UZERO)) {
522
+ writer.uint32(32).uint64(message.accountNumber);
523
+ }
524
+ return writer;
525
+ },
526
+
527
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc {
528
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
529
+ let end = length === undefined ? reader.len : reader.pos + length;
530
+ const message = createBaseSignDoc();
531
+ while (reader.pos < end) {
532
+ const tag = reader.uint32();
533
+ switch (tag >>> 3) {
534
+ case 1:
535
+ if (tag !== 10) {
536
+ break;
537
+ }
538
+
539
+ message.bodyBytes = reader.bytes();
540
+ continue;
541
+ case 2:
542
+ if (tag !== 18) {
543
+ break;
544
+ }
545
+
546
+ message.authInfoBytes = reader.bytes();
547
+ continue;
548
+ case 3:
549
+ if (tag !== 26) {
550
+ break;
551
+ }
552
+
553
+ message.chainId = reader.string();
554
+ continue;
555
+ case 4:
556
+ if (tag !== 32) {
557
+ break;
558
+ }
559
+
560
+ message.accountNumber = reader.uint64() as Long;
561
+ continue;
562
+ }
563
+ if ((tag & 7) === 4 || tag === 0) {
564
+ break;
565
+ }
566
+ reader.skipType(tag & 7);
567
+ }
568
+ return message;
569
+ },
570
+
571
+ fromJSON(object: any): SignDoc {
572
+ return {
573
+ bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(0),
574
+ authInfoBytes: isSet(object.authInfoBytes) ? bytesFromBase64(object.authInfoBytes) : new Uint8Array(0),
575
+ chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
576
+ accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO,
577
+ };
578
+ },
579
+
580
+ toJSON(message: SignDoc): unknown {
581
+ const obj: any = {};
582
+ if (message.bodyBytes.length !== 0) {
583
+ obj.bodyBytes = base64FromBytes(message.bodyBytes);
584
+ }
585
+ if (message.authInfoBytes.length !== 0) {
586
+ obj.authInfoBytes = base64FromBytes(message.authInfoBytes);
587
+ }
588
+ if (message.chainId !== "") {
589
+ obj.chainId = message.chainId;
590
+ }
591
+ if (!message.accountNumber.equals(Long.UZERO)) {
592
+ obj.accountNumber = (message.accountNumber || Long.UZERO).toString();
593
+ }
594
+ return obj;
595
+ },
596
+
597
+ create<I extends Exact<DeepPartial<SignDoc>, I>>(base?: I): SignDoc {
598
+ return SignDoc.fromPartial(base ?? ({} as any));
599
+ },
600
+ fromPartial<I extends Exact<DeepPartial<SignDoc>, I>>(object: I): SignDoc {
601
+ const message = createBaseSignDoc();
602
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array(0);
603
+ message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(0);
604
+ message.chainId = object.chainId ?? "";
605
+ message.accountNumber = (object.accountNumber !== undefined && object.accountNumber !== null)
606
+ ? Long.fromValue(object.accountNumber)
607
+ : Long.UZERO;
608
+ return message;
609
+ },
610
+ };
611
+
612
+ function createBaseSignDocDirectAux(): SignDocDirectAux {
613
+ return {
614
+ bodyBytes: new Uint8Array(0),
615
+ publicKey: undefined,
616
+ chainId: "",
617
+ accountNumber: Long.UZERO,
618
+ sequence: Long.UZERO,
619
+ tip: undefined,
620
+ };
621
+ }
622
+
623
+ export const SignDocDirectAux = {
624
+ encode(message: SignDocDirectAux, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
625
+ if (message.bodyBytes.length !== 0) {
626
+ writer.uint32(10).bytes(message.bodyBytes);
627
+ }
628
+ if (message.publicKey !== undefined) {
629
+ Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim();
630
+ }
631
+ if (message.chainId !== "") {
632
+ writer.uint32(26).string(message.chainId);
633
+ }
634
+ if (!message.accountNumber.equals(Long.UZERO)) {
635
+ writer.uint32(32).uint64(message.accountNumber);
636
+ }
637
+ if (!message.sequence.equals(Long.UZERO)) {
638
+ writer.uint32(40).uint64(message.sequence);
639
+ }
640
+ if (message.tip !== undefined) {
641
+ Tip.encode(message.tip, writer.uint32(50).fork()).ldelim();
642
+ }
643
+ return writer;
644
+ },
645
+
646
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignDocDirectAux {
647
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
648
+ let end = length === undefined ? reader.len : reader.pos + length;
649
+ const message = createBaseSignDocDirectAux();
650
+ while (reader.pos < end) {
651
+ const tag = reader.uint32();
652
+ switch (tag >>> 3) {
653
+ case 1:
654
+ if (tag !== 10) {
655
+ break;
656
+ }
657
+
658
+ message.bodyBytes = reader.bytes();
659
+ continue;
660
+ case 2:
661
+ if (tag !== 18) {
662
+ break;
663
+ }
664
+
665
+ message.publicKey = Any.decode(reader, reader.uint32());
666
+ continue;
667
+ case 3:
668
+ if (tag !== 26) {
669
+ break;
670
+ }
671
+
672
+ message.chainId = reader.string();
673
+ continue;
674
+ case 4:
675
+ if (tag !== 32) {
676
+ break;
677
+ }
678
+
679
+ message.accountNumber = reader.uint64() as Long;
680
+ continue;
681
+ case 5:
682
+ if (tag !== 40) {
683
+ break;
684
+ }
685
+
686
+ message.sequence = reader.uint64() as Long;
687
+ continue;
688
+ case 6:
689
+ if (tag !== 50) {
690
+ break;
691
+ }
692
+
693
+ message.tip = Tip.decode(reader, reader.uint32());
694
+ continue;
695
+ }
696
+ if ((tag & 7) === 4 || tag === 0) {
697
+ break;
698
+ }
699
+ reader.skipType(tag & 7);
700
+ }
701
+ return message;
702
+ },
703
+
704
+ fromJSON(object: any): SignDocDirectAux {
705
+ return {
706
+ bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(0),
707
+ publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined,
708
+ chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
709
+ accountNumber: isSet(object.accountNumber) ? Long.fromValue(object.accountNumber) : Long.UZERO,
710
+ sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO,
711
+ tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined,
712
+ };
713
+ },
714
+
715
+ toJSON(message: SignDocDirectAux): unknown {
716
+ const obj: any = {};
717
+ if (message.bodyBytes.length !== 0) {
718
+ obj.bodyBytes = base64FromBytes(message.bodyBytes);
719
+ }
720
+ if (message.publicKey !== undefined) {
721
+ obj.publicKey = Any.toJSON(message.publicKey);
722
+ }
723
+ if (message.chainId !== "") {
724
+ obj.chainId = message.chainId;
725
+ }
726
+ if (!message.accountNumber.equals(Long.UZERO)) {
727
+ obj.accountNumber = (message.accountNumber || Long.UZERO).toString();
728
+ }
729
+ if (!message.sequence.equals(Long.UZERO)) {
730
+ obj.sequence = (message.sequence || Long.UZERO).toString();
731
+ }
732
+ if (message.tip !== undefined) {
733
+ obj.tip = Tip.toJSON(message.tip);
734
+ }
735
+ return obj;
736
+ },
737
+
738
+ create<I extends Exact<DeepPartial<SignDocDirectAux>, I>>(base?: I): SignDocDirectAux {
739
+ return SignDocDirectAux.fromPartial(base ?? ({} as any));
740
+ },
741
+ fromPartial<I extends Exact<DeepPartial<SignDocDirectAux>, I>>(object: I): SignDocDirectAux {
742
+ const message = createBaseSignDocDirectAux();
743
+ message.bodyBytes = object.bodyBytes ?? new Uint8Array(0);
744
+ message.publicKey = (object.publicKey !== undefined && object.publicKey !== null)
745
+ ? Any.fromPartial(object.publicKey)
746
+ : undefined;
747
+ message.chainId = object.chainId ?? "";
748
+ message.accountNumber = (object.accountNumber !== undefined && object.accountNumber !== null)
749
+ ? Long.fromValue(object.accountNumber)
750
+ : Long.UZERO;
751
+ message.sequence = (object.sequence !== undefined && object.sequence !== null)
752
+ ? Long.fromValue(object.sequence)
753
+ : Long.UZERO;
754
+ message.tip = (object.tip !== undefined && object.tip !== null) ? Tip.fromPartial(object.tip) : undefined;
755
+ return message;
756
+ },
757
+ };
758
+
759
+ function createBaseTxBody(): TxBody {
760
+ return { messages: [], memo: "", timeoutHeight: Long.UZERO, extensionOptions: [], nonCriticalExtensionOptions: [] };
761
+ }
762
+
763
+ export const TxBody = {
764
+ encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
765
+ for (const v of message.messages) {
766
+ Any.encode(v!, writer.uint32(10).fork()).ldelim();
767
+ }
768
+ if (message.memo !== "") {
769
+ writer.uint32(18).string(message.memo);
770
+ }
771
+ if (!message.timeoutHeight.equals(Long.UZERO)) {
772
+ writer.uint32(24).uint64(message.timeoutHeight);
773
+ }
774
+ for (const v of message.extensionOptions) {
775
+ Any.encode(v!, writer.uint32(8186).fork()).ldelim();
776
+ }
777
+ for (const v of message.nonCriticalExtensionOptions) {
778
+ Any.encode(v!, writer.uint32(16378).fork()).ldelim();
779
+ }
780
+ return writer;
781
+ },
782
+
783
+ decode(input: _m0.Reader | Uint8Array, length?: number): TxBody {
784
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
785
+ let end = length === undefined ? reader.len : reader.pos + length;
786
+ const message = createBaseTxBody();
787
+ while (reader.pos < end) {
788
+ const tag = reader.uint32();
789
+ switch (tag >>> 3) {
790
+ case 1:
791
+ if (tag !== 10) {
792
+ break;
793
+ }
794
+
795
+ message.messages.push(Any.decode(reader, reader.uint32()));
796
+ continue;
797
+ case 2:
798
+ if (tag !== 18) {
799
+ break;
800
+ }
801
+
802
+ message.memo = reader.string();
803
+ continue;
804
+ case 3:
805
+ if (tag !== 24) {
806
+ break;
807
+ }
808
+
809
+ message.timeoutHeight = reader.uint64() as Long;
810
+ continue;
811
+ case 1023:
812
+ if (tag !== 8186) {
813
+ break;
814
+ }
815
+
816
+ message.extensionOptions.push(Any.decode(reader, reader.uint32()));
817
+ continue;
818
+ case 2047:
819
+ if (tag !== 16378) {
820
+ break;
821
+ }
822
+
823
+ message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32()));
824
+ continue;
825
+ }
826
+ if ((tag & 7) === 4 || tag === 0) {
827
+ break;
828
+ }
829
+ reader.skipType(tag & 7);
830
+ }
831
+ return message;
832
+ },
833
+
834
+ fromJSON(object: any): TxBody {
835
+ return {
836
+ messages: globalThis.Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [],
837
+ memo: isSet(object.memo) ? globalThis.String(object.memo) : "",
838
+ timeoutHeight: isSet(object.timeoutHeight) ? Long.fromValue(object.timeoutHeight) : Long.UZERO,
839
+ extensionOptions: globalThis.Array.isArray(object?.extensionOptions)
840
+ ? object.extensionOptions.map((e: any) => Any.fromJSON(e))
841
+ : [],
842
+ nonCriticalExtensionOptions: globalThis.Array.isArray(object?.nonCriticalExtensionOptions)
843
+ ? object.nonCriticalExtensionOptions.map((e: any) => Any.fromJSON(e))
844
+ : [],
845
+ };
846
+ },
847
+
848
+ toJSON(message: TxBody): unknown {
849
+ const obj: any = {};
850
+ if (message.messages?.length) {
851
+ obj.messages = message.messages.map((e) => Any.toJSON(e));
852
+ }
853
+ if (message.memo !== "") {
854
+ obj.memo = message.memo;
855
+ }
856
+ if (!message.timeoutHeight.equals(Long.UZERO)) {
857
+ obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString();
858
+ }
859
+ if (message.extensionOptions?.length) {
860
+ obj.extensionOptions = message.extensionOptions.map((e) => Any.toJSON(e));
861
+ }
862
+ if (message.nonCriticalExtensionOptions?.length) {
863
+ obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => Any.toJSON(e));
864
+ }
865
+ return obj;
866
+ },
867
+
868
+ create<I extends Exact<DeepPartial<TxBody>, I>>(base?: I): TxBody {
869
+ return TxBody.fromPartial(base ?? ({} as any));
870
+ },
871
+ fromPartial<I extends Exact<DeepPartial<TxBody>, I>>(object: I): TxBody {
872
+ const message = createBaseTxBody();
873
+ message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [];
874
+ message.memo = object.memo ?? "";
875
+ message.timeoutHeight = (object.timeoutHeight !== undefined && object.timeoutHeight !== null)
876
+ ? Long.fromValue(object.timeoutHeight)
877
+ : Long.UZERO;
878
+ message.extensionOptions = object.extensionOptions?.map((e) => Any.fromPartial(e)) || [];
879
+ message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || [];
880
+ return message;
881
+ },
882
+ };
883
+
884
+ function createBaseAuthInfo(): AuthInfo {
885
+ return { signerInfos: [], fee: undefined, tip: undefined };
886
+ }
887
+
888
+ export const AuthInfo = {
889
+ encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
890
+ for (const v of message.signerInfos) {
891
+ SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim();
892
+ }
893
+ if (message.fee !== undefined) {
894
+ Fee.encode(message.fee, writer.uint32(18).fork()).ldelim();
895
+ }
896
+ if (message.tip !== undefined) {
897
+ Tip.encode(message.tip, writer.uint32(26).fork()).ldelim();
898
+ }
899
+ return writer;
900
+ },
901
+
902
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo {
903
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
904
+ let end = length === undefined ? reader.len : reader.pos + length;
905
+ const message = createBaseAuthInfo();
906
+ while (reader.pos < end) {
907
+ const tag = reader.uint32();
908
+ switch (tag >>> 3) {
909
+ case 1:
910
+ if (tag !== 10) {
911
+ break;
912
+ }
913
+
914
+ message.signerInfos.push(SignerInfo.decode(reader, reader.uint32()));
915
+ continue;
916
+ case 2:
917
+ if (tag !== 18) {
918
+ break;
919
+ }
920
+
921
+ message.fee = Fee.decode(reader, reader.uint32());
922
+ continue;
923
+ case 3:
924
+ if (tag !== 26) {
925
+ break;
926
+ }
927
+
928
+ message.tip = Tip.decode(reader, reader.uint32());
929
+ continue;
930
+ }
931
+ if ((tag & 7) === 4 || tag === 0) {
932
+ break;
933
+ }
934
+ reader.skipType(tag & 7);
935
+ }
936
+ return message;
937
+ },
938
+
939
+ fromJSON(object: any): AuthInfo {
940
+ return {
941
+ signerInfos: globalThis.Array.isArray(object?.signerInfos)
942
+ ? object.signerInfos.map((e: any) => SignerInfo.fromJSON(e))
943
+ : [],
944
+ fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined,
945
+ tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined,
946
+ };
947
+ },
948
+
949
+ toJSON(message: AuthInfo): unknown {
950
+ const obj: any = {};
951
+ if (message.signerInfos?.length) {
952
+ obj.signerInfos = message.signerInfos.map((e) => SignerInfo.toJSON(e));
953
+ }
954
+ if (message.fee !== undefined) {
955
+ obj.fee = Fee.toJSON(message.fee);
956
+ }
957
+ if (message.tip !== undefined) {
958
+ obj.tip = Tip.toJSON(message.tip);
959
+ }
960
+ return obj;
961
+ },
962
+
963
+ create<I extends Exact<DeepPartial<AuthInfo>, I>>(base?: I): AuthInfo {
964
+ return AuthInfo.fromPartial(base ?? ({} as any));
965
+ },
966
+ fromPartial<I extends Exact<DeepPartial<AuthInfo>, I>>(object: I): AuthInfo {
967
+ const message = createBaseAuthInfo();
968
+ message.signerInfos = object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || [];
969
+ message.fee = (object.fee !== undefined && object.fee !== null) ? Fee.fromPartial(object.fee) : undefined;
970
+ message.tip = (object.tip !== undefined && object.tip !== null) ? Tip.fromPartial(object.tip) : undefined;
971
+ return message;
972
+ },
973
+ };
974
+
975
+ function createBaseSignerInfo(): SignerInfo {
976
+ return { publicKey: undefined, modeInfo: undefined, sequence: Long.UZERO };
977
+ }
978
+
979
+ export const SignerInfo = {
980
+ encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
981
+ if (message.publicKey !== undefined) {
982
+ Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();
983
+ }
984
+ if (message.modeInfo !== undefined) {
985
+ ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim();
986
+ }
987
+ if (!message.sequence.equals(Long.UZERO)) {
988
+ writer.uint32(24).uint64(message.sequence);
989
+ }
990
+ return writer;
991
+ },
992
+
993
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo {
994
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
995
+ let end = length === undefined ? reader.len : reader.pos + length;
996
+ const message = createBaseSignerInfo();
997
+ while (reader.pos < end) {
998
+ const tag = reader.uint32();
999
+ switch (tag >>> 3) {
1000
+ case 1:
1001
+ if (tag !== 10) {
1002
+ break;
1003
+ }
1004
+
1005
+ message.publicKey = Any.decode(reader, reader.uint32());
1006
+ continue;
1007
+ case 2:
1008
+ if (tag !== 18) {
1009
+ break;
1010
+ }
1011
+
1012
+ message.modeInfo = ModeInfo.decode(reader, reader.uint32());
1013
+ continue;
1014
+ case 3:
1015
+ if (tag !== 24) {
1016
+ break;
1017
+ }
1018
+
1019
+ message.sequence = reader.uint64() as Long;
1020
+ continue;
1021
+ }
1022
+ if ((tag & 7) === 4 || tag === 0) {
1023
+ break;
1024
+ }
1025
+ reader.skipType(tag & 7);
1026
+ }
1027
+ return message;
1028
+ },
1029
+
1030
+ fromJSON(object: any): SignerInfo {
1031
+ return {
1032
+ publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined,
1033
+ modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : undefined,
1034
+ sequence: isSet(object.sequence) ? Long.fromValue(object.sequence) : Long.UZERO,
1035
+ };
1036
+ },
1037
+
1038
+ toJSON(message: SignerInfo): unknown {
1039
+ const obj: any = {};
1040
+ if (message.publicKey !== undefined) {
1041
+ obj.publicKey = Any.toJSON(message.publicKey);
1042
+ }
1043
+ if (message.modeInfo !== undefined) {
1044
+ obj.modeInfo = ModeInfo.toJSON(message.modeInfo);
1045
+ }
1046
+ if (!message.sequence.equals(Long.UZERO)) {
1047
+ obj.sequence = (message.sequence || Long.UZERO).toString();
1048
+ }
1049
+ return obj;
1050
+ },
1051
+
1052
+ create<I extends Exact<DeepPartial<SignerInfo>, I>>(base?: I): SignerInfo {
1053
+ return SignerInfo.fromPartial(base ?? ({} as any));
1054
+ },
1055
+ fromPartial<I extends Exact<DeepPartial<SignerInfo>, I>>(object: I): SignerInfo {
1056
+ const message = createBaseSignerInfo();
1057
+ message.publicKey = (object.publicKey !== undefined && object.publicKey !== null)
1058
+ ? Any.fromPartial(object.publicKey)
1059
+ : undefined;
1060
+ message.modeInfo = (object.modeInfo !== undefined && object.modeInfo !== null)
1061
+ ? ModeInfo.fromPartial(object.modeInfo)
1062
+ : undefined;
1063
+ message.sequence = (object.sequence !== undefined && object.sequence !== null)
1064
+ ? Long.fromValue(object.sequence)
1065
+ : Long.UZERO;
1066
+ return message;
1067
+ },
1068
+ };
1069
+
1070
+ function createBaseModeInfo(): ModeInfo {
1071
+ return { single: undefined, multi: undefined };
1072
+ }
1073
+
1074
+ export const ModeInfo = {
1075
+ encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1076
+ if (message.single !== undefined) {
1077
+ ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim();
1078
+ }
1079
+ if (message.multi !== undefined) {
1080
+ ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();
1081
+ }
1082
+ return writer;
1083
+ },
1084
+
1085
+ decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo {
1086
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1087
+ let end = length === undefined ? reader.len : reader.pos + length;
1088
+ const message = createBaseModeInfo();
1089
+ while (reader.pos < end) {
1090
+ const tag = reader.uint32();
1091
+ switch (tag >>> 3) {
1092
+ case 1:
1093
+ if (tag !== 10) {
1094
+ break;
1095
+ }
1096
+
1097
+ message.single = ModeInfo_Single.decode(reader, reader.uint32());
1098
+ continue;
1099
+ case 2:
1100
+ if (tag !== 18) {
1101
+ break;
1102
+ }
1103
+
1104
+ message.multi = ModeInfo_Multi.decode(reader, reader.uint32());
1105
+ continue;
1106
+ }
1107
+ if ((tag & 7) === 4 || tag === 0) {
1108
+ break;
1109
+ }
1110
+ reader.skipType(tag & 7);
1111
+ }
1112
+ return message;
1113
+ },
1114
+
1115
+ fromJSON(object: any): ModeInfo {
1116
+ return {
1117
+ single: isSet(object.single) ? ModeInfo_Single.fromJSON(object.single) : undefined,
1118
+ multi: isSet(object.multi) ? ModeInfo_Multi.fromJSON(object.multi) : undefined,
1119
+ };
1120
+ },
1121
+
1122
+ toJSON(message: ModeInfo): unknown {
1123
+ const obj: any = {};
1124
+ if (message.single !== undefined) {
1125
+ obj.single = ModeInfo_Single.toJSON(message.single);
1126
+ }
1127
+ if (message.multi !== undefined) {
1128
+ obj.multi = ModeInfo_Multi.toJSON(message.multi);
1129
+ }
1130
+ return obj;
1131
+ },
1132
+
1133
+ create<I extends Exact<DeepPartial<ModeInfo>, I>>(base?: I): ModeInfo {
1134
+ return ModeInfo.fromPartial(base ?? ({} as any));
1135
+ },
1136
+ fromPartial<I extends Exact<DeepPartial<ModeInfo>, I>>(object: I): ModeInfo {
1137
+ const message = createBaseModeInfo();
1138
+ message.single = (object.single !== undefined && object.single !== null)
1139
+ ? ModeInfo_Single.fromPartial(object.single)
1140
+ : undefined;
1141
+ message.multi = (object.multi !== undefined && object.multi !== null)
1142
+ ? ModeInfo_Multi.fromPartial(object.multi)
1143
+ : undefined;
1144
+ return message;
1145
+ },
1146
+ };
1147
+
1148
+ function createBaseModeInfo_Single(): ModeInfo_Single {
1149
+ return { mode: 0 };
1150
+ }
1151
+
1152
+ export const ModeInfo_Single = {
1153
+ encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1154
+ if (message.mode !== 0) {
1155
+ writer.uint32(8).int32(message.mode);
1156
+ }
1157
+ return writer;
1158
+ },
1159
+
1160
+ decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single {
1161
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1162
+ let end = length === undefined ? reader.len : reader.pos + length;
1163
+ const message = createBaseModeInfo_Single();
1164
+ while (reader.pos < end) {
1165
+ const tag = reader.uint32();
1166
+ switch (tag >>> 3) {
1167
+ case 1:
1168
+ if (tag !== 8) {
1169
+ break;
1170
+ }
1171
+
1172
+ message.mode = reader.int32() as any;
1173
+ continue;
1174
+ }
1175
+ if ((tag & 7) === 4 || tag === 0) {
1176
+ break;
1177
+ }
1178
+ reader.skipType(tag & 7);
1179
+ }
1180
+ return message;
1181
+ },
1182
+
1183
+ fromJSON(object: any): ModeInfo_Single {
1184
+ return { mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 };
1185
+ },
1186
+
1187
+ toJSON(message: ModeInfo_Single): unknown {
1188
+ const obj: any = {};
1189
+ if (message.mode !== 0) {
1190
+ obj.mode = signModeToJSON(message.mode);
1191
+ }
1192
+ return obj;
1193
+ },
1194
+
1195
+ create<I extends Exact<DeepPartial<ModeInfo_Single>, I>>(base?: I): ModeInfo_Single {
1196
+ return ModeInfo_Single.fromPartial(base ?? ({} as any));
1197
+ },
1198
+ fromPartial<I extends Exact<DeepPartial<ModeInfo_Single>, I>>(object: I): ModeInfo_Single {
1199
+ const message = createBaseModeInfo_Single();
1200
+ message.mode = object.mode ?? 0;
1201
+ return message;
1202
+ },
1203
+ };
1204
+
1205
+ function createBaseModeInfo_Multi(): ModeInfo_Multi {
1206
+ return { bitarray: undefined, modeInfos: [] };
1207
+ }
1208
+
1209
+ export const ModeInfo_Multi = {
1210
+ encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1211
+ if (message.bitarray !== undefined) {
1212
+ CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();
1213
+ }
1214
+ for (const v of message.modeInfos) {
1215
+ ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim();
1216
+ }
1217
+ return writer;
1218
+ },
1219
+
1220
+ decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi {
1221
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1222
+ let end = length === undefined ? reader.len : reader.pos + length;
1223
+ const message = createBaseModeInfo_Multi();
1224
+ while (reader.pos < end) {
1225
+ const tag = reader.uint32();
1226
+ switch (tag >>> 3) {
1227
+ case 1:
1228
+ if (tag !== 10) {
1229
+ break;
1230
+ }
1231
+
1232
+ message.bitarray = CompactBitArray.decode(reader, reader.uint32());
1233
+ continue;
1234
+ case 2:
1235
+ if (tag !== 18) {
1236
+ break;
1237
+ }
1238
+
1239
+ message.modeInfos.push(ModeInfo.decode(reader, reader.uint32()));
1240
+ continue;
1241
+ }
1242
+ if ((tag & 7) === 4 || tag === 0) {
1243
+ break;
1244
+ }
1245
+ reader.skipType(tag & 7);
1246
+ }
1247
+ return message;
1248
+ },
1249
+
1250
+ fromJSON(object: any): ModeInfo_Multi {
1251
+ return {
1252
+ bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : undefined,
1253
+ modeInfos: globalThis.Array.isArray(object?.modeInfos)
1254
+ ? object.modeInfos.map((e: any) => ModeInfo.fromJSON(e))
1255
+ : [],
1256
+ };
1257
+ },
1258
+
1259
+ toJSON(message: ModeInfo_Multi): unknown {
1260
+ const obj: any = {};
1261
+ if (message.bitarray !== undefined) {
1262
+ obj.bitarray = CompactBitArray.toJSON(message.bitarray);
1263
+ }
1264
+ if (message.modeInfos?.length) {
1265
+ obj.modeInfos = message.modeInfos.map((e) => ModeInfo.toJSON(e));
1266
+ }
1267
+ return obj;
1268
+ },
1269
+
1270
+ create<I extends Exact<DeepPartial<ModeInfo_Multi>, I>>(base?: I): ModeInfo_Multi {
1271
+ return ModeInfo_Multi.fromPartial(base ?? ({} as any));
1272
+ },
1273
+ fromPartial<I extends Exact<DeepPartial<ModeInfo_Multi>, I>>(object: I): ModeInfo_Multi {
1274
+ const message = createBaseModeInfo_Multi();
1275
+ message.bitarray = (object.bitarray !== undefined && object.bitarray !== null)
1276
+ ? CompactBitArray.fromPartial(object.bitarray)
1277
+ : undefined;
1278
+ message.modeInfos = object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || [];
1279
+ return message;
1280
+ },
1281
+ };
1282
+
1283
+ function createBaseFee(): Fee {
1284
+ return { amount: [], gasLimit: Long.UZERO, payer: "", granter: "" };
1285
+ }
1286
+
1287
+ export const Fee = {
1288
+ encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1289
+ for (const v of message.amount) {
1290
+ Coin.encode(v!, writer.uint32(10).fork()).ldelim();
1291
+ }
1292
+ if (!message.gasLimit.equals(Long.UZERO)) {
1293
+ writer.uint32(16).uint64(message.gasLimit);
1294
+ }
1295
+ if (message.payer !== "") {
1296
+ writer.uint32(26).string(message.payer);
1297
+ }
1298
+ if (message.granter !== "") {
1299
+ writer.uint32(34).string(message.granter);
1300
+ }
1301
+ return writer;
1302
+ },
1303
+
1304
+ decode(input: _m0.Reader | Uint8Array, length?: number): Fee {
1305
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1306
+ let end = length === undefined ? reader.len : reader.pos + length;
1307
+ const message = createBaseFee();
1308
+ while (reader.pos < end) {
1309
+ const tag = reader.uint32();
1310
+ switch (tag >>> 3) {
1311
+ case 1:
1312
+ if (tag !== 10) {
1313
+ break;
1314
+ }
1315
+
1316
+ message.amount.push(Coin.decode(reader, reader.uint32()));
1317
+ continue;
1318
+ case 2:
1319
+ if (tag !== 16) {
1320
+ break;
1321
+ }
1322
+
1323
+ message.gasLimit = reader.uint64() as Long;
1324
+ continue;
1325
+ case 3:
1326
+ if (tag !== 26) {
1327
+ break;
1328
+ }
1329
+
1330
+ message.payer = reader.string();
1331
+ continue;
1332
+ case 4:
1333
+ if (tag !== 34) {
1334
+ break;
1335
+ }
1336
+
1337
+ message.granter = reader.string();
1338
+ continue;
1339
+ }
1340
+ if ((tag & 7) === 4 || tag === 0) {
1341
+ break;
1342
+ }
1343
+ reader.skipType(tag & 7);
1344
+ }
1345
+ return message;
1346
+ },
1347
+
1348
+ fromJSON(object: any): Fee {
1349
+ return {
1350
+ amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [],
1351
+ gasLimit: isSet(object.gasLimit) ? Long.fromValue(object.gasLimit) : Long.UZERO,
1352
+ payer: isSet(object.payer) ? globalThis.String(object.payer) : "",
1353
+ granter: isSet(object.granter) ? globalThis.String(object.granter) : "",
1354
+ };
1355
+ },
1356
+
1357
+ toJSON(message: Fee): unknown {
1358
+ const obj: any = {};
1359
+ if (message.amount?.length) {
1360
+ obj.amount = message.amount.map((e) => Coin.toJSON(e));
1361
+ }
1362
+ if (!message.gasLimit.equals(Long.UZERO)) {
1363
+ obj.gasLimit = (message.gasLimit || Long.UZERO).toString();
1364
+ }
1365
+ if (message.payer !== "") {
1366
+ obj.payer = message.payer;
1367
+ }
1368
+ if (message.granter !== "") {
1369
+ obj.granter = message.granter;
1370
+ }
1371
+ return obj;
1372
+ },
1373
+
1374
+ create<I extends Exact<DeepPartial<Fee>, I>>(base?: I): Fee {
1375
+ return Fee.fromPartial(base ?? ({} as any));
1376
+ },
1377
+ fromPartial<I extends Exact<DeepPartial<Fee>, I>>(object: I): Fee {
1378
+ const message = createBaseFee();
1379
+ message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
1380
+ message.gasLimit = (object.gasLimit !== undefined && object.gasLimit !== null)
1381
+ ? Long.fromValue(object.gasLimit)
1382
+ : Long.UZERO;
1383
+ message.payer = object.payer ?? "";
1384
+ message.granter = object.granter ?? "";
1385
+ return message;
1386
+ },
1387
+ };
1388
+
1389
+ function createBaseTip(): Tip {
1390
+ return { amount: [], tipper: "" };
1391
+ }
1392
+
1393
+ export const Tip = {
1394
+ encode(message: Tip, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1395
+ for (const v of message.amount) {
1396
+ Coin.encode(v!, writer.uint32(10).fork()).ldelim();
1397
+ }
1398
+ if (message.tipper !== "") {
1399
+ writer.uint32(18).string(message.tipper);
1400
+ }
1401
+ return writer;
1402
+ },
1403
+
1404
+ decode(input: _m0.Reader | Uint8Array, length?: number): Tip {
1405
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1406
+ let end = length === undefined ? reader.len : reader.pos + length;
1407
+ const message = createBaseTip();
1408
+ while (reader.pos < end) {
1409
+ const tag = reader.uint32();
1410
+ switch (tag >>> 3) {
1411
+ case 1:
1412
+ if (tag !== 10) {
1413
+ break;
1414
+ }
1415
+
1416
+ message.amount.push(Coin.decode(reader, reader.uint32()));
1417
+ continue;
1418
+ case 2:
1419
+ if (tag !== 18) {
1420
+ break;
1421
+ }
1422
+
1423
+ message.tipper = reader.string();
1424
+ continue;
1425
+ }
1426
+ if ((tag & 7) === 4 || tag === 0) {
1427
+ break;
1428
+ }
1429
+ reader.skipType(tag & 7);
1430
+ }
1431
+ return message;
1432
+ },
1433
+
1434
+ fromJSON(object: any): Tip {
1435
+ return {
1436
+ amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [],
1437
+ tipper: isSet(object.tipper) ? globalThis.String(object.tipper) : "",
1438
+ };
1439
+ },
1440
+
1441
+ toJSON(message: Tip): unknown {
1442
+ const obj: any = {};
1443
+ if (message.amount?.length) {
1444
+ obj.amount = message.amount.map((e) => Coin.toJSON(e));
1445
+ }
1446
+ if (message.tipper !== "") {
1447
+ obj.tipper = message.tipper;
1448
+ }
1449
+ return obj;
1450
+ },
1451
+
1452
+ create<I extends Exact<DeepPartial<Tip>, I>>(base?: I): Tip {
1453
+ return Tip.fromPartial(base ?? ({} as any));
1454
+ },
1455
+ fromPartial<I extends Exact<DeepPartial<Tip>, I>>(object: I): Tip {
1456
+ const message = createBaseTip();
1457
+ message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
1458
+ message.tipper = object.tipper ?? "";
1459
+ return message;
1460
+ },
1461
+ };
1462
+
1463
+ function createBaseAuxSignerData(): AuxSignerData {
1464
+ return { address: "", signDoc: undefined, mode: 0, sig: new Uint8Array(0) };
1465
+ }
1466
+
1467
+ export const AuxSignerData = {
1468
+ encode(message: AuxSignerData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1469
+ if (message.address !== "") {
1470
+ writer.uint32(10).string(message.address);
1471
+ }
1472
+ if (message.signDoc !== undefined) {
1473
+ SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim();
1474
+ }
1475
+ if (message.mode !== 0) {
1476
+ writer.uint32(24).int32(message.mode);
1477
+ }
1478
+ if (message.sig.length !== 0) {
1479
+ writer.uint32(34).bytes(message.sig);
1480
+ }
1481
+ return writer;
1482
+ },
1483
+
1484
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuxSignerData {
1485
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1486
+ let end = length === undefined ? reader.len : reader.pos + length;
1487
+ const message = createBaseAuxSignerData();
1488
+ while (reader.pos < end) {
1489
+ const tag = reader.uint32();
1490
+ switch (tag >>> 3) {
1491
+ case 1:
1492
+ if (tag !== 10) {
1493
+ break;
1494
+ }
1495
+
1496
+ message.address = reader.string();
1497
+ continue;
1498
+ case 2:
1499
+ if (tag !== 18) {
1500
+ break;
1501
+ }
1502
+
1503
+ message.signDoc = SignDocDirectAux.decode(reader, reader.uint32());
1504
+ continue;
1505
+ case 3:
1506
+ if (tag !== 24) {
1507
+ break;
1508
+ }
1509
+
1510
+ message.mode = reader.int32() as any;
1511
+ continue;
1512
+ case 4:
1513
+ if (tag !== 34) {
1514
+ break;
1515
+ }
1516
+
1517
+ message.sig = reader.bytes();
1518
+ continue;
1519
+ }
1520
+ if ((tag & 7) === 4 || tag === 0) {
1521
+ break;
1522
+ }
1523
+ reader.skipType(tag & 7);
1524
+ }
1525
+ return message;
1526
+ },
1527
+
1528
+ fromJSON(object: any): AuxSignerData {
1529
+ return {
1530
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
1531
+ signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined,
1532
+ mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0,
1533
+ sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array(0),
1534
+ };
1535
+ },
1536
+
1537
+ toJSON(message: AuxSignerData): unknown {
1538
+ const obj: any = {};
1539
+ if (message.address !== "") {
1540
+ obj.address = message.address;
1541
+ }
1542
+ if (message.signDoc !== undefined) {
1543
+ obj.signDoc = SignDocDirectAux.toJSON(message.signDoc);
1544
+ }
1545
+ if (message.mode !== 0) {
1546
+ obj.mode = signModeToJSON(message.mode);
1547
+ }
1548
+ if (message.sig.length !== 0) {
1549
+ obj.sig = base64FromBytes(message.sig);
1550
+ }
1551
+ return obj;
1552
+ },
1553
+
1554
+ create<I extends Exact<DeepPartial<AuxSignerData>, I>>(base?: I): AuxSignerData {
1555
+ return AuxSignerData.fromPartial(base ?? ({} as any));
1556
+ },
1557
+ fromPartial<I extends Exact<DeepPartial<AuxSignerData>, I>>(object: I): AuxSignerData {
1558
+ const message = createBaseAuxSignerData();
1559
+ message.address = object.address ?? "";
1560
+ message.signDoc = (object.signDoc !== undefined && object.signDoc !== null)
1561
+ ? SignDocDirectAux.fromPartial(object.signDoc)
1562
+ : undefined;
1563
+ message.mode = object.mode ?? 0;
1564
+ message.sig = object.sig ?? new Uint8Array(0);
1565
+ return message;
1566
+ },
1567
+ };
1568
+
1569
+ function bytesFromBase64(b64: string): Uint8Array {
1570
+ if ((globalThis as any).Buffer) {
1571
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1572
+ } else {
1573
+ const bin = globalThis.atob(b64);
1574
+ const arr = new Uint8Array(bin.length);
1575
+ for (let i = 0; i < bin.length; ++i) {
1576
+ arr[i] = bin.charCodeAt(i);
1577
+ }
1578
+ return arr;
1579
+ }
1580
+ }
1581
+
1582
+ function base64FromBytes(arr: Uint8Array): string {
1583
+ if ((globalThis as any).Buffer) {
1584
+ return globalThis.Buffer.from(arr).toString("base64");
1585
+ } else {
1586
+ const bin: string[] = [];
1587
+ arr.forEach((byte) => {
1588
+ bin.push(globalThis.String.fromCharCode(byte));
1589
+ });
1590
+ return globalThis.btoa(bin.join(""));
1591
+ }
1592
+ }
1593
+
1594
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1595
+
1596
+ export type DeepPartial<T> = T extends Builtin ? T
1597
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
1598
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
1599
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
1600
+ : Partial<T>;
1601
+
1602
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
1603
+ export type Exact<P, I extends P> = P extends Builtin ? P
1604
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
1605
+
1606
+ if (_m0.util.Long !== Long) {
1607
+ _m0.util.Long = Long as any;
1608
+ _m0.configure();
1609
+ }
1610
+
1611
+ function isSet(value: any): boolean {
1612
+ return value !== null && value !== undefined;
1613
+ }