@kimafinance/kima-transaction-api 1.4.2 → 1.4.3

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.
@@ -0,0 +1,1353 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+
5
+ export const protobufPackage = "kimablockchain.swap";
6
+
7
+ export interface MsgRequestSwapTransaction {
8
+ creator: string;
9
+ /** the origin chain of the swap transaction */
10
+ originChain: string;
11
+ /** the origin address of the swap transaction */
12
+ originAddress: string;
13
+ /** the target chain of the swap transaction */
14
+ targetChain: string;
15
+ /** the target address of the swap transaction */
16
+ targetAddress: string;
17
+ /** the origin symbol of the swap transaction */
18
+ originSymbol: string;
19
+ /** the target symbol of the swap transaction */
20
+ targetSymbol: string;
21
+ /** the amount in of the swap transaction */
22
+ amountIn: string;
23
+ /** the amount out of the swap transaction */
24
+ amountOut: string;
25
+ /** the fee of the swap transaction */
26
+ fee: string;
27
+ /** the dex of the swap transaction */
28
+ dex: string;
29
+ /** the slippage of the swap transaction */
30
+ slippage: string;
31
+ /** the options of the swap transaction */
32
+ options: string;
33
+ }
34
+
35
+ export interface MsgRequestSwapTransactionResponse {
36
+ code: string;
37
+ msg: string;
38
+ txId: number;
39
+ }
40
+
41
+ export interface MsgSetTxToProcess {
42
+ creator: string;
43
+ txId: number;
44
+ timestamp: number;
45
+ msgId: string;
46
+ handleId: number;
47
+ /** swap transaction type */
48
+ txType: string;
49
+ /** the fee id for the transaction */
50
+ feeId: string;
51
+ /** the origin gas fee of the transaction */
52
+ originGasFee: string;
53
+ /** the target gas fee of the transaction */
54
+ targetGasFee: string;
55
+ /** the kima processing fee of the transaction */
56
+ kimaProcessingFee: string;
57
+ /** the total fee of the transaction */
58
+ totalFee: string;
59
+ /** the pegged to of the transaction */
60
+ peggedTo: string;
61
+ /** the expiration of the transaction */
62
+ expiration: number;
63
+ }
64
+
65
+ export interface MsgSetTxToProcessResponse {
66
+ code: string;
67
+ msg: string;
68
+ }
69
+
70
+ export interface MsgFinalizeSwapTransaction {
71
+ creator: string;
72
+ txId: number;
73
+ txHash: string;
74
+ success: boolean;
75
+ errReason: string;
76
+ tssMsgId: string;
77
+ /** request_swap, request_swap_refund */
78
+ txType: string;
79
+ /** pull, release, refund */
80
+ payType: string;
81
+ }
82
+
83
+ export interface MsgFinalizeSwapTransactionResponse {
84
+ code: string;
85
+ msg: string;
86
+ }
87
+
88
+ export interface MsgSwapObserveVote {
89
+ creator: string;
90
+ txHash: string;
91
+ chainId: string;
92
+ tokenSymbol: string;
93
+ from: string;
94
+ to: string;
95
+ amount: string;
96
+ payType: string;
97
+ kimaTxId: number;
98
+ tssMsgId: string;
99
+ txType: string;
100
+ succeed: boolean;
101
+ failReason: string;
102
+ reserved: string;
103
+ }
104
+
105
+ export interface MsgSwapObserveVoteResponse {
106
+ code: string;
107
+ msg: string;
108
+ }
109
+
110
+ export interface MsgCleanPendingSwapTransaction {
111
+ creator: string;
112
+ }
113
+
114
+ export interface MsgCleanPendingSwapTransactionResponse {
115
+ code: string;
116
+ msg: string;
117
+ }
118
+
119
+ export interface MsgUpdateSwapTransactionStatus {
120
+ creator: string;
121
+ txId: string;
122
+ status: string;
123
+ reason: string;
124
+ }
125
+
126
+ export interface MsgUpdateSwapTransactionStatusResponse {
127
+ code: string;
128
+ msg: string;
129
+ }
130
+
131
+ function createBaseMsgRequestSwapTransaction(): MsgRequestSwapTransaction {
132
+ return {
133
+ creator: "",
134
+ originChain: "",
135
+ originAddress: "",
136
+ targetChain: "",
137
+ targetAddress: "",
138
+ originSymbol: "",
139
+ targetSymbol: "",
140
+ amountIn: "",
141
+ amountOut: "",
142
+ fee: "",
143
+ dex: "",
144
+ slippage: "",
145
+ options: "",
146
+ };
147
+ }
148
+
149
+ export const MsgRequestSwapTransaction = {
150
+ encode(message: MsgRequestSwapTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
151
+ if (message.creator !== "") {
152
+ writer.uint32(10).string(message.creator);
153
+ }
154
+ if (message.originChain !== "") {
155
+ writer.uint32(18).string(message.originChain);
156
+ }
157
+ if (message.originAddress !== "") {
158
+ writer.uint32(26).string(message.originAddress);
159
+ }
160
+ if (message.targetChain !== "") {
161
+ writer.uint32(34).string(message.targetChain);
162
+ }
163
+ if (message.targetAddress !== "") {
164
+ writer.uint32(42).string(message.targetAddress);
165
+ }
166
+ if (message.originSymbol !== "") {
167
+ writer.uint32(50).string(message.originSymbol);
168
+ }
169
+ if (message.targetSymbol !== "") {
170
+ writer.uint32(58).string(message.targetSymbol);
171
+ }
172
+ if (message.amountIn !== "") {
173
+ writer.uint32(66).string(message.amountIn);
174
+ }
175
+ if (message.amountOut !== "") {
176
+ writer.uint32(74).string(message.amountOut);
177
+ }
178
+ if (message.fee !== "") {
179
+ writer.uint32(82).string(message.fee);
180
+ }
181
+ if (message.dex !== "") {
182
+ writer.uint32(90).string(message.dex);
183
+ }
184
+ if (message.slippage !== "") {
185
+ writer.uint32(98).string(message.slippage);
186
+ }
187
+ if (message.options !== "") {
188
+ writer.uint32(106).string(message.options);
189
+ }
190
+ return writer;
191
+ },
192
+
193
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestSwapTransaction {
194
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
195
+ let end = length === undefined ? reader.len : reader.pos + length;
196
+ const message = createBaseMsgRequestSwapTransaction();
197
+ while (reader.pos < end) {
198
+ const tag = reader.uint32();
199
+ switch (tag >>> 3) {
200
+ case 1:
201
+ message.creator = reader.string();
202
+ break;
203
+ case 2:
204
+ message.originChain = reader.string();
205
+ break;
206
+ case 3:
207
+ message.originAddress = reader.string();
208
+ break;
209
+ case 4:
210
+ message.targetChain = reader.string();
211
+ break;
212
+ case 5:
213
+ message.targetAddress = reader.string();
214
+ break;
215
+ case 6:
216
+ message.originSymbol = reader.string();
217
+ break;
218
+ case 7:
219
+ message.targetSymbol = reader.string();
220
+ break;
221
+ case 8:
222
+ message.amountIn = reader.string();
223
+ break;
224
+ case 9:
225
+ message.amountOut = reader.string();
226
+ break;
227
+ case 10:
228
+ message.fee = reader.string();
229
+ break;
230
+ case 11:
231
+ message.dex = reader.string();
232
+ break;
233
+ case 12:
234
+ message.slippage = reader.string();
235
+ break;
236
+ case 13:
237
+ message.options = reader.string();
238
+ break;
239
+ default:
240
+ reader.skipType(tag & 7);
241
+ break;
242
+ }
243
+ }
244
+ return message;
245
+ },
246
+
247
+ fromJSON(object: any): MsgRequestSwapTransaction {
248
+ return {
249
+ creator: isSet(object.creator) ? String(object.creator) : "",
250
+ originChain: isSet(object.originChain) ? String(object.originChain) : "",
251
+ originAddress: isSet(object.originAddress) ? String(object.originAddress) : "",
252
+ targetChain: isSet(object.targetChain) ? String(object.targetChain) : "",
253
+ targetAddress: isSet(object.targetAddress) ? String(object.targetAddress) : "",
254
+ originSymbol: isSet(object.originSymbol) ? String(object.originSymbol) : "",
255
+ targetSymbol: isSet(object.targetSymbol) ? String(object.targetSymbol) : "",
256
+ amountIn: isSet(object.amountIn) ? String(object.amountIn) : "",
257
+ amountOut: isSet(object.amountOut) ? String(object.amountOut) : "",
258
+ fee: isSet(object.fee) ? String(object.fee) : "",
259
+ dex: isSet(object.dex) ? String(object.dex) : "",
260
+ slippage: isSet(object.slippage) ? String(object.slippage) : "",
261
+ options: isSet(object.options) ? String(object.options) : "",
262
+ };
263
+ },
264
+
265
+ toJSON(message: MsgRequestSwapTransaction): unknown {
266
+ const obj: any = {};
267
+ message.creator !== undefined && (obj.creator = message.creator);
268
+ message.originChain !== undefined && (obj.originChain = message.originChain);
269
+ message.originAddress !== undefined && (obj.originAddress = message.originAddress);
270
+ message.targetChain !== undefined && (obj.targetChain = message.targetChain);
271
+ message.targetAddress !== undefined && (obj.targetAddress = message.targetAddress);
272
+ message.originSymbol !== undefined && (obj.originSymbol = message.originSymbol);
273
+ message.targetSymbol !== undefined && (obj.targetSymbol = message.targetSymbol);
274
+ message.amountIn !== undefined && (obj.amountIn = message.amountIn);
275
+ message.amountOut !== undefined && (obj.amountOut = message.amountOut);
276
+ message.fee !== undefined && (obj.fee = message.fee);
277
+ message.dex !== undefined && (obj.dex = message.dex);
278
+ message.slippage !== undefined && (obj.slippage = message.slippage);
279
+ message.options !== undefined && (obj.options = message.options);
280
+ return obj;
281
+ },
282
+
283
+ fromPartial<I extends Exact<DeepPartial<MsgRequestSwapTransaction>, I>>(object: I): MsgRequestSwapTransaction {
284
+ const message = createBaseMsgRequestSwapTransaction();
285
+ message.creator = object.creator ?? "";
286
+ message.originChain = object.originChain ?? "";
287
+ message.originAddress = object.originAddress ?? "";
288
+ message.targetChain = object.targetChain ?? "";
289
+ message.targetAddress = object.targetAddress ?? "";
290
+ message.originSymbol = object.originSymbol ?? "";
291
+ message.targetSymbol = object.targetSymbol ?? "";
292
+ message.amountIn = object.amountIn ?? "";
293
+ message.amountOut = object.amountOut ?? "";
294
+ message.fee = object.fee ?? "";
295
+ message.dex = object.dex ?? "";
296
+ message.slippage = object.slippage ?? "";
297
+ message.options = object.options ?? "";
298
+ return message;
299
+ },
300
+ };
301
+
302
+ function createBaseMsgRequestSwapTransactionResponse(): MsgRequestSwapTransactionResponse {
303
+ return { code: "", msg: "", txId: 0 };
304
+ }
305
+
306
+ export const MsgRequestSwapTransactionResponse = {
307
+ encode(message: MsgRequestSwapTransactionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
308
+ if (message.code !== "") {
309
+ writer.uint32(10).string(message.code);
310
+ }
311
+ if (message.msg !== "") {
312
+ writer.uint32(18).string(message.msg);
313
+ }
314
+ if (message.txId !== 0) {
315
+ writer.uint32(24).uint64(message.txId);
316
+ }
317
+ return writer;
318
+ },
319
+
320
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestSwapTransactionResponse {
321
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
322
+ let end = length === undefined ? reader.len : reader.pos + length;
323
+ const message = createBaseMsgRequestSwapTransactionResponse();
324
+ while (reader.pos < end) {
325
+ const tag = reader.uint32();
326
+ switch (tag >>> 3) {
327
+ case 1:
328
+ message.code = reader.string();
329
+ break;
330
+ case 2:
331
+ message.msg = reader.string();
332
+ break;
333
+ case 3:
334
+ message.txId = longToNumber(reader.uint64() as Long);
335
+ break;
336
+ default:
337
+ reader.skipType(tag & 7);
338
+ break;
339
+ }
340
+ }
341
+ return message;
342
+ },
343
+
344
+ fromJSON(object: any): MsgRequestSwapTransactionResponse {
345
+ return {
346
+ code: isSet(object.code) ? String(object.code) : "",
347
+ msg: isSet(object.msg) ? String(object.msg) : "",
348
+ txId: isSet(object.txId) ? Number(object.txId) : 0,
349
+ };
350
+ },
351
+
352
+ toJSON(message: MsgRequestSwapTransactionResponse): unknown {
353
+ const obj: any = {};
354
+ message.code !== undefined && (obj.code = message.code);
355
+ message.msg !== undefined && (obj.msg = message.msg);
356
+ message.txId !== undefined && (obj.txId = Math.round(message.txId));
357
+ return obj;
358
+ },
359
+
360
+ fromPartial<I extends Exact<DeepPartial<MsgRequestSwapTransactionResponse>, I>>(
361
+ object: I,
362
+ ): MsgRequestSwapTransactionResponse {
363
+ const message = createBaseMsgRequestSwapTransactionResponse();
364
+ message.code = object.code ?? "";
365
+ message.msg = object.msg ?? "";
366
+ message.txId = object.txId ?? 0;
367
+ return message;
368
+ },
369
+ };
370
+
371
+ function createBaseMsgSetTxToProcess(): MsgSetTxToProcess {
372
+ return {
373
+ creator: "",
374
+ txId: 0,
375
+ timestamp: 0,
376
+ msgId: "",
377
+ handleId: 0,
378
+ txType: "",
379
+ feeId: "",
380
+ originGasFee: "",
381
+ targetGasFee: "",
382
+ kimaProcessingFee: "",
383
+ totalFee: "",
384
+ peggedTo: "",
385
+ expiration: 0,
386
+ };
387
+ }
388
+
389
+ export const MsgSetTxToProcess = {
390
+ encode(message: MsgSetTxToProcess, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
391
+ if (message.creator !== "") {
392
+ writer.uint32(10).string(message.creator);
393
+ }
394
+ if (message.txId !== 0) {
395
+ writer.uint32(16).uint64(message.txId);
396
+ }
397
+ if (message.timestamp !== 0) {
398
+ writer.uint32(24).uint64(message.timestamp);
399
+ }
400
+ if (message.msgId !== "") {
401
+ writer.uint32(34).string(message.msgId);
402
+ }
403
+ if (message.handleId !== 0) {
404
+ writer.uint32(40).uint64(message.handleId);
405
+ }
406
+ if (message.txType !== "") {
407
+ writer.uint32(50).string(message.txType);
408
+ }
409
+ if (message.feeId !== "") {
410
+ writer.uint32(58).string(message.feeId);
411
+ }
412
+ if (message.originGasFee !== "") {
413
+ writer.uint32(66).string(message.originGasFee);
414
+ }
415
+ if (message.targetGasFee !== "") {
416
+ writer.uint32(74).string(message.targetGasFee);
417
+ }
418
+ if (message.kimaProcessingFee !== "") {
419
+ writer.uint32(82).string(message.kimaProcessingFee);
420
+ }
421
+ if (message.totalFee !== "") {
422
+ writer.uint32(90).string(message.totalFee);
423
+ }
424
+ if (message.peggedTo !== "") {
425
+ writer.uint32(98).string(message.peggedTo);
426
+ }
427
+ if (message.expiration !== 0) {
428
+ writer.uint32(104).uint64(message.expiration);
429
+ }
430
+ return writer;
431
+ },
432
+
433
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxToProcess {
434
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
435
+ let end = length === undefined ? reader.len : reader.pos + length;
436
+ const message = createBaseMsgSetTxToProcess();
437
+ while (reader.pos < end) {
438
+ const tag = reader.uint32();
439
+ switch (tag >>> 3) {
440
+ case 1:
441
+ message.creator = reader.string();
442
+ break;
443
+ case 2:
444
+ message.txId = longToNumber(reader.uint64() as Long);
445
+ break;
446
+ case 3:
447
+ message.timestamp = longToNumber(reader.uint64() as Long);
448
+ break;
449
+ case 4:
450
+ message.msgId = reader.string();
451
+ break;
452
+ case 5:
453
+ message.handleId = longToNumber(reader.uint64() as Long);
454
+ break;
455
+ case 6:
456
+ message.txType = reader.string();
457
+ break;
458
+ case 7:
459
+ message.feeId = reader.string();
460
+ break;
461
+ case 8:
462
+ message.originGasFee = reader.string();
463
+ break;
464
+ case 9:
465
+ message.targetGasFee = reader.string();
466
+ break;
467
+ case 10:
468
+ message.kimaProcessingFee = reader.string();
469
+ break;
470
+ case 11:
471
+ message.totalFee = reader.string();
472
+ break;
473
+ case 12:
474
+ message.peggedTo = reader.string();
475
+ break;
476
+ case 13:
477
+ message.expiration = longToNumber(reader.uint64() as Long);
478
+ break;
479
+ default:
480
+ reader.skipType(tag & 7);
481
+ break;
482
+ }
483
+ }
484
+ return message;
485
+ },
486
+
487
+ fromJSON(object: any): MsgSetTxToProcess {
488
+ return {
489
+ creator: isSet(object.creator) ? String(object.creator) : "",
490
+ txId: isSet(object.txId) ? Number(object.txId) : 0,
491
+ timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
492
+ msgId: isSet(object.msgId) ? String(object.msgId) : "",
493
+ handleId: isSet(object.handleId) ? Number(object.handleId) : 0,
494
+ txType: isSet(object.txType) ? String(object.txType) : "",
495
+ feeId: isSet(object.feeId) ? String(object.feeId) : "",
496
+ originGasFee: isSet(object.originGasFee) ? String(object.originGasFee) : "",
497
+ targetGasFee: isSet(object.targetGasFee) ? String(object.targetGasFee) : "",
498
+ kimaProcessingFee: isSet(object.kimaProcessingFee) ? String(object.kimaProcessingFee) : "",
499
+ totalFee: isSet(object.totalFee) ? String(object.totalFee) : "",
500
+ peggedTo: isSet(object.peggedTo) ? String(object.peggedTo) : "",
501
+ expiration: isSet(object.expiration) ? Number(object.expiration) : 0,
502
+ };
503
+ },
504
+
505
+ toJSON(message: MsgSetTxToProcess): unknown {
506
+ const obj: any = {};
507
+ message.creator !== undefined && (obj.creator = message.creator);
508
+ message.txId !== undefined && (obj.txId = Math.round(message.txId));
509
+ message.timestamp !== undefined && (obj.timestamp = Math.round(message.timestamp));
510
+ message.msgId !== undefined && (obj.msgId = message.msgId);
511
+ message.handleId !== undefined && (obj.handleId = Math.round(message.handleId));
512
+ message.txType !== undefined && (obj.txType = message.txType);
513
+ message.feeId !== undefined && (obj.feeId = message.feeId);
514
+ message.originGasFee !== undefined && (obj.originGasFee = message.originGasFee);
515
+ message.targetGasFee !== undefined && (obj.targetGasFee = message.targetGasFee);
516
+ message.kimaProcessingFee !== undefined && (obj.kimaProcessingFee = message.kimaProcessingFee);
517
+ message.totalFee !== undefined && (obj.totalFee = message.totalFee);
518
+ message.peggedTo !== undefined && (obj.peggedTo = message.peggedTo);
519
+ message.expiration !== undefined && (obj.expiration = Math.round(message.expiration));
520
+ return obj;
521
+ },
522
+
523
+ fromPartial<I extends Exact<DeepPartial<MsgSetTxToProcess>, I>>(object: I): MsgSetTxToProcess {
524
+ const message = createBaseMsgSetTxToProcess();
525
+ message.creator = object.creator ?? "";
526
+ message.txId = object.txId ?? 0;
527
+ message.timestamp = object.timestamp ?? 0;
528
+ message.msgId = object.msgId ?? "";
529
+ message.handleId = object.handleId ?? 0;
530
+ message.txType = object.txType ?? "";
531
+ message.feeId = object.feeId ?? "";
532
+ message.originGasFee = object.originGasFee ?? "";
533
+ message.targetGasFee = object.targetGasFee ?? "";
534
+ message.kimaProcessingFee = object.kimaProcessingFee ?? "";
535
+ message.totalFee = object.totalFee ?? "";
536
+ message.peggedTo = object.peggedTo ?? "";
537
+ message.expiration = object.expiration ?? 0;
538
+ return message;
539
+ },
540
+ };
541
+
542
+ function createBaseMsgSetTxToProcessResponse(): MsgSetTxToProcessResponse {
543
+ return { code: "", msg: "" };
544
+ }
545
+
546
+ export const MsgSetTxToProcessResponse = {
547
+ encode(message: MsgSetTxToProcessResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
548
+ if (message.code !== "") {
549
+ writer.uint32(10).string(message.code);
550
+ }
551
+ if (message.msg !== "") {
552
+ writer.uint32(18).string(message.msg);
553
+ }
554
+ return writer;
555
+ },
556
+
557
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxToProcessResponse {
558
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
559
+ let end = length === undefined ? reader.len : reader.pos + length;
560
+ const message = createBaseMsgSetTxToProcessResponse();
561
+ while (reader.pos < end) {
562
+ const tag = reader.uint32();
563
+ switch (tag >>> 3) {
564
+ case 1:
565
+ message.code = reader.string();
566
+ break;
567
+ case 2:
568
+ message.msg = reader.string();
569
+ break;
570
+ default:
571
+ reader.skipType(tag & 7);
572
+ break;
573
+ }
574
+ }
575
+ return message;
576
+ },
577
+
578
+ fromJSON(object: any): MsgSetTxToProcessResponse {
579
+ return { code: isSet(object.code) ? String(object.code) : "", msg: isSet(object.msg) ? String(object.msg) : "" };
580
+ },
581
+
582
+ toJSON(message: MsgSetTxToProcessResponse): unknown {
583
+ const obj: any = {};
584
+ message.code !== undefined && (obj.code = message.code);
585
+ message.msg !== undefined && (obj.msg = message.msg);
586
+ return obj;
587
+ },
588
+
589
+ fromPartial<I extends Exact<DeepPartial<MsgSetTxToProcessResponse>, I>>(object: I): MsgSetTxToProcessResponse {
590
+ const message = createBaseMsgSetTxToProcessResponse();
591
+ message.code = object.code ?? "";
592
+ message.msg = object.msg ?? "";
593
+ return message;
594
+ },
595
+ };
596
+
597
+ function createBaseMsgFinalizeSwapTransaction(): MsgFinalizeSwapTransaction {
598
+ return { creator: "", txId: 0, txHash: "", success: false, errReason: "", tssMsgId: "", txType: "", payType: "" };
599
+ }
600
+
601
+ export const MsgFinalizeSwapTransaction = {
602
+ encode(message: MsgFinalizeSwapTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
603
+ if (message.creator !== "") {
604
+ writer.uint32(10).string(message.creator);
605
+ }
606
+ if (message.txId !== 0) {
607
+ writer.uint32(16).uint64(message.txId);
608
+ }
609
+ if (message.txHash !== "") {
610
+ writer.uint32(26).string(message.txHash);
611
+ }
612
+ if (message.success === true) {
613
+ writer.uint32(32).bool(message.success);
614
+ }
615
+ if (message.errReason !== "") {
616
+ writer.uint32(42).string(message.errReason);
617
+ }
618
+ if (message.tssMsgId !== "") {
619
+ writer.uint32(50).string(message.tssMsgId);
620
+ }
621
+ if (message.txType !== "") {
622
+ writer.uint32(58).string(message.txType);
623
+ }
624
+ if (message.payType !== "") {
625
+ writer.uint32(66).string(message.payType);
626
+ }
627
+ return writer;
628
+ },
629
+
630
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSwapTransaction {
631
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
632
+ let end = length === undefined ? reader.len : reader.pos + length;
633
+ const message = createBaseMsgFinalizeSwapTransaction();
634
+ while (reader.pos < end) {
635
+ const tag = reader.uint32();
636
+ switch (tag >>> 3) {
637
+ case 1:
638
+ message.creator = reader.string();
639
+ break;
640
+ case 2:
641
+ message.txId = longToNumber(reader.uint64() as Long);
642
+ break;
643
+ case 3:
644
+ message.txHash = reader.string();
645
+ break;
646
+ case 4:
647
+ message.success = reader.bool();
648
+ break;
649
+ case 5:
650
+ message.errReason = reader.string();
651
+ break;
652
+ case 6:
653
+ message.tssMsgId = reader.string();
654
+ break;
655
+ case 7:
656
+ message.txType = reader.string();
657
+ break;
658
+ case 8:
659
+ message.payType = reader.string();
660
+ break;
661
+ default:
662
+ reader.skipType(tag & 7);
663
+ break;
664
+ }
665
+ }
666
+ return message;
667
+ },
668
+
669
+ fromJSON(object: any): MsgFinalizeSwapTransaction {
670
+ return {
671
+ creator: isSet(object.creator) ? String(object.creator) : "",
672
+ txId: isSet(object.txId) ? Number(object.txId) : 0,
673
+ txHash: isSet(object.txHash) ? String(object.txHash) : "",
674
+ success: isSet(object.success) ? Boolean(object.success) : false,
675
+ errReason: isSet(object.errReason) ? String(object.errReason) : "",
676
+ tssMsgId: isSet(object.tssMsgId) ? String(object.tssMsgId) : "",
677
+ txType: isSet(object.txType) ? String(object.txType) : "",
678
+ payType: isSet(object.payType) ? String(object.payType) : "",
679
+ };
680
+ },
681
+
682
+ toJSON(message: MsgFinalizeSwapTransaction): unknown {
683
+ const obj: any = {};
684
+ message.creator !== undefined && (obj.creator = message.creator);
685
+ message.txId !== undefined && (obj.txId = Math.round(message.txId));
686
+ message.txHash !== undefined && (obj.txHash = message.txHash);
687
+ message.success !== undefined && (obj.success = message.success);
688
+ message.errReason !== undefined && (obj.errReason = message.errReason);
689
+ message.tssMsgId !== undefined && (obj.tssMsgId = message.tssMsgId);
690
+ message.txType !== undefined && (obj.txType = message.txType);
691
+ message.payType !== undefined && (obj.payType = message.payType);
692
+ return obj;
693
+ },
694
+
695
+ fromPartial<I extends Exact<DeepPartial<MsgFinalizeSwapTransaction>, I>>(object: I): MsgFinalizeSwapTransaction {
696
+ const message = createBaseMsgFinalizeSwapTransaction();
697
+ message.creator = object.creator ?? "";
698
+ message.txId = object.txId ?? 0;
699
+ message.txHash = object.txHash ?? "";
700
+ message.success = object.success ?? false;
701
+ message.errReason = object.errReason ?? "";
702
+ message.tssMsgId = object.tssMsgId ?? "";
703
+ message.txType = object.txType ?? "";
704
+ message.payType = object.payType ?? "";
705
+ return message;
706
+ },
707
+ };
708
+
709
+ function createBaseMsgFinalizeSwapTransactionResponse(): MsgFinalizeSwapTransactionResponse {
710
+ return { code: "", msg: "" };
711
+ }
712
+
713
+ export const MsgFinalizeSwapTransactionResponse = {
714
+ encode(message: MsgFinalizeSwapTransactionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
715
+ if (message.code !== "") {
716
+ writer.uint32(10).string(message.code);
717
+ }
718
+ if (message.msg !== "") {
719
+ writer.uint32(18).string(message.msg);
720
+ }
721
+ return writer;
722
+ },
723
+
724
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSwapTransactionResponse {
725
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
726
+ let end = length === undefined ? reader.len : reader.pos + length;
727
+ const message = createBaseMsgFinalizeSwapTransactionResponse();
728
+ while (reader.pos < end) {
729
+ const tag = reader.uint32();
730
+ switch (tag >>> 3) {
731
+ case 1:
732
+ message.code = reader.string();
733
+ break;
734
+ case 2:
735
+ message.msg = reader.string();
736
+ break;
737
+ default:
738
+ reader.skipType(tag & 7);
739
+ break;
740
+ }
741
+ }
742
+ return message;
743
+ },
744
+
745
+ fromJSON(object: any): MsgFinalizeSwapTransactionResponse {
746
+ return { code: isSet(object.code) ? String(object.code) : "", msg: isSet(object.msg) ? String(object.msg) : "" };
747
+ },
748
+
749
+ toJSON(message: MsgFinalizeSwapTransactionResponse): unknown {
750
+ const obj: any = {};
751
+ message.code !== undefined && (obj.code = message.code);
752
+ message.msg !== undefined && (obj.msg = message.msg);
753
+ return obj;
754
+ },
755
+
756
+ fromPartial<I extends Exact<DeepPartial<MsgFinalizeSwapTransactionResponse>, I>>(
757
+ object: I,
758
+ ): MsgFinalizeSwapTransactionResponse {
759
+ const message = createBaseMsgFinalizeSwapTransactionResponse();
760
+ message.code = object.code ?? "";
761
+ message.msg = object.msg ?? "";
762
+ return message;
763
+ },
764
+ };
765
+
766
+ function createBaseMsgSwapObserveVote(): MsgSwapObserveVote {
767
+ return {
768
+ creator: "",
769
+ txHash: "",
770
+ chainId: "",
771
+ tokenSymbol: "",
772
+ from: "",
773
+ to: "",
774
+ amount: "",
775
+ payType: "",
776
+ kimaTxId: 0,
777
+ tssMsgId: "",
778
+ txType: "",
779
+ succeed: false,
780
+ failReason: "",
781
+ reserved: "",
782
+ };
783
+ }
784
+
785
+ export const MsgSwapObserveVote = {
786
+ encode(message: MsgSwapObserveVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
787
+ if (message.creator !== "") {
788
+ writer.uint32(10).string(message.creator);
789
+ }
790
+ if (message.txHash !== "") {
791
+ writer.uint32(18).string(message.txHash);
792
+ }
793
+ if (message.chainId !== "") {
794
+ writer.uint32(26).string(message.chainId);
795
+ }
796
+ if (message.tokenSymbol !== "") {
797
+ writer.uint32(34).string(message.tokenSymbol);
798
+ }
799
+ if (message.from !== "") {
800
+ writer.uint32(42).string(message.from);
801
+ }
802
+ if (message.to !== "") {
803
+ writer.uint32(50).string(message.to);
804
+ }
805
+ if (message.amount !== "") {
806
+ writer.uint32(58).string(message.amount);
807
+ }
808
+ if (message.payType !== "") {
809
+ writer.uint32(66).string(message.payType);
810
+ }
811
+ if (message.kimaTxId !== 0) {
812
+ writer.uint32(72).uint64(message.kimaTxId);
813
+ }
814
+ if (message.tssMsgId !== "") {
815
+ writer.uint32(82).string(message.tssMsgId);
816
+ }
817
+ if (message.txType !== "") {
818
+ writer.uint32(90).string(message.txType);
819
+ }
820
+ if (message.succeed === true) {
821
+ writer.uint32(96).bool(message.succeed);
822
+ }
823
+ if (message.failReason !== "") {
824
+ writer.uint32(106).string(message.failReason);
825
+ }
826
+ if (message.reserved !== "") {
827
+ writer.uint32(114).string(message.reserved);
828
+ }
829
+ return writer;
830
+ },
831
+
832
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSwapObserveVote {
833
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
834
+ let end = length === undefined ? reader.len : reader.pos + length;
835
+ const message = createBaseMsgSwapObserveVote();
836
+ while (reader.pos < end) {
837
+ const tag = reader.uint32();
838
+ switch (tag >>> 3) {
839
+ case 1:
840
+ message.creator = reader.string();
841
+ break;
842
+ case 2:
843
+ message.txHash = reader.string();
844
+ break;
845
+ case 3:
846
+ message.chainId = reader.string();
847
+ break;
848
+ case 4:
849
+ message.tokenSymbol = reader.string();
850
+ break;
851
+ case 5:
852
+ message.from = reader.string();
853
+ break;
854
+ case 6:
855
+ message.to = reader.string();
856
+ break;
857
+ case 7:
858
+ message.amount = reader.string();
859
+ break;
860
+ case 8:
861
+ message.payType = reader.string();
862
+ break;
863
+ case 9:
864
+ message.kimaTxId = longToNumber(reader.uint64() as Long);
865
+ break;
866
+ case 10:
867
+ message.tssMsgId = reader.string();
868
+ break;
869
+ case 11:
870
+ message.txType = reader.string();
871
+ break;
872
+ case 12:
873
+ message.succeed = reader.bool();
874
+ break;
875
+ case 13:
876
+ message.failReason = reader.string();
877
+ break;
878
+ case 14:
879
+ message.reserved = reader.string();
880
+ break;
881
+ default:
882
+ reader.skipType(tag & 7);
883
+ break;
884
+ }
885
+ }
886
+ return message;
887
+ },
888
+
889
+ fromJSON(object: any): MsgSwapObserveVote {
890
+ return {
891
+ creator: isSet(object.creator) ? String(object.creator) : "",
892
+ txHash: isSet(object.txHash) ? String(object.txHash) : "",
893
+ chainId: isSet(object.chainId) ? String(object.chainId) : "",
894
+ tokenSymbol: isSet(object.tokenSymbol) ? String(object.tokenSymbol) : "",
895
+ from: isSet(object.from) ? String(object.from) : "",
896
+ to: isSet(object.to) ? String(object.to) : "",
897
+ amount: isSet(object.amount) ? String(object.amount) : "",
898
+ payType: isSet(object.payType) ? String(object.payType) : "",
899
+ kimaTxId: isSet(object.kimaTxId) ? Number(object.kimaTxId) : 0,
900
+ tssMsgId: isSet(object.tssMsgId) ? String(object.tssMsgId) : "",
901
+ txType: isSet(object.txType) ? String(object.txType) : "",
902
+ succeed: isSet(object.succeed) ? Boolean(object.succeed) : false,
903
+ failReason: isSet(object.failReason) ? String(object.failReason) : "",
904
+ reserved: isSet(object.reserved) ? String(object.reserved) : "",
905
+ };
906
+ },
907
+
908
+ toJSON(message: MsgSwapObserveVote): unknown {
909
+ const obj: any = {};
910
+ message.creator !== undefined && (obj.creator = message.creator);
911
+ message.txHash !== undefined && (obj.txHash = message.txHash);
912
+ message.chainId !== undefined && (obj.chainId = message.chainId);
913
+ message.tokenSymbol !== undefined && (obj.tokenSymbol = message.tokenSymbol);
914
+ message.from !== undefined && (obj.from = message.from);
915
+ message.to !== undefined && (obj.to = message.to);
916
+ message.amount !== undefined && (obj.amount = message.amount);
917
+ message.payType !== undefined && (obj.payType = message.payType);
918
+ message.kimaTxId !== undefined && (obj.kimaTxId = Math.round(message.kimaTxId));
919
+ message.tssMsgId !== undefined && (obj.tssMsgId = message.tssMsgId);
920
+ message.txType !== undefined && (obj.txType = message.txType);
921
+ message.succeed !== undefined && (obj.succeed = message.succeed);
922
+ message.failReason !== undefined && (obj.failReason = message.failReason);
923
+ message.reserved !== undefined && (obj.reserved = message.reserved);
924
+ return obj;
925
+ },
926
+
927
+ fromPartial<I extends Exact<DeepPartial<MsgSwapObserveVote>, I>>(object: I): MsgSwapObserveVote {
928
+ const message = createBaseMsgSwapObserveVote();
929
+ message.creator = object.creator ?? "";
930
+ message.txHash = object.txHash ?? "";
931
+ message.chainId = object.chainId ?? "";
932
+ message.tokenSymbol = object.tokenSymbol ?? "";
933
+ message.from = object.from ?? "";
934
+ message.to = object.to ?? "";
935
+ message.amount = object.amount ?? "";
936
+ message.payType = object.payType ?? "";
937
+ message.kimaTxId = object.kimaTxId ?? 0;
938
+ message.tssMsgId = object.tssMsgId ?? "";
939
+ message.txType = object.txType ?? "";
940
+ message.succeed = object.succeed ?? false;
941
+ message.failReason = object.failReason ?? "";
942
+ message.reserved = object.reserved ?? "";
943
+ return message;
944
+ },
945
+ };
946
+
947
+ function createBaseMsgSwapObserveVoteResponse(): MsgSwapObserveVoteResponse {
948
+ return { code: "", msg: "" };
949
+ }
950
+
951
+ export const MsgSwapObserveVoteResponse = {
952
+ encode(message: MsgSwapObserveVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
953
+ if (message.code !== "") {
954
+ writer.uint32(10).string(message.code);
955
+ }
956
+ if (message.msg !== "") {
957
+ writer.uint32(18).string(message.msg);
958
+ }
959
+ return writer;
960
+ },
961
+
962
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSwapObserveVoteResponse {
963
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
964
+ let end = length === undefined ? reader.len : reader.pos + length;
965
+ const message = createBaseMsgSwapObserveVoteResponse();
966
+ while (reader.pos < end) {
967
+ const tag = reader.uint32();
968
+ switch (tag >>> 3) {
969
+ case 1:
970
+ message.code = reader.string();
971
+ break;
972
+ case 2:
973
+ message.msg = reader.string();
974
+ break;
975
+ default:
976
+ reader.skipType(tag & 7);
977
+ break;
978
+ }
979
+ }
980
+ return message;
981
+ },
982
+
983
+ fromJSON(object: any): MsgSwapObserveVoteResponse {
984
+ return { code: isSet(object.code) ? String(object.code) : "", msg: isSet(object.msg) ? String(object.msg) : "" };
985
+ },
986
+
987
+ toJSON(message: MsgSwapObserveVoteResponse): unknown {
988
+ const obj: any = {};
989
+ message.code !== undefined && (obj.code = message.code);
990
+ message.msg !== undefined && (obj.msg = message.msg);
991
+ return obj;
992
+ },
993
+
994
+ fromPartial<I extends Exact<DeepPartial<MsgSwapObserveVoteResponse>, I>>(object: I): MsgSwapObserveVoteResponse {
995
+ const message = createBaseMsgSwapObserveVoteResponse();
996
+ message.code = object.code ?? "";
997
+ message.msg = object.msg ?? "";
998
+ return message;
999
+ },
1000
+ };
1001
+
1002
+ function createBaseMsgCleanPendingSwapTransaction(): MsgCleanPendingSwapTransaction {
1003
+ return { creator: "" };
1004
+ }
1005
+
1006
+ export const MsgCleanPendingSwapTransaction = {
1007
+ encode(message: MsgCleanPendingSwapTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1008
+ if (message.creator !== "") {
1009
+ writer.uint32(10).string(message.creator);
1010
+ }
1011
+ return writer;
1012
+ },
1013
+
1014
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCleanPendingSwapTransaction {
1015
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1016
+ let end = length === undefined ? reader.len : reader.pos + length;
1017
+ const message = createBaseMsgCleanPendingSwapTransaction();
1018
+ while (reader.pos < end) {
1019
+ const tag = reader.uint32();
1020
+ switch (tag >>> 3) {
1021
+ case 1:
1022
+ message.creator = reader.string();
1023
+ break;
1024
+ default:
1025
+ reader.skipType(tag & 7);
1026
+ break;
1027
+ }
1028
+ }
1029
+ return message;
1030
+ },
1031
+
1032
+ fromJSON(object: any): MsgCleanPendingSwapTransaction {
1033
+ return { creator: isSet(object.creator) ? String(object.creator) : "" };
1034
+ },
1035
+
1036
+ toJSON(message: MsgCleanPendingSwapTransaction): unknown {
1037
+ const obj: any = {};
1038
+ message.creator !== undefined && (obj.creator = message.creator);
1039
+ return obj;
1040
+ },
1041
+
1042
+ fromPartial<I extends Exact<DeepPartial<MsgCleanPendingSwapTransaction>, I>>(
1043
+ object: I,
1044
+ ): MsgCleanPendingSwapTransaction {
1045
+ const message = createBaseMsgCleanPendingSwapTransaction();
1046
+ message.creator = object.creator ?? "";
1047
+ return message;
1048
+ },
1049
+ };
1050
+
1051
+ function createBaseMsgCleanPendingSwapTransactionResponse(): MsgCleanPendingSwapTransactionResponse {
1052
+ return { code: "", msg: "" };
1053
+ }
1054
+
1055
+ export const MsgCleanPendingSwapTransactionResponse = {
1056
+ encode(message: MsgCleanPendingSwapTransactionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1057
+ if (message.code !== "") {
1058
+ writer.uint32(10).string(message.code);
1059
+ }
1060
+ if (message.msg !== "") {
1061
+ writer.uint32(18).string(message.msg);
1062
+ }
1063
+ return writer;
1064
+ },
1065
+
1066
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCleanPendingSwapTransactionResponse {
1067
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1068
+ let end = length === undefined ? reader.len : reader.pos + length;
1069
+ const message = createBaseMsgCleanPendingSwapTransactionResponse();
1070
+ while (reader.pos < end) {
1071
+ const tag = reader.uint32();
1072
+ switch (tag >>> 3) {
1073
+ case 1:
1074
+ message.code = reader.string();
1075
+ break;
1076
+ case 2:
1077
+ message.msg = reader.string();
1078
+ break;
1079
+ default:
1080
+ reader.skipType(tag & 7);
1081
+ break;
1082
+ }
1083
+ }
1084
+ return message;
1085
+ },
1086
+
1087
+ fromJSON(object: any): MsgCleanPendingSwapTransactionResponse {
1088
+ return { code: isSet(object.code) ? String(object.code) : "", msg: isSet(object.msg) ? String(object.msg) : "" };
1089
+ },
1090
+
1091
+ toJSON(message: MsgCleanPendingSwapTransactionResponse): unknown {
1092
+ const obj: any = {};
1093
+ message.code !== undefined && (obj.code = message.code);
1094
+ message.msg !== undefined && (obj.msg = message.msg);
1095
+ return obj;
1096
+ },
1097
+
1098
+ fromPartial<I extends Exact<DeepPartial<MsgCleanPendingSwapTransactionResponse>, I>>(
1099
+ object: I,
1100
+ ): MsgCleanPendingSwapTransactionResponse {
1101
+ const message = createBaseMsgCleanPendingSwapTransactionResponse();
1102
+ message.code = object.code ?? "";
1103
+ message.msg = object.msg ?? "";
1104
+ return message;
1105
+ },
1106
+ };
1107
+
1108
+ function createBaseMsgUpdateSwapTransactionStatus(): MsgUpdateSwapTransactionStatus {
1109
+ return { creator: "", txId: "", status: "", reason: "" };
1110
+ }
1111
+
1112
+ export const MsgUpdateSwapTransactionStatus = {
1113
+ encode(message: MsgUpdateSwapTransactionStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1114
+ if (message.creator !== "") {
1115
+ writer.uint32(10).string(message.creator);
1116
+ }
1117
+ if (message.txId !== "") {
1118
+ writer.uint32(18).string(message.txId);
1119
+ }
1120
+ if (message.status !== "") {
1121
+ writer.uint32(26).string(message.status);
1122
+ }
1123
+ if (message.reason !== "") {
1124
+ writer.uint32(34).string(message.reason);
1125
+ }
1126
+ return writer;
1127
+ },
1128
+
1129
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSwapTransactionStatus {
1130
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1131
+ let end = length === undefined ? reader.len : reader.pos + length;
1132
+ const message = createBaseMsgUpdateSwapTransactionStatus();
1133
+ while (reader.pos < end) {
1134
+ const tag = reader.uint32();
1135
+ switch (tag >>> 3) {
1136
+ case 1:
1137
+ message.creator = reader.string();
1138
+ break;
1139
+ case 2:
1140
+ message.txId = reader.string();
1141
+ break;
1142
+ case 3:
1143
+ message.status = reader.string();
1144
+ break;
1145
+ case 4:
1146
+ message.reason = reader.string();
1147
+ break;
1148
+ default:
1149
+ reader.skipType(tag & 7);
1150
+ break;
1151
+ }
1152
+ }
1153
+ return message;
1154
+ },
1155
+
1156
+ fromJSON(object: any): MsgUpdateSwapTransactionStatus {
1157
+ return {
1158
+ creator: isSet(object.creator) ? String(object.creator) : "",
1159
+ txId: isSet(object.txId) ? String(object.txId) : "",
1160
+ status: isSet(object.status) ? String(object.status) : "",
1161
+ reason: isSet(object.reason) ? String(object.reason) : "",
1162
+ };
1163
+ },
1164
+
1165
+ toJSON(message: MsgUpdateSwapTransactionStatus): unknown {
1166
+ const obj: any = {};
1167
+ message.creator !== undefined && (obj.creator = message.creator);
1168
+ message.txId !== undefined && (obj.txId = message.txId);
1169
+ message.status !== undefined && (obj.status = message.status);
1170
+ message.reason !== undefined && (obj.reason = message.reason);
1171
+ return obj;
1172
+ },
1173
+
1174
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateSwapTransactionStatus>, I>>(
1175
+ object: I,
1176
+ ): MsgUpdateSwapTransactionStatus {
1177
+ const message = createBaseMsgUpdateSwapTransactionStatus();
1178
+ message.creator = object.creator ?? "";
1179
+ message.txId = object.txId ?? "";
1180
+ message.status = object.status ?? "";
1181
+ message.reason = object.reason ?? "";
1182
+ return message;
1183
+ },
1184
+ };
1185
+
1186
+ function createBaseMsgUpdateSwapTransactionStatusResponse(): MsgUpdateSwapTransactionStatusResponse {
1187
+ return { code: "", msg: "" };
1188
+ }
1189
+
1190
+ export const MsgUpdateSwapTransactionStatusResponse = {
1191
+ encode(message: MsgUpdateSwapTransactionStatusResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1192
+ if (message.code !== "") {
1193
+ writer.uint32(10).string(message.code);
1194
+ }
1195
+ if (message.msg !== "") {
1196
+ writer.uint32(18).string(message.msg);
1197
+ }
1198
+ return writer;
1199
+ },
1200
+
1201
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSwapTransactionStatusResponse {
1202
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1203
+ let end = length === undefined ? reader.len : reader.pos + length;
1204
+ const message = createBaseMsgUpdateSwapTransactionStatusResponse();
1205
+ while (reader.pos < end) {
1206
+ const tag = reader.uint32();
1207
+ switch (tag >>> 3) {
1208
+ case 1:
1209
+ message.code = reader.string();
1210
+ break;
1211
+ case 2:
1212
+ message.msg = reader.string();
1213
+ break;
1214
+ default:
1215
+ reader.skipType(tag & 7);
1216
+ break;
1217
+ }
1218
+ }
1219
+ return message;
1220
+ },
1221
+
1222
+ fromJSON(object: any): MsgUpdateSwapTransactionStatusResponse {
1223
+ return { code: isSet(object.code) ? String(object.code) : "", msg: isSet(object.msg) ? String(object.msg) : "" };
1224
+ },
1225
+
1226
+ toJSON(message: MsgUpdateSwapTransactionStatusResponse): unknown {
1227
+ const obj: any = {};
1228
+ message.code !== undefined && (obj.code = message.code);
1229
+ message.msg !== undefined && (obj.msg = message.msg);
1230
+ return obj;
1231
+ },
1232
+
1233
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateSwapTransactionStatusResponse>, I>>(
1234
+ object: I,
1235
+ ): MsgUpdateSwapTransactionStatusResponse {
1236
+ const message = createBaseMsgUpdateSwapTransactionStatusResponse();
1237
+ message.code = object.code ?? "";
1238
+ message.msg = object.msg ?? "";
1239
+ return message;
1240
+ },
1241
+ };
1242
+
1243
+ /** Msg defines the Msg service. */
1244
+ export interface Msg {
1245
+ RequestSwapTransaction(request: MsgRequestSwapTransaction): Promise<MsgRequestSwapTransactionResponse>;
1246
+ SetTxToProcess(request: MsgSetTxToProcess): Promise<MsgSetTxToProcessResponse>;
1247
+ FinalizeSwapTransaction(request: MsgFinalizeSwapTransaction): Promise<MsgFinalizeSwapTransactionResponse>;
1248
+ SwapObserveVote(request: MsgSwapObserveVote): Promise<MsgSwapObserveVoteResponse>;
1249
+ CleanPendingSwapTransaction(request: MsgCleanPendingSwapTransaction): Promise<MsgCleanPendingSwapTransactionResponse>;
1250
+ UpdateSwapTransactionStatus(request: MsgUpdateSwapTransactionStatus): Promise<MsgUpdateSwapTransactionStatusResponse>;
1251
+ }
1252
+
1253
+ export class MsgClientImpl implements Msg {
1254
+ private readonly rpc: Rpc;
1255
+ constructor(rpc: Rpc) {
1256
+ this.rpc = rpc;
1257
+ this.RequestSwapTransaction = this.RequestSwapTransaction.bind(this);
1258
+ this.SetTxToProcess = this.SetTxToProcess.bind(this);
1259
+ this.FinalizeSwapTransaction = this.FinalizeSwapTransaction.bind(this);
1260
+ this.SwapObserveVote = this.SwapObserveVote.bind(this);
1261
+ this.CleanPendingSwapTransaction = this.CleanPendingSwapTransaction.bind(this);
1262
+ this.UpdateSwapTransactionStatus = this.UpdateSwapTransactionStatus.bind(this);
1263
+ }
1264
+ RequestSwapTransaction(request: MsgRequestSwapTransaction): Promise<MsgRequestSwapTransactionResponse> {
1265
+ const data = MsgRequestSwapTransaction.encode(request).finish();
1266
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "RequestSwapTransaction", data);
1267
+ return promise.then((data) => MsgRequestSwapTransactionResponse.decode(new _m0.Reader(data)));
1268
+ }
1269
+
1270
+ SetTxToProcess(request: MsgSetTxToProcess): Promise<MsgSetTxToProcessResponse> {
1271
+ const data = MsgSetTxToProcess.encode(request).finish();
1272
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "SetTxToProcess", data);
1273
+ return promise.then((data) => MsgSetTxToProcessResponse.decode(new _m0.Reader(data)));
1274
+ }
1275
+
1276
+ FinalizeSwapTransaction(request: MsgFinalizeSwapTransaction): Promise<MsgFinalizeSwapTransactionResponse> {
1277
+ const data = MsgFinalizeSwapTransaction.encode(request).finish();
1278
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "FinalizeSwapTransaction", data);
1279
+ return promise.then((data) => MsgFinalizeSwapTransactionResponse.decode(new _m0.Reader(data)));
1280
+ }
1281
+
1282
+ SwapObserveVote(request: MsgSwapObserveVote): Promise<MsgSwapObserveVoteResponse> {
1283
+ const data = MsgSwapObserveVote.encode(request).finish();
1284
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "SwapObserveVote", data);
1285
+ return promise.then((data) => MsgSwapObserveVoteResponse.decode(new _m0.Reader(data)));
1286
+ }
1287
+
1288
+ CleanPendingSwapTransaction(
1289
+ request: MsgCleanPendingSwapTransaction,
1290
+ ): Promise<MsgCleanPendingSwapTransactionResponse> {
1291
+ const data = MsgCleanPendingSwapTransaction.encode(request).finish();
1292
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "CleanPendingSwapTransaction", data);
1293
+ return promise.then((data) => MsgCleanPendingSwapTransactionResponse.decode(new _m0.Reader(data)));
1294
+ }
1295
+
1296
+ UpdateSwapTransactionStatus(
1297
+ request: MsgUpdateSwapTransactionStatus,
1298
+ ): Promise<MsgUpdateSwapTransactionStatusResponse> {
1299
+ const data = MsgUpdateSwapTransactionStatus.encode(request).finish();
1300
+ const promise = this.rpc.request("kimablockchain.swap.Msg", "UpdateSwapTransactionStatus", data);
1301
+ return promise.then((data) => MsgUpdateSwapTransactionStatusResponse.decode(new _m0.Reader(data)));
1302
+ }
1303
+ }
1304
+
1305
+ interface Rpc {
1306
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
1307
+ }
1308
+
1309
+ declare var self: any | undefined;
1310
+ declare var window: any | undefined;
1311
+ declare var global: any | undefined;
1312
+ var globalThis: any = (() => {
1313
+ if (typeof globalThis !== "undefined") {
1314
+ return globalThis;
1315
+ }
1316
+ if (typeof self !== "undefined") {
1317
+ return self;
1318
+ }
1319
+ if (typeof window !== "undefined") {
1320
+ return window;
1321
+ }
1322
+ if (typeof global !== "undefined") {
1323
+ return global;
1324
+ }
1325
+ throw "Unable to locate global object";
1326
+ })();
1327
+
1328
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1329
+
1330
+ export type DeepPartial<T> = T extends Builtin ? T
1331
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
1332
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
1333
+ : Partial<T>;
1334
+
1335
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
1336
+ export type Exact<P, I extends P> = P extends Builtin ? P
1337
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
1338
+
1339
+ function longToNumber(long: Long): number {
1340
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
1341
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1342
+ }
1343
+ return long.toNumber();
1344
+ }
1345
+
1346
+ if (_m0.util.Long !== Long) {
1347
+ _m0.util.Long = Long as any;
1348
+ _m0.configure();
1349
+ }
1350
+
1351
+ function isSet(value: any): boolean {
1352
+ return value !== null && value !== undefined;
1353
+ }