@burningflames/inj-exchange-sdk 0.0.0-stage → 0.1.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 (70) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +7 -0
  3. package/README.md +198 -2
  4. package/dist/ApiManager-BcwRSg4p.cjs +14 -0
  5. package/dist/ApiManager-VsZ_7GMj.js +9 -0
  6. package/dist/MsgIncreasePositionMargin-7_g04vle.d.ts +2285 -0
  7. package/dist/MsgIncreasePositionMargin-UQn6vCje.d.cts +2284 -0
  8. package/dist/bank-c5iv-fbg.cjs +480 -0
  9. package/dist/bank-xWl_W05K.js +451 -0
  10. package/dist/chain-CgjV0b1c.js +5868 -0
  11. package/dist/chain-LTb0TjXc.cjs +5903 -0
  12. package/dist/clients/chain.cjs +8 -0
  13. package/dist/clients/chain.d.cts +2 -0
  14. package/dist/clients/chain.d.ts +2 -0
  15. package/dist/clients/chain.js +1 -0
  16. package/dist/clients/indexer.cjs +14 -0
  17. package/dist/clients/indexer.d.cts +2 -0
  18. package/dist/clients/indexer.d.ts +2 -0
  19. package/dist/clients/indexer.js +1 -0
  20. package/dist/coin-8_Vn0T8-.cjs +73 -0
  21. package/dist/coin-CowdNxVV.js +68 -0
  22. package/dist/decimal-CIFXn110.js +27 -0
  23. package/dist/decimal-DJMaLHQO.cjs +38 -0
  24. package/dist/eip712-88KVCEnw.d.cts +21 -0
  25. package/dist/eip712-88KVCEnw.d.ts +21 -0
  26. package/dist/errors-CKG7zTvs.cjs +36 -0
  27. package/dist/errors-MWG_E5zA.js +25 -0
  28. package/dist/exchange-BPRx-kFI.js +4637 -0
  29. package/dist/exchange-CTLbPuA7.cjs +4966 -0
  30. package/dist/index-B3bDzB4S.d.cts +2169 -0
  31. package/dist/index-BHLUinQA.d.ts +220 -0
  32. package/dist/index-BPpDV6JA.d.cts +182 -0
  33. package/dist/index-BT_zyZW9.d.cts +220 -0
  34. package/dist/index-DcQT-y4U.d.ts +2169 -0
  35. package/dist/index-DfoLUPEo.d.ts +183 -0
  36. package/dist/index.cjs +73 -0
  37. package/dist/index.d.cts +11 -0
  38. package/dist/index.d.ts +11 -0
  39. package/dist/index.js +13 -0
  40. package/dist/indexer-D7XfYsAZ.js +21699 -0
  41. package/dist/indexer-DI7-gHOA.cjs +21770 -0
  42. package/dist/msgs-Bi5b52-R.js +11359 -0
  43. package/dist/msgs-DNyc0UtV.cjs +11442 -0
  44. package/dist/msgs.cjs +16 -0
  45. package/dist/msgs.d.cts +2 -0
  46. package/dist/msgs.d.ts +2 -0
  47. package/dist/msgs.js +1 -0
  48. package/dist/query-DGTA8Lz_.js +13375 -0
  49. package/dist/query-L1m6tP9I.cjs +13530 -0
  50. package/dist/stream-BgKRWG60.d.cts +46 -0
  51. package/dist/stream-BgKRWG60.d.ts +46 -0
  52. package/dist/stream-D8ZvUQFy.cjs +29 -0
  53. package/dist/stream-RhVNTED5.js +18 -0
  54. package/dist/tendermint-CF_W9U6D.d.ts +49 -0
  55. package/dist/tendermint-zj8c-dVM.d.cts +49 -0
  56. package/dist/tx-BRaw1C6e.d.ts +66 -0
  57. package/dist/tx-BgpasOOk.cjs +464 -0
  58. package/dist/tx-CCt0zqng.d.cts +66 -0
  59. package/dist/tx-COcDYlg3.js +411 -0
  60. package/dist/tx-DIg8nbnn.cjs +1091 -0
  61. package/dist/tx-GN0SFql2.js +1026 -0
  62. package/dist/types.cjs +38 -0
  63. package/dist/types.d.cts +13 -0
  64. package/dist/types.d.ts +13 -0
  65. package/dist/types.js +26 -0
  66. package/dist/utils.cjs +131 -0
  67. package/dist/utils.d.cts +2 -0
  68. package/dist/utils.d.ts +2 -0
  69. package/dist/utils.js +115 -0
  70. package/package.json +124 -4
@@ -0,0 +1,1091 @@
1
+ let _bufbuild_protobuf_wire = require("@bufbuild/protobuf/wire");
2
+ const require_coin = require("./coin-8_Vn0T8-.cjs");
3
+ // gen/google/protobuf/any.ts
4
+ function createBaseAny() {
5
+ return {
6
+ typeUrl: "",
7
+ value: Buffer.alloc(0)
8
+ };
9
+ }
10
+ const Any = {
11
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
12
+ if (message.typeUrl !== "") writer.uint32(10).string(message.typeUrl);
13
+ if (message.value.length !== 0) writer.uint32(18).bytes(message.value);
14
+ return writer;
15
+ },
16
+ decode(input, length) {
17
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
18
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
19
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
20
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
21
+ try {
22
+ const end = length === void 0 ? reader.len : reader.pos + length;
23
+ const message = createBaseAny();
24
+ while (reader.pos < end) {
25
+ const tag = reader.uint32();
26
+ switch (tag >>> 3) {
27
+ case 1:
28
+ if (tag !== 10) break;
29
+ message.typeUrl = reader.string();
30
+ continue;
31
+ case 2:
32
+ if (tag !== 18) break;
33
+ message.value = Buffer.from(reader.bytes());
34
+ continue;
35
+ }
36
+ if ((tag & 7) === 4 || tag === 0) break;
37
+ reader.skip(tag & 7);
38
+ }
39
+ return message;
40
+ } finally {
41
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
42
+ }
43
+ },
44
+ fromJSON(object) {
45
+ return {
46
+ typeUrl: isSet$2(object.typeUrl) ? globalThis.String(object.typeUrl) : isSet$2(object.type_url) ? globalThis.String(object.type_url) : "",
47
+ value: isSet$2(object.value) ? Buffer.from(bytesFromBase64$2(object.value)) : Buffer.alloc(0)
48
+ };
49
+ },
50
+ toJSON(message) {
51
+ const obj = {};
52
+ if (message.typeUrl !== "") obj.typeUrl = message.typeUrl;
53
+ if (message.value.length !== 0) obj.value = base64FromBytes$2(message.value);
54
+ return obj;
55
+ },
56
+ create(base) {
57
+ return Any.fromPartial(base ?? {});
58
+ },
59
+ fromPartial(object) {
60
+ const message = createBaseAny();
61
+ message.typeUrl = object.typeUrl ?? "";
62
+ message.value = object.value ?? Buffer.alloc(0);
63
+ return message;
64
+ }
65
+ };
66
+ function bytesFromBase64$2(b64) {
67
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
68
+ }
69
+ function base64FromBytes$2(arr) {
70
+ return globalThis.Buffer.from(arr).toString("base64");
71
+ }
72
+ function isSet$2(value) {
73
+ return value !== null && value !== void 0;
74
+ }
75
+ // gen/cosmos/crypto/multisig/v1beta1/multisig.ts
76
+ function createBaseCompactBitArray() {
77
+ return {
78
+ extraBitsStored: 0,
79
+ elems: Buffer.alloc(0)
80
+ };
81
+ }
82
+ const CompactBitArray = {
83
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
84
+ if (message.extraBitsStored !== 0) writer.uint32(8).uint32(message.extraBitsStored);
85
+ if (message.elems.length !== 0) writer.uint32(18).bytes(message.elems);
86
+ return writer;
87
+ },
88
+ decode(input, length) {
89
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
90
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
91
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
92
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
93
+ try {
94
+ const end = length === void 0 ? reader.len : reader.pos + length;
95
+ const message = createBaseCompactBitArray();
96
+ while (reader.pos < end) {
97
+ const tag = reader.uint32();
98
+ switch (tag >>> 3) {
99
+ case 1:
100
+ if (tag !== 8) break;
101
+ message.extraBitsStored = reader.uint32();
102
+ continue;
103
+ case 2:
104
+ if (tag !== 18) break;
105
+ message.elems = Buffer.from(reader.bytes());
106
+ continue;
107
+ }
108
+ if ((tag & 7) === 4 || tag === 0) break;
109
+ reader.skip(tag & 7);
110
+ }
111
+ return message;
112
+ } finally {
113
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
114
+ }
115
+ },
116
+ fromJSON(object) {
117
+ return {
118
+ extraBitsStored: isSet$1(object.extraBitsStored) ? globalThis.Number(object.extraBitsStored) : isSet$1(object.extra_bits_stored) ? globalThis.Number(object.extra_bits_stored) : 0,
119
+ elems: isSet$1(object.elems) ? Buffer.from(bytesFromBase64$1(object.elems)) : Buffer.alloc(0)
120
+ };
121
+ },
122
+ toJSON(message) {
123
+ const obj = {};
124
+ if (message.extraBitsStored !== 0) obj.extraBitsStored = Math.round(message.extraBitsStored);
125
+ if (message.elems.length !== 0) obj.elems = base64FromBytes$1(message.elems);
126
+ return obj;
127
+ },
128
+ create(base) {
129
+ return CompactBitArray.fromPartial(base ?? {});
130
+ },
131
+ fromPartial(object) {
132
+ const message = createBaseCompactBitArray();
133
+ message.extraBitsStored = object.extraBitsStored ?? 0;
134
+ message.elems = object.elems ?? Buffer.alloc(0);
135
+ return message;
136
+ }
137
+ };
138
+ function bytesFromBase64$1(b64) {
139
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
140
+ }
141
+ function base64FromBytes$1(arr) {
142
+ return globalThis.Buffer.from(arr).toString("base64");
143
+ }
144
+ function isSet$1(value) {
145
+ return value !== null && value !== void 0;
146
+ }
147
+ // gen/cosmos/tx/signing/v1beta1/signing.ts
148
+ /**
149
+ * SignMode represents a signing mode with its own security guarantees.
150
+ *
151
+ * This enum should be considered a registry of all known sign modes
152
+ * in the Cosmos ecosystem. Apps are not expected to support all known
153
+ * sign modes. Apps that would like to support custom sign modes are
154
+ * encouraged to open a small PR against this file to add a new case
155
+ * to this SignMode enum describing their sign mode so that different
156
+ * apps have a consistent version of this enum.
157
+ */
158
+ let SignMode = /* @__PURE__ */ function(SignMode) {
159
+ /**
160
+ * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
161
+ * rejected.
162
+ */
163
+ SignMode[SignMode["SIGN_MODE_UNSPECIFIED"] = 0] = "SIGN_MODE_UNSPECIFIED";
164
+ /**
165
+ * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
166
+ * verified with raw bytes from Tx.
167
+ */
168
+ SignMode[SignMode["SIGN_MODE_DIRECT"] = 1] = "SIGN_MODE_DIRECT";
169
+ /**
170
+ * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
171
+ * human-readable textual representation on top of the binary representation
172
+ * from SIGN_MODE_DIRECT.
173
+ *
174
+ * Since: cosmos-sdk 0.50
175
+ */
176
+ SignMode[SignMode["SIGN_MODE_TEXTUAL"] = 2] = "SIGN_MODE_TEXTUAL";
177
+ /**
178
+ * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
179
+ * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
180
+ * require signers signing over other signers' `signer_info`.
181
+ *
182
+ * Since: cosmos-sdk 0.46
183
+ */
184
+ SignMode[SignMode["SIGN_MODE_DIRECT_AUX"] = 3] = "SIGN_MODE_DIRECT_AUX";
185
+ /**
186
+ * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
187
+ * Amino JSON and will be removed in the future.
188
+ */
189
+ SignMode[SignMode["SIGN_MODE_LEGACY_AMINO_JSON"] = 127] = "SIGN_MODE_LEGACY_AMINO_JSON";
190
+ /**
191
+ * SIGN_MODE_EIP712_V2 - Injective EIP712 support for any cosmos messages which uses proto-json encoded string for messages
192
+ * Signature verification is implemented in injective core
193
+ */
194
+ SignMode[SignMode["SIGN_MODE_EIP712_V2"] = 128] = "SIGN_MODE_EIP712_V2";
195
+ /**
196
+ * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
197
+ * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
198
+ *
199
+ * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
200
+ * but is not implemented on the SDK by default. To enable EIP-191, you need
201
+ * to pass a custom `TxConfig` that has an implementation of
202
+ * `SignModeHandler` for EIP-191. The SDK may decide to fully support
203
+ * EIP-191 in the future.
204
+ *
205
+ * Since: cosmos-sdk 0.45.2
206
+ */
207
+ SignMode[SignMode["SIGN_MODE_EIP_191"] = 191] = "SIGN_MODE_EIP_191";
208
+ SignMode[SignMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
209
+ return SignMode;
210
+ }({});
211
+ function signModeFromJSON(object) {
212
+ switch (object) {
213
+ case 0:
214
+ case "SIGN_MODE_UNSPECIFIED": return 0;
215
+ case 1:
216
+ case "SIGN_MODE_DIRECT": return 1;
217
+ case 2:
218
+ case "SIGN_MODE_TEXTUAL": return 2;
219
+ case 3:
220
+ case "SIGN_MODE_DIRECT_AUX": return 3;
221
+ case 127:
222
+ case "SIGN_MODE_LEGACY_AMINO_JSON": return 127;
223
+ case 128:
224
+ case "SIGN_MODE_EIP712_V2": return 128;
225
+ case 191:
226
+ case "SIGN_MODE_EIP_191": return 191;
227
+ default: return -1;
228
+ }
229
+ }
230
+ function signModeToJSON(object) {
231
+ switch (object) {
232
+ case 0: return "SIGN_MODE_UNSPECIFIED";
233
+ case 1: return "SIGN_MODE_DIRECT";
234
+ case 2: return "SIGN_MODE_TEXTUAL";
235
+ case 3: return "SIGN_MODE_DIRECT_AUX";
236
+ case 127: return "SIGN_MODE_LEGACY_AMINO_JSON";
237
+ case 128: return "SIGN_MODE_EIP712_V2";
238
+ case 191: return "SIGN_MODE_EIP_191";
239
+ default: return "UNRECOGNIZED";
240
+ }
241
+ }
242
+ // gen/cosmos/tx/v1beta1/tx.ts
243
+ function createBaseTx() {
244
+ return {
245
+ body: void 0,
246
+ authInfo: void 0,
247
+ signatures: []
248
+ };
249
+ }
250
+ const Tx = {
251
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
252
+ if (message.body !== void 0) TxBody.encode(message.body, writer.uint32(10).fork()).join();
253
+ if (message.authInfo !== void 0) AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).join();
254
+ for (const v of message.signatures) writer.uint32(26).bytes(v);
255
+ return writer;
256
+ },
257
+ decode(input, length) {
258
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
259
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
260
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
261
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
262
+ try {
263
+ const end = length === void 0 ? reader.len : reader.pos + length;
264
+ const message = createBaseTx();
265
+ while (reader.pos < end) {
266
+ const tag = reader.uint32();
267
+ switch (tag >>> 3) {
268
+ case 1:
269
+ if (tag !== 10) break;
270
+ message.body = TxBody.decode(reader, reader.uint32());
271
+ continue;
272
+ case 2:
273
+ if (tag !== 18) break;
274
+ message.authInfo = AuthInfo.decode(reader, reader.uint32());
275
+ continue;
276
+ case 3:
277
+ if (tag !== 26) break;
278
+ message.signatures.push(Buffer.from(reader.bytes()));
279
+ continue;
280
+ }
281
+ if ((tag & 7) === 4 || tag === 0) break;
282
+ reader.skip(tag & 7);
283
+ }
284
+ return message;
285
+ } finally {
286
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
287
+ }
288
+ },
289
+ fromJSON(object) {
290
+ return {
291
+ body: isSet(object.body) ? TxBody.fromJSON(object.body) : void 0,
292
+ authInfo: isSet(object.authInfo) ? AuthInfo.fromJSON(object.authInfo) : isSet(object.auth_info) ? AuthInfo.fromJSON(object.auth_info) : void 0,
293
+ signatures: globalThis.Array.isArray(object?.signatures) ? object.signatures.map((e) => Buffer.from(bytesFromBase64(e))) : []
294
+ };
295
+ },
296
+ toJSON(message) {
297
+ const obj = {};
298
+ if (message.body !== void 0) obj.body = TxBody.toJSON(message.body);
299
+ if (message.authInfo !== void 0) obj.authInfo = AuthInfo.toJSON(message.authInfo);
300
+ if (message.signatures?.length) obj.signatures = message.signatures.map((e) => base64FromBytes(e));
301
+ return obj;
302
+ },
303
+ create(base) {
304
+ return Tx.fromPartial(base ?? {});
305
+ },
306
+ fromPartial(object) {
307
+ const message = createBaseTx();
308
+ message.body = object.body !== void 0 && object.body !== null ? TxBody.fromPartial(object.body) : void 0;
309
+ message.authInfo = object.authInfo !== void 0 && object.authInfo !== null ? AuthInfo.fromPartial(object.authInfo) : void 0;
310
+ message.signatures = object.signatures?.map((e) => e) || [];
311
+ return message;
312
+ }
313
+ };
314
+ function createBaseTxRaw() {
315
+ return {
316
+ bodyBytes: Buffer.alloc(0),
317
+ authInfoBytes: Buffer.alloc(0),
318
+ signatures: []
319
+ };
320
+ }
321
+ const TxRaw = {
322
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
323
+ if (message.bodyBytes.length !== 0) writer.uint32(10).bytes(message.bodyBytes);
324
+ if (message.authInfoBytes.length !== 0) writer.uint32(18).bytes(message.authInfoBytes);
325
+ for (const v of message.signatures) writer.uint32(26).bytes(v);
326
+ return writer;
327
+ },
328
+ decode(input, length) {
329
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
330
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
331
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
332
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
333
+ try {
334
+ const end = length === void 0 ? reader.len : reader.pos + length;
335
+ const message = createBaseTxRaw();
336
+ while (reader.pos < end) {
337
+ const tag = reader.uint32();
338
+ switch (tag >>> 3) {
339
+ case 1:
340
+ if (tag !== 10) break;
341
+ message.bodyBytes = Buffer.from(reader.bytes());
342
+ continue;
343
+ case 2:
344
+ if (tag !== 18) break;
345
+ message.authInfoBytes = Buffer.from(reader.bytes());
346
+ continue;
347
+ case 3:
348
+ if (tag !== 26) break;
349
+ message.signatures.push(Buffer.from(reader.bytes()));
350
+ continue;
351
+ }
352
+ if ((tag & 7) === 4 || tag === 0) break;
353
+ reader.skip(tag & 7);
354
+ }
355
+ return message;
356
+ } finally {
357
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
358
+ }
359
+ },
360
+ fromJSON(object) {
361
+ return {
362
+ bodyBytes: isSet(object.bodyBytes) ? Buffer.from(bytesFromBase64(object.bodyBytes)) : isSet(object.body_bytes) ? Buffer.from(bytesFromBase64(object.body_bytes)) : Buffer.alloc(0),
363
+ authInfoBytes: isSet(object.authInfoBytes) ? Buffer.from(bytesFromBase64(object.authInfoBytes)) : isSet(object.auth_info_bytes) ? Buffer.from(bytesFromBase64(object.auth_info_bytes)) : Buffer.alloc(0),
364
+ signatures: globalThis.Array.isArray(object?.signatures) ? object.signatures.map((e) => Buffer.from(bytesFromBase64(e))) : []
365
+ };
366
+ },
367
+ toJSON(message) {
368
+ const obj = {};
369
+ if (message.bodyBytes.length !== 0) obj.bodyBytes = base64FromBytes(message.bodyBytes);
370
+ if (message.authInfoBytes.length !== 0) obj.authInfoBytes = base64FromBytes(message.authInfoBytes);
371
+ if (message.signatures?.length) obj.signatures = message.signatures.map((e) => base64FromBytes(e));
372
+ return obj;
373
+ },
374
+ create(base) {
375
+ return TxRaw.fromPartial(base ?? {});
376
+ },
377
+ fromPartial(object) {
378
+ const message = createBaseTxRaw();
379
+ message.bodyBytes = object.bodyBytes ?? Buffer.alloc(0);
380
+ message.authInfoBytes = object.authInfoBytes ?? Buffer.alloc(0);
381
+ message.signatures = object.signatures?.map((e) => e) || [];
382
+ return message;
383
+ }
384
+ };
385
+ function createBaseSignDoc() {
386
+ return {
387
+ bodyBytes: Buffer.alloc(0),
388
+ authInfoBytes: Buffer.alloc(0),
389
+ chainId: "",
390
+ accountNumber: 0
391
+ };
392
+ }
393
+ const SignDoc = {
394
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
395
+ if (message.bodyBytes.length !== 0) writer.uint32(10).bytes(message.bodyBytes);
396
+ if (message.authInfoBytes.length !== 0) writer.uint32(18).bytes(message.authInfoBytes);
397
+ if (message.chainId !== "") writer.uint32(26).string(message.chainId);
398
+ if (message.accountNumber !== 0) writer.uint32(32).uint64(message.accountNumber);
399
+ return writer;
400
+ },
401
+ decode(input, length) {
402
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
403
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
404
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
405
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
406
+ try {
407
+ const end = length === void 0 ? reader.len : reader.pos + length;
408
+ const message = createBaseSignDoc();
409
+ while (reader.pos < end) {
410
+ const tag = reader.uint32();
411
+ switch (tag >>> 3) {
412
+ case 1:
413
+ if (tag !== 10) break;
414
+ message.bodyBytes = Buffer.from(reader.bytes());
415
+ continue;
416
+ case 2:
417
+ if (tag !== 18) break;
418
+ message.authInfoBytes = Buffer.from(reader.bytes());
419
+ continue;
420
+ case 3:
421
+ if (tag !== 26) break;
422
+ message.chainId = reader.string();
423
+ continue;
424
+ case 4:
425
+ if (tag !== 32) break;
426
+ message.accountNumber = longToNumber(reader.uint64());
427
+ continue;
428
+ }
429
+ if ((tag & 7) === 4 || tag === 0) break;
430
+ reader.skip(tag & 7);
431
+ }
432
+ return message;
433
+ } finally {
434
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
435
+ }
436
+ },
437
+ fromJSON(object) {
438
+ return {
439
+ bodyBytes: isSet(object.bodyBytes) ? Buffer.from(bytesFromBase64(object.bodyBytes)) : isSet(object.body_bytes) ? Buffer.from(bytesFromBase64(object.body_bytes)) : Buffer.alloc(0),
440
+ authInfoBytes: isSet(object.authInfoBytes) ? Buffer.from(bytesFromBase64(object.authInfoBytes)) : isSet(object.auth_info_bytes) ? Buffer.from(bytesFromBase64(object.auth_info_bytes)) : Buffer.alloc(0),
441
+ chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : isSet(object.chain_id) ? globalThis.String(object.chain_id) : "",
442
+ accountNumber: isSet(object.accountNumber) ? globalThis.Number(object.accountNumber) : isSet(object.account_number) ? globalThis.Number(object.account_number) : 0
443
+ };
444
+ },
445
+ toJSON(message) {
446
+ const obj = {};
447
+ if (message.bodyBytes.length !== 0) obj.bodyBytes = base64FromBytes(message.bodyBytes);
448
+ if (message.authInfoBytes.length !== 0) obj.authInfoBytes = base64FromBytes(message.authInfoBytes);
449
+ if (message.chainId !== "") obj.chainId = message.chainId;
450
+ if (message.accountNumber !== 0) obj.accountNumber = Math.round(message.accountNumber);
451
+ return obj;
452
+ },
453
+ create(base) {
454
+ return SignDoc.fromPartial(base ?? {});
455
+ },
456
+ fromPartial(object) {
457
+ const message = createBaseSignDoc();
458
+ message.bodyBytes = object.bodyBytes ?? Buffer.alloc(0);
459
+ message.authInfoBytes = object.authInfoBytes ?? Buffer.alloc(0);
460
+ message.chainId = object.chainId ?? "";
461
+ message.accountNumber = object.accountNumber ?? 0;
462
+ return message;
463
+ }
464
+ };
465
+ function createBaseTxBody() {
466
+ return {
467
+ messages: [],
468
+ memo: "",
469
+ timeoutHeight: 0,
470
+ extensionOptions: [],
471
+ nonCriticalExtensionOptions: []
472
+ };
473
+ }
474
+ const TxBody = {
475
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
476
+ for (const v of message.messages) Any.encode(v, writer.uint32(10).fork()).join();
477
+ if (message.memo !== "") writer.uint32(18).string(message.memo);
478
+ if (message.timeoutHeight !== 0) writer.uint32(24).uint64(message.timeoutHeight);
479
+ for (const v of message.extensionOptions) Any.encode(v, writer.uint32(8186).fork()).join();
480
+ for (const v of message.nonCriticalExtensionOptions) Any.encode(v, writer.uint32(16378).fork()).join();
481
+ return writer;
482
+ },
483
+ decode(input, length) {
484
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
485
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
486
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
487
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
488
+ try {
489
+ const end = length === void 0 ? reader.len : reader.pos + length;
490
+ const message = createBaseTxBody();
491
+ while (reader.pos < end) {
492
+ const tag = reader.uint32();
493
+ switch (tag >>> 3) {
494
+ case 1:
495
+ if (tag !== 10) break;
496
+ message.messages.push(Any.decode(reader, reader.uint32()));
497
+ continue;
498
+ case 2:
499
+ if (tag !== 18) break;
500
+ message.memo = reader.string();
501
+ continue;
502
+ case 3:
503
+ if (tag !== 24) break;
504
+ message.timeoutHeight = longToNumber(reader.uint64());
505
+ continue;
506
+ case 1023:
507
+ if (tag !== 8186) break;
508
+ message.extensionOptions.push(Any.decode(reader, reader.uint32()));
509
+ continue;
510
+ case 2047:
511
+ if (tag !== 16378) break;
512
+ message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32()));
513
+ continue;
514
+ }
515
+ if ((tag & 7) === 4 || tag === 0) break;
516
+ reader.skip(tag & 7);
517
+ }
518
+ return message;
519
+ } finally {
520
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
521
+ }
522
+ },
523
+ fromJSON(object) {
524
+ return {
525
+ messages: globalThis.Array.isArray(object?.messages) ? object.messages.map((e) => Any.fromJSON(e)) : [],
526
+ memo: isSet(object.memo) ? globalThis.String(object.memo) : "",
527
+ timeoutHeight: isSet(object.timeoutHeight) ? globalThis.Number(object.timeoutHeight) : isSet(object.timeout_height) ? globalThis.Number(object.timeout_height) : 0,
528
+ extensionOptions: globalThis.Array.isArray(object?.extensionOptions) ? object.extensionOptions.map((e) => Any.fromJSON(e)) : globalThis.Array.isArray(object?.extension_options) ? object.extension_options.map((e) => Any.fromJSON(e)) : [],
529
+ nonCriticalExtensionOptions: globalThis.Array.isArray(object?.nonCriticalExtensionOptions) ? object.nonCriticalExtensionOptions.map((e) => Any.fromJSON(e)) : globalThis.Array.isArray(object?.non_critical_extension_options) ? object.non_critical_extension_options.map((e) => Any.fromJSON(e)) : []
530
+ };
531
+ },
532
+ toJSON(message) {
533
+ const obj = {};
534
+ if (message.messages?.length) obj.messages = message.messages.map((e) => Any.toJSON(e));
535
+ if (message.memo !== "") obj.memo = message.memo;
536
+ if (message.timeoutHeight !== 0) obj.timeoutHeight = Math.round(message.timeoutHeight);
537
+ if (message.extensionOptions?.length) obj.extensionOptions = message.extensionOptions.map((e) => Any.toJSON(e));
538
+ if (message.nonCriticalExtensionOptions?.length) obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => Any.toJSON(e));
539
+ return obj;
540
+ },
541
+ create(base) {
542
+ return TxBody.fromPartial(base ?? {});
543
+ },
544
+ fromPartial(object) {
545
+ const message = createBaseTxBody();
546
+ message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [];
547
+ message.memo = object.memo ?? "";
548
+ message.timeoutHeight = object.timeoutHeight ?? 0;
549
+ message.extensionOptions = object.extensionOptions?.map((e) => Any.fromPartial(e)) || [];
550
+ message.nonCriticalExtensionOptions = object.nonCriticalExtensionOptions?.map((e) => Any.fromPartial(e)) || [];
551
+ return message;
552
+ }
553
+ };
554
+ function createBaseAuthInfo() {
555
+ return {
556
+ signerInfos: [],
557
+ fee: void 0,
558
+ tip: void 0
559
+ };
560
+ }
561
+ const AuthInfo = {
562
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
563
+ for (const v of message.signerInfos) SignerInfo.encode(v, writer.uint32(10).fork()).join();
564
+ if (message.fee !== void 0) Fee.encode(message.fee, writer.uint32(18).fork()).join();
565
+ if (message.tip !== void 0) Tip.encode(message.tip, writer.uint32(26).fork()).join();
566
+ return writer;
567
+ },
568
+ decode(input, length) {
569
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
570
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
571
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
572
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
573
+ try {
574
+ const end = length === void 0 ? reader.len : reader.pos + length;
575
+ const message = createBaseAuthInfo();
576
+ while (reader.pos < end) {
577
+ const tag = reader.uint32();
578
+ switch (tag >>> 3) {
579
+ case 1:
580
+ if (tag !== 10) break;
581
+ message.signerInfos.push(SignerInfo.decode(reader, reader.uint32()));
582
+ continue;
583
+ case 2:
584
+ if (tag !== 18) break;
585
+ message.fee = Fee.decode(reader, reader.uint32());
586
+ continue;
587
+ case 3:
588
+ if (tag !== 26) break;
589
+ message.tip = Tip.decode(reader, reader.uint32());
590
+ continue;
591
+ }
592
+ if ((tag & 7) === 4 || tag === 0) break;
593
+ reader.skip(tag & 7);
594
+ }
595
+ return message;
596
+ } finally {
597
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
598
+ }
599
+ },
600
+ fromJSON(object) {
601
+ return {
602
+ signerInfos: globalThis.Array.isArray(object?.signerInfos) ? object.signerInfos.map((e) => SignerInfo.fromJSON(e)) : globalThis.Array.isArray(object?.signer_infos) ? object.signer_infos.map((e) => SignerInfo.fromJSON(e)) : [],
603
+ fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : void 0,
604
+ tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : void 0
605
+ };
606
+ },
607
+ toJSON(message) {
608
+ const obj = {};
609
+ if (message.signerInfos?.length) obj.signerInfos = message.signerInfos.map((e) => SignerInfo.toJSON(e));
610
+ if (message.fee !== void 0) obj.fee = Fee.toJSON(message.fee);
611
+ if (message.tip !== void 0) obj.tip = Tip.toJSON(message.tip);
612
+ return obj;
613
+ },
614
+ create(base) {
615
+ return AuthInfo.fromPartial(base ?? {});
616
+ },
617
+ fromPartial(object) {
618
+ const message = createBaseAuthInfo();
619
+ message.signerInfos = object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || [];
620
+ message.fee = object.fee !== void 0 && object.fee !== null ? Fee.fromPartial(object.fee) : void 0;
621
+ message.tip = object.tip !== void 0 && object.tip !== null ? Tip.fromPartial(object.tip) : void 0;
622
+ return message;
623
+ }
624
+ };
625
+ function createBaseSignerInfo() {
626
+ return {
627
+ publicKey: void 0,
628
+ modeInfo: void 0,
629
+ sequence: 0
630
+ };
631
+ }
632
+ const SignerInfo = {
633
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
634
+ if (message.publicKey !== void 0) Any.encode(message.publicKey, writer.uint32(10).fork()).join();
635
+ if (message.modeInfo !== void 0) ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).join();
636
+ if (message.sequence !== 0) writer.uint32(24).uint64(message.sequence);
637
+ return writer;
638
+ },
639
+ decode(input, length) {
640
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
641
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
642
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
643
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
644
+ try {
645
+ const end = length === void 0 ? reader.len : reader.pos + length;
646
+ const message = createBaseSignerInfo();
647
+ while (reader.pos < end) {
648
+ const tag = reader.uint32();
649
+ switch (tag >>> 3) {
650
+ case 1:
651
+ if (tag !== 10) break;
652
+ message.publicKey = Any.decode(reader, reader.uint32());
653
+ continue;
654
+ case 2:
655
+ if (tag !== 18) break;
656
+ message.modeInfo = ModeInfo.decode(reader, reader.uint32());
657
+ continue;
658
+ case 3:
659
+ if (tag !== 24) break;
660
+ message.sequence = longToNumber(reader.uint64());
661
+ continue;
662
+ }
663
+ if ((tag & 7) === 4 || tag === 0) break;
664
+ reader.skip(tag & 7);
665
+ }
666
+ return message;
667
+ } finally {
668
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
669
+ }
670
+ },
671
+ fromJSON(object) {
672
+ return {
673
+ publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : isSet(object.public_key) ? Any.fromJSON(object.public_key) : void 0,
674
+ modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : isSet(object.mode_info) ? ModeInfo.fromJSON(object.mode_info) : void 0,
675
+ sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0
676
+ };
677
+ },
678
+ toJSON(message) {
679
+ const obj = {};
680
+ if (message.publicKey !== void 0) obj.publicKey = Any.toJSON(message.publicKey);
681
+ if (message.modeInfo !== void 0) obj.modeInfo = ModeInfo.toJSON(message.modeInfo);
682
+ if (message.sequence !== 0) obj.sequence = Math.round(message.sequence);
683
+ return obj;
684
+ },
685
+ create(base) {
686
+ return SignerInfo.fromPartial(base ?? {});
687
+ },
688
+ fromPartial(object) {
689
+ const message = createBaseSignerInfo();
690
+ message.publicKey = object.publicKey !== void 0 && object.publicKey !== null ? Any.fromPartial(object.publicKey) : void 0;
691
+ message.modeInfo = object.modeInfo !== void 0 && object.modeInfo !== null ? ModeInfo.fromPartial(object.modeInfo) : void 0;
692
+ message.sequence = object.sequence ?? 0;
693
+ return message;
694
+ }
695
+ };
696
+ function createBaseModeInfo() {
697
+ return {
698
+ single: void 0,
699
+ multi: void 0
700
+ };
701
+ }
702
+ const ModeInfo = {
703
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
704
+ if (message.single !== void 0) ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).join();
705
+ if (message.multi !== void 0) ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).join();
706
+ return writer;
707
+ },
708
+ decode(input, length) {
709
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
710
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
711
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
712
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
713
+ try {
714
+ const end = length === void 0 ? reader.len : reader.pos + length;
715
+ const message = createBaseModeInfo();
716
+ while (reader.pos < end) {
717
+ const tag = reader.uint32();
718
+ switch (tag >>> 3) {
719
+ case 1:
720
+ if (tag !== 10) break;
721
+ message.single = ModeInfo_Single.decode(reader, reader.uint32());
722
+ continue;
723
+ case 2:
724
+ if (tag !== 18) break;
725
+ message.multi = ModeInfo_Multi.decode(reader, reader.uint32());
726
+ continue;
727
+ }
728
+ if ((tag & 7) === 4 || tag === 0) break;
729
+ reader.skip(tag & 7);
730
+ }
731
+ return message;
732
+ } finally {
733
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
734
+ }
735
+ },
736
+ fromJSON(object) {
737
+ return {
738
+ single: isSet(object.single) ? ModeInfo_Single.fromJSON(object.single) : void 0,
739
+ multi: isSet(object.multi) ? ModeInfo_Multi.fromJSON(object.multi) : void 0
740
+ };
741
+ },
742
+ toJSON(message) {
743
+ const obj = {};
744
+ if (message.single !== void 0) obj.single = ModeInfo_Single.toJSON(message.single);
745
+ if (message.multi !== void 0) obj.multi = ModeInfo_Multi.toJSON(message.multi);
746
+ return obj;
747
+ },
748
+ create(base) {
749
+ return ModeInfo.fromPartial(base ?? {});
750
+ },
751
+ fromPartial(object) {
752
+ const message = createBaseModeInfo();
753
+ message.single = object.single !== void 0 && object.single !== null ? ModeInfo_Single.fromPartial(object.single) : void 0;
754
+ message.multi = object.multi !== void 0 && object.multi !== null ? ModeInfo_Multi.fromPartial(object.multi) : void 0;
755
+ return message;
756
+ }
757
+ };
758
+ function createBaseModeInfo_Single() {
759
+ return { mode: 0 };
760
+ }
761
+ const ModeInfo_Single = {
762
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
763
+ if (message.mode !== 0) writer.uint32(8).int32(message.mode);
764
+ return writer;
765
+ },
766
+ decode(input, length) {
767
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
768
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
769
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
770
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
771
+ try {
772
+ const end = length === void 0 ? reader.len : reader.pos + length;
773
+ const message = createBaseModeInfo_Single();
774
+ while (reader.pos < end) {
775
+ const tag = reader.uint32();
776
+ switch (tag >>> 3) {
777
+ case 1:
778
+ if (tag !== 8) break;
779
+ message.mode = reader.int32();
780
+ continue;
781
+ }
782
+ if ((tag & 7) === 4 || tag === 0) break;
783
+ reader.skip(tag & 7);
784
+ }
785
+ return message;
786
+ } finally {
787
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
788
+ }
789
+ },
790
+ fromJSON(object) {
791
+ return { mode: isSet(object.mode) ? signModeFromJSON(object.mode) : 0 };
792
+ },
793
+ toJSON(message) {
794
+ const obj = {};
795
+ if (message.mode !== 0) obj.mode = signModeToJSON(message.mode);
796
+ return obj;
797
+ },
798
+ create(base) {
799
+ return ModeInfo_Single.fromPartial(base ?? {});
800
+ },
801
+ fromPartial(object) {
802
+ const message = createBaseModeInfo_Single();
803
+ message.mode = object.mode ?? 0;
804
+ return message;
805
+ }
806
+ };
807
+ function createBaseModeInfo_Multi() {
808
+ return {
809
+ bitarray: void 0,
810
+ modeInfos: []
811
+ };
812
+ }
813
+ const ModeInfo_Multi = {
814
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
815
+ if (message.bitarray !== void 0) CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).join();
816
+ for (const v of message.modeInfos) ModeInfo.encode(v, writer.uint32(18).fork()).join();
817
+ return writer;
818
+ },
819
+ decode(input, length) {
820
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
821
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
822
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
823
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
824
+ try {
825
+ const end = length === void 0 ? reader.len : reader.pos + length;
826
+ const message = createBaseModeInfo_Multi();
827
+ while (reader.pos < end) {
828
+ const tag = reader.uint32();
829
+ switch (tag >>> 3) {
830
+ case 1:
831
+ if (tag !== 10) break;
832
+ message.bitarray = CompactBitArray.decode(reader, reader.uint32());
833
+ continue;
834
+ case 2:
835
+ if (tag !== 18) break;
836
+ message.modeInfos.push(ModeInfo.decode(reader, reader.uint32()));
837
+ continue;
838
+ }
839
+ if ((tag & 7) === 4 || tag === 0) break;
840
+ reader.skip(tag & 7);
841
+ }
842
+ return message;
843
+ } finally {
844
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
845
+ }
846
+ },
847
+ fromJSON(object) {
848
+ return {
849
+ bitarray: isSet(object.bitarray) ? CompactBitArray.fromJSON(object.bitarray) : void 0,
850
+ modeInfos: globalThis.Array.isArray(object?.modeInfos) ? object.modeInfos.map((e) => ModeInfo.fromJSON(e)) : globalThis.Array.isArray(object?.mode_infos) ? object.mode_infos.map((e) => ModeInfo.fromJSON(e)) : []
851
+ };
852
+ },
853
+ toJSON(message) {
854
+ const obj = {};
855
+ if (message.bitarray !== void 0) obj.bitarray = CompactBitArray.toJSON(message.bitarray);
856
+ if (message.modeInfos?.length) obj.modeInfos = message.modeInfos.map((e) => ModeInfo.toJSON(e));
857
+ return obj;
858
+ },
859
+ create(base) {
860
+ return ModeInfo_Multi.fromPartial(base ?? {});
861
+ },
862
+ fromPartial(object) {
863
+ const message = createBaseModeInfo_Multi();
864
+ message.bitarray = object.bitarray !== void 0 && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : void 0;
865
+ message.modeInfos = object.modeInfos?.map((e) => ModeInfo.fromPartial(e)) || [];
866
+ return message;
867
+ }
868
+ };
869
+ function createBaseFee() {
870
+ return {
871
+ amount: [],
872
+ gasLimit: 0,
873
+ payer: "",
874
+ granter: ""
875
+ };
876
+ }
877
+ const Fee = {
878
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
879
+ for (const v of message.amount) require_coin.Coin.encode(v, writer.uint32(10).fork()).join();
880
+ if (message.gasLimit !== 0) writer.uint32(16).uint64(message.gasLimit);
881
+ if (message.payer !== "") writer.uint32(26).string(message.payer);
882
+ if (message.granter !== "") writer.uint32(34).string(message.granter);
883
+ return writer;
884
+ },
885
+ decode(input, length) {
886
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
887
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
888
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
889
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
890
+ try {
891
+ const end = length === void 0 ? reader.len : reader.pos + length;
892
+ const message = createBaseFee();
893
+ while (reader.pos < end) {
894
+ const tag = reader.uint32();
895
+ switch (tag >>> 3) {
896
+ case 1:
897
+ if (tag !== 10) break;
898
+ message.amount.push(require_coin.Coin.decode(reader, reader.uint32()));
899
+ continue;
900
+ case 2:
901
+ if (tag !== 16) break;
902
+ message.gasLimit = longToNumber(reader.uint64());
903
+ continue;
904
+ case 3:
905
+ if (tag !== 26) break;
906
+ message.payer = reader.string();
907
+ continue;
908
+ case 4:
909
+ if (tag !== 34) break;
910
+ message.granter = reader.string();
911
+ continue;
912
+ }
913
+ if ((tag & 7) === 4 || tag === 0) break;
914
+ reader.skip(tag & 7);
915
+ }
916
+ return message;
917
+ } finally {
918
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
919
+ }
920
+ },
921
+ fromJSON(object) {
922
+ return {
923
+ amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => require_coin.Coin.fromJSON(e)) : [],
924
+ gasLimit: isSet(object.gasLimit) ? globalThis.Number(object.gasLimit) : isSet(object.gas_limit) ? globalThis.Number(object.gas_limit) : 0,
925
+ payer: isSet(object.payer) ? globalThis.String(object.payer) : "",
926
+ granter: isSet(object.granter) ? globalThis.String(object.granter) : ""
927
+ };
928
+ },
929
+ toJSON(message) {
930
+ const obj = {};
931
+ if (message.amount?.length) obj.amount = message.amount.map((e) => require_coin.Coin.toJSON(e));
932
+ if (message.gasLimit !== 0) obj.gasLimit = Math.round(message.gasLimit);
933
+ if (message.payer !== "") obj.payer = message.payer;
934
+ if (message.granter !== "") obj.granter = message.granter;
935
+ return obj;
936
+ },
937
+ create(base) {
938
+ return Fee.fromPartial(base ?? {});
939
+ },
940
+ fromPartial(object) {
941
+ const message = createBaseFee();
942
+ message.amount = object.amount?.map((e) => require_coin.Coin.fromPartial(e)) || [];
943
+ message.gasLimit = object.gasLimit ?? 0;
944
+ message.payer = object.payer ?? "";
945
+ message.granter = object.granter ?? "";
946
+ return message;
947
+ }
948
+ };
949
+ function createBaseTip() {
950
+ return {
951
+ amount: [],
952
+ tipper: ""
953
+ };
954
+ }
955
+ const Tip = {
956
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
957
+ for (const v of message.amount) require_coin.Coin.encode(v, writer.uint32(10).fork()).join();
958
+ if (message.tipper !== "") writer.uint32(18).string(message.tipper);
959
+ return writer;
960
+ },
961
+ decode(input, length) {
962
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
963
+ const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
964
+ if (previousRecursionDepth >= 100) throw new globalThis.Error("protobuf decode recursion limit exceeded");
965
+ reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
966
+ try {
967
+ const end = length === void 0 ? reader.len : reader.pos + length;
968
+ const message = createBaseTip();
969
+ while (reader.pos < end) {
970
+ const tag = reader.uint32();
971
+ switch (tag >>> 3) {
972
+ case 1:
973
+ if (tag !== 10) break;
974
+ message.amount.push(require_coin.Coin.decode(reader, reader.uint32()));
975
+ continue;
976
+ case 2:
977
+ if (tag !== 18) break;
978
+ message.tipper = reader.string();
979
+ continue;
980
+ }
981
+ if ((tag & 7) === 4 || tag === 0) break;
982
+ reader.skip(tag & 7);
983
+ }
984
+ return message;
985
+ } finally {
986
+ reader.__tsProtoDecodeDepth = previousRecursionDepth;
987
+ }
988
+ },
989
+ fromJSON(object) {
990
+ return {
991
+ amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => require_coin.Coin.fromJSON(e)) : [],
992
+ tipper: isSet(object.tipper) ? globalThis.String(object.tipper) : ""
993
+ };
994
+ },
995
+ toJSON(message) {
996
+ const obj = {};
997
+ if (message.amount?.length) obj.amount = message.amount.map((e) => require_coin.Coin.toJSON(e));
998
+ if (message.tipper !== "") obj.tipper = message.tipper;
999
+ return obj;
1000
+ },
1001
+ create(base) {
1002
+ return Tip.fromPartial(base ?? {});
1003
+ },
1004
+ fromPartial(object) {
1005
+ const message = createBaseTip();
1006
+ message.amount = object.amount?.map((e) => require_coin.Coin.fromPartial(e)) || [];
1007
+ message.tipper = object.tipper ?? "";
1008
+ return message;
1009
+ }
1010
+ };
1011
+ function bytesFromBase64(b64) {
1012
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1013
+ }
1014
+ function base64FromBytes(arr) {
1015
+ return globalThis.Buffer.from(arr).toString("base64");
1016
+ }
1017
+ function longToNumber(int64) {
1018
+ const num = globalThis.Number(int64.toString());
1019
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1020
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1021
+ return num;
1022
+ }
1023
+ function isSet(value) {
1024
+ return value !== null && value !== void 0;
1025
+ }
1026
+ Object.defineProperty(exports, "Any", {
1027
+ enumerable: true,
1028
+ get: function() {
1029
+ return Any;
1030
+ }
1031
+ });
1032
+ Object.defineProperty(exports, "AuthInfo", {
1033
+ enumerable: true,
1034
+ get: function() {
1035
+ return AuthInfo;
1036
+ }
1037
+ });
1038
+ Object.defineProperty(exports, "Fee", {
1039
+ enumerable: true,
1040
+ get: function() {
1041
+ return Fee;
1042
+ }
1043
+ });
1044
+ Object.defineProperty(exports, "ModeInfo", {
1045
+ enumerable: true,
1046
+ get: function() {
1047
+ return ModeInfo;
1048
+ }
1049
+ });
1050
+ Object.defineProperty(exports, "ModeInfo_Single", {
1051
+ enumerable: true,
1052
+ get: function() {
1053
+ return ModeInfo_Single;
1054
+ }
1055
+ });
1056
+ Object.defineProperty(exports, "SignDoc", {
1057
+ enumerable: true,
1058
+ get: function() {
1059
+ return SignDoc;
1060
+ }
1061
+ });
1062
+ Object.defineProperty(exports, "SignMode", {
1063
+ enumerable: true,
1064
+ get: function() {
1065
+ return SignMode;
1066
+ }
1067
+ });
1068
+ Object.defineProperty(exports, "SignerInfo", {
1069
+ enumerable: true,
1070
+ get: function() {
1071
+ return SignerInfo;
1072
+ }
1073
+ });
1074
+ Object.defineProperty(exports, "Tx", {
1075
+ enumerable: true,
1076
+ get: function() {
1077
+ return Tx;
1078
+ }
1079
+ });
1080
+ Object.defineProperty(exports, "TxBody", {
1081
+ enumerable: true,
1082
+ get: function() {
1083
+ return TxBody;
1084
+ }
1085
+ });
1086
+ Object.defineProperty(exports, "TxRaw", {
1087
+ enumerable: true,
1088
+ get: function() {
1089
+ return TxRaw;
1090
+ }
1091
+ });