@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.
- package/build/index.d.ts +50 -3
- package/build/index.js +121 -17
- package/build/kima/common.d.ts +1 -4
- package/build/kima/common.js +9 -12
- package/build/kima/tx.d.ts +674 -0
- package/build/kima/tx.js +2170 -0
- package/package.json +10 -10
- package/src/index.ts +206 -3
- package/src/kima/common.ts +12 -5
- package/src/kima/tx.ts +2945 -0
- package/build/api/htlc-lock.d.ts +0 -23
- package/build/api/htlc-lock.js +0 -37
- package/build/api/htlc-reclaim.d.ts +0 -14
- package/build/api/htlc-reclaim.js +0 -28
- package/build/api/submit.d.ts +0 -54
- package/build/api/submit.js +0 -94
- package/build/config/global-this.config.d.ts +0 -2
- package/build/config/global-this.config.js +0 -18
- package/build/config/probuff.config.d.ts +0 -2
- package/build/config/probuff.config.js +0 -12
- package/build/kima/tx/cancel.d.ts +0 -35
- package/build/kima/tx/cancel.js +0 -115
- package/build/kima/tx/drain-finalize.d.ts +0 -47
- package/build/kima/tx/drain-finalize.js +0 -155
- package/build/kima/tx/drain.d.ts +0 -50
- package/build/kima/tx/drain.js +0 -164
- package/build/kima/tx/finalize.d.ts +0 -47
- package/build/kima/tx/finalize.js +0 -155
- package/build/kima/tx/htlc-lock.d.ts +0 -42
- package/build/kima/tx/htlc-lock.js +0 -152
- package/build/kima/tx/htlc-reclaim.d.ts +0 -30
- package/build/kima/tx/htlc-reclaim.js +0 -105
- package/build/kima/tx/index.d.ts +0 -1
- package/build/kima/tx/index.js +0 -4
- package/build/kima/tx/liquidity-provision.d.ts +0 -30
- package/build/kima/tx/liquidity-provision.js +0 -102
- package/build/kima/tx/message-service.d.ts +0 -54
- package/build/kima/tx/message-service.js +0 -117
- package/build/kima/tx/provision-finalize.d.ts +0 -47
- package/build/kima/tx/provision-finalize.js +0 -155
- package/build/kima/tx/provision.d.ts +0 -70
- package/build/kima/tx/provision.js +0 -230
- package/build/kima/tx/request.d.ts +0 -63
- package/build/kima/tx/request.js +0 -222
- package/build/kima/tx/response.d.ts +0 -21
- package/build/kima/tx/response.js +0 -69
- package/build/kima/tx/rpc.d.ts +0 -0
- package/build/kima/tx/rpc.js +0 -1
- package/build/kima/tx/set-hash.d.ts +0 -42
- package/build/kima/tx/set-hash.js +0 -130
- package/build/kima/tx/set-process.d.ts +0 -37
- package/build/kima/tx/set-process.js +0 -121
- package/build/kima/tx/transfer-limit.d.ts +0 -30
- package/build/kima/tx/transfer-limit.js +0 -102
- package/build/kima/tx/withdraw.d.ts +0 -47
- package/build/kima/tx/withdraw.js +0 -155
- package/build/utils.d.ts +0 -17
- package/build/utils.js +0 -49
- package/src/api/htlc-lock.ts +0 -57
- package/src/api/htlc-reclaim.ts +0 -39
- package/src/api/submit.ts +0 -132
- package/src/config/global-this.config.ts +0 -20
- package/src/config/probuff.config.ts +0 -9
- package/src/kima/tx/cancel.ts +0 -147
- package/src/kima/tx/drain-finalize.ts +0 -191
- package/src/kima/tx/drain.ts +0 -201
- package/src/kima/tx/finalize.ts +0 -191
- package/src/kima/tx/htlc-lock.ts +0 -183
- package/src/kima/tx/htlc-reclaim.ts +0 -132
- package/src/kima/tx/index.ts +0 -1
- package/src/kima/tx/liquidity-provision.ts +0 -132
- package/src/kima/tx/message-service.ts +0 -278
- package/src/kima/tx/provision-finalize.ts +0 -191
- package/src/kima/tx/provision.ts +0 -279
- package/src/kima/tx/request.ts +0 -256
- package/src/kima/tx/response.ts +0 -83
- package/src/kima/tx/rpc.ts +0 -0
- package/src/kima/tx/set-hash.ts +0 -162
- package/src/kima/tx/set-process.ts +0 -151
- package/src/kima/tx/transfer-limit.ts +0 -132
- package/src/kima/tx/withdraw.ts +0 -191
- package/src/utils.ts +0 -67
package/src/kima/tx/set-hash.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import _m0 from "../../config/probuff.config";
|
|
2
|
-
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
-
|
|
4
|
-
export interface MsgSetTxHash {
|
|
5
|
-
creator: string;
|
|
6
|
-
txId: number;
|
|
7
|
-
txHash: string;
|
|
8
|
-
/** request_transaction, request_provision_transaction, request_drain_transaction */
|
|
9
|
-
txType: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface MsgSetTxHashResponse {
|
|
13
|
-
code: string;
|
|
14
|
-
msg: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function createBaseMsgSetTxHash(): MsgSetTxHash {
|
|
18
|
-
return { creator: "", txId: 0, txHash: "", txType: "" };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const MsgSetTxHash = {
|
|
22
|
-
encode(
|
|
23
|
-
message: MsgSetTxHash,
|
|
24
|
-
writer: _m0.Writer = _m0.Writer.create()
|
|
25
|
-
): _m0.Writer {
|
|
26
|
-
if (message.creator !== "") {
|
|
27
|
-
writer.uint32(10).string(message.creator);
|
|
28
|
-
}
|
|
29
|
-
if (message.txId !== 0) {
|
|
30
|
-
writer.uint32(16).uint64(message.txId);
|
|
31
|
-
}
|
|
32
|
-
if (message.txHash !== "") {
|
|
33
|
-
writer.uint32(26).string(message.txHash);
|
|
34
|
-
}
|
|
35
|
-
if (message.txType !== "") {
|
|
36
|
-
writer.uint32(34).string(message.txType);
|
|
37
|
-
}
|
|
38
|
-
return writer;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxHash {
|
|
42
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
43
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
44
|
-
const message = createBaseMsgSetTxHash();
|
|
45
|
-
while (reader.pos < end) {
|
|
46
|
-
const tag = reader.uint32();
|
|
47
|
-
switch (tag >>> 3) {
|
|
48
|
-
case 1:
|
|
49
|
-
message.creator = reader.string();
|
|
50
|
-
break;
|
|
51
|
-
case 2:
|
|
52
|
-
message.txId = longToNumber(reader.uint64() as Long);
|
|
53
|
-
break;
|
|
54
|
-
case 3:
|
|
55
|
-
message.txHash = reader.string();
|
|
56
|
-
break;
|
|
57
|
-
case 4:
|
|
58
|
-
message.txType = reader.string();
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
reader.skipType(tag & 7);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return message;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
fromJSON(object: any): MsgSetTxHash {
|
|
69
|
-
return {
|
|
70
|
-
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
71
|
-
txId: isSet(object.txId) ? Number(object.txId) : 0,
|
|
72
|
-
txHash: isSet(object.txHash) ? String(object.txHash) : "",
|
|
73
|
-
txType: isSet(object.txType) ? String(object.txType) : "",
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
toJSON(message: MsgSetTxHash): unknown {
|
|
78
|
-
const obj: any = {};
|
|
79
|
-
message.creator !== undefined && (obj.creator = message.creator);
|
|
80
|
-
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
81
|
-
message.txHash !== undefined && (obj.txHash = message.txHash);
|
|
82
|
-
message.txType !== undefined && (obj.txType = message.txType);
|
|
83
|
-
return obj;
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxHash>, I>>(
|
|
87
|
-
object: I
|
|
88
|
-
): MsgSetTxHash {
|
|
89
|
-
const message = createBaseMsgSetTxHash();
|
|
90
|
-
message.creator = object.creator ?? "";
|
|
91
|
-
message.txId = object.txId ?? 0;
|
|
92
|
-
message.txHash = object.txHash ?? "";
|
|
93
|
-
message.txType = object.txType ?? "";
|
|
94
|
-
return message;
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
function createBaseMsgSetTxHashResponse(): MsgSetTxHashResponse {
|
|
99
|
-
return { code: "", msg: "" };
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export const MsgSetTxHashResponse = {
|
|
103
|
-
encode(
|
|
104
|
-
message: MsgSetTxHashResponse,
|
|
105
|
-
writer: _m0.Writer = _m0.Writer.create()
|
|
106
|
-
): _m0.Writer {
|
|
107
|
-
if (message.code !== "") {
|
|
108
|
-
writer.uint32(10).string(message.code);
|
|
109
|
-
}
|
|
110
|
-
if (message.msg !== "") {
|
|
111
|
-
writer.uint32(18).string(message.msg);
|
|
112
|
-
}
|
|
113
|
-
return writer;
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
decode(
|
|
117
|
-
input: _m0.Reader | Uint8Array,
|
|
118
|
-
length?: number
|
|
119
|
-
): MsgSetTxHashResponse {
|
|
120
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
121
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
122
|
-
const message = createBaseMsgSetTxHashResponse();
|
|
123
|
-
while (reader.pos < end) {
|
|
124
|
-
const tag = reader.uint32();
|
|
125
|
-
switch (tag >>> 3) {
|
|
126
|
-
case 1:
|
|
127
|
-
message.code = reader.string();
|
|
128
|
-
break;
|
|
129
|
-
case 2:
|
|
130
|
-
message.msg = reader.string();
|
|
131
|
-
break;
|
|
132
|
-
default:
|
|
133
|
-
reader.skipType(tag & 7);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return message;
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
fromJSON(object: any): MsgSetTxHashResponse {
|
|
141
|
-
return {
|
|
142
|
-
code: isSet(object.code) ? String(object.code) : "",
|
|
143
|
-
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
toJSON(message: MsgSetTxHashResponse): unknown {
|
|
148
|
-
const obj: any = {};
|
|
149
|
-
message.code !== undefined && (obj.code = message.code);
|
|
150
|
-
message.msg !== undefined && (obj.msg = message.msg);
|
|
151
|
-
return obj;
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxHashResponse>, I>>(
|
|
155
|
-
object: I
|
|
156
|
-
): MsgSetTxHashResponse {
|
|
157
|
-
const message = createBaseMsgSetTxHashResponse();
|
|
158
|
-
message.code = object.code ?? "";
|
|
159
|
-
message.msg = object.msg ?? "";
|
|
160
|
-
return message;
|
|
161
|
-
},
|
|
162
|
-
};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import _m0 from "../../config/probuff.config";
|
|
2
|
-
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
-
|
|
4
|
-
export interface MsgSetTxProcess {
|
|
5
|
-
creator: string;
|
|
6
|
-
txId: number;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
msgId: string;
|
|
9
|
-
/** request_transaction, request_provision_transaction, request_drain_transaction, withdraw_pool */
|
|
10
|
-
txType: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface MsgSetTxProcessResponse {}
|
|
14
|
-
|
|
15
|
-
function createBaseMsgSetTxProcess(): MsgSetTxProcess {
|
|
16
|
-
return { creator: "", txId: 0, timestamp: 0, msgId: "", txType: "" };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const MsgSetTxProcess = {
|
|
20
|
-
encode(
|
|
21
|
-
message: MsgSetTxProcess,
|
|
22
|
-
writer: _m0.Writer = _m0.Writer.create()
|
|
23
|
-
): _m0.Writer {
|
|
24
|
-
if (message.creator !== "") {
|
|
25
|
-
writer.uint32(10).string(message.creator);
|
|
26
|
-
}
|
|
27
|
-
if (message.txId !== 0) {
|
|
28
|
-
writer.uint32(16).uint64(message.txId);
|
|
29
|
-
}
|
|
30
|
-
if (message.timestamp !== 0) {
|
|
31
|
-
writer.uint32(24).uint64(message.timestamp);
|
|
32
|
-
}
|
|
33
|
-
if (message.msgId !== "") {
|
|
34
|
-
writer.uint32(34).string(message.msgId);
|
|
35
|
-
}
|
|
36
|
-
if (message.txType !== "") {
|
|
37
|
-
writer.uint32(42).string(message.txType);
|
|
38
|
-
}
|
|
39
|
-
return writer;
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetTxProcess {
|
|
43
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
44
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
45
|
-
const message = createBaseMsgSetTxProcess();
|
|
46
|
-
while (reader.pos < end) {
|
|
47
|
-
const tag = reader.uint32();
|
|
48
|
-
switch (tag >>> 3) {
|
|
49
|
-
case 1:
|
|
50
|
-
message.creator = reader.string();
|
|
51
|
-
break;
|
|
52
|
-
case 2:
|
|
53
|
-
message.txId = longToNumber(reader.uint64() as Long);
|
|
54
|
-
break;
|
|
55
|
-
case 3:
|
|
56
|
-
message.timestamp = longToNumber(reader.uint64() as Long);
|
|
57
|
-
break;
|
|
58
|
-
case 4:
|
|
59
|
-
message.msgId = reader.string();
|
|
60
|
-
break;
|
|
61
|
-
case 5:
|
|
62
|
-
message.txType = reader.string();
|
|
63
|
-
break;
|
|
64
|
-
default:
|
|
65
|
-
reader.skipType(tag & 7);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return message;
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
fromJSON(object: any): MsgSetTxProcess {
|
|
73
|
-
return {
|
|
74
|
-
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
75
|
-
txId: isSet(object.txId) ? Number(object.txId) : 0,
|
|
76
|
-
timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
|
|
77
|
-
msgId: isSet(object.msgId) ? String(object.msgId) : "",
|
|
78
|
-
txType: isSet(object.txType) ? String(object.txType) : "",
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
toJSON(message: MsgSetTxProcess): unknown {
|
|
83
|
-
const obj: any = {};
|
|
84
|
-
message.creator !== undefined && (obj.creator = message.creator);
|
|
85
|
-
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
86
|
-
message.timestamp !== undefined &&
|
|
87
|
-
(obj.timestamp = Math.round(message.timestamp));
|
|
88
|
-
message.msgId !== undefined && (obj.msgId = message.msgId);
|
|
89
|
-
message.txType !== undefined && (obj.txType = message.txType);
|
|
90
|
-
return obj;
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcess>, I>>(
|
|
94
|
-
object: I
|
|
95
|
-
): MsgSetTxProcess {
|
|
96
|
-
const message = createBaseMsgSetTxProcess();
|
|
97
|
-
message.creator = object.creator ?? "";
|
|
98
|
-
message.txId = object.txId ?? 0;
|
|
99
|
-
message.timestamp = object.timestamp ?? 0;
|
|
100
|
-
message.msgId = object.msgId ?? "";
|
|
101
|
-
message.txType = object.txType ?? "";
|
|
102
|
-
return message;
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
function createBaseMsgSetTxProcessResponse(): MsgSetTxProcessResponse {
|
|
107
|
-
return {};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export const MsgSetTxProcessResponse = {
|
|
111
|
-
encode(
|
|
112
|
-
_: MsgSetTxProcessResponse,
|
|
113
|
-
writer: _m0.Writer = _m0.Writer.create()
|
|
114
|
-
): _m0.Writer {
|
|
115
|
-
return writer;
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
decode(
|
|
119
|
-
input: _m0.Reader | Uint8Array,
|
|
120
|
-
length?: number
|
|
121
|
-
): MsgSetTxProcessResponse {
|
|
122
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
123
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
124
|
-
const message = createBaseMsgSetTxProcessResponse();
|
|
125
|
-
while (reader.pos < end) {
|
|
126
|
-
const tag = reader.uint32();
|
|
127
|
-
switch (tag >>> 3) {
|
|
128
|
-
default:
|
|
129
|
-
reader.skipType(tag & 7);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return message;
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
fromJSON(_: any): MsgSetTxProcessResponse {
|
|
137
|
-
return {};
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
toJSON(_: MsgSetTxProcessResponse): unknown {
|
|
141
|
-
const obj: any = {};
|
|
142
|
-
return obj;
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
fromPartial<I extends Exact<DeepPartial<MsgSetTxProcessResponse>, I>>(
|
|
146
|
-
_: I
|
|
147
|
-
): MsgSetTxProcessResponse {
|
|
148
|
-
const message = createBaseMsgSetTxProcessResponse();
|
|
149
|
-
return message;
|
|
150
|
-
},
|
|
151
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import _m0 from "../../config/probuff.config";
|
|
2
|
-
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
-
|
|
4
|
-
export interface MsgUpdateTransferLimitParams {
|
|
5
|
-
authority: string;
|
|
6
|
-
maxBTC: string;
|
|
7
|
-
maxUSDT: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface MsgUpdateTransferLimitParamsResponse {}
|
|
11
|
-
|
|
12
|
-
function createBaseMsgUpdateTransferLimitParams(): MsgUpdateTransferLimitParams {
|
|
13
|
-
return { authority: "", maxBTC: "", maxUSDT: "" };
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const MsgUpdateTransferLimitParams = {
|
|
17
|
-
encode(
|
|
18
|
-
message: MsgUpdateTransferLimitParams,
|
|
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
|
-
): MsgUpdateTransferLimitParams {
|
|
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 = createBaseMsgUpdateTransferLimitParams();
|
|
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): MsgUpdateTransferLimitParams {
|
|
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: MsgUpdateTransferLimitParams): 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<I extends Exact<DeepPartial<MsgUpdateTransferLimitParams>, I>>(
|
|
77
|
-
object: I
|
|
78
|
-
): MsgUpdateTransferLimitParams {
|
|
79
|
-
const message = createBaseMsgUpdateTransferLimitParams();
|
|
80
|
-
message.authority = object.authority ?? "";
|
|
81
|
-
message.maxBTC = object.maxBTC ?? "";
|
|
82
|
-
message.maxUSDT = object.maxUSDT ?? "";
|
|
83
|
-
return message;
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
function createBaseMsgUpdateTransferLimitParamsResponse(): MsgUpdateTransferLimitParamsResponse {
|
|
88
|
-
return {};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const MsgUpdateTransferLimitParamsResponse = {
|
|
92
|
-
encode(
|
|
93
|
-
_: MsgUpdateTransferLimitParamsResponse,
|
|
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
|
-
): MsgUpdateTransferLimitParamsResponse {
|
|
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 = createBaseMsgUpdateTransferLimitParamsResponse();
|
|
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): MsgUpdateTransferLimitParamsResponse {
|
|
118
|
-
return {};
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
toJSON(_: MsgUpdateTransferLimitParamsResponse): unknown {
|
|
122
|
-
const obj: any = {};
|
|
123
|
-
return obj;
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
fromPartial<
|
|
127
|
-
I extends Exact<DeepPartial<MsgUpdateTransferLimitParamsResponse>, I>
|
|
128
|
-
>(_: I): MsgUpdateTransferLimitParamsResponse {
|
|
129
|
-
const message = createBaseMsgUpdateTransferLimitParamsResponse();
|
|
130
|
-
return message;
|
|
131
|
-
},
|
|
132
|
-
};
|
package/src/kima/tx/withdraw.ts
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import _m0 from "../../config/probuff.config";
|
|
2
|
-
import { DeepPartial, Exact, isSet, longToNumber } from "../../utils";
|
|
3
|
-
|
|
4
|
-
export interface MsgFinalizeWithdrawTransaction {
|
|
5
|
-
creator: string;
|
|
6
|
-
txId: number;
|
|
7
|
-
txHash: string;
|
|
8
|
-
success: boolean;
|
|
9
|
-
signedKey: string;
|
|
10
|
-
errReason: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface MsgFinalizeWithdrawTransactionResponse {
|
|
14
|
-
code: string;
|
|
15
|
-
msg: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function createBaseMsgFinalizeWithdrawTransaction(): MsgFinalizeWithdrawTransaction {
|
|
19
|
-
return {
|
|
20
|
-
creator: "",
|
|
21
|
-
txId: 0,
|
|
22
|
-
txHash: "",
|
|
23
|
-
success: false,
|
|
24
|
-
signedKey: "",
|
|
25
|
-
errReason: "",
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const MsgFinalizeWithdrawTransaction = {
|
|
30
|
-
encode(
|
|
31
|
-
message: MsgFinalizeWithdrawTransaction,
|
|
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
|
-
): MsgFinalizeWithdrawTransaction {
|
|
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 = createBaseMsgFinalizeWithdrawTransaction();
|
|
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): MsgFinalizeWithdrawTransaction {
|
|
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: MsgFinalizeWithdrawTransaction): 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<MsgFinalizeWithdrawTransaction>, I>>(
|
|
114
|
-
object: I
|
|
115
|
-
): MsgFinalizeWithdrawTransaction {
|
|
116
|
-
const message = createBaseMsgFinalizeWithdrawTransaction();
|
|
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 createBaseMsgFinalizeWithdrawTransactionResponse(): MsgFinalizeWithdrawTransactionResponse {
|
|
128
|
-
return { code: "", msg: "" };
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export const MsgFinalizeWithdrawTransactionResponse = {
|
|
132
|
-
encode(
|
|
133
|
-
message: MsgFinalizeWithdrawTransactionResponse,
|
|
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
|
-
): MsgFinalizeWithdrawTransactionResponse {
|
|
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 = createBaseMsgFinalizeWithdrawTransactionResponse();
|
|
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): MsgFinalizeWithdrawTransactionResponse {
|
|
170
|
-
return {
|
|
171
|
-
code: isSet(object.code) ? String(object.code) : "",
|
|
172
|
-
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
173
|
-
};
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
toJSON(message: MsgFinalizeWithdrawTransactionResponse): 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<MsgFinalizeWithdrawTransactionResponse>, I>
|
|
185
|
-
>(object: I): MsgFinalizeWithdrawTransactionResponse {
|
|
186
|
-
const message = createBaseMsgFinalizeWithdrawTransactionResponse();
|
|
187
|
-
message.code = object.code ?? "";
|
|
188
|
-
message.msg = object.msg ?? "";
|
|
189
|
-
return message;
|
|
190
|
-
},
|
|
191
|
-
};
|
package/src/utils.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import globalThis from "./config/global-this.config";
|
|
2
|
-
|
|
3
|
-
export function isSet(value: any): boolean {
|
|
4
|
-
return value !== null && value !== undefined;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function bytesFromBase64(b64: string): Uint8Array {
|
|
8
|
-
if (globalThis.Buffer) {
|
|
9
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
10
|
-
} else {
|
|
11
|
-
const bin = globalThis.atob(b64);
|
|
12
|
-
const arr = new Uint8Array(bin.length);
|
|
13
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
14
|
-
arr[i] = bin.charCodeAt(i);
|
|
15
|
-
}
|
|
16
|
-
return arr;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function base64FromBytes(arr: Uint8Array): string {
|
|
21
|
-
if (globalThis.Buffer) {
|
|
22
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
23
|
-
} else {
|
|
24
|
-
const bin: string[] = [];
|
|
25
|
-
arr.forEach((byte) => {
|
|
26
|
-
bin.push(String.fromCharCode(byte));
|
|
27
|
-
});
|
|
28
|
-
return globalThis.btoa(bin.join(""));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function sleep(ms: number) {
|
|
33
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type Builtin =
|
|
37
|
-
| Date
|
|
38
|
-
| Function
|
|
39
|
-
| Uint8Array
|
|
40
|
-
| string
|
|
41
|
-
| number
|
|
42
|
-
| boolean
|
|
43
|
-
| undefined;
|
|
44
|
-
|
|
45
|
-
export type DeepPartial<T> = T extends Builtin
|
|
46
|
-
? T
|
|
47
|
-
: T extends Array<infer U>
|
|
48
|
-
? Array<DeepPartial<U>>
|
|
49
|
-
: T extends ReadonlyArray<infer U>
|
|
50
|
-
? ReadonlyArray<DeepPartial<U>>
|
|
51
|
-
: T extends {}
|
|
52
|
-
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
53
|
-
: Partial<T>;
|
|
54
|
-
|
|
55
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
56
|
-
export type Exact<P, I extends P> = P extends Builtin
|
|
57
|
-
? P
|
|
58
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
|
59
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export function longToNumber(long: Long): number {
|
|
63
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
64
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
65
|
-
}
|
|
66
|
-
return long.toNumber();
|
|
67
|
-
}
|