@kimafinance/kima-transaction-api 1.0.20-beta.1 → 1.0.22-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.
@@ -6,6 +6,9 @@ on:
6
6
  jobs:
7
7
  build:
8
8
  runs-on: ubuntu-latest
9
+ permissions:
10
+ contents: read
11
+ id-token: write
9
12
 
10
13
  steps:
11
14
  - uses: actions/checkout@v2
@@ -22,7 +25,8 @@ jobs:
22
25
  run: |
23
26
 
24
27
  npm install
25
- npm publish
28
+ npm start
29
+ npm publish --provenance
26
30
 
27
31
  env:
28
32
  NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -0,0 +1,28 @@
1
+ export declare enum SupportedNetworks {
2
+ ETHEREUM = "ETH",
3
+ POLYGON = "POL",
4
+ AVALANCHE = "AVX",
5
+ SOLANA = "SOL",
6
+ FUSE = "FUS",
7
+ CELO = "CEL",
8
+ BSC = "BSC",
9
+ ARBITRIUM = "ARB",
10
+ OPTIMISM = "OPT",
11
+ POLYGON_ZKEVM = "ZKE"
12
+ }
13
+ export declare enum CurrencyOptions {
14
+ USDT = "USDT",
15
+ USDC = "USDC",
16
+ USDK = "USDK"
17
+ }
18
+ interface Props {
19
+ originChain: SupportedNetworks;
20
+ originAddress: string;
21
+ targetChain: SupportedNetworks;
22
+ targetAddress: string;
23
+ symbol: CurrencyOptions;
24
+ amount: number;
25
+ fee: number;
26
+ }
27
+ export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, symbol, amount, fee, }: Props): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
28
+ export {};
package/build/index.js ADDED
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submitKimaTransaction = exports.CurrencyOptions = exports.SupportedNetworks = void 0;
4
+ const proto_signing_1 = require("@cosmjs/proto-signing");
5
+ const common_1 = require("./kima/common");
6
+ var SupportedNetworks;
7
+ (function (SupportedNetworks) {
8
+ SupportedNetworks["ETHEREUM"] = "ETH";
9
+ SupportedNetworks["POLYGON"] = "POL";
10
+ SupportedNetworks["AVALANCHE"] = "AVX";
11
+ SupportedNetworks["SOLANA"] = "SOL";
12
+ SupportedNetworks["FUSE"] = "FUS";
13
+ SupportedNetworks["CELO"] = "CEL";
14
+ SupportedNetworks["BSC"] = "BSC";
15
+ SupportedNetworks["ARBITRIUM"] = "ARB";
16
+ SupportedNetworks["OPTIMISM"] = "OPT";
17
+ SupportedNetworks["POLYGON_ZKEVM"] = "ZKE";
18
+ })(SupportedNetworks = exports.SupportedNetworks || (exports.SupportedNetworks = {}));
19
+ var CurrencyOptions;
20
+ (function (CurrencyOptions) {
21
+ CurrencyOptions["USDT"] = "USDT";
22
+ CurrencyOptions["USDC"] = "USDC";
23
+ CurrencyOptions["USDK"] = "USDK";
24
+ })(CurrencyOptions = exports.CurrencyOptions || (exports.CurrencyOptions = {}));
25
+ function sleep(ms) {
26
+ return new Promise((resolve) => setTimeout(resolve, ms));
27
+ }
28
+ async function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, symbol, amount, fee, }) {
29
+ const wallet = await proto_signing_1.DirectSecp256k1HdWallet.fromMnemonic(process.env.KIMA_BACKEND_MNEMONIC, { prefix: "kima" });
30
+ const client = await (0, common_1.TxClient)(wallet);
31
+ const [firstAccount] = await wallet.getAccounts();
32
+ const params = {
33
+ creator: firstAccount.address,
34
+ originChain,
35
+ originAddress,
36
+ targetChain,
37
+ targetAddress,
38
+ symbol,
39
+ amount: amount.toString(),
40
+ fee: fee.toString(),
41
+ };
42
+ let msg = await client.msgRequestTransaction(params);
43
+ const result = await client.signAndBroadcast([msg]);
44
+ let txId = 1;
45
+ for (const event of result.events) {
46
+ if (event.type === "transaction_requested") {
47
+ for (const attr of event.attributes) {
48
+ if (attr.key === "txId") {
49
+ txId = +attr.value;
50
+ }
51
+ }
52
+ }
53
+ }
54
+ msg = await client.msgSetTxHash({
55
+ creator: firstAccount.address,
56
+ txId,
57
+ txHash: result.transactionHash,
58
+ });
59
+ console.log(msg);
60
+ let hashResult;
61
+ do {
62
+ hashResult = await client.signAndBroadcast([msg]);
63
+ await sleep(1000);
64
+ } while (hashResult.code !== 0);
65
+ return result;
66
+ }
67
+ exports.submitKimaTransaction = submitKimaTransaction;
@@ -0,0 +1,14 @@
1
+ import { StdFee } from "@cosmjs/stargate";
2
+ import { Registry, OfflineSigner, EncodeObject } from "@cosmjs/proto-signing";
3
+ import { MsgRequestTransaction, MsgSetTxHash } from "./tx";
4
+ interface SignAndBroadcastOptions {
5
+ fee: StdFee;
6
+ memo?: string;
7
+ }
8
+ export declare const registry: Registry;
9
+ export declare const TxClient: (wallet: OfflineSigner) => Promise<{
10
+ signAndBroadcast: (msgs: EncodeObject[], { fee, memo }?: SignAndBroadcastOptions) => Promise<import("@cosmjs/stargate").DeliverTxResponse>;
11
+ msgRequestTransaction: (data: MsgRequestTransaction) => EncodeObject;
12
+ msgSetTxHash: (data: MsgSetTxHash) => EncodeObject;
13
+ }>;
14
+ export {};
@@ -0,0 +1,36 @@
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.TxClient = exports.registry = void 0;
7
+ const stargate_1 = require("@cosmjs/stargate");
8
+ const dotenv_1 = __importDefault(require("dotenv"));
9
+ const proto_signing_1 = require("@cosmjs/proto-signing");
10
+ const tx_1 = require("./tx");
11
+ dotenv_1.default.config();
12
+ const defaultFee = {
13
+ amount: [],
14
+ gas: "2000000",
15
+ };
16
+ const types = [
17
+ ["/kimablockchain.transaction.MsgRequestTransaction", tx_1.MsgRequestTransaction],
18
+ ["/kimablockchain.transaction.MsgSetTxHash", tx_1.MsgSetTxHash],
19
+ ];
20
+ exports.registry = new proto_signing_1.Registry(types);
21
+ const TxClient = async (wallet) => {
22
+ const client = await stargate_1.SigningStargateClient.connectWithSigner(process.env.KIMA_BACKEND_NODE_PROVIDER, wallet, { registry: exports.registry });
23
+ const { address } = (await wallet.getAccounts())[0];
24
+ return {
25
+ signAndBroadcast: (msgs, { fee, memo } = { fee: defaultFee, memo: "" }) => client.signAndBroadcast(address, msgs, fee, memo),
26
+ msgRequestTransaction: (data) => ({
27
+ typeUrl: "/kimablockchain.transaction.MsgRequestTransaction",
28
+ value: tx_1.MsgRequestTransaction.fromPartial(data),
29
+ }),
30
+ msgSetTxHash: (data) => ({
31
+ typeUrl: "/kimablockchain.transaction.MsgSetTxHash",
32
+ value: tx_1.MsgSetTxHash.fromPartial(data),
33
+ }),
34
+ };
35
+ };
36
+ exports.TxClient = TxClient;
@@ -0,0 +1,426 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "kimablockchain.transaction";
3
+ export interface MsgRequestTransaction {
4
+ creator: string;
5
+ originChain: string;
6
+ originAddress: string;
7
+ targetChain: string;
8
+ targetAddress: string;
9
+ symbol: string;
10
+ amount: string;
11
+ fee: string;
12
+ }
13
+ export interface MsgRequestTransactionResponse {
14
+ code: string;
15
+ msg: string;
16
+ txId: number;
17
+ }
18
+ export interface MsgFinalizeTransaction {
19
+ creator: string;
20
+ txId: number;
21
+ txHash: string;
22
+ success: string;
23
+ signedKey: string;
24
+ }
25
+ export interface MsgFinalizeTransactionResponse {
26
+ code: string;
27
+ msg: string;
28
+ }
29
+ export interface MsgFinalizeProvisionTransaction {
30
+ creator: string;
31
+ txId: number;
32
+ txHash: string;
33
+ success: string;
34
+ signedKey: string;
35
+ }
36
+ export interface MsgFinalizeProvisionTransactionResponse {
37
+ code: string;
38
+ msg: string;
39
+ }
40
+ export interface MsgRequestProvisionTransaction {
41
+ creator: string;
42
+ chain: string;
43
+ fromAddress: string;
44
+ symbol: string;
45
+ amount: string;
46
+ options: string;
47
+ }
48
+ export interface MsgRequestProvisionTransactionResponse {
49
+ code: string;
50
+ msg: string;
51
+ txId: number;
52
+ }
53
+ export interface MsgCancelTransaction {
54
+ creator: string;
55
+ transactionId: string;
56
+ }
57
+ export interface MsgCancelTransactionResponse {
58
+ code: string;
59
+ msg: string;
60
+ }
61
+ export interface MsgSetTxHash {
62
+ creator: string;
63
+ txId: number;
64
+ txHash: string;
65
+ }
66
+ export interface MsgSetTxHashResponse {
67
+ code: string;
68
+ msg: string;
69
+ }
70
+ export interface MsgSetTxProcess {
71
+ creator: string;
72
+ txId: number;
73
+ timestamp: number;
74
+ msgId: string;
75
+ }
76
+ export interface MsgSetTxProcessResponse {
77
+ }
78
+ export interface MsgRequestDrainTransaction {
79
+ creator: string;
80
+ toChain: string;
81
+ toAddress: string;
82
+ symbol: string;
83
+ amount: string;
84
+ options: string;
85
+ }
86
+ export interface MsgRequestDrainTransactionResponse {
87
+ code: string;
88
+ msg: string;
89
+ txId: number;
90
+ }
91
+ export interface MsgFinalizeDrainTransaction {
92
+ creator: string;
93
+ txId: number;
94
+ txHash: string;
95
+ success: string;
96
+ signedKey: string;
97
+ }
98
+ export interface MsgFinalizeDrainTransactionResponse {
99
+ code: string;
100
+ msg: string;
101
+ }
102
+ export declare const MsgRequestTransaction: {
103
+ encode(message: MsgRequestTransaction, writer?: _m0.Writer): _m0.Writer;
104
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransaction;
105
+ fromJSON(object: any): MsgRequestTransaction;
106
+ toJSON(message: MsgRequestTransaction): unknown;
107
+ fromPartial<I extends {
108
+ creator?: string | undefined;
109
+ originChain?: string | undefined;
110
+ originAddress?: string | undefined;
111
+ targetChain?: string | undefined;
112
+ targetAddress?: string | undefined;
113
+ symbol?: string | undefined;
114
+ amount?: string | undefined;
115
+ fee?: string | undefined;
116
+ } & {
117
+ creator?: string | undefined;
118
+ originChain?: string | undefined;
119
+ originAddress?: string | undefined;
120
+ targetChain?: string | undefined;
121
+ targetAddress?: string | undefined;
122
+ symbol?: string | undefined;
123
+ amount?: string | undefined;
124
+ fee?: string | undefined;
125
+ } & { [K in Exclude<keyof I, keyof MsgRequestTransaction>]: never; }>(object: I): MsgRequestTransaction;
126
+ };
127
+ export declare const MsgRequestTransactionResponse: {
128
+ encode(message: MsgRequestTransactionResponse, writer?: _m0.Writer): _m0.Writer;
129
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransactionResponse;
130
+ fromJSON(object: any): MsgRequestTransactionResponse;
131
+ toJSON(message: MsgRequestTransactionResponse): unknown;
132
+ fromPartial<I extends {
133
+ code?: string | undefined;
134
+ msg?: string | undefined;
135
+ txId?: number | undefined;
136
+ } & {
137
+ code?: string | undefined;
138
+ msg?: string | undefined;
139
+ txId?: number | undefined;
140
+ } & { [K in Exclude<keyof I, keyof MsgRequestTransactionResponse>]: never; }>(object: I): MsgRequestTransactionResponse;
141
+ };
142
+ export declare const MsgFinalizeTransaction: {
143
+ encode(message: MsgFinalizeTransaction, writer?: _m0.Writer): _m0.Writer;
144
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeTransaction;
145
+ fromJSON(object: any): MsgFinalizeTransaction;
146
+ toJSON(message: MsgFinalizeTransaction): unknown;
147
+ fromPartial<I extends {
148
+ creator?: string | undefined;
149
+ txId?: number | undefined;
150
+ txHash?: string | undefined;
151
+ success?: string | undefined;
152
+ signedKey?: string | undefined;
153
+ } & {
154
+ creator?: string | undefined;
155
+ txId?: number | undefined;
156
+ txHash?: string | undefined;
157
+ success?: string | undefined;
158
+ signedKey?: string | undefined;
159
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeTransaction>]: never; }>(object: I): MsgFinalizeTransaction;
160
+ };
161
+ export declare const MsgFinalizeTransactionResponse: {
162
+ encode(message: MsgFinalizeTransactionResponse, writer?: _m0.Writer): _m0.Writer;
163
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeTransactionResponse;
164
+ fromJSON(object: any): MsgFinalizeTransactionResponse;
165
+ toJSON(message: MsgFinalizeTransactionResponse): unknown;
166
+ fromPartial<I extends {
167
+ code?: string | undefined;
168
+ msg?: string | undefined;
169
+ } & {
170
+ code?: string | undefined;
171
+ msg?: string | undefined;
172
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeTransactionResponse>]: never; }>(object: I): MsgFinalizeTransactionResponse;
173
+ };
174
+ export declare const MsgFinalizeProvisionTransaction: {
175
+ encode(message: MsgFinalizeProvisionTransaction, writer?: _m0.Writer): _m0.Writer;
176
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeProvisionTransaction;
177
+ fromJSON(object: any): MsgFinalizeProvisionTransaction;
178
+ toJSON(message: MsgFinalizeProvisionTransaction): unknown;
179
+ fromPartial<I extends {
180
+ creator?: string | undefined;
181
+ txId?: number | undefined;
182
+ txHash?: string | undefined;
183
+ success?: string | undefined;
184
+ signedKey?: string | undefined;
185
+ } & {
186
+ creator?: string | undefined;
187
+ txId?: number | undefined;
188
+ txHash?: string | undefined;
189
+ success?: string | undefined;
190
+ signedKey?: string | undefined;
191
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeProvisionTransaction>]: never; }>(object: I): MsgFinalizeProvisionTransaction;
192
+ };
193
+ export declare const MsgFinalizeProvisionTransactionResponse: {
194
+ encode(message: MsgFinalizeProvisionTransactionResponse, writer?: _m0.Writer): _m0.Writer;
195
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeProvisionTransactionResponse;
196
+ fromJSON(object: any): MsgFinalizeProvisionTransactionResponse;
197
+ toJSON(message: MsgFinalizeProvisionTransactionResponse): unknown;
198
+ fromPartial<I extends {
199
+ code?: string | undefined;
200
+ msg?: string | undefined;
201
+ } & {
202
+ code?: string | undefined;
203
+ msg?: string | undefined;
204
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeProvisionTransactionResponse>]: never; }>(object: I): MsgFinalizeProvisionTransactionResponse;
205
+ };
206
+ export declare const MsgRequestProvisionTransaction: {
207
+ encode(message: MsgRequestProvisionTransaction, writer?: _m0.Writer): _m0.Writer;
208
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestProvisionTransaction;
209
+ fromJSON(object: any): MsgRequestProvisionTransaction;
210
+ toJSON(message: MsgRequestProvisionTransaction): unknown;
211
+ fromPartial<I extends {
212
+ creator?: string | undefined;
213
+ chain?: string | undefined;
214
+ fromAddress?: string | undefined;
215
+ symbol?: string | undefined;
216
+ amount?: string | undefined;
217
+ options?: string | undefined;
218
+ } & {
219
+ creator?: string | undefined;
220
+ chain?: string | undefined;
221
+ fromAddress?: string | undefined;
222
+ symbol?: string | undefined;
223
+ amount?: string | undefined;
224
+ options?: string | undefined;
225
+ } & { [K in Exclude<keyof I, keyof MsgRequestProvisionTransaction>]: never; }>(object: I): MsgRequestProvisionTransaction;
226
+ };
227
+ export declare const MsgRequestProvisionTransactionResponse: {
228
+ encode(message: MsgRequestProvisionTransactionResponse, writer?: _m0.Writer): _m0.Writer;
229
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestProvisionTransactionResponse;
230
+ fromJSON(object: any): MsgRequestProvisionTransactionResponse;
231
+ toJSON(message: MsgRequestProvisionTransactionResponse): unknown;
232
+ fromPartial<I extends {
233
+ code?: string | undefined;
234
+ msg?: string | undefined;
235
+ txId?: number | undefined;
236
+ } & {
237
+ code?: string | undefined;
238
+ msg?: string | undefined;
239
+ txId?: number | undefined;
240
+ } & { [K in Exclude<keyof I, keyof MsgRequestProvisionTransactionResponse>]: never; }>(object: I): MsgRequestProvisionTransactionResponse;
241
+ };
242
+ export declare const MsgCancelTransaction: {
243
+ encode(message: MsgCancelTransaction, writer?: _m0.Writer): _m0.Writer;
244
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelTransaction;
245
+ fromJSON(object: any): MsgCancelTransaction;
246
+ toJSON(message: MsgCancelTransaction): unknown;
247
+ fromPartial<I extends {
248
+ creator?: string | undefined;
249
+ transactionId?: string | undefined;
250
+ } & {
251
+ creator?: string | undefined;
252
+ transactionId?: string | undefined;
253
+ } & { [K in Exclude<keyof I, keyof MsgCancelTransaction>]: never; }>(object: I): MsgCancelTransaction;
254
+ };
255
+ export declare const MsgCancelTransactionResponse: {
256
+ encode(message: MsgCancelTransactionResponse, writer?: _m0.Writer): _m0.Writer;
257
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelTransactionResponse;
258
+ fromJSON(object: any): MsgCancelTransactionResponse;
259
+ toJSON(message: MsgCancelTransactionResponse): unknown;
260
+ fromPartial<I extends {
261
+ code?: string | undefined;
262
+ msg?: string | undefined;
263
+ } & {
264
+ code?: string | undefined;
265
+ msg?: string | undefined;
266
+ } & { [K in Exclude<keyof I, keyof MsgCancelTransactionResponse>]: never; }>(object: I): MsgCancelTransactionResponse;
267
+ };
268
+ export declare const MsgSetTxHash: {
269
+ encode(message: MsgSetTxHash, writer?: _m0.Writer): _m0.Writer;
270
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxHash;
271
+ fromJSON(object: any): MsgSetTxHash;
272
+ toJSON(message: MsgSetTxHash): unknown;
273
+ fromPartial<I extends {
274
+ creator?: string | undefined;
275
+ txId?: number | undefined;
276
+ txHash?: string | undefined;
277
+ } & {
278
+ creator?: string | undefined;
279
+ txId?: number | undefined;
280
+ txHash?: string | undefined;
281
+ } & { [K in Exclude<keyof I, keyof MsgSetTxHash>]: never; }>(object: I): MsgSetTxHash;
282
+ };
283
+ export declare const MsgSetTxHashResponse: {
284
+ encode(message: MsgSetTxHashResponse, writer?: _m0.Writer): _m0.Writer;
285
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxHashResponse;
286
+ fromJSON(object: any): MsgSetTxHashResponse;
287
+ toJSON(message: MsgSetTxHashResponse): unknown;
288
+ fromPartial<I extends {
289
+ code?: string | undefined;
290
+ msg?: string | undefined;
291
+ } & {
292
+ code?: string | undefined;
293
+ msg?: string | undefined;
294
+ } & { [K in Exclude<keyof I, keyof MsgSetTxHashResponse>]: never; }>(object: I): MsgSetTxHashResponse;
295
+ };
296
+ export declare const MsgSetTxProcess: {
297
+ encode(message: MsgSetTxProcess, writer?: _m0.Writer): _m0.Writer;
298
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxProcess;
299
+ fromJSON(object: any): MsgSetTxProcess;
300
+ toJSON(message: MsgSetTxProcess): unknown;
301
+ fromPartial<I extends {
302
+ creator?: string | undefined;
303
+ txId?: number | undefined;
304
+ timestamp?: number | undefined;
305
+ msgId?: string | undefined;
306
+ } & {
307
+ creator?: string | undefined;
308
+ txId?: number | undefined;
309
+ timestamp?: number | undefined;
310
+ msgId?: string | undefined;
311
+ } & { [K in Exclude<keyof I, keyof MsgSetTxProcess>]: never; }>(object: I): MsgSetTxProcess;
312
+ };
313
+ export declare const MsgSetTxProcessResponse: {
314
+ encode(_: MsgSetTxProcessResponse, writer?: _m0.Writer): _m0.Writer;
315
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxProcessResponse;
316
+ fromJSON(_: any): MsgSetTxProcessResponse;
317
+ toJSON(_: MsgSetTxProcessResponse): unknown;
318
+ fromPartial<I extends {} & {} & { [K in Exclude<keyof I, never>]: never; }>(_: I): MsgSetTxProcessResponse;
319
+ };
320
+ export declare const MsgRequestDrainTransaction: {
321
+ encode(message: MsgRequestDrainTransaction, writer?: _m0.Writer): _m0.Writer;
322
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestDrainTransaction;
323
+ fromJSON(object: any): MsgRequestDrainTransaction;
324
+ toJSON(message: MsgRequestDrainTransaction): unknown;
325
+ fromPartial<I extends {
326
+ creator?: string | undefined;
327
+ toChain?: string | undefined;
328
+ toAddress?: string | undefined;
329
+ symbol?: string | undefined;
330
+ amount?: string | undefined;
331
+ options?: string | undefined;
332
+ } & {
333
+ creator?: string | undefined;
334
+ toChain?: string | undefined;
335
+ toAddress?: string | undefined;
336
+ symbol?: string | undefined;
337
+ amount?: string | undefined;
338
+ options?: string | undefined;
339
+ } & { [K in Exclude<keyof I, keyof MsgRequestDrainTransaction>]: never; }>(object: I): MsgRequestDrainTransaction;
340
+ };
341
+ export declare const MsgRequestDrainTransactionResponse: {
342
+ encode(message: MsgRequestDrainTransactionResponse, writer?: _m0.Writer): _m0.Writer;
343
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestDrainTransactionResponse;
344
+ fromJSON(object: any): MsgRequestDrainTransactionResponse;
345
+ toJSON(message: MsgRequestDrainTransactionResponse): unknown;
346
+ fromPartial<I extends {
347
+ code?: string | undefined;
348
+ msg?: string | undefined;
349
+ txId?: number | undefined;
350
+ } & {
351
+ code?: string | undefined;
352
+ msg?: string | undefined;
353
+ txId?: number | undefined;
354
+ } & { [K in Exclude<keyof I, keyof MsgRequestDrainTransactionResponse>]: never; }>(object: I): MsgRequestDrainTransactionResponse;
355
+ };
356
+ export declare const MsgFinalizeDrainTransaction: {
357
+ encode(message: MsgFinalizeDrainTransaction, writer?: _m0.Writer): _m0.Writer;
358
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeDrainTransaction;
359
+ fromJSON(object: any): MsgFinalizeDrainTransaction;
360
+ toJSON(message: MsgFinalizeDrainTransaction): unknown;
361
+ fromPartial<I extends {
362
+ creator?: string | undefined;
363
+ txId?: number | undefined;
364
+ txHash?: string | undefined;
365
+ success?: string | undefined;
366
+ signedKey?: string | undefined;
367
+ } & {
368
+ creator?: string | undefined;
369
+ txId?: number | undefined;
370
+ txHash?: string | undefined;
371
+ success?: string | undefined;
372
+ signedKey?: string | undefined;
373
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeDrainTransaction>]: never; }>(object: I): MsgFinalizeDrainTransaction;
374
+ };
375
+ export declare const MsgFinalizeDrainTransactionResponse: {
376
+ encode(message: MsgFinalizeDrainTransactionResponse, writer?: _m0.Writer): _m0.Writer;
377
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeDrainTransactionResponse;
378
+ fromJSON(object: any): MsgFinalizeDrainTransactionResponse;
379
+ toJSON(message: MsgFinalizeDrainTransactionResponse): unknown;
380
+ fromPartial<I extends {
381
+ code?: string | undefined;
382
+ msg?: string | undefined;
383
+ } & {
384
+ code?: string | undefined;
385
+ msg?: string | undefined;
386
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeDrainTransactionResponse>]: never; }>(object: I): MsgFinalizeDrainTransactionResponse;
387
+ };
388
+ /** Msg defines the Msg service. */
389
+ export interface Msg {
390
+ RequestTransaction(request: MsgRequestTransaction): Promise<MsgRequestTransactionResponse>;
391
+ FinalizeTransaction(request: MsgFinalizeTransaction): Promise<MsgFinalizeTransactionResponse>;
392
+ RequestProvisionTransaction(request: MsgRequestProvisionTransaction): Promise<MsgRequestProvisionTransactionResponse>;
393
+ CancelTransaction(request: MsgCancelTransaction): Promise<MsgCancelTransactionResponse>;
394
+ SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse>;
395
+ SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse>;
396
+ FinalizeProvisionTransaction(request: MsgFinalizeProvisionTransaction): Promise<MsgFinalizeProvisionTransactionResponse>;
397
+ RequestDrainTransaction(request: MsgRequestDrainTransaction): Promise<MsgRequestDrainTransactionResponse>;
398
+ FinalizeDrainTransaction(request: MsgFinalizeDrainTransaction): Promise<MsgFinalizeDrainTransactionResponse>;
399
+ }
400
+ export declare class MsgClientImpl implements Msg {
401
+ private readonly rpc;
402
+ constructor(rpc: Rpc);
403
+ RequestTransaction(request: MsgRequestTransaction): Promise<MsgRequestTransactionResponse>;
404
+ FinalizeTransaction(request: MsgFinalizeTransaction): Promise<MsgFinalizeTransactionResponse>;
405
+ RequestProvisionTransaction(request: MsgRequestProvisionTransaction): Promise<MsgRequestProvisionTransactionResponse>;
406
+ CancelTransaction(request: MsgCancelTransaction): Promise<MsgCancelTransactionResponse>;
407
+ SetTxHash(request: MsgSetTxHash): Promise<MsgSetTxHashResponse>;
408
+ SetTxProcess(request: MsgSetTxProcess): Promise<MsgSetTxProcessResponse>;
409
+ FinalizeProvisionTransaction(request: MsgFinalizeProvisionTransaction): Promise<MsgFinalizeProvisionTransactionResponse>;
410
+ RequestDrainTransaction(request: MsgRequestDrainTransaction): Promise<MsgRequestDrainTransactionResponse>;
411
+ FinalizeDrainTransaction(request: MsgFinalizeDrainTransaction): Promise<MsgFinalizeDrainTransactionResponse>;
412
+ }
413
+ interface Rpc {
414
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
415
+ }
416
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
417
+ export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
418
+ [K in keyof T]?: DeepPartial<T[K]>;
419
+ } : Partial<T>;
420
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
421
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
422
+ [K in keyof P]: Exact<P[K], I[K]>;
423
+ } & {
424
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
425
+ };
426
+ export {};