@kimafinance/kima-transaction-api 1.0.10-beta.1 → 1.0.12-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.
@@ -24,11 +24,11 @@ const TxClient = async (wallet) => {
24
24
  return {
25
25
  signAndBroadcast: (msgs, { fee, memo } = { fee: defaultFee, memo: "" }) => client.signAndBroadcast(address, msgs, fee, memo),
26
26
  msgRequestTransaction: (data) => ({
27
- typeUrl: "/KimaFinance.kima.MsgRequestTransaction",
27
+ typeUrl: "/KimaFinance.kima.kima.MsgRequestTransaction",
28
28
  value: tx_1.MsgRequestTransaction.fromPartial(data),
29
29
  }),
30
30
  msgSetTxHash: (data) => ({
31
- typeUrl: "/KimaFinance.kima.MsgSetTxHash",
31
+ typeUrl: "/KimaFinance.kima.kima.MsgSetTxHash",
32
32
  value: tx_1.MsgSetTxHash.fromPartial(data),
33
33
  }),
34
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimafinance/kima-transaction-api",
3
- "version": "1.0.10-beta.1",
3
+ "version": "1.0.12-beta.1",
4
4
  "description": "A wrapper around Kima's API, enabling sending and monitoring transactions (Beta version)",
5
5
  "author": "",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -31,6 +31,10 @@ interface Props {
31
31
  fee: number;
32
32
  }
33
33
 
34
+ function sleep(ms: number) {
35
+ return new Promise((resolve) => setTimeout(resolve, ms));
36
+ }
37
+
34
38
  export async function submitKimaTransaction({
35
39
  originChain,
36
40
  originAddress,
@@ -60,13 +64,13 @@ export async function submitKimaTransaction({
60
64
  let msg = await client.msgRequestTransaction(params);
61
65
  const result = await client.signAndBroadcast([msg]);
62
66
 
63
- let txId = "1";
67
+ let txId = 1;
64
68
 
65
69
  for (const event of result.events) {
66
70
  if (event.type === "transaction_requested") {
67
71
  for (const attr of event.attributes) {
68
72
  if (attr.key === "txId") {
69
- txId = attr.value;
73
+ txId = +attr.value;
70
74
  }
71
75
  }
72
76
  }
@@ -78,7 +82,11 @@ export async function submitKimaTransaction({
78
82
  txHash: result.transactionHash,
79
83
  });
80
84
 
81
- await client.signAndBroadcast([msg]);
85
+ let hashResult;
86
+ do {
87
+ hashResult = await client.signAndBroadcast([msg]);
88
+ await sleep(1000);
89
+ } while (hashResult.code !== 0);
82
90
 
83
91
  return result;
84
92
  }
@@ -16,8 +16,8 @@ interface SignAndBroadcastOptions {
16
16
  }
17
17
 
18
18
  const types = [
19
- ["/KimaFinance.kima.MsgRequestTransaction", MsgRequestTransaction],
20
- ["/KimaFinance.kima.MsgSetTxHash", MsgSetTxHash],
19
+ ["/KimaFinance.kima.kima.MsgRequestTransaction", MsgRequestTransaction],
20
+ ["/KimaFinance.kima.kima.MsgSetTxHash", MsgSetTxHash],
21
21
  ];
22
22
 
23
23
  export const registry = new Registry(<any>types);
@@ -36,11 +36,11 @@ export const TxClient = async (wallet: OfflineSigner) => {
36
36
  { fee, memo }: SignAndBroadcastOptions = { fee: defaultFee, memo: "" }
37
37
  ) => client.signAndBroadcast(address, msgs, fee, memo),
38
38
  msgRequestTransaction: (data: MsgRequestTransaction): EncodeObject => ({
39
- typeUrl: "/KimaFinance.kima.MsgRequestTransaction",
39
+ typeUrl: "/KimaFinance.kima.kima.MsgRequestTransaction",
40
40
  value: MsgRequestTransaction.fromPartial(data),
41
41
  }),
42
42
  msgSetTxHash: (data: MsgSetTxHash): EncodeObject => ({
43
- typeUrl: "/KimaFinance.kima.MsgSetTxHash",
43
+ typeUrl: "/KimaFinance.kima.kima.MsgSetTxHash",
44
44
  value: MsgSetTxHash.fromPartial(data),
45
45
  }),
46
46
  };
package/src/kima/tx.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable */
2
- import { Reader, Writer } from "protobufjs/minimal";
2
+ import { Reader, util, configure, Writer } from "protobufjs/minimal";
3
+ import * as Long from "long";
3
4
 
4
5
  export const protobufPackage = "KimaFinance.kima.kima";
5
6
 
@@ -17,12 +18,12 @@ export interface MsgRequestTransaction {
17
18
  export interface MsgRequestTransactionResponse {
18
19
  code: string;
19
20
  msg: string;
20
- txId: string;
21
+ txId: number;
21
22
  }
22
23
 
23
24
  export interface MsgApproveTransaction {
24
25
  creator: string;
25
- txId: string;
26
+ txId: number;
26
27
  txTHash: string;
27
28
  success: string;
28
29
  signedKey: string;
@@ -41,7 +42,7 @@ export interface MsgObservationVote {
41
42
  to: string;
42
43
  amount: string;
43
44
  payType: string;
44
- kimaTxID: string;
45
+ kimaTxID: number;
45
46
  succeed: string;
46
47
  }
47
48
 
@@ -199,7 +200,7 @@ export interface MsgAddChainResponse {
199
200
 
200
201
  export interface MsgUpdateTssHash {
201
202
  creator: string;
202
- txId: string;
203
+ txId: number;
203
204
  tssPullHash: string;
204
205
  }
205
206
 
@@ -239,7 +240,7 @@ export interface MsgUpdateTssStatusResponse {}
239
240
 
240
241
  export interface MsgSetTxHash {
241
242
  creator: string;
242
- txId: string;
243
+ txId: number;
243
244
  txHash: string;
244
245
  }
245
246
 
@@ -250,7 +251,7 @@ export interface MsgSetTxHashResponse {
250
251
 
251
252
  export interface MsgSetTxProcess {
252
253
  creator: string;
253
- txId: string;
254
+ txId: number;
254
255
  timestamp: string;
255
256
  msgId: string;
256
257
  }
@@ -259,7 +260,7 @@ export interface MsgSetTxProcessResponse {}
259
260
 
260
261
  export interface MsgFinalizeTransaction {
261
262
  creator: string;
262
- txId: string;
263
+ txId: number;
263
264
  txHash: string;
264
265
  success: string;
265
266
  signedKey: string;
@@ -270,6 +271,39 @@ export interface MsgFinalizeTransactionResponse {
270
271
  msg: string;
271
272
  }
272
273
 
274
+ export interface MsgWithdrawPool {
275
+ creator: string;
276
+ chain: string;
277
+ targetAddress: string;
278
+ amount: string;
279
+ }
280
+
281
+ export interface MsgWithdrawPoolResponse {}
282
+
283
+ export interface MsgUpdateToken {
284
+ creator: string;
285
+ chain: string;
286
+ address: string;
287
+ }
288
+
289
+ export interface MsgUpdateTokenResponse {}
290
+
291
+ export interface MsgUpdatePoolRequest {
292
+ creator: string;
293
+ reqId: string;
294
+ processed: string;
295
+ }
296
+
297
+ export interface MsgUpdatePoolRequestResponse {}
298
+
299
+ export interface MsgLeaderReady {
300
+ creator: string;
301
+ msgId: string;
302
+ peerId: string;
303
+ }
304
+
305
+ export interface MsgLeaderReadyResponse {}
306
+
273
307
  const baseMsgRequestTransaction: object = {
274
308
  creator: "",
275
309
  originChain: "",
@@ -465,7 +499,7 @@ export const MsgRequestTransaction = {
465
499
  const baseMsgRequestTransactionResponse: object = {
466
500
  code: "",
467
501
  msg: "",
468
- txId: "",
502
+ txId: 0,
469
503
  };
470
504
 
471
505
  export const MsgRequestTransactionResponse = {
@@ -479,8 +513,8 @@ export const MsgRequestTransactionResponse = {
479
513
  if (message.msg !== "") {
480
514
  writer.uint32(18).string(message.msg);
481
515
  }
482
- if (message.txId !== "") {
483
- writer.uint32(26).string(message.txId);
516
+ if (message.txId !== 0) {
517
+ writer.uint32(24).uint64(message.txId);
484
518
  }
485
519
  return writer;
486
520
  },
@@ -504,7 +538,7 @@ export const MsgRequestTransactionResponse = {
504
538
  message.msg = reader.string();
505
539
  break;
506
540
  case 3:
507
- message.txId = reader.string();
541
+ message.txId = longToNumber(reader.uint64() as Long);
508
542
  break;
509
543
  default:
510
544
  reader.skipType(tag & 7);
@@ -529,9 +563,9 @@ export const MsgRequestTransactionResponse = {
529
563
  message.msg = "";
530
564
  }
531
565
  if (object.txId !== undefined && object.txId !== null) {
532
- message.txId = String(object.txId);
566
+ message.txId = Number(object.txId);
533
567
  } else {
534
- message.txId = "";
568
+ message.txId = 0;
535
569
  }
536
570
  return message;
537
571
  },
@@ -563,7 +597,7 @@ export const MsgRequestTransactionResponse = {
563
597
  if (object.txId !== undefined && object.txId !== null) {
564
598
  message.txId = object.txId;
565
599
  } else {
566
- message.txId = "";
600
+ message.txId = 0;
567
601
  }
568
602
  return message;
569
603
  },
@@ -571,7 +605,7 @@ export const MsgRequestTransactionResponse = {
571
605
 
572
606
  const baseMsgApproveTransaction: object = {
573
607
  creator: "",
574
- txId: "",
608
+ txId: 0,
575
609
  txTHash: "",
576
610
  success: "",
577
611
  signedKey: "",
@@ -585,8 +619,8 @@ export const MsgApproveTransaction = {
585
619
  if (message.creator !== "") {
586
620
  writer.uint32(10).string(message.creator);
587
621
  }
588
- if (message.txId !== "") {
589
- writer.uint32(18).string(message.txId);
622
+ if (message.txId !== 0) {
623
+ writer.uint32(16).uint64(message.txId);
590
624
  }
591
625
  if (message.txTHash !== "") {
592
626
  writer.uint32(26).string(message.txTHash);
@@ -611,7 +645,7 @@ export const MsgApproveTransaction = {
611
645
  message.creator = reader.string();
612
646
  break;
613
647
  case 2:
614
- message.txId = reader.string();
648
+ message.txId = longToNumber(reader.uint64() as Long);
615
649
  break;
616
650
  case 3:
617
651
  message.txTHash = reader.string();
@@ -638,9 +672,9 @@ export const MsgApproveTransaction = {
638
672
  message.creator = "";
639
673
  }
640
674
  if (object.txId !== undefined && object.txId !== null) {
641
- message.txId = String(object.txId);
675
+ message.txId = Number(object.txId);
642
676
  } else {
643
- message.txId = "";
677
+ message.txId = 0;
644
678
  }
645
679
  if (object.txTHash !== undefined && object.txTHash !== null) {
646
680
  message.txTHash = String(object.txTHash);
@@ -682,7 +716,7 @@ export const MsgApproveTransaction = {
682
716
  if (object.txId !== undefined && object.txId !== null) {
683
717
  message.txId = object.txId;
684
718
  } else {
685
- message.txId = "";
719
+ message.txId = 0;
686
720
  }
687
721
  if (object.txTHash !== undefined && object.txTHash !== null) {
688
722
  message.txTHash = object.txTHash;
@@ -797,7 +831,7 @@ const baseMsgObservationVote: object = {
797
831
  to: "",
798
832
  amount: "",
799
833
  payType: "",
800
- kimaTxID: "",
834
+ kimaTxID: 0,
801
835
  succeed: "",
802
836
  };
803
837
 
@@ -827,8 +861,8 @@ export const MsgObservationVote = {
827
861
  if (message.payType !== "") {
828
862
  writer.uint32(58).string(message.payType);
829
863
  }
830
- if (message.kimaTxID !== "") {
831
- writer.uint32(66).string(message.kimaTxID);
864
+ if (message.kimaTxID !== 0) {
865
+ writer.uint32(64).uint64(message.kimaTxID);
832
866
  }
833
867
  if (message.succeed !== "") {
834
868
  writer.uint32(74).string(message.succeed);
@@ -865,7 +899,7 @@ export const MsgObservationVote = {
865
899
  message.payType = reader.string();
866
900
  break;
867
901
  case 8:
868
- message.kimaTxID = reader.string();
902
+ message.kimaTxID = longToNumber(reader.uint64() as Long);
869
903
  break;
870
904
  case 9:
871
905
  message.succeed = reader.string();
@@ -916,9 +950,9 @@ export const MsgObservationVote = {
916
950
  message.payType = "";
917
951
  }
918
952
  if (object.kimaTxID !== undefined && object.kimaTxID !== null) {
919
- message.kimaTxID = String(object.kimaTxID);
953
+ message.kimaTxID = Number(object.kimaTxID);
920
954
  } else {
921
- message.kimaTxID = "";
955
+ message.kimaTxID = 0;
922
956
  }
923
957
  if (object.succeed !== undefined && object.succeed !== null) {
924
958
  message.succeed = String(object.succeed);
@@ -982,7 +1016,7 @@ export const MsgObservationVote = {
982
1016
  if (object.kimaTxID !== undefined && object.kimaTxID !== null) {
983
1017
  message.kimaTxID = object.kimaTxID;
984
1018
  } else {
985
- message.kimaTxID = "";
1019
+ message.kimaTxID = 0;
986
1020
  }
987
1021
  if (object.succeed !== undefined && object.succeed !== null) {
988
1022
  message.succeed = object.succeed;
@@ -3438,15 +3472,15 @@ export const MsgAddChainResponse = {
3438
3472
  },
3439
3473
  };
3440
3474
 
3441
- const baseMsgUpdateTssHash: object = { creator: "", txId: "", tssPullHash: "" };
3475
+ const baseMsgUpdateTssHash: object = { creator: "", txId: 0, tssPullHash: "" };
3442
3476
 
3443
3477
  export const MsgUpdateTssHash = {
3444
3478
  encode(message: MsgUpdateTssHash, writer: Writer = Writer.create()): Writer {
3445
3479
  if (message.creator !== "") {
3446
3480
  writer.uint32(10).string(message.creator);
3447
3481
  }
3448
- if (message.txId !== "") {
3449
- writer.uint32(18).string(message.txId);
3482
+ if (message.txId !== 0) {
3483
+ writer.uint32(16).uint64(message.txId);
3450
3484
  }
3451
3485
  if (message.tssPullHash !== "") {
3452
3486
  writer.uint32(26).string(message.tssPullHash);
@@ -3465,7 +3499,7 @@ export const MsgUpdateTssHash = {
3465
3499
  message.creator = reader.string();
3466
3500
  break;
3467
3501
  case 2:
3468
- message.txId = reader.string();
3502
+ message.txId = longToNumber(reader.uint64() as Long);
3469
3503
  break;
3470
3504
  case 3:
3471
3505
  message.tssPullHash = reader.string();
@@ -3486,9 +3520,9 @@ export const MsgUpdateTssHash = {
3486
3520
  message.creator = "";
3487
3521
  }
3488
3522
  if (object.txId !== undefined && object.txId !== null) {
3489
- message.txId = String(object.txId);
3523
+ message.txId = Number(object.txId);
3490
3524
  } else {
3491
- message.txId = "";
3525
+ message.txId = 0;
3492
3526
  }
3493
3527
  if (object.tssPullHash !== undefined && object.tssPullHash !== null) {
3494
3528
  message.tssPullHash = String(object.tssPullHash);
@@ -3517,7 +3551,7 @@ export const MsgUpdateTssHash = {
3517
3551
  if (object.txId !== undefined && object.txId !== null) {
3518
3552
  message.txId = object.txId;
3519
3553
  } else {
3520
- message.txId = "";
3554
+ message.txId = 0;
3521
3555
  }
3522
3556
  if (object.tssPullHash !== undefined && object.tssPullHash !== null) {
3523
3557
  message.tssPullHash = object.tssPullHash;
@@ -4094,15 +4128,15 @@ export const MsgUpdateTssStatusResponse = {
4094
4128
  },
4095
4129
  };
4096
4130
 
4097
- const baseMsgSetTxHash: object = { creator: "", txId: "", txHash: "" };
4131
+ const baseMsgSetTxHash: object = { creator: "", txId: 0, txHash: "" };
4098
4132
 
4099
4133
  export const MsgSetTxHash = {
4100
4134
  encode(message: MsgSetTxHash, writer: Writer = Writer.create()): Writer {
4101
4135
  if (message.creator !== "") {
4102
4136
  writer.uint32(10).string(message.creator);
4103
4137
  }
4104
- if (message.txId !== "") {
4105
- writer.uint32(18).string(message.txId);
4138
+ if (message.txId !== 0) {
4139
+ writer.uint32(16).uint64(message.txId);
4106
4140
  }
4107
4141
  if (message.txHash !== "") {
4108
4142
  writer.uint32(26).string(message.txHash);
@@ -4121,7 +4155,7 @@ export const MsgSetTxHash = {
4121
4155
  message.creator = reader.string();
4122
4156
  break;
4123
4157
  case 2:
4124
- message.txId = reader.string();
4158
+ message.txId = longToNumber(reader.uint64() as Long);
4125
4159
  break;
4126
4160
  case 3:
4127
4161
  message.txHash = reader.string();
@@ -4142,9 +4176,9 @@ export const MsgSetTxHash = {
4142
4176
  message.creator = "";
4143
4177
  }
4144
4178
  if (object.txId !== undefined && object.txId !== null) {
4145
- message.txId = String(object.txId);
4179
+ message.txId = Number(object.txId);
4146
4180
  } else {
4147
- message.txId = "";
4181
+ message.txId = 0;
4148
4182
  }
4149
4183
  if (object.txHash !== undefined && object.txHash !== null) {
4150
4184
  message.txHash = String(object.txHash);
@@ -4172,7 +4206,7 @@ export const MsgSetTxHash = {
4172
4206
  if (object.txId !== undefined && object.txId !== null) {
4173
4207
  message.txId = object.txId;
4174
4208
  } else {
4175
- message.txId = "";
4209
+ message.txId = 0;
4176
4210
  }
4177
4211
  if (object.txHash !== undefined && object.txHash !== null) {
4178
4212
  message.txHash = object.txHash;
@@ -4260,7 +4294,7 @@ export const MsgSetTxHashResponse = {
4260
4294
 
4261
4295
  const baseMsgSetTxProcess: object = {
4262
4296
  creator: "",
4263
- txId: "",
4297
+ txId: 0,
4264
4298
  timestamp: "",
4265
4299
  msgId: "",
4266
4300
  };
@@ -4270,8 +4304,8 @@ export const MsgSetTxProcess = {
4270
4304
  if (message.creator !== "") {
4271
4305
  writer.uint32(10).string(message.creator);
4272
4306
  }
4273
- if (message.txId !== "") {
4274
- writer.uint32(18).string(message.txId);
4307
+ if (message.txId !== 0) {
4308
+ writer.uint32(16).uint64(message.txId);
4275
4309
  }
4276
4310
  if (message.timestamp !== "") {
4277
4311
  writer.uint32(26).string(message.timestamp);
@@ -4293,7 +4327,7 @@ export const MsgSetTxProcess = {
4293
4327
  message.creator = reader.string();
4294
4328
  break;
4295
4329
  case 2:
4296
- message.txId = reader.string();
4330
+ message.txId = longToNumber(reader.uint64() as Long);
4297
4331
  break;
4298
4332
  case 3:
4299
4333
  message.timestamp = reader.string();
@@ -4317,9 +4351,9 @@ export const MsgSetTxProcess = {
4317
4351
  message.creator = "";
4318
4352
  }
4319
4353
  if (object.txId !== undefined && object.txId !== null) {
4320
- message.txId = String(object.txId);
4354
+ message.txId = Number(object.txId);
4321
4355
  } else {
4322
- message.txId = "";
4356
+ message.txId = 0;
4323
4357
  }
4324
4358
  if (object.timestamp !== undefined && object.timestamp !== null) {
4325
4359
  message.timestamp = String(object.timestamp);
@@ -4353,7 +4387,7 @@ export const MsgSetTxProcess = {
4353
4387
  if (object.txId !== undefined && object.txId !== null) {
4354
4388
  message.txId = object.txId;
4355
4389
  } else {
4356
- message.txId = "";
4390
+ message.txId = 0;
4357
4391
  }
4358
4392
  if (object.timestamp !== undefined && object.timestamp !== null) {
4359
4393
  message.timestamp = object.timestamp;
@@ -4417,7 +4451,7 @@ export const MsgSetTxProcessResponse = {
4417
4451
 
4418
4452
  const baseMsgFinalizeTransaction: object = {
4419
4453
  creator: "",
4420
- txId: "",
4454
+ txId: 0,
4421
4455
  txHash: "",
4422
4456
  success: "",
4423
4457
  signedKey: "",
@@ -4431,8 +4465,8 @@ export const MsgFinalizeTransaction = {
4431
4465
  if (message.creator !== "") {
4432
4466
  writer.uint32(10).string(message.creator);
4433
4467
  }
4434
- if (message.txId !== "") {
4435
- writer.uint32(18).string(message.txId);
4468
+ if (message.txId !== 0) {
4469
+ writer.uint32(16).uint64(message.txId);
4436
4470
  }
4437
4471
  if (message.txHash !== "") {
4438
4472
  writer.uint32(26).string(message.txHash);
@@ -4457,7 +4491,7 @@ export const MsgFinalizeTransaction = {
4457
4491
  message.creator = reader.string();
4458
4492
  break;
4459
4493
  case 2:
4460
- message.txId = reader.string();
4494
+ message.txId = longToNumber(reader.uint64() as Long);
4461
4495
  break;
4462
4496
  case 3:
4463
4497
  message.txHash = reader.string();
@@ -4484,9 +4518,9 @@ export const MsgFinalizeTransaction = {
4484
4518
  message.creator = "";
4485
4519
  }
4486
4520
  if (object.txId !== undefined && object.txId !== null) {
4487
- message.txId = String(object.txId);
4521
+ message.txId = Number(object.txId);
4488
4522
  } else {
4489
- message.txId = "";
4523
+ message.txId = 0;
4490
4524
  }
4491
4525
  if (object.txHash !== undefined && object.txHash !== null) {
4492
4526
  message.txHash = String(object.txHash);
@@ -4528,7 +4562,7 @@ export const MsgFinalizeTransaction = {
4528
4562
  if (object.txId !== undefined && object.txId !== null) {
4529
4563
  message.txId = object.txId;
4530
4564
  } else {
4531
- message.txId = "";
4565
+ message.txId = 0;
4532
4566
  }
4533
4567
  if (object.txHash !== undefined && object.txHash !== null) {
4534
4568
  message.txHash = object.txHash;
@@ -4635,6 +4669,566 @@ export const MsgFinalizeTransactionResponse = {
4635
4669
  },
4636
4670
  };
4637
4671
 
4672
+ const baseMsgWithdrawPool: object = {
4673
+ creator: "",
4674
+ chain: "",
4675
+ targetAddress: "",
4676
+ amount: "",
4677
+ };
4678
+
4679
+ export const MsgWithdrawPool = {
4680
+ encode(message: MsgWithdrawPool, writer: Writer = Writer.create()): Writer {
4681
+ if (message.creator !== "") {
4682
+ writer.uint32(10).string(message.creator);
4683
+ }
4684
+ if (message.chain !== "") {
4685
+ writer.uint32(18).string(message.chain);
4686
+ }
4687
+ if (message.targetAddress !== "") {
4688
+ writer.uint32(26).string(message.targetAddress);
4689
+ }
4690
+ if (message.amount !== "") {
4691
+ writer.uint32(34).string(message.amount);
4692
+ }
4693
+ return writer;
4694
+ },
4695
+
4696
+ decode(input: Reader | Uint8Array, length?: number): MsgWithdrawPool {
4697
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
4698
+ let end = length === undefined ? reader.len : reader.pos + length;
4699
+ const message = { ...baseMsgWithdrawPool } as MsgWithdrawPool;
4700
+ while (reader.pos < end) {
4701
+ const tag = reader.uint32();
4702
+ switch (tag >>> 3) {
4703
+ case 1:
4704
+ message.creator = reader.string();
4705
+ break;
4706
+ case 2:
4707
+ message.chain = reader.string();
4708
+ break;
4709
+ case 3:
4710
+ message.targetAddress = reader.string();
4711
+ break;
4712
+ case 4:
4713
+ message.amount = reader.string();
4714
+ break;
4715
+ default:
4716
+ reader.skipType(tag & 7);
4717
+ break;
4718
+ }
4719
+ }
4720
+ return message;
4721
+ },
4722
+
4723
+ fromJSON(object: any): MsgWithdrawPool {
4724
+ const message = { ...baseMsgWithdrawPool } as MsgWithdrawPool;
4725
+ if (object.creator !== undefined && object.creator !== null) {
4726
+ message.creator = String(object.creator);
4727
+ } else {
4728
+ message.creator = "";
4729
+ }
4730
+ if (object.chain !== undefined && object.chain !== null) {
4731
+ message.chain = String(object.chain);
4732
+ } else {
4733
+ message.chain = "";
4734
+ }
4735
+ if (object.targetAddress !== undefined && object.targetAddress !== null) {
4736
+ message.targetAddress = String(object.targetAddress);
4737
+ } else {
4738
+ message.targetAddress = "";
4739
+ }
4740
+ if (object.amount !== undefined && object.amount !== null) {
4741
+ message.amount = String(object.amount);
4742
+ } else {
4743
+ message.amount = "";
4744
+ }
4745
+ return message;
4746
+ },
4747
+
4748
+ toJSON(message: MsgWithdrawPool): unknown {
4749
+ const obj: any = {};
4750
+ message.creator !== undefined && (obj.creator = message.creator);
4751
+ message.chain !== undefined && (obj.chain = message.chain);
4752
+ message.targetAddress !== undefined &&
4753
+ (obj.targetAddress = message.targetAddress);
4754
+ message.amount !== undefined && (obj.amount = message.amount);
4755
+ return obj;
4756
+ },
4757
+
4758
+ fromPartial(object: DeepPartial<MsgWithdrawPool>): MsgWithdrawPool {
4759
+ const message = { ...baseMsgWithdrawPool } as MsgWithdrawPool;
4760
+ if (object.creator !== undefined && object.creator !== null) {
4761
+ message.creator = object.creator;
4762
+ } else {
4763
+ message.creator = "";
4764
+ }
4765
+ if (object.chain !== undefined && object.chain !== null) {
4766
+ message.chain = object.chain;
4767
+ } else {
4768
+ message.chain = "";
4769
+ }
4770
+ if (object.targetAddress !== undefined && object.targetAddress !== null) {
4771
+ message.targetAddress = object.targetAddress;
4772
+ } else {
4773
+ message.targetAddress = "";
4774
+ }
4775
+ if (object.amount !== undefined && object.amount !== null) {
4776
+ message.amount = object.amount;
4777
+ } else {
4778
+ message.amount = "";
4779
+ }
4780
+ return message;
4781
+ },
4782
+ };
4783
+
4784
+ const baseMsgWithdrawPoolResponse: object = {};
4785
+
4786
+ export const MsgWithdrawPoolResponse = {
4787
+ encode(_: MsgWithdrawPoolResponse, writer: Writer = Writer.create()): Writer {
4788
+ return writer;
4789
+ },
4790
+
4791
+ decode(input: Reader | Uint8Array, length?: number): MsgWithdrawPoolResponse {
4792
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
4793
+ let end = length === undefined ? reader.len : reader.pos + length;
4794
+ const message = {
4795
+ ...baseMsgWithdrawPoolResponse,
4796
+ } as MsgWithdrawPoolResponse;
4797
+ while (reader.pos < end) {
4798
+ const tag = reader.uint32();
4799
+ switch (tag >>> 3) {
4800
+ default:
4801
+ reader.skipType(tag & 7);
4802
+ break;
4803
+ }
4804
+ }
4805
+ return message;
4806
+ },
4807
+
4808
+ fromJSON(_: any): MsgWithdrawPoolResponse {
4809
+ const message = {
4810
+ ...baseMsgWithdrawPoolResponse,
4811
+ } as MsgWithdrawPoolResponse;
4812
+ return message;
4813
+ },
4814
+
4815
+ toJSON(_: MsgWithdrawPoolResponse): unknown {
4816
+ const obj: any = {};
4817
+ return obj;
4818
+ },
4819
+
4820
+ fromPartial(
4821
+ _: DeepPartial<MsgWithdrawPoolResponse>
4822
+ ): MsgWithdrawPoolResponse {
4823
+ const message = {
4824
+ ...baseMsgWithdrawPoolResponse,
4825
+ } as MsgWithdrawPoolResponse;
4826
+ return message;
4827
+ },
4828
+ };
4829
+
4830
+ const baseMsgUpdateToken: object = { creator: "", chain: "", address: "" };
4831
+
4832
+ export const MsgUpdateToken = {
4833
+ encode(message: MsgUpdateToken, writer: Writer = Writer.create()): Writer {
4834
+ if (message.creator !== "") {
4835
+ writer.uint32(10).string(message.creator);
4836
+ }
4837
+ if (message.chain !== "") {
4838
+ writer.uint32(18).string(message.chain);
4839
+ }
4840
+ if (message.address !== "") {
4841
+ writer.uint32(26).string(message.address);
4842
+ }
4843
+ return writer;
4844
+ },
4845
+
4846
+ decode(input: Reader | Uint8Array, length?: number): MsgUpdateToken {
4847
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
4848
+ let end = length === undefined ? reader.len : reader.pos + length;
4849
+ const message = { ...baseMsgUpdateToken } as MsgUpdateToken;
4850
+ while (reader.pos < end) {
4851
+ const tag = reader.uint32();
4852
+ switch (tag >>> 3) {
4853
+ case 1:
4854
+ message.creator = reader.string();
4855
+ break;
4856
+ case 2:
4857
+ message.chain = reader.string();
4858
+ break;
4859
+ case 3:
4860
+ message.address = reader.string();
4861
+ break;
4862
+ default:
4863
+ reader.skipType(tag & 7);
4864
+ break;
4865
+ }
4866
+ }
4867
+ return message;
4868
+ },
4869
+
4870
+ fromJSON(object: any): MsgUpdateToken {
4871
+ const message = { ...baseMsgUpdateToken } as MsgUpdateToken;
4872
+ if (object.creator !== undefined && object.creator !== null) {
4873
+ message.creator = String(object.creator);
4874
+ } else {
4875
+ message.creator = "";
4876
+ }
4877
+ if (object.chain !== undefined && object.chain !== null) {
4878
+ message.chain = String(object.chain);
4879
+ } else {
4880
+ message.chain = "";
4881
+ }
4882
+ if (object.address !== undefined && object.address !== null) {
4883
+ message.address = String(object.address);
4884
+ } else {
4885
+ message.address = "";
4886
+ }
4887
+ return message;
4888
+ },
4889
+
4890
+ toJSON(message: MsgUpdateToken): unknown {
4891
+ const obj: any = {};
4892
+ message.creator !== undefined && (obj.creator = message.creator);
4893
+ message.chain !== undefined && (obj.chain = message.chain);
4894
+ message.address !== undefined && (obj.address = message.address);
4895
+ return obj;
4896
+ },
4897
+
4898
+ fromPartial(object: DeepPartial<MsgUpdateToken>): MsgUpdateToken {
4899
+ const message = { ...baseMsgUpdateToken } as MsgUpdateToken;
4900
+ if (object.creator !== undefined && object.creator !== null) {
4901
+ message.creator = object.creator;
4902
+ } else {
4903
+ message.creator = "";
4904
+ }
4905
+ if (object.chain !== undefined && object.chain !== null) {
4906
+ message.chain = object.chain;
4907
+ } else {
4908
+ message.chain = "";
4909
+ }
4910
+ if (object.address !== undefined && object.address !== null) {
4911
+ message.address = object.address;
4912
+ } else {
4913
+ message.address = "";
4914
+ }
4915
+ return message;
4916
+ },
4917
+ };
4918
+
4919
+ const baseMsgUpdateTokenResponse: object = {};
4920
+
4921
+ export const MsgUpdateTokenResponse = {
4922
+ encode(_: MsgUpdateTokenResponse, writer: Writer = Writer.create()): Writer {
4923
+ return writer;
4924
+ },
4925
+
4926
+ decode(input: Reader | Uint8Array, length?: number): MsgUpdateTokenResponse {
4927
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
4928
+ let end = length === undefined ? reader.len : reader.pos + length;
4929
+ const message = { ...baseMsgUpdateTokenResponse } as MsgUpdateTokenResponse;
4930
+ while (reader.pos < end) {
4931
+ const tag = reader.uint32();
4932
+ switch (tag >>> 3) {
4933
+ default:
4934
+ reader.skipType(tag & 7);
4935
+ break;
4936
+ }
4937
+ }
4938
+ return message;
4939
+ },
4940
+
4941
+ fromJSON(_: any): MsgUpdateTokenResponse {
4942
+ const message = { ...baseMsgUpdateTokenResponse } as MsgUpdateTokenResponse;
4943
+ return message;
4944
+ },
4945
+
4946
+ toJSON(_: MsgUpdateTokenResponse): unknown {
4947
+ const obj: any = {};
4948
+ return obj;
4949
+ },
4950
+
4951
+ fromPartial(_: DeepPartial<MsgUpdateTokenResponse>): MsgUpdateTokenResponse {
4952
+ const message = { ...baseMsgUpdateTokenResponse } as MsgUpdateTokenResponse;
4953
+ return message;
4954
+ },
4955
+ };
4956
+
4957
+ const baseMsgUpdatePoolRequest: object = {
4958
+ creator: "",
4959
+ reqId: "",
4960
+ processed: "",
4961
+ };
4962
+
4963
+ export const MsgUpdatePoolRequest = {
4964
+ encode(
4965
+ message: MsgUpdatePoolRequest,
4966
+ writer: Writer = Writer.create()
4967
+ ): Writer {
4968
+ if (message.creator !== "") {
4969
+ writer.uint32(10).string(message.creator);
4970
+ }
4971
+ if (message.reqId !== "") {
4972
+ writer.uint32(18).string(message.reqId);
4973
+ }
4974
+ if (message.processed !== "") {
4975
+ writer.uint32(26).string(message.processed);
4976
+ }
4977
+ return writer;
4978
+ },
4979
+
4980
+ decode(input: Reader | Uint8Array, length?: number): MsgUpdatePoolRequest {
4981
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
4982
+ let end = length === undefined ? reader.len : reader.pos + length;
4983
+ const message = { ...baseMsgUpdatePoolRequest } as MsgUpdatePoolRequest;
4984
+ while (reader.pos < end) {
4985
+ const tag = reader.uint32();
4986
+ switch (tag >>> 3) {
4987
+ case 1:
4988
+ message.creator = reader.string();
4989
+ break;
4990
+ case 2:
4991
+ message.reqId = reader.string();
4992
+ break;
4993
+ case 3:
4994
+ message.processed = reader.string();
4995
+ break;
4996
+ default:
4997
+ reader.skipType(tag & 7);
4998
+ break;
4999
+ }
5000
+ }
5001
+ return message;
5002
+ },
5003
+
5004
+ fromJSON(object: any): MsgUpdatePoolRequest {
5005
+ const message = { ...baseMsgUpdatePoolRequest } as MsgUpdatePoolRequest;
5006
+ if (object.creator !== undefined && object.creator !== null) {
5007
+ message.creator = String(object.creator);
5008
+ } else {
5009
+ message.creator = "";
5010
+ }
5011
+ if (object.reqId !== undefined && object.reqId !== null) {
5012
+ message.reqId = String(object.reqId);
5013
+ } else {
5014
+ message.reqId = "";
5015
+ }
5016
+ if (object.processed !== undefined && object.processed !== null) {
5017
+ message.processed = String(object.processed);
5018
+ } else {
5019
+ message.processed = "";
5020
+ }
5021
+ return message;
5022
+ },
5023
+
5024
+ toJSON(message: MsgUpdatePoolRequest): unknown {
5025
+ const obj: any = {};
5026
+ message.creator !== undefined && (obj.creator = message.creator);
5027
+ message.reqId !== undefined && (obj.reqId = message.reqId);
5028
+ message.processed !== undefined && (obj.processed = message.processed);
5029
+ return obj;
5030
+ },
5031
+
5032
+ fromPartial(object: DeepPartial<MsgUpdatePoolRequest>): MsgUpdatePoolRequest {
5033
+ const message = { ...baseMsgUpdatePoolRequest } as MsgUpdatePoolRequest;
5034
+ if (object.creator !== undefined && object.creator !== null) {
5035
+ message.creator = object.creator;
5036
+ } else {
5037
+ message.creator = "";
5038
+ }
5039
+ if (object.reqId !== undefined && object.reqId !== null) {
5040
+ message.reqId = object.reqId;
5041
+ } else {
5042
+ message.reqId = "";
5043
+ }
5044
+ if (object.processed !== undefined && object.processed !== null) {
5045
+ message.processed = object.processed;
5046
+ } else {
5047
+ message.processed = "";
5048
+ }
5049
+ return message;
5050
+ },
5051
+ };
5052
+
5053
+ const baseMsgUpdatePoolRequestResponse: object = {};
5054
+
5055
+ export const MsgUpdatePoolRequestResponse = {
5056
+ encode(
5057
+ _: MsgUpdatePoolRequestResponse,
5058
+ writer: Writer = Writer.create()
5059
+ ): Writer {
5060
+ return writer;
5061
+ },
5062
+
5063
+ decode(
5064
+ input: Reader | Uint8Array,
5065
+ length?: number
5066
+ ): MsgUpdatePoolRequestResponse {
5067
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
5068
+ let end = length === undefined ? reader.len : reader.pos + length;
5069
+ const message = {
5070
+ ...baseMsgUpdatePoolRequestResponse,
5071
+ } as MsgUpdatePoolRequestResponse;
5072
+ while (reader.pos < end) {
5073
+ const tag = reader.uint32();
5074
+ switch (tag >>> 3) {
5075
+ default:
5076
+ reader.skipType(tag & 7);
5077
+ break;
5078
+ }
5079
+ }
5080
+ return message;
5081
+ },
5082
+
5083
+ fromJSON(_: any): MsgUpdatePoolRequestResponse {
5084
+ const message = {
5085
+ ...baseMsgUpdatePoolRequestResponse,
5086
+ } as MsgUpdatePoolRequestResponse;
5087
+ return message;
5088
+ },
5089
+
5090
+ toJSON(_: MsgUpdatePoolRequestResponse): unknown {
5091
+ const obj: any = {};
5092
+ return obj;
5093
+ },
5094
+
5095
+ fromPartial(
5096
+ _: DeepPartial<MsgUpdatePoolRequestResponse>
5097
+ ): MsgUpdatePoolRequestResponse {
5098
+ const message = {
5099
+ ...baseMsgUpdatePoolRequestResponse,
5100
+ } as MsgUpdatePoolRequestResponse;
5101
+ return message;
5102
+ },
5103
+ };
5104
+
5105
+ const baseMsgLeaderReady: object = { creator: "", msgId: "", peerId: "" };
5106
+
5107
+ export const MsgLeaderReady = {
5108
+ encode(message: MsgLeaderReady, writer: Writer = Writer.create()): Writer {
5109
+ if (message.creator !== "") {
5110
+ writer.uint32(10).string(message.creator);
5111
+ }
5112
+ if (message.msgId !== "") {
5113
+ writer.uint32(18).string(message.msgId);
5114
+ }
5115
+ if (message.peerId !== "") {
5116
+ writer.uint32(26).string(message.peerId);
5117
+ }
5118
+ return writer;
5119
+ },
5120
+
5121
+ decode(input: Reader | Uint8Array, length?: number): MsgLeaderReady {
5122
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
5123
+ let end = length === undefined ? reader.len : reader.pos + length;
5124
+ const message = { ...baseMsgLeaderReady } as MsgLeaderReady;
5125
+ while (reader.pos < end) {
5126
+ const tag = reader.uint32();
5127
+ switch (tag >>> 3) {
5128
+ case 1:
5129
+ message.creator = reader.string();
5130
+ break;
5131
+ case 2:
5132
+ message.msgId = reader.string();
5133
+ break;
5134
+ case 3:
5135
+ message.peerId = reader.string();
5136
+ break;
5137
+ default:
5138
+ reader.skipType(tag & 7);
5139
+ break;
5140
+ }
5141
+ }
5142
+ return message;
5143
+ },
5144
+
5145
+ fromJSON(object: any): MsgLeaderReady {
5146
+ const message = { ...baseMsgLeaderReady } as MsgLeaderReady;
5147
+ if (object.creator !== undefined && object.creator !== null) {
5148
+ message.creator = String(object.creator);
5149
+ } else {
5150
+ message.creator = "";
5151
+ }
5152
+ if (object.msgId !== undefined && object.msgId !== null) {
5153
+ message.msgId = String(object.msgId);
5154
+ } else {
5155
+ message.msgId = "";
5156
+ }
5157
+ if (object.peerId !== undefined && object.peerId !== null) {
5158
+ message.peerId = String(object.peerId);
5159
+ } else {
5160
+ message.peerId = "";
5161
+ }
5162
+ return message;
5163
+ },
5164
+
5165
+ toJSON(message: MsgLeaderReady): unknown {
5166
+ const obj: any = {};
5167
+ message.creator !== undefined && (obj.creator = message.creator);
5168
+ message.msgId !== undefined && (obj.msgId = message.msgId);
5169
+ message.peerId !== undefined && (obj.peerId = message.peerId);
5170
+ return obj;
5171
+ },
5172
+
5173
+ fromPartial(object: DeepPartial<MsgLeaderReady>): MsgLeaderReady {
5174
+ const message = { ...baseMsgLeaderReady } as MsgLeaderReady;
5175
+ if (object.creator !== undefined && object.creator !== null) {
5176
+ message.creator = object.creator;
5177
+ } else {
5178
+ message.creator = "";
5179
+ }
5180
+ if (object.msgId !== undefined && object.msgId !== null) {
5181
+ message.msgId = object.msgId;
5182
+ } else {
5183
+ message.msgId = "";
5184
+ }
5185
+ if (object.peerId !== undefined && object.peerId !== null) {
5186
+ message.peerId = object.peerId;
5187
+ } else {
5188
+ message.peerId = "";
5189
+ }
5190
+ return message;
5191
+ },
5192
+ };
5193
+
5194
+ const baseMsgLeaderReadyResponse: object = {};
5195
+
5196
+ export const MsgLeaderReadyResponse = {
5197
+ encode(_: MsgLeaderReadyResponse, writer: Writer = Writer.create()): Writer {
5198
+ return writer;
5199
+ },
5200
+
5201
+ decode(input: Reader | Uint8Array, length?: number): MsgLeaderReadyResponse {
5202
+ const reader = input instanceof Uint8Array ? new Reader(input) : input;
5203
+ let end = length === undefined ? reader.len : reader.pos + length;
5204
+ const message = { ...baseMsgLeaderReadyResponse } as MsgLeaderReadyResponse;
5205
+ while (reader.pos < end) {
5206
+ const tag = reader.uint32();
5207
+ switch (tag >>> 3) {
5208
+ default:
5209
+ reader.skipType(tag & 7);
5210
+ break;
5211
+ }
5212
+ }
5213
+ return message;
5214
+ },
5215
+
5216
+ fromJSON(_: any): MsgLeaderReadyResponse {
5217
+ const message = { ...baseMsgLeaderReadyResponse } as MsgLeaderReadyResponse;
5218
+ return message;
5219
+ },
5220
+
5221
+ toJSON(_: MsgLeaderReadyResponse): unknown {
5222
+ const obj: any = {};
5223
+ return obj;
5224
+ },
5225
+
5226
+ fromPartial(_: DeepPartial<MsgLeaderReadyResponse>): MsgLeaderReadyResponse {
5227
+ const message = { ...baseMsgLeaderReadyResponse } as MsgLeaderReadyResponse;
5228
+ return message;
5229
+ },
5230
+ };
5231
+
4638
5232
  /** Msg defines the Msg service. */
4639
5233
  export interface Msg {
4640
5234
  RequestTransaction(
@@ -4681,10 +5275,16 @@ export interface Msg {
4681
5275
  ): Promise<MsgUpdateTssStatusResponse>;
4682
5276
  SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse>;
4683
5277
  SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse>;
4684
- /** this line is used by starport scaffolding # proto/tx/rpc */
4685
5278
  FinalizeTransaction(
4686
5279
  request: MsgFinalizeTransaction
4687
5280
  ): Promise<MsgFinalizeTransactionResponse>;
5281
+ WithdrawPool(request: MsgWithdrawPool): Promise<MsgWithdrawPoolResponse>;
5282
+ UpdateToken(request: MsgUpdateToken): Promise<MsgUpdateTokenResponse>;
5283
+ UpdatePoolRequest(
5284
+ request: MsgUpdatePoolRequest
5285
+ ): Promise<MsgUpdatePoolRequestResponse>;
5286
+ /** this line is used by starport scaffolding # proto/tx/rpc */
5287
+ LeaderReady(request: MsgLeaderReady): Promise<MsgLeaderReadyResponse>;
4688
5288
  }
4689
5289
 
4690
5290
  export class MsgClientImpl implements Msg {
@@ -4985,6 +5585,56 @@ export class MsgClientImpl implements Msg {
4985
5585
  MsgFinalizeTransactionResponse.decode(new Reader(data))
4986
5586
  );
4987
5587
  }
5588
+
5589
+ WithdrawPool(request: MsgWithdrawPool): Promise<MsgWithdrawPoolResponse> {
5590
+ const data = MsgWithdrawPool.encode(request).finish();
5591
+ const promise = this.rpc.request(
5592
+ "KimaFinance.kima.kima.Msg",
5593
+ "WithdrawPool",
5594
+ data
5595
+ );
5596
+ return promise.then((data) =>
5597
+ MsgWithdrawPoolResponse.decode(new Reader(data))
5598
+ );
5599
+ }
5600
+
5601
+ UpdateToken(request: MsgUpdateToken): Promise<MsgUpdateTokenResponse> {
5602
+ const data = MsgUpdateToken.encode(request).finish();
5603
+ const promise = this.rpc.request(
5604
+ "KimaFinance.kima.kima.Msg",
5605
+ "UpdateToken",
5606
+ data
5607
+ );
5608
+ return promise.then((data) =>
5609
+ MsgUpdateTokenResponse.decode(new Reader(data))
5610
+ );
5611
+ }
5612
+
5613
+ UpdatePoolRequest(
5614
+ request: MsgUpdatePoolRequest
5615
+ ): Promise<MsgUpdatePoolRequestResponse> {
5616
+ const data = MsgUpdatePoolRequest.encode(request).finish();
5617
+ const promise = this.rpc.request(
5618
+ "KimaFinance.kima.kima.Msg",
5619
+ "UpdatePoolRequest",
5620
+ data
5621
+ );
5622
+ return promise.then((data) =>
5623
+ MsgUpdatePoolRequestResponse.decode(new Reader(data))
5624
+ );
5625
+ }
5626
+
5627
+ LeaderReady(request: MsgLeaderReady): Promise<MsgLeaderReadyResponse> {
5628
+ const data = MsgLeaderReady.encode(request).finish();
5629
+ const promise = this.rpc.request(
5630
+ "KimaFinance.kima.kima.Msg",
5631
+ "LeaderReady",
5632
+ data
5633
+ );
5634
+ return promise.then((data) =>
5635
+ MsgLeaderReadyResponse.decode(new Reader(data))
5636
+ );
5637
+ }
4988
5638
  }
4989
5639
 
4990
5640
  interface Rpc {
@@ -4995,6 +5645,16 @@ interface Rpc {
4995
5645
  ): Promise<Uint8Array>;
4996
5646
  }
4997
5647
 
5648
+ declare var self: any | undefined;
5649
+ declare var window: any | undefined;
5650
+ var globalThis: any = (() => {
5651
+ if (typeof globalThis !== "undefined") return globalThis;
5652
+ if (typeof self !== "undefined") return self;
5653
+ if (typeof window !== "undefined") return window;
5654
+ if (typeof global !== "undefined") return global;
5655
+ throw "Unable to locate global object";
5656
+ })();
5657
+
4998
5658
  type Builtin = Date | Function | Uint8Array | string | number | undefined;
4999
5659
  export type DeepPartial<T> = T extends Builtin
5000
5660
  ? T
@@ -5005,3 +5665,10 @@ export type DeepPartial<T> = T extends Builtin
5005
5665
  : T extends {}
5006
5666
  ? { [K in keyof T]?: DeepPartial<T[K]> }
5007
5667
  : Partial<T>;
5668
+
5669
+ function longToNumber(long: Long): number {
5670
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
5671
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
5672
+ }
5673
+ return long.toNumber();
5674
+ }