@kimafinance/kima-transaction-api 1.4.0 → 1.4.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/README.md +19 -5
- package/build/api/htlc-lock.d.ts +23 -0
- package/build/api/htlc-lock.js +37 -0
- package/build/api/htlc-reclaim.d.ts +14 -0
- package/build/api/htlc-reclaim.js +28 -0
- package/build/api/submit.d.ts +54 -0
- package/build/api/submit.js +94 -0
- package/build/config/global-this.config.d.ts +2 -0
- package/build/config/global-this.config.js +18 -0
- package/build/config/probuff.config.d.ts +2 -0
- package/build/config/probuff.config.js +12 -0
- package/build/index.d.ts +3 -50
- package/build/index.js +17 -121
- package/build/kima/common.d.ts +4 -1
- package/build/kima/common.js +12 -9
- package/build/kima/tx/cancel.d.ts +35 -0
- package/build/kima/tx/cancel.js +115 -0
- package/build/kima/tx/drain-finalize.d.ts +47 -0
- package/build/kima/tx/drain-finalize.js +155 -0
- package/build/kima/tx/drain.d.ts +50 -0
- package/build/kima/tx/drain.js +164 -0
- package/build/kima/tx/finalize.d.ts +47 -0
- package/build/kima/tx/finalize.js +155 -0
- package/build/kima/tx/htlc-lock.d.ts +42 -0
- package/build/kima/tx/htlc-lock.js +152 -0
- package/build/kima/tx/htlc-reclaim.d.ts +30 -0
- package/build/kima/tx/htlc-reclaim.js +105 -0
- package/build/kima/tx/index.d.ts +1 -0
- package/build/kima/tx/index.js +4 -0
- package/build/kima/tx/liquidity-provision.d.ts +30 -0
- package/build/kima/tx/liquidity-provision.js +102 -0
- package/build/kima/tx/message-service.d.ts +54 -0
- package/build/kima/tx/message-service.js +117 -0
- package/build/kima/tx/provision-finalize.d.ts +47 -0
- package/build/kima/tx/provision-finalize.js +155 -0
- package/build/kima/tx/provision.d.ts +70 -0
- package/build/kima/tx/provision.js +230 -0
- package/build/kima/tx/request.d.ts +63 -0
- package/build/kima/tx/request.js +222 -0
- package/build/kima/tx/response.d.ts +21 -0
- package/build/kima/tx/response.js +69 -0
- package/build/kima/tx/rpc.d.ts +0 -0
- package/build/kima/tx/rpc.js +1 -0
- package/build/kima/tx/set-hash.d.ts +42 -0
- package/build/kima/tx/set-hash.js +130 -0
- package/build/kima/tx/set-process.d.ts +37 -0
- package/build/kima/tx/set-process.js +121 -0
- package/build/kima/tx/transfer-limit.d.ts +30 -0
- package/build/kima/tx/transfer-limit.js +102 -0
- package/build/kima/tx/withdraw.d.ts +47 -0
- package/build/kima/tx/withdraw.js +155 -0
- package/build/utils.d.ts +17 -0
- package/build/utils.js +49 -0
- package/package.json +10 -10
- package/src/api/htlc-lock.ts +57 -0
- package/src/api/htlc-reclaim.ts +39 -0
- package/src/api/submit.ts +132 -0
- package/src/config/global-this.config.ts +20 -0
- package/src/config/probuff.config.ts +9 -0
- package/src/index.ts +3 -206
- package/src/kima/common.ts +5 -12
- package/src/kima/tx/cancel.ts +147 -0
- package/src/kima/tx/drain-finalize.ts +191 -0
- package/src/kima/tx/drain.ts +201 -0
- package/src/kima/tx/finalize.ts +191 -0
- package/src/kima/tx/htlc-lock.ts +183 -0
- package/src/kima/tx/htlc-reclaim.ts +132 -0
- package/src/kima/tx/index.ts +1 -0
- package/src/kima/tx/liquidity-provision.ts +132 -0
- package/src/kima/tx/message-service.ts +278 -0
- package/src/kima/tx/provision-finalize.ts +191 -0
- package/src/kima/tx/provision.ts +279 -0
- package/src/kima/tx/request.ts +256 -0
- package/src/kima/tx/response.ts +83 -0
- package/src/kima/tx/rpc.ts +0 -0
- package/src/kima/tx/set-hash.ts +162 -0
- package/src/kima/tx/set-process.ts +151 -0
- package/src/kima/tx/transfer-limit.ts +132 -0
- package/src/kima/tx/withdraw.ts +191 -0
- package/src/utils.ts +67 -0
- package/build/kima/tx.d.ts +0 -674
- package/build/kima/tx.js +0 -2170
- package/src/kima/tx.ts +0 -2945
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
+
|
|
4
|
+
export interface MsgFinalizeDrainTransaction {
|
|
5
|
+
creator: string;
|
|
6
|
+
txId: number;
|
|
7
|
+
txHash: string;
|
|
8
|
+
success: boolean;
|
|
9
|
+
signedKey: string;
|
|
10
|
+
errReason: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MsgFinalizeDrainTransactionResponse {
|
|
14
|
+
code: string;
|
|
15
|
+
msg: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createBaseMsgFinalizeDrainTransaction(): MsgFinalizeDrainTransaction {
|
|
19
|
+
return {
|
|
20
|
+
creator: "",
|
|
21
|
+
txId: 0,
|
|
22
|
+
txHash: "",
|
|
23
|
+
success: false,
|
|
24
|
+
signedKey: "",
|
|
25
|
+
errReason: "",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const MsgFinalizeDrainTransaction = {
|
|
30
|
+
encode(
|
|
31
|
+
message: MsgFinalizeDrainTransaction,
|
|
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
|
+
): MsgFinalizeDrainTransaction {
|
|
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 = createBaseMsgFinalizeDrainTransaction();
|
|
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): MsgFinalizeDrainTransaction {
|
|
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: MsgFinalizeDrainTransaction): 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<MsgFinalizeDrainTransaction>, I>>(
|
|
114
|
+
object: I
|
|
115
|
+
): MsgFinalizeDrainTransaction {
|
|
116
|
+
const message = createBaseMsgFinalizeDrainTransaction();
|
|
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 createBaseMsgFinalizeDrainTransactionResponse(): MsgFinalizeDrainTransactionResponse {
|
|
128
|
+
return { code: "", msg: "" };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const MsgFinalizeDrainTransactionResponse = {
|
|
132
|
+
encode(
|
|
133
|
+
message: MsgFinalizeDrainTransactionResponse,
|
|
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
|
+
): MsgFinalizeDrainTransactionResponse {
|
|
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 = createBaseMsgFinalizeDrainTransactionResponse();
|
|
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): MsgFinalizeDrainTransactionResponse {
|
|
170
|
+
return {
|
|
171
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
172
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
toJSON(message: MsgFinalizeDrainTransactionResponse): 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<MsgFinalizeDrainTransactionResponse>, I>
|
|
185
|
+
>(object: I): MsgFinalizeDrainTransactionResponse {
|
|
186
|
+
const message = createBaseMsgFinalizeDrainTransactionResponse();
|
|
187
|
+
message.code = object.code ?? "";
|
|
188
|
+
message.msg = object.msg ?? "";
|
|
189
|
+
return message;
|
|
190
|
+
},
|
|
191
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
+
|
|
4
|
+
export interface MsgRequestDrainTransaction {
|
|
5
|
+
creator: string;
|
|
6
|
+
toChain: string;
|
|
7
|
+
toAddress: string;
|
|
8
|
+
symbol: string;
|
|
9
|
+
amount: string;
|
|
10
|
+
options: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MsgRequestDrainTransactionResponse {
|
|
14
|
+
code: string;
|
|
15
|
+
msg: string;
|
|
16
|
+
txId: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function createBaseMsgRequestDrainTransaction(): MsgRequestDrainTransaction {
|
|
20
|
+
return {
|
|
21
|
+
creator: "",
|
|
22
|
+
toChain: "",
|
|
23
|
+
toAddress: "",
|
|
24
|
+
symbol: "",
|
|
25
|
+
amount: "",
|
|
26
|
+
options: "",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const MsgRequestDrainTransaction = {
|
|
31
|
+
encode(
|
|
32
|
+
message: MsgRequestDrainTransaction,
|
|
33
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
34
|
+
): _m0.Writer {
|
|
35
|
+
if (message.creator !== "") {
|
|
36
|
+
writer.uint32(10).string(message.creator);
|
|
37
|
+
}
|
|
38
|
+
if (message.toChain !== "") {
|
|
39
|
+
writer.uint32(18).string(message.toChain);
|
|
40
|
+
}
|
|
41
|
+
if (message.toAddress !== "") {
|
|
42
|
+
writer.uint32(26).string(message.toAddress);
|
|
43
|
+
}
|
|
44
|
+
if (message.symbol !== "") {
|
|
45
|
+
writer.uint32(34).string(message.symbol);
|
|
46
|
+
}
|
|
47
|
+
if (message.amount !== "") {
|
|
48
|
+
writer.uint32(42).string(message.amount);
|
|
49
|
+
}
|
|
50
|
+
if (message.options !== "") {
|
|
51
|
+
writer.uint32(50).string(message.options);
|
|
52
|
+
}
|
|
53
|
+
return writer;
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
decode(
|
|
57
|
+
input: _m0.Reader | Uint8Array,
|
|
58
|
+
length?: number
|
|
59
|
+
): MsgRequestDrainTransaction {
|
|
60
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
61
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
62
|
+
const message = createBaseMsgRequestDrainTransaction();
|
|
63
|
+
while (reader.pos < end) {
|
|
64
|
+
const tag = reader.uint32();
|
|
65
|
+
switch (tag >>> 3) {
|
|
66
|
+
case 1:
|
|
67
|
+
message.creator = reader.string();
|
|
68
|
+
break;
|
|
69
|
+
case 2:
|
|
70
|
+
message.toChain = reader.string();
|
|
71
|
+
break;
|
|
72
|
+
case 3:
|
|
73
|
+
message.toAddress = reader.string();
|
|
74
|
+
break;
|
|
75
|
+
case 4:
|
|
76
|
+
message.symbol = reader.string();
|
|
77
|
+
break;
|
|
78
|
+
case 5:
|
|
79
|
+
message.amount = reader.string();
|
|
80
|
+
break;
|
|
81
|
+
case 6:
|
|
82
|
+
message.options = reader.string();
|
|
83
|
+
break;
|
|
84
|
+
default:
|
|
85
|
+
reader.skipType(tag & 7);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return message;
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
fromJSON(object: any): MsgRequestDrainTransaction {
|
|
93
|
+
return {
|
|
94
|
+
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
95
|
+
toChain: isSet(object.toChain) ? String(object.toChain) : "",
|
|
96
|
+
toAddress: isSet(object.toAddress) ? String(object.toAddress) : "",
|
|
97
|
+
symbol: isSet(object.symbol) ? String(object.symbol) : "",
|
|
98
|
+
amount: isSet(object.amount) ? String(object.amount) : "",
|
|
99
|
+
options: isSet(object.options) ? String(object.options) : "",
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
toJSON(message: MsgRequestDrainTransaction): unknown {
|
|
104
|
+
const obj: any = {};
|
|
105
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
106
|
+
message.toChain !== undefined && (obj.toChain = message.toChain);
|
|
107
|
+
message.toAddress !== undefined && (obj.toAddress = message.toAddress);
|
|
108
|
+
message.symbol !== undefined && (obj.symbol = message.symbol);
|
|
109
|
+
message.amount !== undefined && (obj.amount = message.amount);
|
|
110
|
+
message.options !== undefined && (obj.options = message.options);
|
|
111
|
+
return obj;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
fromPartial<I extends Exact<DeepPartial<MsgRequestDrainTransaction>, I>>(
|
|
115
|
+
object: I
|
|
116
|
+
): MsgRequestDrainTransaction {
|
|
117
|
+
const message = createBaseMsgRequestDrainTransaction();
|
|
118
|
+
message.creator = object.creator ?? "";
|
|
119
|
+
message.toChain = object.toChain ?? "";
|
|
120
|
+
message.toAddress = object.toAddress ?? "";
|
|
121
|
+
message.symbol = object.symbol ?? "";
|
|
122
|
+
message.amount = object.amount ?? "";
|
|
123
|
+
message.options = object.options ?? "";
|
|
124
|
+
return message;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
function createBaseMsgRequestDrainTransactionResponse(): MsgRequestDrainTransactionResponse {
|
|
129
|
+
return { code: "", msg: "", txId: 0 };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const MsgRequestDrainTransactionResponse = {
|
|
133
|
+
encode(
|
|
134
|
+
message: MsgRequestDrainTransactionResponse,
|
|
135
|
+
writer: _m0.Writer = _m0.Writer.create()
|
|
136
|
+
): _m0.Writer {
|
|
137
|
+
if (message.code !== "") {
|
|
138
|
+
writer.uint32(10).string(message.code);
|
|
139
|
+
}
|
|
140
|
+
if (message.msg !== "") {
|
|
141
|
+
writer.uint32(18).string(message.msg);
|
|
142
|
+
}
|
|
143
|
+
if (message.txId !== 0) {
|
|
144
|
+
writer.uint32(24).uint64(message.txId);
|
|
145
|
+
}
|
|
146
|
+
return writer;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
decode(
|
|
150
|
+
input: _m0.Reader | Uint8Array,
|
|
151
|
+
length?: number
|
|
152
|
+
): MsgRequestDrainTransactionResponse {
|
|
153
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
154
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
155
|
+
const message = createBaseMsgRequestDrainTransactionResponse();
|
|
156
|
+
while (reader.pos < end) {
|
|
157
|
+
const tag = reader.uint32();
|
|
158
|
+
switch (tag >>> 3) {
|
|
159
|
+
case 1:
|
|
160
|
+
message.code = reader.string();
|
|
161
|
+
break;
|
|
162
|
+
case 2:
|
|
163
|
+
message.msg = reader.string();
|
|
164
|
+
break;
|
|
165
|
+
case 3:
|
|
166
|
+
message.txId = longToNumber(reader.uint64() as Long);
|
|
167
|
+
break;
|
|
168
|
+
default:
|
|
169
|
+
reader.skipType(tag & 7);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return message;
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
fromJSON(object: any): MsgRequestDrainTransactionResponse {
|
|
177
|
+
return {
|
|
178
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
179
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
180
|
+
txId: isSet(object.txId) ? Number(object.txId) : 0,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
toJSON(message: MsgRequestDrainTransactionResponse): unknown {
|
|
185
|
+
const obj: any = {};
|
|
186
|
+
message.code !== undefined && (obj.code = message.code);
|
|
187
|
+
message.msg !== undefined && (obj.msg = message.msg);
|
|
188
|
+
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
189
|
+
return obj;
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
fromPartial<
|
|
193
|
+
I extends Exact<DeepPartial<MsgRequestDrainTransactionResponse>, I>
|
|
194
|
+
>(object: I): MsgRequestDrainTransactionResponse {
|
|
195
|
+
const message = createBaseMsgRequestDrainTransactionResponse();
|
|
196
|
+
message.code = object.code ?? "";
|
|
197
|
+
message.msg = object.msg ?? "";
|
|
198
|
+
message.txId = object.txId ?? 0;
|
|
199
|
+
return message;
|
|
200
|
+
},
|
|
201
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
+
|
|
4
|
+
export interface MsgFinalizeTransaction {
|
|
5
|
+
creator: string;
|
|
6
|
+
txId: number;
|
|
7
|
+
txHash: string;
|
|
8
|
+
success: boolean;
|
|
9
|
+
signedKey: string;
|
|
10
|
+
errReason: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MsgFinalizeTransactionResponse {
|
|
14
|
+
code: string;
|
|
15
|
+
msg: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createBaseMsgFinalizeTransaction(): MsgFinalizeTransaction {
|
|
19
|
+
return {
|
|
20
|
+
creator: "",
|
|
21
|
+
txId: 0,
|
|
22
|
+
txHash: "",
|
|
23
|
+
success: false,
|
|
24
|
+
signedKey: "",
|
|
25
|
+
errReason: "",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const MsgFinalizeTransaction = {
|
|
30
|
+
encode(
|
|
31
|
+
message: MsgFinalizeTransaction,
|
|
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
|
+
): MsgFinalizeTransaction {
|
|
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 = createBaseMsgFinalizeTransaction();
|
|
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): MsgFinalizeTransaction {
|
|
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: MsgFinalizeTransaction): 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<MsgFinalizeTransaction>, I>>(
|
|
114
|
+
object: I
|
|
115
|
+
): MsgFinalizeTransaction {
|
|
116
|
+
const message = createBaseMsgFinalizeTransaction();
|
|
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 createBaseMsgFinalizeTransactionResponse(): MsgFinalizeTransactionResponse {
|
|
128
|
+
return { code: "", msg: "" };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const MsgFinalizeTransactionResponse = {
|
|
132
|
+
encode(
|
|
133
|
+
message: MsgFinalizeTransactionResponse,
|
|
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
|
+
): MsgFinalizeTransactionResponse {
|
|
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 = createBaseMsgFinalizeTransactionResponse();
|
|
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): MsgFinalizeTransactionResponse {
|
|
170
|
+
return {
|
|
171
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
172
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
toJSON(message: MsgFinalizeTransactionResponse): 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<I extends Exact<DeepPartial<MsgFinalizeTransactionResponse>, I>>(
|
|
184
|
+
object: I
|
|
185
|
+
): MsgFinalizeTransactionResponse {
|
|
186
|
+
const message = createBaseMsgFinalizeTransactionResponse();
|
|
187
|
+
message.code = object.code ?? "";
|
|
188
|
+
message.msg = object.msg ?? "";
|
|
189
|
+
return message;
|
|
190
|
+
},
|
|
191
|
+
};
|