@kimafinance/kima-transaction-api 1.0.24-beta.1 → 1.0.26-beta.1
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.
- package/build/index.d.ts +6 -1
- package/build/index.js +7 -2
- package/build/kima/tx.d.ts +40 -0
- package/build/kima/tx.js +218 -19
- package/package.json +1 -1
- package/src/index.ts +16 -1
- package/src/kima/tx.ts +559 -120
package/src/kima/tx.ts
CHANGED
|
@@ -13,6 +13,16 @@ export interface MsgRequestTransaction {
|
|
|
13
13
|
symbol: string;
|
|
14
14
|
amount: string;
|
|
15
15
|
fee: string;
|
|
16
|
+
/** the timestamp when the HTLC contract expires and the user can reclaim the funds locked there */
|
|
17
|
+
htlcExpirationTimestamp: string;
|
|
18
|
+
/** the txhash locking the funds in the HTLC */
|
|
19
|
+
htlcCreationHash: string;
|
|
20
|
+
/** the output index of the locked funds in the HTLC creation transaction */
|
|
21
|
+
htlcCreationVout: number;
|
|
22
|
+
/** a version denoting which HTLC script version is being using for the HTLC transaction */
|
|
23
|
+
htlcVersion: string;
|
|
24
|
+
/** for bitcoin transaction this is the public key of the sender */
|
|
25
|
+
senderPubKey: Uint8Array;
|
|
16
26
|
}
|
|
17
27
|
|
|
18
28
|
export interface MsgRequestTransactionResponse {
|
|
@@ -54,6 +64,16 @@ export interface MsgRequestProvisionTransaction {
|
|
|
54
64
|
symbol: string;
|
|
55
65
|
amount: string;
|
|
56
66
|
options: string;
|
|
67
|
+
/** BTC transaction */
|
|
68
|
+
htlcExpirationTimestamp: string;
|
|
69
|
+
/** the txhash locking the funds in the HTLC */
|
|
70
|
+
htlcCreationHash: string;
|
|
71
|
+
/** the output index of the locked funds in the HTLC creation transaction */
|
|
72
|
+
htlcCreationVout: number;
|
|
73
|
+
/** a version denoting which HTLC script version is being using for the HTLC transaction */
|
|
74
|
+
htlcVersion: string;
|
|
75
|
+
/** the (compressed) public key of the sender */
|
|
76
|
+
senderPubKey: Uint8Array;
|
|
57
77
|
}
|
|
58
78
|
|
|
59
79
|
export interface MsgRequestProvisionTransactionResponse {
|
|
@@ -94,8 +114,7 @@ export interface MsgSetTxProcess {
|
|
|
94
114
|
txType: string;
|
|
95
115
|
}
|
|
96
116
|
|
|
97
|
-
export interface MsgSetTxProcessResponse {
|
|
98
|
-
}
|
|
117
|
+
export interface MsgSetTxProcessResponse {}
|
|
99
118
|
|
|
100
119
|
export interface MsgRequestDrainTransaction {
|
|
101
120
|
creator: string;
|
|
@@ -135,11 +154,19 @@ function createBaseMsgRequestTransaction(): MsgRequestTransaction {
|
|
|
135
154
|
symbol: "",
|
|
136
155
|
amount: "",
|
|
137
156
|
fee: "",
|
|
157
|
+
htlcExpirationTimestamp: "",
|
|
158
|
+
htlcCreationHash: "",
|
|
159
|
+
htlcCreationVout: 0,
|
|
160
|
+
htlcVersion: "",
|
|
161
|
+
senderPubKey: new Uint8Array(),
|
|
138
162
|
};
|
|
139
163
|
}
|
|
140
164
|
|
|
141
165
|
export const MsgRequestTransaction = {
|
|
142
|
-
encode(
|
|
166
|
+
encode(
|
|
167
|
+
message: MsgRequestTransaction,
|
|
168
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
169
|
+
): _m0.Writer {
|
|
143
170
|
if (message.creator !== "") {
|
|
144
171
|
writer.uint32(10).string(message.creator);
|
|
145
172
|
}
|
|
@@ -164,10 +191,28 @@ export const MsgRequestTransaction = {
|
|
|
164
191
|
if (message.fee !== "") {
|
|
165
192
|
writer.uint32(66).string(message.fee);
|
|
166
193
|
}
|
|
194
|
+
if (message.htlcExpirationTimestamp !== "") {
|
|
195
|
+
writer.uint32(74).string(message.htlcExpirationTimestamp);
|
|
196
|
+
}
|
|
197
|
+
if (message.htlcCreationHash !== "") {
|
|
198
|
+
writer.uint32(82).string(message.htlcCreationHash);
|
|
199
|
+
}
|
|
200
|
+
if (message.htlcCreationVout !== 0) {
|
|
201
|
+
writer.uint32(88).uint32(message.htlcCreationVout);
|
|
202
|
+
}
|
|
203
|
+
if (message.htlcVersion !== "") {
|
|
204
|
+
writer.uint32(98).string(message.htlcVersion);
|
|
205
|
+
}
|
|
206
|
+
if (message.senderPubKey.length !== 0) {
|
|
207
|
+
writer.uint32(106).bytes(message.senderPubKey);
|
|
208
|
+
}
|
|
167
209
|
return writer;
|
|
168
210
|
},
|
|
169
211
|
|
|
170
|
-
decode(
|
|
212
|
+
decode(
|
|
213
|
+
input: _m0.Reader | Uint8Array,
|
|
214
|
+
length?: number
|
|
215
|
+
): MsgRequestTransaction {
|
|
171
216
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
172
217
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
173
218
|
const message = createBaseMsgRequestTransaction();
|
|
@@ -198,6 +243,21 @@ export const MsgRequestTransaction = {
|
|
|
198
243
|
case 8:
|
|
199
244
|
message.fee = reader.string();
|
|
200
245
|
break;
|
|
246
|
+
case 9:
|
|
247
|
+
message.htlcExpirationTimestamp = reader.string();
|
|
248
|
+
break;
|
|
249
|
+
case 10:
|
|
250
|
+
message.htlcCreationHash = reader.string();
|
|
251
|
+
break;
|
|
252
|
+
case 11:
|
|
253
|
+
message.htlcCreationVout = reader.uint32();
|
|
254
|
+
break;
|
|
255
|
+
case 12:
|
|
256
|
+
message.htlcVersion = reader.string();
|
|
257
|
+
break;
|
|
258
|
+
case 13:
|
|
259
|
+
message.senderPubKey = reader.bytes();
|
|
260
|
+
break;
|
|
201
261
|
default:
|
|
202
262
|
reader.skipType(tag & 7);
|
|
203
263
|
break;
|
|
@@ -210,29 +270,66 @@ export const MsgRequestTransaction = {
|
|
|
210
270
|
return {
|
|
211
271
|
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
212
272
|
originChain: isSet(object.originChain) ? String(object.originChain) : "",
|
|
213
|
-
originAddress: isSet(object.originAddress)
|
|
273
|
+
originAddress: isSet(object.originAddress)
|
|
274
|
+
? String(object.originAddress)
|
|
275
|
+
: "",
|
|
214
276
|
targetChain: isSet(object.targetChain) ? String(object.targetChain) : "",
|
|
215
|
-
targetAddress: isSet(object.targetAddress)
|
|
277
|
+
targetAddress: isSet(object.targetAddress)
|
|
278
|
+
? String(object.targetAddress)
|
|
279
|
+
: "",
|
|
216
280
|
symbol: isSet(object.symbol) ? String(object.symbol) : "",
|
|
217
281
|
amount: isSet(object.amount) ? String(object.amount) : "",
|
|
218
282
|
fee: isSet(object.fee) ? String(object.fee) : "",
|
|
283
|
+
htlcExpirationTimestamp: isSet(object.htlcExpirationTimestamp)
|
|
284
|
+
? String(object.htlcExpirationTimestamp)
|
|
285
|
+
: "",
|
|
286
|
+
htlcCreationHash: isSet(object.htlcCreationHash)
|
|
287
|
+
? String(object.htlcCreationHash)
|
|
288
|
+
: "",
|
|
289
|
+
htlcCreationVout: isSet(object.htlcCreationVout)
|
|
290
|
+
? Number(object.htlcCreationVout)
|
|
291
|
+
: 0,
|
|
292
|
+
htlcVersion: isSet(object.htlcVersion) ? String(object.htlcVersion) : "",
|
|
293
|
+
senderPubKey: isSet(object.senderPubKey)
|
|
294
|
+
? bytesFromBase64(object.senderPubKey)
|
|
295
|
+
: new Uint8Array(),
|
|
219
296
|
};
|
|
220
297
|
},
|
|
221
298
|
|
|
222
299
|
toJSON(message: MsgRequestTransaction): unknown {
|
|
223
300
|
const obj: any = {};
|
|
224
301
|
message.creator !== undefined && (obj.creator = message.creator);
|
|
225
|
-
message.originChain !== undefined &&
|
|
226
|
-
|
|
227
|
-
message.
|
|
228
|
-
|
|
302
|
+
message.originChain !== undefined &&
|
|
303
|
+
(obj.originChain = message.originChain);
|
|
304
|
+
message.originAddress !== undefined &&
|
|
305
|
+
(obj.originAddress = message.originAddress);
|
|
306
|
+
message.targetChain !== undefined &&
|
|
307
|
+
(obj.targetChain = message.targetChain);
|
|
308
|
+
message.targetAddress !== undefined &&
|
|
309
|
+
(obj.targetAddress = message.targetAddress);
|
|
229
310
|
message.symbol !== undefined && (obj.symbol = message.symbol);
|
|
230
311
|
message.amount !== undefined && (obj.amount = message.amount);
|
|
231
312
|
message.fee !== undefined && (obj.fee = message.fee);
|
|
313
|
+
message.htlcExpirationTimestamp !== undefined &&
|
|
314
|
+
(obj.htlcExpirationTimestamp = message.htlcExpirationTimestamp);
|
|
315
|
+
message.htlcCreationHash !== undefined &&
|
|
316
|
+
(obj.htlcCreationHash = message.htlcCreationHash);
|
|
317
|
+
message.htlcCreationVout !== undefined &&
|
|
318
|
+
(obj.htlcCreationVout = Math.round(message.htlcCreationVout));
|
|
319
|
+
message.htlcVersion !== undefined &&
|
|
320
|
+
(obj.htlcVersion = message.htlcVersion);
|
|
321
|
+
message.senderPubKey !== undefined &&
|
|
322
|
+
(obj.senderPubKey = base64FromBytes(
|
|
323
|
+
message.senderPubKey !== undefined
|
|
324
|
+
? message.senderPubKey
|
|
325
|
+
: new Uint8Array()
|
|
326
|
+
));
|
|
232
327
|
return obj;
|
|
233
328
|
},
|
|
234
329
|
|
|
235
|
-
fromPartial<I extends Exact<DeepPartial<MsgRequestTransaction>, I>>(
|
|
330
|
+
fromPartial<I extends Exact<DeepPartial<MsgRequestTransaction>, I>>(
|
|
331
|
+
object: I
|
|
332
|
+
): MsgRequestTransaction {
|
|
236
333
|
const message = createBaseMsgRequestTransaction();
|
|
237
334
|
message.creator = object.creator ?? "";
|
|
238
335
|
message.originChain = object.originChain ?? "";
|
|
@@ -242,6 +339,11 @@ export const MsgRequestTransaction = {
|
|
|
242
339
|
message.symbol = object.symbol ?? "";
|
|
243
340
|
message.amount = object.amount ?? "";
|
|
244
341
|
message.fee = object.fee ?? "";
|
|
342
|
+
message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
|
|
343
|
+
message.htlcCreationHash = object.htlcCreationHash ?? "";
|
|
344
|
+
message.htlcCreationVout = object.htlcCreationVout ?? 0;
|
|
345
|
+
message.htlcVersion = object.htlcVersion ?? "";
|
|
346
|
+
message.senderPubKey = object.senderPubKey ?? new Uint8Array();
|
|
245
347
|
return message;
|
|
246
348
|
},
|
|
247
349
|
};
|
|
@@ -251,7 +353,10 @@ function createBaseMsgRequestTransactionResponse(): MsgRequestTransactionRespons
|
|
|
251
353
|
}
|
|
252
354
|
|
|
253
355
|
export const MsgRequestTransactionResponse = {
|
|
254
|
-
encode(
|
|
356
|
+
encode(
|
|
357
|
+
message: MsgRequestTransactionResponse,
|
|
358
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
359
|
+
): _m0.Writer {
|
|
255
360
|
if (message.code !== "") {
|
|
256
361
|
writer.uint32(10).string(message.code);
|
|
257
362
|
}
|
|
@@ -264,7 +369,10 @@ export const MsgRequestTransactionResponse = {
|
|
|
264
369
|
return writer;
|
|
265
370
|
},
|
|
266
371
|
|
|
267
|
-
decode(
|
|
372
|
+
decode(
|
|
373
|
+
input: _m0.Reader | Uint8Array,
|
|
374
|
+
length?: number
|
|
375
|
+
): MsgRequestTransactionResponse {
|
|
268
376
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
269
377
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
270
378
|
const message = createBaseMsgRequestTransactionResponse();
|
|
@@ -305,7 +413,7 @@ export const MsgRequestTransactionResponse = {
|
|
|
305
413
|
},
|
|
306
414
|
|
|
307
415
|
fromPartial<I extends Exact<DeepPartial<MsgRequestTransactionResponse>, I>>(
|
|
308
|
-
object: I
|
|
416
|
+
object: I
|
|
309
417
|
): MsgRequestTransactionResponse {
|
|
310
418
|
const message = createBaseMsgRequestTransactionResponse();
|
|
311
419
|
message.code = object.code ?? "";
|
|
@@ -320,7 +428,10 @@ function createBaseMsgFinalizeTransaction(): MsgFinalizeTransaction {
|
|
|
320
428
|
}
|
|
321
429
|
|
|
322
430
|
export const MsgFinalizeTransaction = {
|
|
323
|
-
encode(
|
|
431
|
+
encode(
|
|
432
|
+
message: MsgFinalizeTransaction,
|
|
433
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
434
|
+
): _m0.Writer {
|
|
324
435
|
if (message.creator !== "") {
|
|
325
436
|
writer.uint32(10).string(message.creator);
|
|
326
437
|
}
|
|
@@ -339,7 +450,10 @@ export const MsgFinalizeTransaction = {
|
|
|
339
450
|
return writer;
|
|
340
451
|
},
|
|
341
452
|
|
|
342
|
-
decode(
|
|
453
|
+
decode(
|
|
454
|
+
input: _m0.Reader | Uint8Array,
|
|
455
|
+
length?: number
|
|
456
|
+
): MsgFinalizeTransaction {
|
|
343
457
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
344
458
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
345
459
|
const message = createBaseMsgFinalizeTransaction();
|
|
@@ -389,7 +503,9 @@ export const MsgFinalizeTransaction = {
|
|
|
389
503
|
return obj;
|
|
390
504
|
},
|
|
391
505
|
|
|
392
|
-
fromPartial<I extends Exact<DeepPartial<MsgFinalizeTransaction>, I>>(
|
|
506
|
+
fromPartial<I extends Exact<DeepPartial<MsgFinalizeTransaction>, I>>(
|
|
507
|
+
object: I
|
|
508
|
+
): MsgFinalizeTransaction {
|
|
393
509
|
const message = createBaseMsgFinalizeTransaction();
|
|
394
510
|
message.creator = object.creator ?? "";
|
|
395
511
|
message.txId = object.txId ?? 0;
|
|
@@ -405,7 +521,10 @@ function createBaseMsgFinalizeTransactionResponse(): MsgFinalizeTransactionRespo
|
|
|
405
521
|
}
|
|
406
522
|
|
|
407
523
|
export const MsgFinalizeTransactionResponse = {
|
|
408
|
-
encode(
|
|
524
|
+
encode(
|
|
525
|
+
message: MsgFinalizeTransactionResponse,
|
|
526
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
527
|
+
): _m0.Writer {
|
|
409
528
|
if (message.code !== "") {
|
|
410
529
|
writer.uint32(10).string(message.code);
|
|
411
530
|
}
|
|
@@ -415,7 +534,10 @@ export const MsgFinalizeTransactionResponse = {
|
|
|
415
534
|
return writer;
|
|
416
535
|
},
|
|
417
536
|
|
|
418
|
-
decode(
|
|
537
|
+
decode(
|
|
538
|
+
input: _m0.Reader | Uint8Array,
|
|
539
|
+
length?: number
|
|
540
|
+
): MsgFinalizeTransactionResponse {
|
|
419
541
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
420
542
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
421
543
|
const message = createBaseMsgFinalizeTransactionResponse();
|
|
@@ -437,7 +559,10 @@ export const MsgFinalizeTransactionResponse = {
|
|
|
437
559
|
},
|
|
438
560
|
|
|
439
561
|
fromJSON(object: any): MsgFinalizeTransactionResponse {
|
|
440
|
-
return {
|
|
562
|
+
return {
|
|
563
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
564
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
565
|
+
};
|
|
441
566
|
},
|
|
442
567
|
|
|
443
568
|
toJSON(message: MsgFinalizeTransactionResponse): unknown {
|
|
@@ -448,7 +573,7 @@ export const MsgFinalizeTransactionResponse = {
|
|
|
448
573
|
},
|
|
449
574
|
|
|
450
575
|
fromPartial<I extends Exact<DeepPartial<MsgFinalizeTransactionResponse>, I>>(
|
|
451
|
-
object: I
|
|
576
|
+
object: I
|
|
452
577
|
): MsgFinalizeTransactionResponse {
|
|
453
578
|
const message = createBaseMsgFinalizeTransactionResponse();
|
|
454
579
|
message.code = object.code ?? "";
|
|
@@ -462,7 +587,10 @@ function createBaseMsgFinalizeProvisionTransaction(): MsgFinalizeProvisionTransa
|
|
|
462
587
|
}
|
|
463
588
|
|
|
464
589
|
export const MsgFinalizeProvisionTransaction = {
|
|
465
|
-
encode(
|
|
590
|
+
encode(
|
|
591
|
+
message: MsgFinalizeProvisionTransaction,
|
|
592
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
593
|
+
): _m0.Writer {
|
|
466
594
|
if (message.creator !== "") {
|
|
467
595
|
writer.uint32(10).string(message.creator);
|
|
468
596
|
}
|
|
@@ -481,7 +609,10 @@ export const MsgFinalizeProvisionTransaction = {
|
|
|
481
609
|
return writer;
|
|
482
610
|
},
|
|
483
611
|
|
|
484
|
-
decode(
|
|
612
|
+
decode(
|
|
613
|
+
input: _m0.Reader | Uint8Array,
|
|
614
|
+
length?: number
|
|
615
|
+
): MsgFinalizeProvisionTransaction {
|
|
485
616
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
486
617
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
487
618
|
const message = createBaseMsgFinalizeProvisionTransaction();
|
|
@@ -532,7 +663,7 @@ export const MsgFinalizeProvisionTransaction = {
|
|
|
532
663
|
},
|
|
533
664
|
|
|
534
665
|
fromPartial<I extends Exact<DeepPartial<MsgFinalizeProvisionTransaction>, I>>(
|
|
535
|
-
object: I
|
|
666
|
+
object: I
|
|
536
667
|
): MsgFinalizeProvisionTransaction {
|
|
537
668
|
const message = createBaseMsgFinalizeProvisionTransaction();
|
|
538
669
|
message.creator = object.creator ?? "";
|
|
@@ -549,7 +680,10 @@ function createBaseMsgFinalizeProvisionTransactionResponse(): MsgFinalizeProvisi
|
|
|
549
680
|
}
|
|
550
681
|
|
|
551
682
|
export const MsgFinalizeProvisionTransactionResponse = {
|
|
552
|
-
encode(
|
|
683
|
+
encode(
|
|
684
|
+
message: MsgFinalizeProvisionTransactionResponse,
|
|
685
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
686
|
+
): _m0.Writer {
|
|
553
687
|
if (message.code !== "") {
|
|
554
688
|
writer.uint32(10).string(message.code);
|
|
555
689
|
}
|
|
@@ -559,7 +693,10 @@ export const MsgFinalizeProvisionTransactionResponse = {
|
|
|
559
693
|
return writer;
|
|
560
694
|
},
|
|
561
695
|
|
|
562
|
-
decode(
|
|
696
|
+
decode(
|
|
697
|
+
input: _m0.Reader | Uint8Array,
|
|
698
|
+
length?: number
|
|
699
|
+
): MsgFinalizeProvisionTransactionResponse {
|
|
563
700
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
564
701
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
565
702
|
const message = createBaseMsgFinalizeProvisionTransactionResponse();
|
|
@@ -581,7 +718,10 @@ export const MsgFinalizeProvisionTransactionResponse = {
|
|
|
581
718
|
},
|
|
582
719
|
|
|
583
720
|
fromJSON(object: any): MsgFinalizeProvisionTransactionResponse {
|
|
584
|
-
return {
|
|
721
|
+
return {
|
|
722
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
723
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
724
|
+
};
|
|
585
725
|
},
|
|
586
726
|
|
|
587
727
|
toJSON(message: MsgFinalizeProvisionTransactionResponse): unknown {
|
|
@@ -591,9 +731,9 @@ export const MsgFinalizeProvisionTransactionResponse = {
|
|
|
591
731
|
return obj;
|
|
592
732
|
},
|
|
593
733
|
|
|
594
|
-
fromPartial<
|
|
595
|
-
|
|
596
|
-
): MsgFinalizeProvisionTransactionResponse {
|
|
734
|
+
fromPartial<
|
|
735
|
+
I extends Exact<DeepPartial<MsgFinalizeProvisionTransactionResponse>, I>
|
|
736
|
+
>(object: I): MsgFinalizeProvisionTransactionResponse {
|
|
597
737
|
const message = createBaseMsgFinalizeProvisionTransactionResponse();
|
|
598
738
|
message.code = object.code ?? "";
|
|
599
739
|
message.msg = object.msg ?? "";
|
|
@@ -602,11 +742,26 @@ export const MsgFinalizeProvisionTransactionResponse = {
|
|
|
602
742
|
};
|
|
603
743
|
|
|
604
744
|
function createBaseMsgRequestProvisionTransaction(): MsgRequestProvisionTransaction {
|
|
605
|
-
return {
|
|
745
|
+
return {
|
|
746
|
+
creator: "",
|
|
747
|
+
chain: "",
|
|
748
|
+
fromAddress: "",
|
|
749
|
+
symbol: "",
|
|
750
|
+
amount: "",
|
|
751
|
+
options: "",
|
|
752
|
+
htlcExpirationTimestamp: "",
|
|
753
|
+
htlcCreationHash: "",
|
|
754
|
+
htlcCreationVout: 0,
|
|
755
|
+
htlcVersion: "",
|
|
756
|
+
senderPubKey: new Uint8Array(),
|
|
757
|
+
};
|
|
606
758
|
}
|
|
607
759
|
|
|
608
760
|
export const MsgRequestProvisionTransaction = {
|
|
609
|
-
encode(
|
|
761
|
+
encode(
|
|
762
|
+
message: MsgRequestProvisionTransaction,
|
|
763
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
764
|
+
): _m0.Writer {
|
|
610
765
|
if (message.creator !== "") {
|
|
611
766
|
writer.uint32(10).string(message.creator);
|
|
612
767
|
}
|
|
@@ -625,10 +780,28 @@ export const MsgRequestProvisionTransaction = {
|
|
|
625
780
|
if (message.options !== "") {
|
|
626
781
|
writer.uint32(50).string(message.options);
|
|
627
782
|
}
|
|
783
|
+
if (message.htlcExpirationTimestamp !== "") {
|
|
784
|
+
writer.uint32(58).string(message.htlcExpirationTimestamp);
|
|
785
|
+
}
|
|
786
|
+
if (message.htlcCreationHash !== "") {
|
|
787
|
+
writer.uint32(66).string(message.htlcCreationHash);
|
|
788
|
+
}
|
|
789
|
+
if (message.htlcCreationVout !== 0) {
|
|
790
|
+
writer.uint32(72).uint32(message.htlcCreationVout);
|
|
791
|
+
}
|
|
792
|
+
if (message.htlcVersion !== "") {
|
|
793
|
+
writer.uint32(82).string(message.htlcVersion);
|
|
794
|
+
}
|
|
795
|
+
if (message.senderPubKey.length !== 0) {
|
|
796
|
+
writer.uint32(90).bytes(message.senderPubKey);
|
|
797
|
+
}
|
|
628
798
|
return writer;
|
|
629
799
|
},
|
|
630
800
|
|
|
631
|
-
decode(
|
|
801
|
+
decode(
|
|
802
|
+
input: _m0.Reader | Uint8Array,
|
|
803
|
+
length?: number
|
|
804
|
+
): MsgRequestProvisionTransaction {
|
|
632
805
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
633
806
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
634
807
|
const message = createBaseMsgRequestProvisionTransaction();
|
|
@@ -653,6 +826,21 @@ export const MsgRequestProvisionTransaction = {
|
|
|
653
826
|
case 6:
|
|
654
827
|
message.options = reader.string();
|
|
655
828
|
break;
|
|
829
|
+
case 7:
|
|
830
|
+
message.htlcExpirationTimestamp = reader.string();
|
|
831
|
+
break;
|
|
832
|
+
case 8:
|
|
833
|
+
message.htlcCreationHash = reader.string();
|
|
834
|
+
break;
|
|
835
|
+
case 9:
|
|
836
|
+
message.htlcCreationVout = reader.uint32();
|
|
837
|
+
break;
|
|
838
|
+
case 10:
|
|
839
|
+
message.htlcVersion = reader.string();
|
|
840
|
+
break;
|
|
841
|
+
case 11:
|
|
842
|
+
message.senderPubKey = reader.bytes();
|
|
843
|
+
break;
|
|
656
844
|
default:
|
|
657
845
|
reader.skipType(tag & 7);
|
|
658
846
|
break;
|
|
@@ -669,6 +857,19 @@ export const MsgRequestProvisionTransaction = {
|
|
|
669
857
|
symbol: isSet(object.symbol) ? String(object.symbol) : "",
|
|
670
858
|
amount: isSet(object.amount) ? String(object.amount) : "",
|
|
671
859
|
options: isSet(object.options) ? String(object.options) : "",
|
|
860
|
+
htlcExpirationTimestamp: isSet(object.htlcExpirationTimestamp)
|
|
861
|
+
? String(object.htlcExpirationTimestamp)
|
|
862
|
+
: "",
|
|
863
|
+
htlcCreationHash: isSet(object.htlcCreationHash)
|
|
864
|
+
? String(object.htlcCreationHash)
|
|
865
|
+
: "",
|
|
866
|
+
htlcCreationVout: isSet(object.htlcCreationVout)
|
|
867
|
+
? Number(object.htlcCreationVout)
|
|
868
|
+
: 0,
|
|
869
|
+
htlcVersion: isSet(object.htlcVersion) ? String(object.htlcVersion) : "",
|
|
870
|
+
senderPubKey: isSet(object.senderPubKey)
|
|
871
|
+
? bytesFromBase64(object.senderPubKey)
|
|
872
|
+
: new Uint8Array(),
|
|
672
873
|
};
|
|
673
874
|
},
|
|
674
875
|
|
|
@@ -676,15 +877,30 @@ export const MsgRequestProvisionTransaction = {
|
|
|
676
877
|
const obj: any = {};
|
|
677
878
|
message.creator !== undefined && (obj.creator = message.creator);
|
|
678
879
|
message.chain !== undefined && (obj.chain = message.chain);
|
|
679
|
-
message.fromAddress !== undefined &&
|
|
880
|
+
message.fromAddress !== undefined &&
|
|
881
|
+
(obj.fromAddress = message.fromAddress);
|
|
680
882
|
message.symbol !== undefined && (obj.symbol = message.symbol);
|
|
681
883
|
message.amount !== undefined && (obj.amount = message.amount);
|
|
682
884
|
message.options !== undefined && (obj.options = message.options);
|
|
885
|
+
message.htlcExpirationTimestamp !== undefined &&
|
|
886
|
+
(obj.htlcExpirationTimestamp = message.htlcExpirationTimestamp);
|
|
887
|
+
message.htlcCreationHash !== undefined &&
|
|
888
|
+
(obj.htlcCreationHash = message.htlcCreationHash);
|
|
889
|
+
message.htlcCreationVout !== undefined &&
|
|
890
|
+
(obj.htlcCreationVout = Math.round(message.htlcCreationVout));
|
|
891
|
+
message.htlcVersion !== undefined &&
|
|
892
|
+
(obj.htlcVersion = message.htlcVersion);
|
|
893
|
+
message.senderPubKey !== undefined &&
|
|
894
|
+
(obj.senderPubKey = base64FromBytes(
|
|
895
|
+
message.senderPubKey !== undefined
|
|
896
|
+
? message.senderPubKey
|
|
897
|
+
: new Uint8Array()
|
|
898
|
+
));
|
|
683
899
|
return obj;
|
|
684
900
|
},
|
|
685
901
|
|
|
686
902
|
fromPartial<I extends Exact<DeepPartial<MsgRequestProvisionTransaction>, I>>(
|
|
687
|
-
object: I
|
|
903
|
+
object: I
|
|
688
904
|
): MsgRequestProvisionTransaction {
|
|
689
905
|
const message = createBaseMsgRequestProvisionTransaction();
|
|
690
906
|
message.creator = object.creator ?? "";
|
|
@@ -693,6 +909,11 @@ export const MsgRequestProvisionTransaction = {
|
|
|
693
909
|
message.symbol = object.symbol ?? "";
|
|
694
910
|
message.amount = object.amount ?? "";
|
|
695
911
|
message.options = object.options ?? "";
|
|
912
|
+
message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
|
|
913
|
+
message.htlcCreationHash = object.htlcCreationHash ?? "";
|
|
914
|
+
message.htlcCreationVout = object.htlcCreationVout ?? 0;
|
|
915
|
+
message.htlcVersion = object.htlcVersion ?? "";
|
|
916
|
+
message.senderPubKey = object.senderPubKey ?? new Uint8Array();
|
|
696
917
|
return message;
|
|
697
918
|
},
|
|
698
919
|
};
|
|
@@ -702,7 +923,10 @@ function createBaseMsgRequestProvisionTransactionResponse(): MsgRequestProvision
|
|
|
702
923
|
}
|
|
703
924
|
|
|
704
925
|
export const MsgRequestProvisionTransactionResponse = {
|
|
705
|
-
encode(
|
|
926
|
+
encode(
|
|
927
|
+
message: MsgRequestProvisionTransactionResponse,
|
|
928
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
929
|
+
): _m0.Writer {
|
|
706
930
|
if (message.code !== "") {
|
|
707
931
|
writer.uint32(10).string(message.code);
|
|
708
932
|
}
|
|
@@ -715,7 +939,10 @@ export const MsgRequestProvisionTransactionResponse = {
|
|
|
715
939
|
return writer;
|
|
716
940
|
},
|
|
717
941
|
|
|
718
|
-
decode(
|
|
942
|
+
decode(
|
|
943
|
+
input: _m0.Reader | Uint8Array,
|
|
944
|
+
length?: number
|
|
945
|
+
): MsgRequestProvisionTransactionResponse {
|
|
719
946
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
720
947
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
721
948
|
const message = createBaseMsgRequestProvisionTransactionResponse();
|
|
@@ -755,9 +982,9 @@ export const MsgRequestProvisionTransactionResponse = {
|
|
|
755
982
|
return obj;
|
|
756
983
|
},
|
|
757
984
|
|
|
758
|
-
fromPartial<
|
|
759
|
-
|
|
760
|
-
): MsgRequestProvisionTransactionResponse {
|
|
985
|
+
fromPartial<
|
|
986
|
+
I extends Exact<DeepPartial<MsgRequestProvisionTransactionResponse>, I>
|
|
987
|
+
>(object: I): MsgRequestProvisionTransactionResponse {
|
|
761
988
|
const message = createBaseMsgRequestProvisionTransactionResponse();
|
|
762
989
|
message.code = object.code ?? "";
|
|
763
990
|
message.msg = object.msg ?? "";
|
|
@@ -771,7 +998,10 @@ function createBaseMsgCancelTransaction(): MsgCancelTransaction {
|
|
|
771
998
|
}
|
|
772
999
|
|
|
773
1000
|
export const MsgCancelTransaction = {
|
|
774
|
-
encode(
|
|
1001
|
+
encode(
|
|
1002
|
+
message: MsgCancelTransaction,
|
|
1003
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1004
|
+
): _m0.Writer {
|
|
775
1005
|
if (message.creator !== "") {
|
|
776
1006
|
writer.uint32(10).string(message.creator);
|
|
777
1007
|
}
|
|
@@ -781,7 +1011,10 @@ export const MsgCancelTransaction = {
|
|
|
781
1011
|
return writer;
|
|
782
1012
|
},
|
|
783
1013
|
|
|
784
|
-
decode(
|
|
1014
|
+
decode(
|
|
1015
|
+
input: _m0.Reader | Uint8Array,
|
|
1016
|
+
length?: number
|
|
1017
|
+
): MsgCancelTransaction {
|
|
785
1018
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
786
1019
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
787
1020
|
const message = createBaseMsgCancelTransaction();
|
|
@@ -805,18 +1038,23 @@ export const MsgCancelTransaction = {
|
|
|
805
1038
|
fromJSON(object: any): MsgCancelTransaction {
|
|
806
1039
|
return {
|
|
807
1040
|
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
808
|
-
transactionId: isSet(object.transactionId)
|
|
1041
|
+
transactionId: isSet(object.transactionId)
|
|
1042
|
+
? String(object.transactionId)
|
|
1043
|
+
: "",
|
|
809
1044
|
};
|
|
810
1045
|
},
|
|
811
1046
|
|
|
812
1047
|
toJSON(message: MsgCancelTransaction): unknown {
|
|
813
1048
|
const obj: any = {};
|
|
814
1049
|
message.creator !== undefined && (obj.creator = message.creator);
|
|
815
|
-
message.transactionId !== undefined &&
|
|
1050
|
+
message.transactionId !== undefined &&
|
|
1051
|
+
(obj.transactionId = message.transactionId);
|
|
816
1052
|
return obj;
|
|
817
1053
|
},
|
|
818
1054
|
|
|
819
|
-
fromPartial<I extends Exact<DeepPartial<MsgCancelTransaction>, I>>(
|
|
1055
|
+
fromPartial<I extends Exact<DeepPartial<MsgCancelTransaction>, I>>(
|
|
1056
|
+
object: I
|
|
1057
|
+
): MsgCancelTransaction {
|
|
820
1058
|
const message = createBaseMsgCancelTransaction();
|
|
821
1059
|
message.creator = object.creator ?? "";
|
|
822
1060
|
message.transactionId = object.transactionId ?? "";
|
|
@@ -829,7 +1067,10 @@ function createBaseMsgCancelTransactionResponse(): MsgCancelTransactionResponse
|
|
|
829
1067
|
}
|
|
830
1068
|
|
|
831
1069
|
export const MsgCancelTransactionResponse = {
|
|
832
|
-
encode(
|
|
1070
|
+
encode(
|
|
1071
|
+
message: MsgCancelTransactionResponse,
|
|
1072
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1073
|
+
): _m0.Writer {
|
|
833
1074
|
if (message.code !== "") {
|
|
834
1075
|
writer.uint32(10).string(message.code);
|
|
835
1076
|
}
|
|
@@ -839,7 +1080,10 @@ export const MsgCancelTransactionResponse = {
|
|
|
839
1080
|
return writer;
|
|
840
1081
|
},
|
|
841
1082
|
|
|
842
|
-
decode(
|
|
1083
|
+
decode(
|
|
1084
|
+
input: _m0.Reader | Uint8Array,
|
|
1085
|
+
length?: number
|
|
1086
|
+
): MsgCancelTransactionResponse {
|
|
843
1087
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
844
1088
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
845
1089
|
const message = createBaseMsgCancelTransactionResponse();
|
|
@@ -861,7 +1105,10 @@ export const MsgCancelTransactionResponse = {
|
|
|
861
1105
|
},
|
|
862
1106
|
|
|
863
1107
|
fromJSON(object: any): MsgCancelTransactionResponse {
|
|
864
|
-
return {
|
|
1108
|
+
return {
|
|
1109
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
1110
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
1111
|
+
};
|
|
865
1112
|
},
|
|
866
1113
|
|
|
867
1114
|
toJSON(message: MsgCancelTransactionResponse): unknown {
|
|
@@ -871,7 +1118,9 @@ export const MsgCancelTransactionResponse = {
|
|
|
871
1118
|
return obj;
|
|
872
1119
|
},
|
|
873
1120
|
|
|
874
|
-
fromPartial<I extends Exact<DeepPartial<MsgCancelTransactionResponse>, I>>(
|
|
1121
|
+
fromPartial<I extends Exact<DeepPartial<MsgCancelTransactionResponse>, I>>(
|
|
1122
|
+
object: I
|
|
1123
|
+
): MsgCancelTransactionResponse {
|
|
875
1124
|
const message = createBaseMsgCancelTransactionResponse();
|
|
876
1125
|
message.code = object.code ?? "";
|
|
877
1126
|
message.msg = object.msg ?? "";
|
|
@@ -884,7 +1133,10 @@ function createBaseMsgSetTxHash(): MsgSetTxHash {
|
|
|
884
1133
|
}
|
|
885
1134
|
|
|
886
1135
|
export const MsgSetTxHash = {
|
|
887
|
-
encode(
|
|
1136
|
+
encode(
|
|
1137
|
+
message: MsgSetTxHash,
|
|
1138
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1139
|
+
): _m0.Writer {
|
|
888
1140
|
if (message.creator !== "") {
|
|
889
1141
|
writer.uint32(10).string(message.creator);
|
|
890
1142
|
}
|
|
@@ -945,7 +1197,9 @@ export const MsgSetTxHash = {
|
|
|
945
1197
|
return obj;
|
|
946
1198
|
},
|
|
947
1199
|
|
|
948
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxHash>, I>>(
|
|
1200
|
+
fromPartial<I extends Exact<DeepPartial<MsgSetTxHash>, I>>(
|
|
1201
|
+
object: I
|
|
1202
|
+
): MsgSetTxHash {
|
|
949
1203
|
const message = createBaseMsgSetTxHash();
|
|
950
1204
|
message.creator = object.creator ?? "";
|
|
951
1205
|
message.txId = object.txId ?? 0;
|
|
@@ -960,7 +1214,10 @@ function createBaseMsgSetTxHashResponse(): MsgSetTxHashResponse {
|
|
|
960
1214
|
}
|
|
961
1215
|
|
|
962
1216
|
export const MsgSetTxHashResponse = {
|
|
963
|
-
encode(
|
|
1217
|
+
encode(
|
|
1218
|
+
message: MsgSetTxHashResponse,
|
|
1219
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1220
|
+
): _m0.Writer {
|
|
964
1221
|
if (message.code !== "") {
|
|
965
1222
|
writer.uint32(10).string(message.code);
|
|
966
1223
|
}
|
|
@@ -970,7 +1227,10 @@ export const MsgSetTxHashResponse = {
|
|
|
970
1227
|
return writer;
|
|
971
1228
|
},
|
|
972
1229
|
|
|
973
|
-
decode(
|
|
1230
|
+
decode(
|
|
1231
|
+
input: _m0.Reader | Uint8Array,
|
|
1232
|
+
length?: number
|
|
1233
|
+
): MsgSetTxHashResponse {
|
|
974
1234
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
975
1235
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
976
1236
|
const message = createBaseMsgSetTxHashResponse();
|
|
@@ -992,7 +1252,10 @@ export const MsgSetTxHashResponse = {
|
|
|
992
1252
|
},
|
|
993
1253
|
|
|
994
1254
|
fromJSON(object: any): MsgSetTxHashResponse {
|
|
995
|
-
return {
|
|
1255
|
+
return {
|
|
1256
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
1257
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
1258
|
+
};
|
|
996
1259
|
},
|
|
997
1260
|
|
|
998
1261
|
toJSON(message: MsgSetTxHashResponse): unknown {
|
|
@@ -1002,7 +1265,9 @@ export const MsgSetTxHashResponse = {
|
|
|
1002
1265
|
return obj;
|
|
1003
1266
|
},
|
|
1004
1267
|
|
|
1005
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxHashResponse>, I>>(
|
|
1268
|
+
fromPartial<I extends Exact<DeepPartial<MsgSetTxHashResponse>, I>>(
|
|
1269
|
+
object: I
|
|
1270
|
+
): MsgSetTxHashResponse {
|
|
1006
1271
|
const message = createBaseMsgSetTxHashResponse();
|
|
1007
1272
|
message.code = object.code ?? "";
|
|
1008
1273
|
message.msg = object.msg ?? "";
|
|
@@ -1015,7 +1280,10 @@ function createBaseMsgSetTxProcess(): MsgSetTxProcess {
|
|
|
1015
1280
|
}
|
|
1016
1281
|
|
|
1017
1282
|
export const MsgSetTxProcess = {
|
|
1018
|
-
encode(
|
|
1283
|
+
encode(
|
|
1284
|
+
message: MsgSetTxProcess,
|
|
1285
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1286
|
+
): _m0.Writer {
|
|
1019
1287
|
if (message.creator !== "") {
|
|
1020
1288
|
writer.uint32(10).string(message.creator);
|
|
1021
1289
|
}
|
|
@@ -1078,13 +1346,16 @@ export const MsgSetTxProcess = {
|
|
|
1078
1346
|
const obj: any = {};
|
|
1079
1347
|
message.creator !== undefined && (obj.creator = message.creator);
|
|
1080
1348
|
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
1081
|
-
message.timestamp !== undefined &&
|
|
1349
|
+
message.timestamp !== undefined &&
|
|
1350
|
+
(obj.timestamp = Math.round(message.timestamp));
|
|
1082
1351
|
message.msgId !== undefined && (obj.msgId = message.msgId);
|
|
1083
1352
|
message.txType !== undefined && (obj.txType = message.txType);
|
|
1084
1353
|
return obj;
|
|
1085
1354
|
},
|
|
1086
1355
|
|
|
1087
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcess>, I>>(
|
|
1356
|
+
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcess>, I>>(
|
|
1357
|
+
object: I
|
|
1358
|
+
): MsgSetTxProcess {
|
|
1088
1359
|
const message = createBaseMsgSetTxProcess();
|
|
1089
1360
|
message.creator = object.creator ?? "";
|
|
1090
1361
|
message.txId = object.txId ?? 0;
|
|
@@ -1100,11 +1371,17 @@ function createBaseMsgSetTxProcessResponse(): MsgSetTxProcessResponse {
|
|
|
1100
1371
|
}
|
|
1101
1372
|
|
|
1102
1373
|
export const MsgSetTxProcessResponse = {
|
|
1103
|
-
encode(
|
|
1374
|
+
encode(
|
|
1375
|
+
_: MsgSetTxProcessResponse,
|
|
1376
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1377
|
+
): _m0.Writer {
|
|
1104
1378
|
return writer;
|
|
1105
1379
|
},
|
|
1106
1380
|
|
|
1107
|
-
decode(
|
|
1381
|
+
decode(
|
|
1382
|
+
input: _m0.Reader | Uint8Array,
|
|
1383
|
+
length?: number
|
|
1384
|
+
): MsgSetTxProcessResponse {
|
|
1108
1385
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1109
1386
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1110
1387
|
const message = createBaseMsgSetTxProcessResponse();
|
|
@@ -1128,18 +1405,30 @@ export const MsgSetTxProcessResponse = {
|
|
|
1128
1405
|
return obj;
|
|
1129
1406
|
},
|
|
1130
1407
|
|
|
1131
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcessResponse>, I>>(
|
|
1408
|
+
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcessResponse>, I>>(
|
|
1409
|
+
_: I
|
|
1410
|
+
): MsgSetTxProcessResponse {
|
|
1132
1411
|
const message = createBaseMsgSetTxProcessResponse();
|
|
1133
1412
|
return message;
|
|
1134
1413
|
},
|
|
1135
1414
|
};
|
|
1136
1415
|
|
|
1137
1416
|
function createBaseMsgRequestDrainTransaction(): MsgRequestDrainTransaction {
|
|
1138
|
-
return {
|
|
1417
|
+
return {
|
|
1418
|
+
creator: "",
|
|
1419
|
+
toChain: "",
|
|
1420
|
+
toAddress: "",
|
|
1421
|
+
symbol: "",
|
|
1422
|
+
amount: "",
|
|
1423
|
+
options: "",
|
|
1424
|
+
};
|
|
1139
1425
|
}
|
|
1140
1426
|
|
|
1141
1427
|
export const MsgRequestDrainTransaction = {
|
|
1142
|
-
encode(
|
|
1428
|
+
encode(
|
|
1429
|
+
message: MsgRequestDrainTransaction,
|
|
1430
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1431
|
+
): _m0.Writer {
|
|
1143
1432
|
if (message.creator !== "") {
|
|
1144
1433
|
writer.uint32(10).string(message.creator);
|
|
1145
1434
|
}
|
|
@@ -1161,7 +1450,10 @@ export const MsgRequestDrainTransaction = {
|
|
|
1161
1450
|
return writer;
|
|
1162
1451
|
},
|
|
1163
1452
|
|
|
1164
|
-
decode(
|
|
1453
|
+
decode(
|
|
1454
|
+
input: _m0.Reader | Uint8Array,
|
|
1455
|
+
length?: number
|
|
1456
|
+
): MsgRequestDrainTransaction {
|
|
1165
1457
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1166
1458
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1167
1459
|
const message = createBaseMsgRequestDrainTransaction();
|
|
@@ -1216,7 +1508,9 @@ export const MsgRequestDrainTransaction = {
|
|
|
1216
1508
|
return obj;
|
|
1217
1509
|
},
|
|
1218
1510
|
|
|
1219
|
-
fromPartial<I extends Exact<DeepPartial<MsgRequestDrainTransaction>, I>>(
|
|
1511
|
+
fromPartial<I extends Exact<DeepPartial<MsgRequestDrainTransaction>, I>>(
|
|
1512
|
+
object: I
|
|
1513
|
+
): MsgRequestDrainTransaction {
|
|
1220
1514
|
const message = createBaseMsgRequestDrainTransaction();
|
|
1221
1515
|
message.creator = object.creator ?? "";
|
|
1222
1516
|
message.toChain = object.toChain ?? "";
|
|
@@ -1233,7 +1527,10 @@ function createBaseMsgRequestDrainTransactionResponse(): MsgRequestDrainTransact
|
|
|
1233
1527
|
}
|
|
1234
1528
|
|
|
1235
1529
|
export const MsgRequestDrainTransactionResponse = {
|
|
1236
|
-
encode(
|
|
1530
|
+
encode(
|
|
1531
|
+
message: MsgRequestDrainTransactionResponse,
|
|
1532
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1533
|
+
): _m0.Writer {
|
|
1237
1534
|
if (message.code !== "") {
|
|
1238
1535
|
writer.uint32(10).string(message.code);
|
|
1239
1536
|
}
|
|
@@ -1246,7 +1543,10 @@ export const MsgRequestDrainTransactionResponse = {
|
|
|
1246
1543
|
return writer;
|
|
1247
1544
|
},
|
|
1248
1545
|
|
|
1249
|
-
decode(
|
|
1546
|
+
decode(
|
|
1547
|
+
input: _m0.Reader | Uint8Array,
|
|
1548
|
+
length?: number
|
|
1549
|
+
): MsgRequestDrainTransactionResponse {
|
|
1250
1550
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1251
1551
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1252
1552
|
const message = createBaseMsgRequestDrainTransactionResponse();
|
|
@@ -1286,9 +1586,9 @@ export const MsgRequestDrainTransactionResponse = {
|
|
|
1286
1586
|
return obj;
|
|
1287
1587
|
},
|
|
1288
1588
|
|
|
1289
|
-
fromPartial<
|
|
1290
|
-
|
|
1291
|
-
): MsgRequestDrainTransactionResponse {
|
|
1589
|
+
fromPartial<
|
|
1590
|
+
I extends Exact<DeepPartial<MsgRequestDrainTransactionResponse>, I>
|
|
1591
|
+
>(object: I): MsgRequestDrainTransactionResponse {
|
|
1292
1592
|
const message = createBaseMsgRequestDrainTransactionResponse();
|
|
1293
1593
|
message.code = object.code ?? "";
|
|
1294
1594
|
message.msg = object.msg ?? "";
|
|
@@ -1302,7 +1602,10 @@ function createBaseMsgFinalizeDrainTransaction(): MsgFinalizeDrainTransaction {
|
|
|
1302
1602
|
}
|
|
1303
1603
|
|
|
1304
1604
|
export const MsgFinalizeDrainTransaction = {
|
|
1305
|
-
encode(
|
|
1605
|
+
encode(
|
|
1606
|
+
message: MsgFinalizeDrainTransaction,
|
|
1607
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1608
|
+
): _m0.Writer {
|
|
1306
1609
|
if (message.creator !== "") {
|
|
1307
1610
|
writer.uint32(10).string(message.creator);
|
|
1308
1611
|
}
|
|
@@ -1321,7 +1624,10 @@ export const MsgFinalizeDrainTransaction = {
|
|
|
1321
1624
|
return writer;
|
|
1322
1625
|
},
|
|
1323
1626
|
|
|
1324
|
-
decode(
|
|
1627
|
+
decode(
|
|
1628
|
+
input: _m0.Reader | Uint8Array,
|
|
1629
|
+
length?: number
|
|
1630
|
+
): MsgFinalizeDrainTransaction {
|
|
1325
1631
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1326
1632
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1327
1633
|
const message = createBaseMsgFinalizeDrainTransaction();
|
|
@@ -1371,7 +1677,9 @@ export const MsgFinalizeDrainTransaction = {
|
|
|
1371
1677
|
return obj;
|
|
1372
1678
|
},
|
|
1373
1679
|
|
|
1374
|
-
fromPartial<I extends Exact<DeepPartial<MsgFinalizeDrainTransaction>, I>>(
|
|
1680
|
+
fromPartial<I extends Exact<DeepPartial<MsgFinalizeDrainTransaction>, I>>(
|
|
1681
|
+
object: I
|
|
1682
|
+
): MsgFinalizeDrainTransaction {
|
|
1375
1683
|
const message = createBaseMsgFinalizeDrainTransaction();
|
|
1376
1684
|
message.creator = object.creator ?? "";
|
|
1377
1685
|
message.txId = object.txId ?? 0;
|
|
@@ -1387,7 +1695,10 @@ function createBaseMsgFinalizeDrainTransactionResponse(): MsgFinalizeDrainTransa
|
|
|
1387
1695
|
}
|
|
1388
1696
|
|
|
1389
1697
|
export const MsgFinalizeDrainTransactionResponse = {
|
|
1390
|
-
encode(
|
|
1698
|
+
encode(
|
|
1699
|
+
message: MsgFinalizeDrainTransactionResponse,
|
|
1700
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
1701
|
+
): _m0.Writer {
|
|
1391
1702
|
if (message.code !== "") {
|
|
1392
1703
|
writer.uint32(10).string(message.code);
|
|
1393
1704
|
}
|
|
@@ -1397,7 +1708,10 @@ export const MsgFinalizeDrainTransactionResponse = {
|
|
|
1397
1708
|
return writer;
|
|
1398
1709
|
},
|
|
1399
1710
|
|
|
1400
|
-
decode(
|
|
1711
|
+
decode(
|
|
1712
|
+
input: _m0.Reader | Uint8Array,
|
|
1713
|
+
length?: number
|
|
1714
|
+
): MsgFinalizeDrainTransactionResponse {
|
|
1401
1715
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1402
1716
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1403
1717
|
const message = createBaseMsgFinalizeDrainTransactionResponse();
|
|
@@ -1419,7 +1733,10 @@ export const MsgFinalizeDrainTransactionResponse = {
|
|
|
1419
1733
|
},
|
|
1420
1734
|
|
|
1421
1735
|
fromJSON(object: any): MsgFinalizeDrainTransactionResponse {
|
|
1422
|
-
return {
|
|
1736
|
+
return {
|
|
1737
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
1738
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
1739
|
+
};
|
|
1423
1740
|
},
|
|
1424
1741
|
|
|
1425
1742
|
toJSON(message: MsgFinalizeDrainTransactionResponse): unknown {
|
|
@@ -1429,9 +1746,9 @@ export const MsgFinalizeDrainTransactionResponse = {
|
|
|
1429
1746
|
return obj;
|
|
1430
1747
|
},
|
|
1431
1748
|
|
|
1432
|
-
fromPartial<
|
|
1433
|
-
|
|
1434
|
-
): MsgFinalizeDrainTransactionResponse {
|
|
1749
|
+
fromPartial<
|
|
1750
|
+
I extends Exact<DeepPartial<MsgFinalizeDrainTransactionResponse>, I>
|
|
1751
|
+
>(object: I): MsgFinalizeDrainTransactionResponse {
|
|
1435
1752
|
const message = createBaseMsgFinalizeDrainTransactionResponse();
|
|
1436
1753
|
message.code = object.code ?? "";
|
|
1437
1754
|
message.msg = object.msg ?? "";
|
|
@@ -1441,17 +1758,29 @@ export const MsgFinalizeDrainTransactionResponse = {
|
|
|
1441
1758
|
|
|
1442
1759
|
/** Msg defines the Msg service. */
|
|
1443
1760
|
export interface Msg {
|
|
1444
|
-
RequestTransaction(
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1761
|
+
RequestTransaction(
|
|
1762
|
+
request: MsgRequestTransaction
|
|
1763
|
+
): Promise<MsgRequestTransactionResponse>;
|
|
1764
|
+
FinalizeTransaction(
|
|
1765
|
+
request: MsgFinalizeTransaction
|
|
1766
|
+
): Promise<MsgFinalizeTransactionResponse>;
|
|
1767
|
+
RequestProvisionTransaction(
|
|
1768
|
+
request: MsgRequestProvisionTransaction
|
|
1769
|
+
): Promise<MsgRequestProvisionTransactionResponse>;
|
|
1770
|
+
CancelTransaction(
|
|
1771
|
+
request: MsgCancelTransaction
|
|
1772
|
+
): Promise<MsgCancelTransactionResponse>;
|
|
1448
1773
|
SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse>;
|
|
1449
1774
|
SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse>;
|
|
1450
1775
|
FinalizeProvisionTransaction(
|
|
1451
|
-
request: MsgFinalizeProvisionTransaction
|
|
1776
|
+
request: MsgFinalizeProvisionTransaction
|
|
1452
1777
|
): Promise<MsgFinalizeProvisionTransactionResponse>;
|
|
1453
|
-
RequestDrainTransaction(
|
|
1454
|
-
|
|
1778
|
+
RequestDrainTransaction(
|
|
1779
|
+
request: MsgRequestDrainTransaction
|
|
1780
|
+
): Promise<MsgRequestDrainTransactionResponse>;
|
|
1781
|
+
FinalizeDrainTransaction(
|
|
1782
|
+
request: MsgFinalizeDrainTransaction
|
|
1783
|
+
): Promise<MsgFinalizeDrainTransactionResponse>;
|
|
1455
1784
|
}
|
|
1456
1785
|
|
|
1457
1786
|
export class MsgClientImpl implements Msg {
|
|
@@ -1460,75 +1789,145 @@ export class MsgClientImpl implements Msg {
|
|
|
1460
1789
|
this.rpc = rpc;
|
|
1461
1790
|
this.RequestTransaction = this.RequestTransaction.bind(this);
|
|
1462
1791
|
this.FinalizeTransaction = this.FinalizeTransaction.bind(this);
|
|
1463
|
-
this.RequestProvisionTransaction =
|
|
1792
|
+
this.RequestProvisionTransaction =
|
|
1793
|
+
this.RequestProvisionTransaction.bind(this);
|
|
1464
1794
|
this.CancelTransaction = this.CancelTransaction.bind(this);
|
|
1465
1795
|
this.SetTxHash = this.SetTxHash.bind(this);
|
|
1466
1796
|
this.SetTxProcess = this.SetTxProcess.bind(this);
|
|
1467
|
-
this.FinalizeProvisionTransaction =
|
|
1797
|
+
this.FinalizeProvisionTransaction =
|
|
1798
|
+
this.FinalizeProvisionTransaction.bind(this);
|
|
1468
1799
|
this.RequestDrainTransaction = this.RequestDrainTransaction.bind(this);
|
|
1469
1800
|
this.FinalizeDrainTransaction = this.FinalizeDrainTransaction.bind(this);
|
|
1470
1801
|
}
|
|
1471
|
-
RequestTransaction(
|
|
1802
|
+
RequestTransaction(
|
|
1803
|
+
request: MsgRequestTransaction
|
|
1804
|
+
): Promise<MsgRequestTransactionResponse> {
|
|
1472
1805
|
const data = MsgRequestTransaction.encode(request).finish();
|
|
1473
|
-
const promise = this.rpc.request(
|
|
1474
|
-
|
|
1806
|
+
const promise = this.rpc.request(
|
|
1807
|
+
"kimablockchain.transaction.Msg",
|
|
1808
|
+
"RequestTransaction",
|
|
1809
|
+
data
|
|
1810
|
+
);
|
|
1811
|
+
return promise.then((data) =>
|
|
1812
|
+
MsgRequestTransactionResponse.decode(new _m0.Reader(data))
|
|
1813
|
+
);
|
|
1475
1814
|
}
|
|
1476
1815
|
|
|
1477
|
-
FinalizeTransaction(
|
|
1816
|
+
FinalizeTransaction(
|
|
1817
|
+
request: MsgFinalizeTransaction
|
|
1818
|
+
): Promise<MsgFinalizeTransactionResponse> {
|
|
1478
1819
|
const data = MsgFinalizeTransaction.encode(request).finish();
|
|
1479
|
-
const promise = this.rpc.request(
|
|
1480
|
-
|
|
1820
|
+
const promise = this.rpc.request(
|
|
1821
|
+
"kimablockchain.transaction.Msg",
|
|
1822
|
+
"FinalizeTransaction",
|
|
1823
|
+
data
|
|
1824
|
+
);
|
|
1825
|
+
return promise.then((data) =>
|
|
1826
|
+
MsgFinalizeTransactionResponse.decode(new _m0.Reader(data))
|
|
1827
|
+
);
|
|
1481
1828
|
}
|
|
1482
1829
|
|
|
1483
1830
|
RequestProvisionTransaction(
|
|
1484
|
-
request: MsgRequestProvisionTransaction
|
|
1831
|
+
request: MsgRequestProvisionTransaction
|
|
1485
1832
|
): Promise<MsgRequestProvisionTransactionResponse> {
|
|
1486
1833
|
const data = MsgRequestProvisionTransaction.encode(request).finish();
|
|
1487
|
-
const promise = this.rpc.request(
|
|
1488
|
-
|
|
1834
|
+
const promise = this.rpc.request(
|
|
1835
|
+
"kimablockchain.transaction.Msg",
|
|
1836
|
+
"RequestProvisionTransaction",
|
|
1837
|
+
data
|
|
1838
|
+
);
|
|
1839
|
+
return promise.then((data) =>
|
|
1840
|
+
MsgRequestProvisionTransactionResponse.decode(new _m0.Reader(data))
|
|
1841
|
+
);
|
|
1489
1842
|
}
|
|
1490
1843
|
|
|
1491
|
-
CancelTransaction(
|
|
1844
|
+
CancelTransaction(
|
|
1845
|
+
request: MsgCancelTransaction
|
|
1846
|
+
): Promise<MsgCancelTransactionResponse> {
|
|
1492
1847
|
const data = MsgCancelTransaction.encode(request).finish();
|
|
1493
|
-
const promise = this.rpc.request(
|
|
1494
|
-
|
|
1848
|
+
const promise = this.rpc.request(
|
|
1849
|
+
"kimablockchain.transaction.Msg",
|
|
1850
|
+
"CancelTransaction",
|
|
1851
|
+
data
|
|
1852
|
+
);
|
|
1853
|
+
return promise.then((data) =>
|
|
1854
|
+
MsgCancelTransactionResponse.decode(new _m0.Reader(data))
|
|
1855
|
+
);
|
|
1495
1856
|
}
|
|
1496
1857
|
|
|
1497
1858
|
SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse> {
|
|
1498
1859
|
const data = MsgSetTxHash.encode(request).finish();
|
|
1499
|
-
const promise = this.rpc.request(
|
|
1500
|
-
|
|
1860
|
+
const promise = this.rpc.request(
|
|
1861
|
+
"kimablockchain.transaction.Msg",
|
|
1862
|
+
"SetTxHash",
|
|
1863
|
+
data
|
|
1864
|
+
);
|
|
1865
|
+
return promise.then((data) =>
|
|
1866
|
+
MsgSetTxHashResponse.decode(new _m0.Reader(data))
|
|
1867
|
+
);
|
|
1501
1868
|
}
|
|
1502
1869
|
|
|
1503
1870
|
SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse> {
|
|
1504
1871
|
const data = MsgSetTxProcess.encode(request).finish();
|
|
1505
|
-
const promise = this.rpc.request(
|
|
1506
|
-
|
|
1872
|
+
const promise = this.rpc.request(
|
|
1873
|
+
"kimablockchain.transaction.Msg",
|
|
1874
|
+
"SetTxProcess",
|
|
1875
|
+
data
|
|
1876
|
+
);
|
|
1877
|
+
return promise.then((data) =>
|
|
1878
|
+
MsgSetTxProcessResponse.decode(new _m0.Reader(data))
|
|
1879
|
+
);
|
|
1507
1880
|
}
|
|
1508
1881
|
|
|
1509
1882
|
FinalizeProvisionTransaction(
|
|
1510
|
-
request: MsgFinalizeProvisionTransaction
|
|
1883
|
+
request: MsgFinalizeProvisionTransaction
|
|
1511
1884
|
): Promise<MsgFinalizeProvisionTransactionResponse> {
|
|
1512
1885
|
const data = MsgFinalizeProvisionTransaction.encode(request).finish();
|
|
1513
|
-
const promise = this.rpc.request(
|
|
1514
|
-
|
|
1886
|
+
const promise = this.rpc.request(
|
|
1887
|
+
"kimablockchain.transaction.Msg",
|
|
1888
|
+
"FinalizeProvisionTransaction",
|
|
1889
|
+
data
|
|
1890
|
+
);
|
|
1891
|
+
return promise.then((data) =>
|
|
1892
|
+
MsgFinalizeProvisionTransactionResponse.decode(new _m0.Reader(data))
|
|
1893
|
+
);
|
|
1515
1894
|
}
|
|
1516
1895
|
|
|
1517
|
-
RequestDrainTransaction(
|
|
1896
|
+
RequestDrainTransaction(
|
|
1897
|
+
request: MsgRequestDrainTransaction
|
|
1898
|
+
): Promise<MsgRequestDrainTransactionResponse> {
|
|
1518
1899
|
const data = MsgRequestDrainTransaction.encode(request).finish();
|
|
1519
|
-
const promise = this.rpc.request(
|
|
1520
|
-
|
|
1900
|
+
const promise = this.rpc.request(
|
|
1901
|
+
"kimablockchain.transaction.Msg",
|
|
1902
|
+
"RequestDrainTransaction",
|
|
1903
|
+
data
|
|
1904
|
+
);
|
|
1905
|
+
return promise.then((data) =>
|
|
1906
|
+
MsgRequestDrainTransactionResponse.decode(new _m0.Reader(data))
|
|
1907
|
+
);
|
|
1521
1908
|
}
|
|
1522
1909
|
|
|
1523
|
-
FinalizeDrainTransaction(
|
|
1910
|
+
FinalizeDrainTransaction(
|
|
1911
|
+
request: MsgFinalizeDrainTransaction
|
|
1912
|
+
): Promise<MsgFinalizeDrainTransactionResponse> {
|
|
1524
1913
|
const data = MsgFinalizeDrainTransaction.encode(request).finish();
|
|
1525
|
-
const promise = this.rpc.request(
|
|
1526
|
-
|
|
1914
|
+
const promise = this.rpc.request(
|
|
1915
|
+
"kimablockchain.transaction.Msg",
|
|
1916
|
+
"FinalizeDrainTransaction",
|
|
1917
|
+
data
|
|
1918
|
+
);
|
|
1919
|
+
return promise.then((data) =>
|
|
1920
|
+
MsgFinalizeDrainTransactionResponse.decode(new _m0.Reader(data))
|
|
1921
|
+
);
|
|
1527
1922
|
}
|
|
1528
1923
|
}
|
|
1529
1924
|
|
|
1530
1925
|
interface Rpc {
|
|
1531
|
-
request(
|
|
1926
|
+
request(
|
|
1927
|
+
service: string,
|
|
1928
|
+
method: string,
|
|
1929
|
+
data: Uint8Array
|
|
1930
|
+
): Promise<Uint8Array>;
|
|
1532
1931
|
}
|
|
1533
1932
|
|
|
1534
1933
|
declare var self: any | undefined;
|
|
@@ -1550,16 +1949,56 @@ var globalThis: any = (() => {
|
|
|
1550
1949
|
throw "Unable to locate global object";
|
|
1551
1950
|
})();
|
|
1552
1951
|
|
|
1553
|
-
|
|
1952
|
+
function bytesFromBase64(b64: string): Uint8Array {
|
|
1953
|
+
if (globalThis.Buffer) {
|
|
1954
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
1955
|
+
} else {
|
|
1956
|
+
const bin = globalThis.atob(b64);
|
|
1957
|
+
const arr = new Uint8Array(bin.length);
|
|
1958
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
1959
|
+
arr[i] = bin.charCodeAt(i);
|
|
1960
|
+
}
|
|
1961
|
+
return arr;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1554
1964
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1965
|
+
function base64FromBytes(arr: Uint8Array): string {
|
|
1966
|
+
if (globalThis.Buffer) {
|
|
1967
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
1968
|
+
} else {
|
|
1969
|
+
const bin: string[] = [];
|
|
1970
|
+
arr.forEach((byte) => {
|
|
1971
|
+
bin.push(String.fromCharCode(byte));
|
|
1972
|
+
});
|
|
1973
|
+
return globalThis.btoa(bin.join(""));
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
type Builtin =
|
|
1978
|
+
| Date
|
|
1979
|
+
| Function
|
|
1980
|
+
| Uint8Array
|
|
1981
|
+
| string
|
|
1982
|
+
| number
|
|
1983
|
+
| boolean
|
|
1984
|
+
| undefined;
|
|
1985
|
+
|
|
1986
|
+
export type DeepPartial<T> = T extends Builtin
|
|
1987
|
+
? T
|
|
1988
|
+
: T extends Array<infer U>
|
|
1989
|
+
? Array<DeepPartial<U>>
|
|
1990
|
+
: T extends ReadonlyArray<infer U>
|
|
1991
|
+
? ReadonlyArray<DeepPartial<U>>
|
|
1992
|
+
: T extends {}
|
|
1993
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1558
1994
|
: Partial<T>;
|
|
1559
1995
|
|
|
1560
1996
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1561
|
-
export type Exact<P, I extends P> = P extends Builtin
|
|
1562
|
-
|
|
1997
|
+
export type Exact<P, I extends P> = P extends Builtin
|
|
1998
|
+
? P
|
|
1999
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
|
2000
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
2001
|
+
};
|
|
1563
2002
|
|
|
1564
2003
|
function longToNumber(long: Long): number {
|
|
1565
2004
|
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|