@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,63 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
export interface MsgRequestTransaction {
|
|
3
|
+
creator: string;
|
|
4
|
+
originChain: string;
|
|
5
|
+
originAddress: string;
|
|
6
|
+
targetChain: string;
|
|
7
|
+
targetAddress: string;
|
|
8
|
+
originSymbol: string;
|
|
9
|
+
targetSymbol: string;
|
|
10
|
+
amount: string;
|
|
11
|
+
fee: string;
|
|
12
|
+
/** the timestamp when the HTLC contract expires and the user can reclaim the funds locked there */
|
|
13
|
+
htlcExpirationTimestamp: string;
|
|
14
|
+
/** the txhash locking the funds in the HTLC */
|
|
15
|
+
htlcCreationHash: string;
|
|
16
|
+
/** the output index of the locked funds in the HTLC creation transaction */
|
|
17
|
+
htlcCreationVout: number;
|
|
18
|
+
/** a version denoting which HTLC script version is being using for the HTLC transaction */
|
|
19
|
+
htlcVersion: string;
|
|
20
|
+
/** for bitcoin transaction this is the public key of the sender */
|
|
21
|
+
senderPubKey: Uint8Array;
|
|
22
|
+
/** additional data JSON object */
|
|
23
|
+
options: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const MsgRequestTransaction: {
|
|
26
|
+
encode(message: MsgRequestTransaction, writer?: _m0.Writer): _m0.Writer;
|
|
27
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransaction;
|
|
28
|
+
fromJSON(object: any): MsgRequestTransaction;
|
|
29
|
+
toJSON(message: MsgRequestTransaction): unknown;
|
|
30
|
+
fromPartial<I extends {
|
|
31
|
+
creator?: string | undefined;
|
|
32
|
+
originChain?: string | undefined;
|
|
33
|
+
originAddress?: string | undefined;
|
|
34
|
+
targetChain?: string | undefined;
|
|
35
|
+
targetAddress?: string | undefined;
|
|
36
|
+
originSymbol?: string | undefined;
|
|
37
|
+
targetSymbol?: string | undefined;
|
|
38
|
+
amount?: string | undefined;
|
|
39
|
+
fee?: string | undefined;
|
|
40
|
+
htlcExpirationTimestamp?: string | undefined;
|
|
41
|
+
htlcCreationHash?: string | undefined;
|
|
42
|
+
htlcCreationVout?: number | undefined;
|
|
43
|
+
htlcVersion?: string | undefined;
|
|
44
|
+
senderPubKey?: Uint8Array | undefined;
|
|
45
|
+
options?: string | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
creator?: string | undefined;
|
|
48
|
+
originChain?: string | undefined;
|
|
49
|
+
originAddress?: string | undefined;
|
|
50
|
+
targetChain?: string | undefined;
|
|
51
|
+
targetAddress?: string | undefined;
|
|
52
|
+
originSymbol?: string | undefined;
|
|
53
|
+
targetSymbol?: string | undefined;
|
|
54
|
+
amount?: string | undefined;
|
|
55
|
+
fee?: string | undefined;
|
|
56
|
+
htlcExpirationTimestamp?: string | undefined;
|
|
57
|
+
htlcCreationHash?: string | undefined;
|
|
58
|
+
htlcCreationVout?: number | undefined;
|
|
59
|
+
htlcVersion?: string | undefined;
|
|
60
|
+
senderPubKey?: Uint8Array | undefined;
|
|
61
|
+
options?: string | undefined;
|
|
62
|
+
} & { [K in Exclude<keyof I, keyof MsgRequestTransaction>]: never; }>(object: I): MsgRequestTransaction;
|
|
63
|
+
};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MsgRequestTransaction = void 0;
|
|
7
|
+
const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
function createBaseMsgRequestTransaction() {
|
|
10
|
+
return {
|
|
11
|
+
creator: "",
|
|
12
|
+
originChain: "",
|
|
13
|
+
originAddress: "",
|
|
14
|
+
targetChain: "",
|
|
15
|
+
targetAddress: "",
|
|
16
|
+
originSymbol: "",
|
|
17
|
+
targetSymbol: "",
|
|
18
|
+
amount: "",
|
|
19
|
+
fee: "",
|
|
20
|
+
htlcExpirationTimestamp: "",
|
|
21
|
+
htlcCreationHash: "",
|
|
22
|
+
htlcCreationVout: 0,
|
|
23
|
+
htlcVersion: "",
|
|
24
|
+
senderPubKey: new Uint8Array(),
|
|
25
|
+
options: "",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.MsgRequestTransaction = {
|
|
29
|
+
encode(message, writer = probuff_config_1.default.Writer.create()) {
|
|
30
|
+
if (message.creator !== "") {
|
|
31
|
+
writer.uint32(10).string(message.creator);
|
|
32
|
+
}
|
|
33
|
+
if (message.originChain !== "") {
|
|
34
|
+
writer.uint32(18).string(message.originChain);
|
|
35
|
+
}
|
|
36
|
+
if (message.originAddress !== "") {
|
|
37
|
+
writer.uint32(26).string(message.originAddress);
|
|
38
|
+
}
|
|
39
|
+
if (message.targetChain !== "") {
|
|
40
|
+
writer.uint32(34).string(message.targetChain);
|
|
41
|
+
}
|
|
42
|
+
if (message.targetAddress !== "") {
|
|
43
|
+
writer.uint32(42).string(message.targetAddress);
|
|
44
|
+
}
|
|
45
|
+
if (message.originSymbol !== "") {
|
|
46
|
+
writer.uint32(50).string(message.originSymbol);
|
|
47
|
+
}
|
|
48
|
+
if (message.targetSymbol !== "") {
|
|
49
|
+
writer.uint32(58).string(message.targetSymbol);
|
|
50
|
+
}
|
|
51
|
+
if (message.amount !== "") {
|
|
52
|
+
writer.uint32(66).string(message.amount);
|
|
53
|
+
}
|
|
54
|
+
if (message.fee !== "") {
|
|
55
|
+
writer.uint32(74).string(message.fee);
|
|
56
|
+
}
|
|
57
|
+
if (message.htlcExpirationTimestamp !== "") {
|
|
58
|
+
writer.uint32(82).string(message.htlcExpirationTimestamp);
|
|
59
|
+
}
|
|
60
|
+
if (message.htlcCreationHash !== "") {
|
|
61
|
+
writer.uint32(90).string(message.htlcCreationHash);
|
|
62
|
+
}
|
|
63
|
+
if (message.htlcCreationVout !== 0) {
|
|
64
|
+
writer.uint32(96).uint32(message.htlcCreationVout);
|
|
65
|
+
}
|
|
66
|
+
if (message.htlcVersion !== "") {
|
|
67
|
+
writer.uint32(106).string(message.htlcVersion);
|
|
68
|
+
}
|
|
69
|
+
if (message.senderPubKey.length !== 0) {
|
|
70
|
+
writer.uint32(114).bytes(message.senderPubKey);
|
|
71
|
+
}
|
|
72
|
+
if (message.options !== "") {
|
|
73
|
+
writer.uint32(122).string(message.options);
|
|
74
|
+
}
|
|
75
|
+
return writer;
|
|
76
|
+
},
|
|
77
|
+
decode(input, length) {
|
|
78
|
+
const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
|
|
79
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
80
|
+
const message = createBaseMsgRequestTransaction();
|
|
81
|
+
while (reader.pos < end) {
|
|
82
|
+
const tag = reader.uint32();
|
|
83
|
+
switch (tag >>> 3) {
|
|
84
|
+
case 1:
|
|
85
|
+
message.creator = reader.string();
|
|
86
|
+
break;
|
|
87
|
+
case 2:
|
|
88
|
+
message.originChain = reader.string();
|
|
89
|
+
break;
|
|
90
|
+
case 3:
|
|
91
|
+
message.originAddress = reader.string();
|
|
92
|
+
break;
|
|
93
|
+
case 4:
|
|
94
|
+
message.targetChain = reader.string();
|
|
95
|
+
break;
|
|
96
|
+
case 5:
|
|
97
|
+
message.targetAddress = reader.string();
|
|
98
|
+
break;
|
|
99
|
+
case 6:
|
|
100
|
+
message.originSymbol = reader.string();
|
|
101
|
+
break;
|
|
102
|
+
case 7:
|
|
103
|
+
message.targetSymbol = reader.string();
|
|
104
|
+
break;
|
|
105
|
+
case 8:
|
|
106
|
+
message.amount = reader.string();
|
|
107
|
+
break;
|
|
108
|
+
case 9:
|
|
109
|
+
message.fee = reader.string();
|
|
110
|
+
break;
|
|
111
|
+
case 10:
|
|
112
|
+
message.htlcExpirationTimestamp = reader.string();
|
|
113
|
+
break;
|
|
114
|
+
case 11:
|
|
115
|
+
message.htlcCreationHash = reader.string();
|
|
116
|
+
break;
|
|
117
|
+
case 12:
|
|
118
|
+
message.htlcCreationVout = reader.uint32();
|
|
119
|
+
break;
|
|
120
|
+
case 13:
|
|
121
|
+
message.htlcVersion = reader.string();
|
|
122
|
+
break;
|
|
123
|
+
case 14:
|
|
124
|
+
message.senderPubKey = reader.bytes();
|
|
125
|
+
break;
|
|
126
|
+
case 15:
|
|
127
|
+
message.options = reader.string();
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
reader.skipType(tag & 7);
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return message;
|
|
135
|
+
},
|
|
136
|
+
fromJSON(object) {
|
|
137
|
+
return {
|
|
138
|
+
creator: (0, utils_1.isSet)(object.creator) ? String(object.creator) : "",
|
|
139
|
+
originChain: (0, utils_1.isSet)(object.originChain) ? String(object.originChain) : "",
|
|
140
|
+
originAddress: (0, utils_1.isSet)(object.originAddress)
|
|
141
|
+
? String(object.originAddress)
|
|
142
|
+
: "",
|
|
143
|
+
targetChain: (0, utils_1.isSet)(object.targetChain) ? String(object.targetChain) : "",
|
|
144
|
+
targetAddress: (0, utils_1.isSet)(object.targetAddress)
|
|
145
|
+
? String(object.targetAddress)
|
|
146
|
+
: "",
|
|
147
|
+
originSymbol: (0, utils_1.isSet)(object.originSymbol)
|
|
148
|
+
? String(object.originSymbol)
|
|
149
|
+
: "",
|
|
150
|
+
targetSymbol: (0, utils_1.isSet)(object.targetSymbol)
|
|
151
|
+
? String(object.targetSymbol)
|
|
152
|
+
: "",
|
|
153
|
+
amount: (0, utils_1.isSet)(object.amount) ? String(object.amount) : "",
|
|
154
|
+
fee: (0, utils_1.isSet)(object.fee) ? String(object.fee) : "",
|
|
155
|
+
htlcExpirationTimestamp: (0, utils_1.isSet)(object.htlcExpirationTimestamp)
|
|
156
|
+
? String(object.htlcExpirationTimestamp)
|
|
157
|
+
: "",
|
|
158
|
+
htlcCreationHash: (0, utils_1.isSet)(object.htlcCreationHash)
|
|
159
|
+
? String(object.htlcCreationHash)
|
|
160
|
+
: "",
|
|
161
|
+
htlcCreationVout: (0, utils_1.isSet)(object.htlcCreationVout)
|
|
162
|
+
? Number(object.htlcCreationVout)
|
|
163
|
+
: 0,
|
|
164
|
+
htlcVersion: (0, utils_1.isSet)(object.htlcVersion) ? String(object.htlcVersion) : "",
|
|
165
|
+
senderPubKey: (0, utils_1.isSet)(object.senderPubKey)
|
|
166
|
+
? (0, utils_1.bytesFromBase64)(object.senderPubKey)
|
|
167
|
+
: new Uint8Array(),
|
|
168
|
+
options: (0, utils_1.isSet)(object.options) ? String(object.options) : "",
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
toJSON(message) {
|
|
172
|
+
const obj = {};
|
|
173
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
174
|
+
message.originChain !== undefined &&
|
|
175
|
+
(obj.originChain = message.originChain);
|
|
176
|
+
message.originAddress !== undefined &&
|
|
177
|
+
(obj.originAddress = message.originAddress);
|
|
178
|
+
message.targetChain !== undefined &&
|
|
179
|
+
(obj.targetChain = message.targetChain);
|
|
180
|
+
message.targetAddress !== undefined &&
|
|
181
|
+
(obj.targetAddress = message.targetAddress);
|
|
182
|
+
message.originSymbol !== undefined &&
|
|
183
|
+
(obj.originSymbol = message.originSymbol);
|
|
184
|
+
message.targetSymbol !== undefined &&
|
|
185
|
+
(obj.targetSymbol = message.targetSymbol);
|
|
186
|
+
message.amount !== undefined && (obj.amount = message.amount);
|
|
187
|
+
message.fee !== undefined && (obj.fee = message.fee);
|
|
188
|
+
message.htlcExpirationTimestamp !== undefined &&
|
|
189
|
+
(obj.htlcExpirationTimestamp = message.htlcExpirationTimestamp);
|
|
190
|
+
message.htlcCreationHash !== undefined &&
|
|
191
|
+
(obj.htlcCreationHash = message.htlcCreationHash);
|
|
192
|
+
message.htlcCreationVout !== undefined &&
|
|
193
|
+
(obj.htlcCreationVout = Math.round(message.htlcCreationVout));
|
|
194
|
+
message.htlcVersion !== undefined &&
|
|
195
|
+
(obj.htlcVersion = message.htlcVersion);
|
|
196
|
+
message.senderPubKey !== undefined &&
|
|
197
|
+
(obj.senderPubKey = (0, utils_1.base64FromBytes)(message.senderPubKey !== undefined
|
|
198
|
+
? message.senderPubKey
|
|
199
|
+
: new Uint8Array()));
|
|
200
|
+
message.options !== undefined && (obj.options = message.options);
|
|
201
|
+
return obj;
|
|
202
|
+
},
|
|
203
|
+
fromPartial(object) {
|
|
204
|
+
const message = createBaseMsgRequestTransaction();
|
|
205
|
+
message.creator = object.creator ?? "";
|
|
206
|
+
message.originChain = object.originChain ?? "";
|
|
207
|
+
message.originAddress = object.originAddress ?? "";
|
|
208
|
+
message.targetChain = object.targetChain ?? "";
|
|
209
|
+
message.targetAddress = object.targetAddress ?? "";
|
|
210
|
+
message.originSymbol = object.originSymbol ?? "";
|
|
211
|
+
message.targetSymbol = object.targetSymbol ?? "";
|
|
212
|
+
message.amount = object.amount ?? "";
|
|
213
|
+
message.fee = object.fee ?? "";
|
|
214
|
+
message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
|
|
215
|
+
message.htlcCreationHash = object.htlcCreationHash ?? "";
|
|
216
|
+
message.htlcCreationVout = object.htlcCreationVout ?? 0;
|
|
217
|
+
message.htlcVersion = object.htlcVersion ?? "";
|
|
218
|
+
message.senderPubKey = object.senderPubKey ?? new Uint8Array();
|
|
219
|
+
message.options = object.options ?? "";
|
|
220
|
+
return message;
|
|
221
|
+
},
|
|
222
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
export interface MsgRequestTransactionResponse {
|
|
3
|
+
code: string;
|
|
4
|
+
msg: string;
|
|
5
|
+
txId: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const MsgRequestTransactionResponse: {
|
|
8
|
+
encode(message: MsgRequestTransactionResponse, writer?: _m0.Writer): _m0.Writer;
|
|
9
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransactionResponse;
|
|
10
|
+
fromJSON(object: any): MsgRequestTransactionResponse;
|
|
11
|
+
toJSON(message: MsgRequestTransactionResponse): unknown;
|
|
12
|
+
fromPartial<I extends {
|
|
13
|
+
code?: string | undefined;
|
|
14
|
+
msg?: string | undefined;
|
|
15
|
+
txId?: number | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
code?: string | undefined;
|
|
18
|
+
msg?: string | undefined;
|
|
19
|
+
txId?: number | undefined;
|
|
20
|
+
} & { [K in Exclude<keyof I, keyof MsgRequestTransactionResponse>]: never; }>(object: I): MsgRequestTransactionResponse;
|
|
21
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MsgRequestTransactionResponse = void 0;
|
|
7
|
+
const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
function createBaseMsgRequestTransactionResponse() {
|
|
10
|
+
return { code: "", msg: "", txId: 0 };
|
|
11
|
+
}
|
|
12
|
+
exports.MsgRequestTransactionResponse = {
|
|
13
|
+
encode(message, writer = probuff_config_1.default.Writer.create()) {
|
|
14
|
+
if (message.code !== "") {
|
|
15
|
+
writer.uint32(10).string(message.code);
|
|
16
|
+
}
|
|
17
|
+
if (message.msg !== "") {
|
|
18
|
+
writer.uint32(18).string(message.msg);
|
|
19
|
+
}
|
|
20
|
+
if (message.txId !== 0) {
|
|
21
|
+
writer.uint32(24).uint64(message.txId);
|
|
22
|
+
}
|
|
23
|
+
return writer;
|
|
24
|
+
},
|
|
25
|
+
decode(input, length) {
|
|
26
|
+
const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
|
|
27
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
28
|
+
const message = createBaseMsgRequestTransactionResponse();
|
|
29
|
+
while (reader.pos < end) {
|
|
30
|
+
const tag = reader.uint32();
|
|
31
|
+
switch (tag >>> 3) {
|
|
32
|
+
case 1:
|
|
33
|
+
message.code = reader.string();
|
|
34
|
+
break;
|
|
35
|
+
case 2:
|
|
36
|
+
message.msg = reader.string();
|
|
37
|
+
break;
|
|
38
|
+
case 3:
|
|
39
|
+
message.txId = (0, utils_1.longToNumber)(reader.uint64());
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
reader.skipType(tag & 7);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return message;
|
|
47
|
+
},
|
|
48
|
+
fromJSON(object) {
|
|
49
|
+
return {
|
|
50
|
+
code: (0, utils_1.isSet)(object.code) ? String(object.code) : "",
|
|
51
|
+
msg: (0, utils_1.isSet)(object.msg) ? String(object.msg) : "",
|
|
52
|
+
txId: (0, utils_1.isSet)(object.txId) ? Number(object.txId) : 0,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
toJSON(message) {
|
|
56
|
+
const obj = {};
|
|
57
|
+
message.code !== undefined && (obj.code = message.code);
|
|
58
|
+
message.msg !== undefined && (obj.msg = message.msg);
|
|
59
|
+
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
60
|
+
return obj;
|
|
61
|
+
},
|
|
62
|
+
fromPartial(object) {
|
|
63
|
+
const message = createBaseMsgRequestTransactionResponse();
|
|
64
|
+
message.code = object.code ?? "";
|
|
65
|
+
message.msg = object.msg ?? "";
|
|
66
|
+
message.txId = object.txId ?? 0;
|
|
67
|
+
return message;
|
|
68
|
+
},
|
|
69
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
export interface MsgSetTxHash {
|
|
3
|
+
creator: string;
|
|
4
|
+
txId: number;
|
|
5
|
+
txHash: string;
|
|
6
|
+
/** request_transaction, request_provision_transaction, request_drain_transaction */
|
|
7
|
+
txType: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MsgSetTxHashResponse {
|
|
10
|
+
code: string;
|
|
11
|
+
msg: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const MsgSetTxHash: {
|
|
14
|
+
encode(message: MsgSetTxHash, writer?: _m0.Writer): _m0.Writer;
|
|
15
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxHash;
|
|
16
|
+
fromJSON(object: any): MsgSetTxHash;
|
|
17
|
+
toJSON(message: MsgSetTxHash): unknown;
|
|
18
|
+
fromPartial<I extends {
|
|
19
|
+
creator?: string | undefined;
|
|
20
|
+
txId?: number | undefined;
|
|
21
|
+
txHash?: string | undefined;
|
|
22
|
+
txType?: string | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
creator?: string | undefined;
|
|
25
|
+
txId?: number | undefined;
|
|
26
|
+
txHash?: string | undefined;
|
|
27
|
+
txType?: string | undefined;
|
|
28
|
+
} & { [K in Exclude<keyof I, keyof MsgSetTxHash>]: never; }>(object: I): MsgSetTxHash;
|
|
29
|
+
};
|
|
30
|
+
export declare const MsgSetTxHashResponse: {
|
|
31
|
+
encode(message: MsgSetTxHashResponse, writer?: _m0.Writer): _m0.Writer;
|
|
32
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxHashResponse;
|
|
33
|
+
fromJSON(object: any): MsgSetTxHashResponse;
|
|
34
|
+
toJSON(message: MsgSetTxHashResponse): unknown;
|
|
35
|
+
fromPartial<I extends {
|
|
36
|
+
code?: string | undefined;
|
|
37
|
+
msg?: string | undefined;
|
|
38
|
+
} & {
|
|
39
|
+
code?: string | undefined;
|
|
40
|
+
msg?: string | undefined;
|
|
41
|
+
} & { [K in Exclude<keyof I, keyof MsgSetTxHashResponse>]: never; }>(object: I): MsgSetTxHashResponse;
|
|
42
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MsgSetTxHashResponse = exports.MsgSetTxHash = void 0;
|
|
7
|
+
const probuff_config_1 = __importDefault(require("../../config/probuff.config"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
function createBaseMsgSetTxHash() {
|
|
10
|
+
return { creator: "", txId: 0, txHash: "", txType: "" };
|
|
11
|
+
}
|
|
12
|
+
exports.MsgSetTxHash = {
|
|
13
|
+
encode(message, writer = probuff_config_1.default.Writer.create()) {
|
|
14
|
+
if (message.creator !== "") {
|
|
15
|
+
writer.uint32(10).string(message.creator);
|
|
16
|
+
}
|
|
17
|
+
if (message.txId !== 0) {
|
|
18
|
+
writer.uint32(16).uint64(message.txId);
|
|
19
|
+
}
|
|
20
|
+
if (message.txHash !== "") {
|
|
21
|
+
writer.uint32(26).string(message.txHash);
|
|
22
|
+
}
|
|
23
|
+
if (message.txType !== "") {
|
|
24
|
+
writer.uint32(34).string(message.txType);
|
|
25
|
+
}
|
|
26
|
+
return writer;
|
|
27
|
+
},
|
|
28
|
+
decode(input, length) {
|
|
29
|
+
const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
|
|
30
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
31
|
+
const message = createBaseMsgSetTxHash();
|
|
32
|
+
while (reader.pos < end) {
|
|
33
|
+
const tag = reader.uint32();
|
|
34
|
+
switch (tag >>> 3) {
|
|
35
|
+
case 1:
|
|
36
|
+
message.creator = reader.string();
|
|
37
|
+
break;
|
|
38
|
+
case 2:
|
|
39
|
+
message.txId = (0, utils_1.longToNumber)(reader.uint64());
|
|
40
|
+
break;
|
|
41
|
+
case 3:
|
|
42
|
+
message.txHash = reader.string();
|
|
43
|
+
break;
|
|
44
|
+
case 4:
|
|
45
|
+
message.txType = reader.string();
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
reader.skipType(tag & 7);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return message;
|
|
53
|
+
},
|
|
54
|
+
fromJSON(object) {
|
|
55
|
+
return {
|
|
56
|
+
creator: (0, utils_1.isSet)(object.creator) ? String(object.creator) : "",
|
|
57
|
+
txId: (0, utils_1.isSet)(object.txId) ? Number(object.txId) : 0,
|
|
58
|
+
txHash: (0, utils_1.isSet)(object.txHash) ? String(object.txHash) : "",
|
|
59
|
+
txType: (0, utils_1.isSet)(object.txType) ? String(object.txType) : "",
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
toJSON(message) {
|
|
63
|
+
const obj = {};
|
|
64
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
65
|
+
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
66
|
+
message.txHash !== undefined && (obj.txHash = message.txHash);
|
|
67
|
+
message.txType !== undefined && (obj.txType = message.txType);
|
|
68
|
+
return obj;
|
|
69
|
+
},
|
|
70
|
+
fromPartial(object) {
|
|
71
|
+
const message = createBaseMsgSetTxHash();
|
|
72
|
+
message.creator = object.creator ?? "";
|
|
73
|
+
message.txId = object.txId ?? 0;
|
|
74
|
+
message.txHash = object.txHash ?? "";
|
|
75
|
+
message.txType = object.txType ?? "";
|
|
76
|
+
return message;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
function createBaseMsgSetTxHashResponse() {
|
|
80
|
+
return { code: "", msg: "" };
|
|
81
|
+
}
|
|
82
|
+
exports.MsgSetTxHashResponse = {
|
|
83
|
+
encode(message, writer = probuff_config_1.default.Writer.create()) {
|
|
84
|
+
if (message.code !== "") {
|
|
85
|
+
writer.uint32(10).string(message.code);
|
|
86
|
+
}
|
|
87
|
+
if (message.msg !== "") {
|
|
88
|
+
writer.uint32(18).string(message.msg);
|
|
89
|
+
}
|
|
90
|
+
return writer;
|
|
91
|
+
},
|
|
92
|
+
decode(input, length) {
|
|
93
|
+
const reader = input instanceof probuff_config_1.default.Reader ? input : new probuff_config_1.default.Reader(input);
|
|
94
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
95
|
+
const message = createBaseMsgSetTxHashResponse();
|
|
96
|
+
while (reader.pos < end) {
|
|
97
|
+
const tag = reader.uint32();
|
|
98
|
+
switch (tag >>> 3) {
|
|
99
|
+
case 1:
|
|
100
|
+
message.code = reader.string();
|
|
101
|
+
break;
|
|
102
|
+
case 2:
|
|
103
|
+
message.msg = reader.string();
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
reader.skipType(tag & 7);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return message;
|
|
111
|
+
},
|
|
112
|
+
fromJSON(object) {
|
|
113
|
+
return {
|
|
114
|
+
code: (0, utils_1.isSet)(object.code) ? String(object.code) : "",
|
|
115
|
+
msg: (0, utils_1.isSet)(object.msg) ? String(object.msg) : "",
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
toJSON(message) {
|
|
119
|
+
const obj = {};
|
|
120
|
+
message.code !== undefined && (obj.code = message.code);
|
|
121
|
+
message.msg !== undefined && (obj.msg = message.msg);
|
|
122
|
+
return obj;
|
|
123
|
+
},
|
|
124
|
+
fromPartial(object) {
|
|
125
|
+
const message = createBaseMsgSetTxHashResponse();
|
|
126
|
+
message.code = object.code ?? "";
|
|
127
|
+
message.msg = object.msg ?? "";
|
|
128
|
+
return message;
|
|
129
|
+
},
|
|
130
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _m0 from "../../config/probuff.config";
|
|
2
|
+
export interface MsgSetTxProcess {
|
|
3
|
+
creator: string;
|
|
4
|
+
txId: number;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
msgId: string;
|
|
7
|
+
/** request_transaction, request_provision_transaction, request_drain_transaction, withdraw_pool */
|
|
8
|
+
txType: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MsgSetTxProcessResponse {
|
|
11
|
+
}
|
|
12
|
+
export declare const MsgSetTxProcess: {
|
|
13
|
+
encode(message: MsgSetTxProcess, writer?: _m0.Writer): _m0.Writer;
|
|
14
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxProcess;
|
|
15
|
+
fromJSON(object: any): MsgSetTxProcess;
|
|
16
|
+
toJSON(message: MsgSetTxProcess): unknown;
|
|
17
|
+
fromPartial<I extends {
|
|
18
|
+
creator?: string | undefined;
|
|
19
|
+
txId?: number | undefined;
|
|
20
|
+
timestamp?: number | undefined;
|
|
21
|
+
msgId?: string | undefined;
|
|
22
|
+
txType?: string | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
creator?: string | undefined;
|
|
25
|
+
txId?: number | undefined;
|
|
26
|
+
timestamp?: number | undefined;
|
|
27
|
+
msgId?: string | undefined;
|
|
28
|
+
txType?: string | undefined;
|
|
29
|
+
} & { [K in Exclude<keyof I, keyof MsgSetTxProcess>]: never; }>(object: I): MsgSetTxProcess;
|
|
30
|
+
};
|
|
31
|
+
export declare const MsgSetTxProcessResponse: {
|
|
32
|
+
encode(_: MsgSetTxProcessResponse, writer?: _m0.Writer): _m0.Writer;
|
|
33
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxProcessResponse;
|
|
34
|
+
fromJSON(_: any): MsgSetTxProcessResponse;
|
|
35
|
+
toJSON(_: MsgSetTxProcessResponse): unknown;
|
|
36
|
+
fromPartial<I extends {} & {} & { [K in Exclude<keyof I, never>]: never; }>(_: I): MsgSetTxProcessResponse;
|
|
37
|
+
};
|