@kimafinance/kima-transaction-api 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/build/index.d.ts +50 -3
  2. package/build/index.js +121 -17
  3. package/build/kima/common.d.ts +1 -4
  4. package/build/kima/common.js +9 -12
  5. package/build/kima/tx.d.ts +674 -0
  6. package/build/kima/tx.js +2170 -0
  7. package/package.json +10 -10
  8. package/src/index.ts +206 -3
  9. package/src/kima/common.ts +12 -5
  10. package/src/kima/tx.ts +2945 -0
  11. package/build/api/htlc-lock.d.ts +0 -23
  12. package/build/api/htlc-lock.js +0 -37
  13. package/build/api/htlc-reclaim.d.ts +0 -14
  14. package/build/api/htlc-reclaim.js +0 -28
  15. package/build/api/submit.d.ts +0 -54
  16. package/build/api/submit.js +0 -94
  17. package/build/config/global-this.config.d.ts +0 -2
  18. package/build/config/global-this.config.js +0 -18
  19. package/build/config/probuff.config.d.ts +0 -2
  20. package/build/config/probuff.config.js +0 -12
  21. package/build/kima/tx/cancel.d.ts +0 -35
  22. package/build/kima/tx/cancel.js +0 -115
  23. package/build/kima/tx/drain-finalize.d.ts +0 -47
  24. package/build/kima/tx/drain-finalize.js +0 -155
  25. package/build/kima/tx/drain.d.ts +0 -50
  26. package/build/kima/tx/drain.js +0 -164
  27. package/build/kima/tx/finalize.d.ts +0 -47
  28. package/build/kima/tx/finalize.js +0 -155
  29. package/build/kima/tx/htlc-lock.d.ts +0 -42
  30. package/build/kima/tx/htlc-lock.js +0 -152
  31. package/build/kima/tx/htlc-reclaim.d.ts +0 -30
  32. package/build/kima/tx/htlc-reclaim.js +0 -105
  33. package/build/kima/tx/index.d.ts +0 -1
  34. package/build/kima/tx/index.js +0 -4
  35. package/build/kima/tx/liquidity-provision.d.ts +0 -30
  36. package/build/kima/tx/liquidity-provision.js +0 -102
  37. package/build/kima/tx/message-service.d.ts +0 -54
  38. package/build/kima/tx/message-service.js +0 -117
  39. package/build/kima/tx/provision-finalize.d.ts +0 -47
  40. package/build/kima/tx/provision-finalize.js +0 -155
  41. package/build/kima/tx/provision.d.ts +0 -70
  42. package/build/kima/tx/provision.js +0 -230
  43. package/build/kima/tx/request.d.ts +0 -63
  44. package/build/kima/tx/request.js +0 -222
  45. package/build/kima/tx/response.d.ts +0 -21
  46. package/build/kima/tx/response.js +0 -69
  47. package/build/kima/tx/rpc.d.ts +0 -0
  48. package/build/kima/tx/rpc.js +0 -1
  49. package/build/kima/tx/set-hash.d.ts +0 -42
  50. package/build/kima/tx/set-hash.js +0 -130
  51. package/build/kima/tx/set-process.d.ts +0 -37
  52. package/build/kima/tx/set-process.js +0 -121
  53. package/build/kima/tx/transfer-limit.d.ts +0 -30
  54. package/build/kima/tx/transfer-limit.js +0 -102
  55. package/build/kima/tx/withdraw.d.ts +0 -47
  56. package/build/kima/tx/withdraw.js +0 -155
  57. package/build/utils.d.ts +0 -17
  58. package/build/utils.js +0 -49
  59. package/src/api/htlc-lock.ts +0 -57
  60. package/src/api/htlc-reclaim.ts +0 -39
  61. package/src/api/submit.ts +0 -132
  62. package/src/config/global-this.config.ts +0 -20
  63. package/src/config/probuff.config.ts +0 -9
  64. package/src/kima/tx/cancel.ts +0 -147
  65. package/src/kima/tx/drain-finalize.ts +0 -191
  66. package/src/kima/tx/drain.ts +0 -201
  67. package/src/kima/tx/finalize.ts +0 -191
  68. package/src/kima/tx/htlc-lock.ts +0 -183
  69. package/src/kima/tx/htlc-reclaim.ts +0 -132
  70. package/src/kima/tx/index.ts +0 -1
  71. package/src/kima/tx/liquidity-provision.ts +0 -132
  72. package/src/kima/tx/message-service.ts +0 -278
  73. package/src/kima/tx/provision-finalize.ts +0 -191
  74. package/src/kima/tx/provision.ts +0 -279
  75. package/src/kima/tx/request.ts +0 -256
  76. package/src/kima/tx/response.ts +0 -83
  77. package/src/kima/tx/rpc.ts +0 -0
  78. package/src/kima/tx/set-hash.ts +0 -162
  79. package/src/kima/tx/set-process.ts +0 -151
  80. package/src/kima/tx/transfer-limit.ts +0 -132
  81. package/src/kima/tx/withdraw.ts +0 -191
  82. package/src/utils.ts +0 -67
@@ -1,132 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
3
-
4
- export interface MsgUpdateLiquidityProvisionParams {
5
- authority: string;
6
- maxBTC: string;
7
- maxUSDT: string;
8
- }
9
-
10
- export interface MsgUpdateLiquidityProvisionParamsResponse {}
11
-
12
- function createBaseMsgUpdateLiquidityProvisionParams(): MsgUpdateLiquidityProvisionParams {
13
- return { authority: "", maxBTC: "", maxUSDT: "" };
14
- }
15
-
16
- export const MsgUpdateLiquidityProvisionParams = {
17
- encode(
18
- message: MsgUpdateLiquidityProvisionParams,
19
- writer: _m0.Writer = _m0.Writer.create()
20
- ): _m0.Writer {
21
- if (message.authority !== "") {
22
- writer.uint32(10).string(message.authority);
23
- }
24
- if (message.maxBTC !== "") {
25
- writer.uint32(18).string(message.maxBTC);
26
- }
27
- if (message.maxUSDT !== "") {
28
- writer.uint32(26).string(message.maxUSDT);
29
- }
30
- return writer;
31
- },
32
-
33
- decode(
34
- input: _m0.Reader | Uint8Array,
35
- length?: number
36
- ): MsgUpdateLiquidityProvisionParams {
37
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
38
- let end = length === undefined ? reader.len : reader.pos + length;
39
- const message = createBaseMsgUpdateLiquidityProvisionParams();
40
- while (reader.pos < end) {
41
- const tag = reader.uint32();
42
- switch (tag >>> 3) {
43
- case 1:
44
- message.authority = reader.string();
45
- break;
46
- case 2:
47
- message.maxBTC = reader.string();
48
- break;
49
- case 3:
50
- message.maxUSDT = reader.string();
51
- break;
52
- default:
53
- reader.skipType(tag & 7);
54
- break;
55
- }
56
- }
57
- return message;
58
- },
59
-
60
- fromJSON(object: any): MsgUpdateLiquidityProvisionParams {
61
- return {
62
- authority: isSet(object.authority) ? String(object.authority) : "",
63
- maxBTC: isSet(object.maxBTC) ? String(object.maxBTC) : "",
64
- maxUSDT: isSet(object.maxUSDT) ? String(object.maxUSDT) : "",
65
- };
66
- },
67
-
68
- toJSON(message: MsgUpdateLiquidityProvisionParams): unknown {
69
- const obj: any = {};
70
- message.authority !== undefined && (obj.authority = message.authority);
71
- message.maxBTC !== undefined && (obj.maxBTC = message.maxBTC);
72
- message.maxUSDT !== undefined && (obj.maxUSDT = message.maxUSDT);
73
- return obj;
74
- },
75
-
76
- fromPartial<
77
- I extends Exact<DeepPartial<MsgUpdateLiquidityProvisionParams>, I>
78
- >(object: I): MsgUpdateLiquidityProvisionParams {
79
- const message = createBaseMsgUpdateLiquidityProvisionParams();
80
- message.authority = object.authority ?? "";
81
- message.maxBTC = object.maxBTC ?? "";
82
- message.maxUSDT = object.maxUSDT ?? "";
83
- return message;
84
- },
85
- };
86
-
87
- function createBaseMsgUpdateLiquidityProvisionParamsResponse(): MsgUpdateLiquidityProvisionParamsResponse {
88
- return {};
89
- }
90
-
91
- export const MsgUpdateLiquidityProvisionParamsResponse = {
92
- encode(
93
- _: MsgUpdateLiquidityProvisionParamsResponse,
94
- writer: _m0.Writer = _m0.Writer.create()
95
- ): _m0.Writer {
96
- return writer;
97
- },
98
-
99
- decode(
100
- input: _m0.Reader | Uint8Array,
101
- length?: number
102
- ): MsgUpdateLiquidityProvisionParamsResponse {
103
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
104
- let end = length === undefined ? reader.len : reader.pos + length;
105
- const message = createBaseMsgUpdateLiquidityProvisionParamsResponse();
106
- while (reader.pos < end) {
107
- const tag = reader.uint32();
108
- switch (tag >>> 3) {
109
- default:
110
- reader.skipType(tag & 7);
111
- break;
112
- }
113
- }
114
- return message;
115
- },
116
-
117
- fromJSON(_: any): MsgUpdateLiquidityProvisionParamsResponse {
118
- return {};
119
- },
120
-
121
- toJSON(_: MsgUpdateLiquidityProvisionParamsResponse): unknown {
122
- const obj: any = {};
123
- return obj;
124
- },
125
-
126
- fromPartial<
127
- I extends Exact<DeepPartial<MsgUpdateLiquidityProvisionParamsResponse>, I>
128
- >(_: I): MsgUpdateLiquidityProvisionParamsResponse {
129
- const message = createBaseMsgUpdateLiquidityProvisionParamsResponse();
130
- return message;
131
- },
132
- };
@@ -1,278 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- import { MsgCancelTransaction, MsgCancelTransactionResponse } from "./cancel";
3
- import { MsgRequestDrainTransaction, MsgRequestDrainTransactionResponse } from "./drain";
4
- import { MsgFinalizeDrainTransaction, MsgFinalizeDrainTransactionResponse } from "./drain-finalize";
5
- import { MsgFinalizeTransaction, MsgFinalizeTransactionResponse } from "./finalize";
6
- import { MsgRequestHtlcLock, MsgRequestHtlcLockResponse } from "./htlc-lock";
7
- import { MsgHtlcReclaim, MsgHtlcReclaimResponse } from "./htlc-reclaim";
8
- import { MsgUpdateLiquidityProvisionParams, MsgUpdateLiquidityProvisionParamsResponse } from "./liquidity-provision";
9
- import { MsgRequestProvisionTransaction, MsgRequestProvisionTransactionResponse } from "./provision";
10
- import { MsgFinalizeProvisionTransaction, MsgFinalizeProvisionTransactionResponse } from "./provision-finalize";
11
- import { MsgRequestTransaction } from "./request";
12
- import { MsgRequestTransactionResponse } from "./response";
13
- import { MsgSetTxHash, MsgSetTxHashResponse } from "./set-hash";
14
- import { MsgSetTxProcess, MsgSetTxProcessResponse } from "./set-process";
15
- import { MsgUpdateTransferLimitParams, MsgUpdateTransferLimitParamsResponse } from "./transfer-limit";
16
- import { MsgFinalizeWithdrawTransaction, MsgFinalizeWithdrawTransactionResponse } from "./withdraw";
17
-
18
- /** Msg defines the Msg service. */
19
- export interface Msg {
20
- RequestTransaction(
21
- request: MsgRequestTransaction
22
- ): Promise<MsgRequestTransactionResponse>;
23
- FinalizeTransaction(
24
- request: MsgFinalizeTransaction
25
- ): Promise<MsgFinalizeTransactionResponse>;
26
- RequestProvisionTransaction(
27
- request: MsgRequestProvisionTransaction
28
- ): Promise<MsgRequestProvisionTransactionResponse>;
29
- CancelTransaction(
30
- request: MsgCancelTransaction
31
- ): Promise<MsgCancelTransactionResponse>;
32
- SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse>;
33
- SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse>;
34
- FinalizeProvisionTransaction(
35
- request: MsgFinalizeProvisionTransaction
36
- ): Promise<MsgFinalizeProvisionTransactionResponse>;
37
- RequestDrainTransaction(
38
- request: MsgRequestDrainTransaction
39
- ): Promise<MsgRequestDrainTransactionResponse>;
40
- FinalizeDrainTransaction(
41
- request: MsgFinalizeDrainTransaction
42
- ): Promise<MsgFinalizeDrainTransactionResponse>;
43
- RequestHtlcLock(
44
- request: MsgRequestHtlcLock
45
- ): Promise<MsgRequestHtlcLockResponse>;
46
- HtlcReclaim(request: MsgHtlcReclaim): Promise<MsgHtlcReclaimResponse>;
47
- UpdateLiquidityProvisionParams(
48
- request: MsgUpdateLiquidityProvisionParams
49
- ): Promise<MsgUpdateLiquidityProvisionParamsResponse>;
50
- UpdateTransferLimitParams(
51
- request: MsgUpdateTransferLimitParams
52
- ): Promise<MsgUpdateTransferLimitParamsResponse>;
53
- FinalizeWithdrawTransaction(
54
- request: MsgFinalizeWithdrawTransaction
55
- ): Promise<MsgFinalizeWithdrawTransactionResponse>;
56
- }
57
-
58
- interface Rpc {
59
- request(
60
- service: string,
61
- method: string,
62
- data: Uint8Array
63
- ): Promise<Uint8Array>;
64
- }
65
-
66
- export class MsgClientImpl implements Msg {
67
- private readonly rpc: Rpc;
68
- constructor(rpc: Rpc) {
69
- this.rpc = rpc;
70
- this.RequestTransaction = this.RequestTransaction.bind(this);
71
- this.FinalizeTransaction = this.FinalizeTransaction.bind(this);
72
- this.RequestProvisionTransaction =
73
- this.RequestProvisionTransaction.bind(this);
74
- this.CancelTransaction = this.CancelTransaction.bind(this);
75
- this.SetTxHash = this.SetTxHash.bind(this);
76
- this.SetTxProcess = this.SetTxProcess.bind(this);
77
- this.FinalizeProvisionTransaction =
78
- this.FinalizeProvisionTransaction.bind(this);
79
- this.RequestDrainTransaction = this.RequestDrainTransaction.bind(this);
80
- this.FinalizeDrainTransaction = this.FinalizeDrainTransaction.bind(this);
81
- this.RequestHtlcLock = this.RequestHtlcLock.bind(this);
82
- this.HtlcReclaim = this.HtlcReclaim.bind(this);
83
- this.UpdateLiquidityProvisionParams =
84
- this.UpdateLiquidityProvisionParams.bind(this);
85
- this.UpdateTransferLimitParams = this.UpdateTransferLimitParams.bind(this);
86
- this.FinalizeWithdrawTransaction =
87
- this.FinalizeWithdrawTransaction.bind(this);
88
- }
89
- RequestTransaction(
90
- request: MsgRequestTransaction
91
- ): Promise<MsgRequestTransactionResponse> {
92
- const data = MsgRequestTransaction.encode(request).finish();
93
- const promise = this.rpc.request(
94
- "kimablockchain.transaction.Msg",
95
- "RequestTransaction",
96
- data
97
- );
98
- return promise.then((data) =>
99
- MsgRequestTransactionResponse.decode(new _m0.Reader(data))
100
- );
101
- }
102
-
103
- FinalizeTransaction(
104
- request: MsgFinalizeTransaction
105
- ): Promise<MsgFinalizeTransactionResponse> {
106
- const data = MsgFinalizeTransaction.encode(request).finish();
107
- const promise = this.rpc.request(
108
- "kimablockchain.transaction.Msg",
109
- "FinalizeTransaction",
110
- data
111
- );
112
- return promise.then((data) =>
113
- MsgFinalizeTransactionResponse.decode(new _m0.Reader(data))
114
- );
115
- }
116
-
117
- RequestProvisionTransaction(
118
- request: MsgRequestProvisionTransaction
119
- ): Promise<MsgRequestProvisionTransactionResponse> {
120
- const data = MsgRequestProvisionTransaction.encode(request).finish();
121
- const promise = this.rpc.request(
122
- "kimablockchain.transaction.Msg",
123
- "RequestProvisionTransaction",
124
- data
125
- );
126
- return promise.then((data) =>
127
- MsgRequestProvisionTransactionResponse.decode(new _m0.Reader(data))
128
- );
129
- }
130
-
131
- CancelTransaction(
132
- request: MsgCancelTransaction
133
- ): Promise<MsgCancelTransactionResponse> {
134
- const data = MsgCancelTransaction.encode(request).finish();
135
- const promise = this.rpc.request(
136
- "kimablockchain.transaction.Msg",
137
- "CancelTransaction",
138
- data
139
- );
140
- return promise.then((data) =>
141
- MsgCancelTransactionResponse.decode(new _m0.Reader(data))
142
- );
143
- }
144
-
145
- SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse> {
146
- const data = MsgSetTxHash.encode(request).finish();
147
- const promise = this.rpc.request(
148
- "kimablockchain.transaction.Msg",
149
- "SetTxHash",
150
- data
151
- );
152
- return promise.then((data) =>
153
- MsgSetTxHashResponse.decode(new _m0.Reader(data))
154
- );
155
- }
156
-
157
- SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse> {
158
- const data = MsgSetTxProcess.encode(request).finish();
159
- const promise = this.rpc.request(
160
- "kimablockchain.transaction.Msg",
161
- "SetTxProcess",
162
- data
163
- );
164
- return promise.then((data) =>
165
- MsgSetTxProcessResponse.decode(new _m0.Reader(data))
166
- );
167
- }
168
-
169
- FinalizeProvisionTransaction(
170
- request: MsgFinalizeProvisionTransaction
171
- ): Promise<MsgFinalizeProvisionTransactionResponse> {
172
- const data = MsgFinalizeProvisionTransaction.encode(request).finish();
173
- const promise = this.rpc.request(
174
- "kimablockchain.transaction.Msg",
175
- "FinalizeProvisionTransaction",
176
- data
177
- );
178
- return promise.then((data) =>
179
- MsgFinalizeProvisionTransactionResponse.decode(new _m0.Reader(data))
180
- );
181
- }
182
-
183
- RequestDrainTransaction(
184
- request: MsgRequestDrainTransaction
185
- ): Promise<MsgRequestDrainTransactionResponse> {
186
- const data = MsgRequestDrainTransaction.encode(request).finish();
187
- const promise = this.rpc.request(
188
- "kimablockchain.transaction.Msg",
189
- "RequestDrainTransaction",
190
- data
191
- );
192
- return promise.then((data) =>
193
- MsgRequestDrainTransactionResponse.decode(new _m0.Reader(data))
194
- );
195
- }
196
-
197
- FinalizeDrainTransaction(
198
- request: MsgFinalizeDrainTransaction
199
- ): Promise<MsgFinalizeDrainTransactionResponse> {
200
- const data = MsgFinalizeDrainTransaction.encode(request).finish();
201
- const promise = this.rpc.request(
202
- "kimablockchain.transaction.Msg",
203
- "FinalizeDrainTransaction",
204
- data
205
- );
206
- return promise.then((data) =>
207
- MsgFinalizeDrainTransactionResponse.decode(new _m0.Reader(data))
208
- );
209
- }
210
-
211
- RequestHtlcLock(
212
- request: MsgRequestHtlcLock
213
- ): Promise<MsgRequestHtlcLockResponse> {
214
- const data = MsgRequestHtlcLock.encode(request).finish();
215
- const promise = this.rpc.request(
216
- "kimablockchain.transaction.Msg",
217
- "RequestHtlcLock",
218
- data
219
- );
220
- return promise.then((data) =>
221
- MsgRequestHtlcLockResponse.decode(new _m0.Reader(data))
222
- );
223
- }
224
-
225
- HtlcReclaim(request: MsgHtlcReclaim): Promise<MsgHtlcReclaimResponse> {
226
- const data = MsgHtlcReclaim.encode(request).finish();
227
- const promise = this.rpc.request(
228
- "kimablockchain.transaction.Msg",
229
- "HtlcReclaim",
230
- data
231
- );
232
- return promise.then((data) =>
233
- MsgHtlcReclaimResponse.decode(new _m0.Reader(data))
234
- );
235
- }
236
-
237
- UpdateLiquidityProvisionParams(
238
- request: MsgUpdateLiquidityProvisionParams
239
- ): Promise<MsgUpdateLiquidityProvisionParamsResponse> {
240
- const data = MsgUpdateLiquidityProvisionParams.encode(request).finish();
241
- const promise = this.rpc.request(
242
- "kimablockchain.transaction.Msg",
243
- "UpdateLiquidityProvisionParams",
244
- data
245
- );
246
- return promise.then((data) =>
247
- MsgUpdateLiquidityProvisionParamsResponse.decode(new _m0.Reader(data))
248
- );
249
- }
250
-
251
- UpdateTransferLimitParams(
252
- request: MsgUpdateTransferLimitParams
253
- ): Promise<MsgUpdateTransferLimitParamsResponse> {
254
- const data = MsgUpdateTransferLimitParams.encode(request).finish();
255
- const promise = this.rpc.request(
256
- "kimablockchain.transaction.Msg",
257
- "UpdateTransferLimitParams",
258
- data
259
- );
260
- return promise.then((data) =>
261
- MsgUpdateTransferLimitParamsResponse.decode(new _m0.Reader(data))
262
- );
263
- }
264
-
265
- FinalizeWithdrawTransaction(
266
- request: MsgFinalizeWithdrawTransaction
267
- ): Promise<MsgFinalizeWithdrawTransactionResponse> {
268
- const data = MsgFinalizeWithdrawTransaction.encode(request).finish();
269
- const promise = this.rpc.request(
270
- "kimablockchain.transaction.Msg",
271
- "FinalizeWithdrawTransaction",
272
- data
273
- );
274
- return promise.then((data) =>
275
- MsgFinalizeWithdrawTransactionResponse.decode(new _m0.Reader(data))
276
- );
277
- }
278
- }
@@ -1,191 +0,0 @@
1
- import _m0 from "../../config/probuff.config";
2
- import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
3
-
4
- export interface MsgFinalizeProvisionTransaction {
5
- creator: string;
6
- txId: number;
7
- txHash: string;
8
- success: boolean;
9
- signedKey: string;
10
- errReason: string;
11
- }
12
-
13
- export interface MsgFinalizeProvisionTransactionResponse {
14
- code: string;
15
- msg: string;
16
- }
17
-
18
- function createBaseMsgFinalizeProvisionTransaction(): MsgFinalizeProvisionTransaction {
19
- return {
20
- creator: "",
21
- txId: 0,
22
- txHash: "",
23
- success: false,
24
- signedKey: "",
25
- errReason: "",
26
- };
27
- }
28
-
29
- export const MsgFinalizeProvisionTransaction = {
30
- encode(
31
- message: MsgFinalizeProvisionTransaction,
32
- writer: _m0.Writer = _m0.Writer.create()
33
- ): _m0.Writer {
34
- if (message.creator !== "") {
35
- writer.uint32(10).string(message.creator);
36
- }
37
- if (message.txId !== 0) {
38
- writer.uint32(16).uint64(message.txId);
39
- }
40
- if (message.txHash !== "") {
41
- writer.uint32(26).string(message.txHash);
42
- }
43
- if (message.success === true) {
44
- writer.uint32(32).bool(message.success);
45
- }
46
- if (message.signedKey !== "") {
47
- writer.uint32(42).string(message.signedKey);
48
- }
49
- if (message.errReason !== "") {
50
- writer.uint32(50).string(message.errReason);
51
- }
52
- return writer;
53
- },
54
-
55
- decode(
56
- input: _m0.Reader | Uint8Array,
57
- length?: number
58
- ): MsgFinalizeProvisionTransaction {
59
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
60
- let end = length === undefined ? reader.len : reader.pos + length;
61
- const message = createBaseMsgFinalizeProvisionTransaction();
62
- while (reader.pos < end) {
63
- const tag = reader.uint32();
64
- switch (tag >>> 3) {
65
- case 1:
66
- message.creator = reader.string();
67
- break;
68
- case 2:
69
- message.txId = longToNumber(reader.uint64() as Long);
70
- break;
71
- case 3:
72
- message.txHash = reader.string();
73
- break;
74
- case 4:
75
- message.success = reader.bool();
76
- break;
77
- case 5:
78
- message.signedKey = reader.string();
79
- break;
80
- case 6:
81
- message.errReason = reader.string();
82
- break;
83
- default:
84
- reader.skipType(tag & 7);
85
- break;
86
- }
87
- }
88
- return message;
89
- },
90
-
91
- fromJSON(object: any): MsgFinalizeProvisionTransaction {
92
- return {
93
- creator: isSet(object.creator) ? String(object.creator) : "",
94
- txId: isSet(object.txId) ? Number(object.txId) : 0,
95
- txHash: isSet(object.txHash) ? String(object.txHash) : "",
96
- success: isSet(object.success) ? Boolean(object.success) : false,
97
- signedKey: isSet(object.signedKey) ? String(object.signedKey) : "",
98
- errReason: isSet(object.errReason) ? String(object.errReason) : "",
99
- };
100
- },
101
-
102
- toJSON(message: MsgFinalizeProvisionTransaction): unknown {
103
- const obj: any = {};
104
- message.creator !== undefined && (obj.creator = message.creator);
105
- message.txId !== undefined && (obj.txId = Math.round(message.txId));
106
- message.txHash !== undefined && (obj.txHash = message.txHash);
107
- message.success !== undefined && (obj.success = message.success);
108
- message.signedKey !== undefined && (obj.signedKey = message.signedKey);
109
- message.errReason !== undefined && (obj.errReason = message.errReason);
110
- return obj;
111
- },
112
-
113
- fromPartial<I extends Exact<DeepPartial<MsgFinalizeProvisionTransaction>, I>>(
114
- object: I
115
- ): MsgFinalizeProvisionTransaction {
116
- const message = createBaseMsgFinalizeProvisionTransaction();
117
- message.creator = object.creator ?? "";
118
- message.txId = object.txId ?? 0;
119
- message.txHash = object.txHash ?? "";
120
- message.success = object.success ?? false;
121
- message.signedKey = object.signedKey ?? "";
122
- message.errReason = object.errReason ?? "";
123
- return message;
124
- },
125
- };
126
-
127
- function createBaseMsgFinalizeProvisionTransactionResponse(): MsgFinalizeProvisionTransactionResponse {
128
- return { code: "", msg: "" };
129
- }
130
-
131
- export const MsgFinalizeProvisionTransactionResponse = {
132
- encode(
133
- message: MsgFinalizeProvisionTransactionResponse,
134
- writer: _m0.Writer = _m0.Writer.create()
135
- ): _m0.Writer {
136
- if (message.code !== "") {
137
- writer.uint32(10).string(message.code);
138
- }
139
- if (message.msg !== "") {
140
- writer.uint32(18).string(message.msg);
141
- }
142
- return writer;
143
- },
144
-
145
- decode(
146
- input: _m0.Reader | Uint8Array,
147
- length?: number
148
- ): MsgFinalizeProvisionTransactionResponse {
149
- const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
150
- let end = length === undefined ? reader.len : reader.pos + length;
151
- const message = createBaseMsgFinalizeProvisionTransactionResponse();
152
- while (reader.pos < end) {
153
- const tag = reader.uint32();
154
- switch (tag >>> 3) {
155
- case 1:
156
- message.code = reader.string();
157
- break;
158
- case 2:
159
- message.msg = reader.string();
160
- break;
161
- default:
162
- reader.skipType(tag & 7);
163
- break;
164
- }
165
- }
166
- return message;
167
- },
168
-
169
- fromJSON(object: any): MsgFinalizeProvisionTransactionResponse {
170
- return {
171
- code: isSet(object.code) ? String(object.code) : "",
172
- msg: isSet(object.msg) ? String(object.msg) : "",
173
- };
174
- },
175
-
176
- toJSON(message: MsgFinalizeProvisionTransactionResponse): unknown {
177
- const obj: any = {};
178
- message.code !== undefined && (obj.code = message.code);
179
- message.msg !== undefined && (obj.msg = message.msg);
180
- return obj;
181
- },
182
-
183
- fromPartial<
184
- I extends Exact<DeepPartial<MsgFinalizeProvisionTransactionResponse>, I>
185
- >(object: I): MsgFinalizeProvisionTransactionResponse {
186
- const message = createBaseMsgFinalizeProvisionTransactionResponse();
187
- message.code = object.code ?? "";
188
- message.msg = object.msg ?? "";
189
- return message;
190
- },
191
- };