@kimafinance/kima-transaction-api 1.0.29-beta.1 → 1.0.31-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.
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/kima/common.js +2 -2
- package/build/kima/tx.d.ts +121 -4
- package/build/kima/tx.js +402 -21
- package/package.json +1 -1
- package/src/index.ts +7 -3
- package/src/kima/common.ts +3 -3
- package/src/kima/tx.ts +556 -22
package/build/kima/tx.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MsgClientImpl = exports.MsgHtlcReclaimResponse = exports.MsgHtlcReclaim = exports.MsgRequestHtlcLockResponse = exports.MsgRequestHtlcLock = exports.MsgFinalizeDrainTransactionResponse = exports.MsgFinalizeDrainTransaction = exports.MsgRequestDrainTransactionResponse = exports.MsgRequestDrainTransaction = exports.MsgSetTxProcessResponse = exports.MsgSetTxProcess = exports.MsgSetTxHashResponse = exports.MsgSetTxHash = exports.MsgCancelTransactionResponse = exports.MsgCancelTransaction = exports.MsgRequestProvisionTransactionResponse = exports.MsgRequestProvisionTransaction = exports.MsgFinalizeProvisionTransactionResponse = exports.MsgFinalizeProvisionTransaction = exports.MsgFinalizeTransactionResponse = exports.MsgFinalizeTransaction = exports.MsgRequestTransactionResponse = exports.MsgRequestTransaction = exports.protobufPackage = void 0;
|
|
6
|
+
exports.MsgClientImpl = exports.MsgFinalizeWithdrawTransactionResponse = exports.MsgFinalizeWithdrawTransaction = exports.MsgUpdateTransferLimitParamsResponse = exports.MsgUpdateTransferLimitParams = exports.MsgUpdateLiquidityProvisionParamsResponse = exports.MsgUpdateLiquidityProvisionParams = exports.MsgHtlcReclaimResponse = exports.MsgHtlcReclaim = exports.MsgRequestHtlcLockResponse = exports.MsgRequestHtlcLock = exports.MsgFinalizeDrainTransactionResponse = exports.MsgFinalizeDrainTransaction = exports.MsgRequestDrainTransactionResponse = exports.MsgRequestDrainTransaction = exports.MsgSetTxProcessResponse = exports.MsgSetTxProcess = exports.MsgSetTxHashResponse = exports.MsgSetTxHash = exports.MsgCancelTransactionResponse = exports.MsgCancelTransaction = exports.MsgRequestProvisionTransactionResponse = exports.MsgRequestProvisionTransaction = exports.MsgFinalizeProvisionTransactionResponse = exports.MsgFinalizeProvisionTransaction = exports.MsgFinalizeTransactionResponse = exports.MsgFinalizeTransaction = exports.MsgRequestTransactionResponse = exports.MsgRequestTransaction = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
@@ -15,7 +15,8 @@ function createBaseMsgRequestTransaction() {
|
|
|
15
15
|
originAddress: "",
|
|
16
16
|
targetChain: "",
|
|
17
17
|
targetAddress: "",
|
|
18
|
-
|
|
18
|
+
originSymbol: "",
|
|
19
|
+
targetSymbol: "",
|
|
19
20
|
amount: "",
|
|
20
21
|
fee: "",
|
|
21
22
|
htlcExpirationTimestamp: "",
|
|
@@ -23,6 +24,7 @@ function createBaseMsgRequestTransaction() {
|
|
|
23
24
|
htlcCreationVout: 0,
|
|
24
25
|
htlcVersion: "",
|
|
25
26
|
senderPubKey: new Uint8Array(),
|
|
27
|
+
options: "",
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
exports.MsgRequestTransaction = {
|
|
@@ -42,29 +44,35 @@ exports.MsgRequestTransaction = {
|
|
|
42
44
|
if (message.targetAddress !== "") {
|
|
43
45
|
writer.uint32(42).string(message.targetAddress);
|
|
44
46
|
}
|
|
45
|
-
if (message.
|
|
46
|
-
writer.uint32(50).string(message.
|
|
47
|
+
if (message.originSymbol !== "") {
|
|
48
|
+
writer.uint32(50).string(message.originSymbol);
|
|
49
|
+
}
|
|
50
|
+
if (message.targetSymbol !== "") {
|
|
51
|
+
writer.uint32(58).string(message.targetSymbol);
|
|
47
52
|
}
|
|
48
53
|
if (message.amount !== "") {
|
|
49
|
-
writer.uint32(
|
|
54
|
+
writer.uint32(66).string(message.amount);
|
|
50
55
|
}
|
|
51
56
|
if (message.fee !== "") {
|
|
52
|
-
writer.uint32(
|
|
57
|
+
writer.uint32(74).string(message.fee);
|
|
53
58
|
}
|
|
54
59
|
if (message.htlcExpirationTimestamp !== "") {
|
|
55
|
-
writer.uint32(
|
|
60
|
+
writer.uint32(82).string(message.htlcExpirationTimestamp);
|
|
56
61
|
}
|
|
57
62
|
if (message.htlcCreationHash !== "") {
|
|
58
|
-
writer.uint32(
|
|
63
|
+
writer.uint32(90).string(message.htlcCreationHash);
|
|
59
64
|
}
|
|
60
65
|
if (message.htlcCreationVout !== 0) {
|
|
61
|
-
writer.uint32(
|
|
66
|
+
writer.uint32(96).uint32(message.htlcCreationVout);
|
|
62
67
|
}
|
|
63
68
|
if (message.htlcVersion !== "") {
|
|
64
|
-
writer.uint32(
|
|
69
|
+
writer.uint32(106).string(message.htlcVersion);
|
|
65
70
|
}
|
|
66
71
|
if (message.senderPubKey.length !== 0) {
|
|
67
|
-
writer.uint32(
|
|
72
|
+
writer.uint32(114).bytes(message.senderPubKey);
|
|
73
|
+
}
|
|
74
|
+
if (message.options !== "") {
|
|
75
|
+
writer.uint32(122).string(message.options);
|
|
68
76
|
}
|
|
69
77
|
return writer;
|
|
70
78
|
},
|
|
@@ -91,29 +99,35 @@ exports.MsgRequestTransaction = {
|
|
|
91
99
|
message.targetAddress = reader.string();
|
|
92
100
|
break;
|
|
93
101
|
case 6:
|
|
94
|
-
message.
|
|
102
|
+
message.originSymbol = reader.string();
|
|
95
103
|
break;
|
|
96
104
|
case 7:
|
|
97
|
-
message.
|
|
105
|
+
message.targetSymbol = reader.string();
|
|
98
106
|
break;
|
|
99
107
|
case 8:
|
|
100
|
-
message.
|
|
108
|
+
message.amount = reader.string();
|
|
101
109
|
break;
|
|
102
110
|
case 9:
|
|
103
|
-
message.
|
|
111
|
+
message.fee = reader.string();
|
|
104
112
|
break;
|
|
105
113
|
case 10:
|
|
106
|
-
message.
|
|
114
|
+
message.htlcExpirationTimestamp = reader.string();
|
|
107
115
|
break;
|
|
108
116
|
case 11:
|
|
109
|
-
message.
|
|
117
|
+
message.htlcCreationHash = reader.string();
|
|
110
118
|
break;
|
|
111
119
|
case 12:
|
|
112
|
-
message.
|
|
120
|
+
message.htlcCreationVout = reader.uint32();
|
|
113
121
|
break;
|
|
114
122
|
case 13:
|
|
123
|
+
message.htlcVersion = reader.string();
|
|
124
|
+
break;
|
|
125
|
+
case 14:
|
|
115
126
|
message.senderPubKey = reader.bytes();
|
|
116
127
|
break;
|
|
128
|
+
case 15:
|
|
129
|
+
message.options = reader.string();
|
|
130
|
+
break;
|
|
117
131
|
default:
|
|
118
132
|
reader.skipType(tag & 7);
|
|
119
133
|
break;
|
|
@@ -132,7 +146,12 @@ exports.MsgRequestTransaction = {
|
|
|
132
146
|
targetAddress: isSet(object.targetAddress)
|
|
133
147
|
? String(object.targetAddress)
|
|
134
148
|
: "",
|
|
135
|
-
|
|
149
|
+
originSymbol: isSet(object.originSymbol)
|
|
150
|
+
? String(object.originSymbol)
|
|
151
|
+
: "",
|
|
152
|
+
targetSymbol: isSet(object.targetSymbol)
|
|
153
|
+
? String(object.targetSymbol)
|
|
154
|
+
: "",
|
|
136
155
|
amount: isSet(object.amount) ? String(object.amount) : "",
|
|
137
156
|
fee: isSet(object.fee) ? String(object.fee) : "",
|
|
138
157
|
htlcExpirationTimestamp: isSet(object.htlcExpirationTimestamp)
|
|
@@ -148,6 +167,7 @@ exports.MsgRequestTransaction = {
|
|
|
148
167
|
senderPubKey: isSet(object.senderPubKey)
|
|
149
168
|
? bytesFromBase64(object.senderPubKey)
|
|
150
169
|
: new Uint8Array(),
|
|
170
|
+
options: isSet(object.options) ? String(object.options) : "",
|
|
151
171
|
};
|
|
152
172
|
},
|
|
153
173
|
toJSON(message) {
|
|
@@ -161,7 +181,10 @@ exports.MsgRequestTransaction = {
|
|
|
161
181
|
(obj.targetChain = message.targetChain);
|
|
162
182
|
message.targetAddress !== undefined &&
|
|
163
183
|
(obj.targetAddress = message.targetAddress);
|
|
164
|
-
message.
|
|
184
|
+
message.originSymbol !== undefined &&
|
|
185
|
+
(obj.originSymbol = message.originSymbol);
|
|
186
|
+
message.targetSymbol !== undefined &&
|
|
187
|
+
(obj.targetSymbol = message.targetSymbol);
|
|
165
188
|
message.amount !== undefined && (obj.amount = message.amount);
|
|
166
189
|
message.fee !== undefined && (obj.fee = message.fee);
|
|
167
190
|
message.htlcExpirationTimestamp !== undefined &&
|
|
@@ -176,6 +199,7 @@ exports.MsgRequestTransaction = {
|
|
|
176
199
|
(obj.senderPubKey = base64FromBytes(message.senderPubKey !== undefined
|
|
177
200
|
? message.senderPubKey
|
|
178
201
|
: new Uint8Array()));
|
|
202
|
+
message.options !== undefined && (obj.options = message.options);
|
|
179
203
|
return obj;
|
|
180
204
|
},
|
|
181
205
|
fromPartial(object) {
|
|
@@ -185,7 +209,8 @@ exports.MsgRequestTransaction = {
|
|
|
185
209
|
message.originAddress = object.originAddress ?? "";
|
|
186
210
|
message.targetChain = object.targetChain ?? "";
|
|
187
211
|
message.targetAddress = object.targetAddress ?? "";
|
|
188
|
-
message.
|
|
212
|
+
message.originSymbol = object.originSymbol ?? "";
|
|
213
|
+
message.targetSymbol = object.targetSymbol ?? "";
|
|
189
214
|
message.amount = object.amount ?? "";
|
|
190
215
|
message.fee = object.fee ?? "";
|
|
191
216
|
message.htlcExpirationTimestamp = object.htlcExpirationTimestamp ?? "";
|
|
@@ -193,6 +218,7 @@ exports.MsgRequestTransaction = {
|
|
|
193
218
|
message.htlcCreationVout = object.htlcCreationVout ?? 0;
|
|
194
219
|
message.htlcVersion = object.htlcVersion ?? "";
|
|
195
220
|
message.senderPubKey = object.senderPubKey ?? new Uint8Array();
|
|
221
|
+
message.options = object.options ?? "";
|
|
196
222
|
return message;
|
|
197
223
|
},
|
|
198
224
|
};
|
|
@@ -1659,6 +1685,341 @@ exports.MsgHtlcReclaimResponse = {
|
|
|
1659
1685
|
return message;
|
|
1660
1686
|
},
|
|
1661
1687
|
};
|
|
1688
|
+
function createBaseMsgUpdateLiquidityProvisionParams() {
|
|
1689
|
+
return { authority: "", maxBTC: "", maxUSDT: "" };
|
|
1690
|
+
}
|
|
1691
|
+
exports.MsgUpdateLiquidityProvisionParams = {
|
|
1692
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1693
|
+
if (message.authority !== "") {
|
|
1694
|
+
writer.uint32(10).string(message.authority);
|
|
1695
|
+
}
|
|
1696
|
+
if (message.maxBTC !== "") {
|
|
1697
|
+
writer.uint32(18).string(message.maxBTC);
|
|
1698
|
+
}
|
|
1699
|
+
if (message.maxUSDT !== "") {
|
|
1700
|
+
writer.uint32(26).string(message.maxUSDT);
|
|
1701
|
+
}
|
|
1702
|
+
return writer;
|
|
1703
|
+
},
|
|
1704
|
+
decode(input, length) {
|
|
1705
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1706
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1707
|
+
const message = createBaseMsgUpdateLiquidityProvisionParams();
|
|
1708
|
+
while (reader.pos < end) {
|
|
1709
|
+
const tag = reader.uint32();
|
|
1710
|
+
switch (tag >>> 3) {
|
|
1711
|
+
case 1:
|
|
1712
|
+
message.authority = reader.string();
|
|
1713
|
+
break;
|
|
1714
|
+
case 2:
|
|
1715
|
+
message.maxBTC = reader.string();
|
|
1716
|
+
break;
|
|
1717
|
+
case 3:
|
|
1718
|
+
message.maxUSDT = reader.string();
|
|
1719
|
+
break;
|
|
1720
|
+
default:
|
|
1721
|
+
reader.skipType(tag & 7);
|
|
1722
|
+
break;
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
return message;
|
|
1726
|
+
},
|
|
1727
|
+
fromJSON(object) {
|
|
1728
|
+
return {
|
|
1729
|
+
authority: isSet(object.authority) ? String(object.authority) : "",
|
|
1730
|
+
maxBTC: isSet(object.maxBTC) ? String(object.maxBTC) : "",
|
|
1731
|
+
maxUSDT: isSet(object.maxUSDT) ? String(object.maxUSDT) : "",
|
|
1732
|
+
};
|
|
1733
|
+
},
|
|
1734
|
+
toJSON(message) {
|
|
1735
|
+
const obj = {};
|
|
1736
|
+
message.authority !== undefined && (obj.authority = message.authority);
|
|
1737
|
+
message.maxBTC !== undefined && (obj.maxBTC = message.maxBTC);
|
|
1738
|
+
message.maxUSDT !== undefined && (obj.maxUSDT = message.maxUSDT);
|
|
1739
|
+
return obj;
|
|
1740
|
+
},
|
|
1741
|
+
fromPartial(object) {
|
|
1742
|
+
const message = createBaseMsgUpdateLiquidityProvisionParams();
|
|
1743
|
+
message.authority = object.authority ?? "";
|
|
1744
|
+
message.maxBTC = object.maxBTC ?? "";
|
|
1745
|
+
message.maxUSDT = object.maxUSDT ?? "";
|
|
1746
|
+
return message;
|
|
1747
|
+
},
|
|
1748
|
+
};
|
|
1749
|
+
function createBaseMsgUpdateLiquidityProvisionParamsResponse() {
|
|
1750
|
+
return {};
|
|
1751
|
+
}
|
|
1752
|
+
exports.MsgUpdateLiquidityProvisionParamsResponse = {
|
|
1753
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
1754
|
+
return writer;
|
|
1755
|
+
},
|
|
1756
|
+
decode(input, length) {
|
|
1757
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1758
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1759
|
+
const message = createBaseMsgUpdateLiquidityProvisionParamsResponse();
|
|
1760
|
+
while (reader.pos < end) {
|
|
1761
|
+
const tag = reader.uint32();
|
|
1762
|
+
switch (tag >>> 3) {
|
|
1763
|
+
default:
|
|
1764
|
+
reader.skipType(tag & 7);
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
return message;
|
|
1769
|
+
},
|
|
1770
|
+
fromJSON(_) {
|
|
1771
|
+
return {};
|
|
1772
|
+
},
|
|
1773
|
+
toJSON(_) {
|
|
1774
|
+
const obj = {};
|
|
1775
|
+
return obj;
|
|
1776
|
+
},
|
|
1777
|
+
fromPartial(_) {
|
|
1778
|
+
const message = createBaseMsgUpdateLiquidityProvisionParamsResponse();
|
|
1779
|
+
return message;
|
|
1780
|
+
},
|
|
1781
|
+
};
|
|
1782
|
+
function createBaseMsgUpdateTransferLimitParams() {
|
|
1783
|
+
return { authority: "", maxBTC: "", maxUSDT: "" };
|
|
1784
|
+
}
|
|
1785
|
+
exports.MsgUpdateTransferLimitParams = {
|
|
1786
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1787
|
+
if (message.authority !== "") {
|
|
1788
|
+
writer.uint32(10).string(message.authority);
|
|
1789
|
+
}
|
|
1790
|
+
if (message.maxBTC !== "") {
|
|
1791
|
+
writer.uint32(18).string(message.maxBTC);
|
|
1792
|
+
}
|
|
1793
|
+
if (message.maxUSDT !== "") {
|
|
1794
|
+
writer.uint32(26).string(message.maxUSDT);
|
|
1795
|
+
}
|
|
1796
|
+
return writer;
|
|
1797
|
+
},
|
|
1798
|
+
decode(input, length) {
|
|
1799
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1800
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1801
|
+
const message = createBaseMsgUpdateTransferLimitParams();
|
|
1802
|
+
while (reader.pos < end) {
|
|
1803
|
+
const tag = reader.uint32();
|
|
1804
|
+
switch (tag >>> 3) {
|
|
1805
|
+
case 1:
|
|
1806
|
+
message.authority = reader.string();
|
|
1807
|
+
break;
|
|
1808
|
+
case 2:
|
|
1809
|
+
message.maxBTC = reader.string();
|
|
1810
|
+
break;
|
|
1811
|
+
case 3:
|
|
1812
|
+
message.maxUSDT = reader.string();
|
|
1813
|
+
break;
|
|
1814
|
+
default:
|
|
1815
|
+
reader.skipType(tag & 7);
|
|
1816
|
+
break;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
return message;
|
|
1820
|
+
},
|
|
1821
|
+
fromJSON(object) {
|
|
1822
|
+
return {
|
|
1823
|
+
authority: isSet(object.authority) ? String(object.authority) : "",
|
|
1824
|
+
maxBTC: isSet(object.maxBTC) ? String(object.maxBTC) : "",
|
|
1825
|
+
maxUSDT: isSet(object.maxUSDT) ? String(object.maxUSDT) : "",
|
|
1826
|
+
};
|
|
1827
|
+
},
|
|
1828
|
+
toJSON(message) {
|
|
1829
|
+
const obj = {};
|
|
1830
|
+
message.authority !== undefined && (obj.authority = message.authority);
|
|
1831
|
+
message.maxBTC !== undefined && (obj.maxBTC = message.maxBTC);
|
|
1832
|
+
message.maxUSDT !== undefined && (obj.maxUSDT = message.maxUSDT);
|
|
1833
|
+
return obj;
|
|
1834
|
+
},
|
|
1835
|
+
fromPartial(object) {
|
|
1836
|
+
const message = createBaseMsgUpdateTransferLimitParams();
|
|
1837
|
+
message.authority = object.authority ?? "";
|
|
1838
|
+
message.maxBTC = object.maxBTC ?? "";
|
|
1839
|
+
message.maxUSDT = object.maxUSDT ?? "";
|
|
1840
|
+
return message;
|
|
1841
|
+
},
|
|
1842
|
+
};
|
|
1843
|
+
function createBaseMsgUpdateTransferLimitParamsResponse() {
|
|
1844
|
+
return {};
|
|
1845
|
+
}
|
|
1846
|
+
exports.MsgUpdateTransferLimitParamsResponse = {
|
|
1847
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
1848
|
+
return writer;
|
|
1849
|
+
},
|
|
1850
|
+
decode(input, length) {
|
|
1851
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1852
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1853
|
+
const message = createBaseMsgUpdateTransferLimitParamsResponse();
|
|
1854
|
+
while (reader.pos < end) {
|
|
1855
|
+
const tag = reader.uint32();
|
|
1856
|
+
switch (tag >>> 3) {
|
|
1857
|
+
default:
|
|
1858
|
+
reader.skipType(tag & 7);
|
|
1859
|
+
break;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
return message;
|
|
1863
|
+
},
|
|
1864
|
+
fromJSON(_) {
|
|
1865
|
+
return {};
|
|
1866
|
+
},
|
|
1867
|
+
toJSON(_) {
|
|
1868
|
+
const obj = {};
|
|
1869
|
+
return obj;
|
|
1870
|
+
},
|
|
1871
|
+
fromPartial(_) {
|
|
1872
|
+
const message = createBaseMsgUpdateTransferLimitParamsResponse();
|
|
1873
|
+
return message;
|
|
1874
|
+
},
|
|
1875
|
+
};
|
|
1876
|
+
function createBaseMsgFinalizeWithdrawTransaction() {
|
|
1877
|
+
return {
|
|
1878
|
+
creator: "",
|
|
1879
|
+
txId: 0,
|
|
1880
|
+
txHash: "",
|
|
1881
|
+
success: false,
|
|
1882
|
+
signedKey: "",
|
|
1883
|
+
errReason: "",
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
exports.MsgFinalizeWithdrawTransaction = {
|
|
1887
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1888
|
+
if (message.creator !== "") {
|
|
1889
|
+
writer.uint32(10).string(message.creator);
|
|
1890
|
+
}
|
|
1891
|
+
if (message.txId !== 0) {
|
|
1892
|
+
writer.uint32(16).uint64(message.txId);
|
|
1893
|
+
}
|
|
1894
|
+
if (message.txHash !== "") {
|
|
1895
|
+
writer.uint32(26).string(message.txHash);
|
|
1896
|
+
}
|
|
1897
|
+
if (message.success === true) {
|
|
1898
|
+
writer.uint32(32).bool(message.success);
|
|
1899
|
+
}
|
|
1900
|
+
if (message.signedKey !== "") {
|
|
1901
|
+
writer.uint32(42).string(message.signedKey);
|
|
1902
|
+
}
|
|
1903
|
+
if (message.errReason !== "") {
|
|
1904
|
+
writer.uint32(50).string(message.errReason);
|
|
1905
|
+
}
|
|
1906
|
+
return writer;
|
|
1907
|
+
},
|
|
1908
|
+
decode(input, length) {
|
|
1909
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1910
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1911
|
+
const message = createBaseMsgFinalizeWithdrawTransaction();
|
|
1912
|
+
while (reader.pos < end) {
|
|
1913
|
+
const tag = reader.uint32();
|
|
1914
|
+
switch (tag >>> 3) {
|
|
1915
|
+
case 1:
|
|
1916
|
+
message.creator = reader.string();
|
|
1917
|
+
break;
|
|
1918
|
+
case 2:
|
|
1919
|
+
message.txId = longToNumber(reader.uint64());
|
|
1920
|
+
break;
|
|
1921
|
+
case 3:
|
|
1922
|
+
message.txHash = reader.string();
|
|
1923
|
+
break;
|
|
1924
|
+
case 4:
|
|
1925
|
+
message.success = reader.bool();
|
|
1926
|
+
break;
|
|
1927
|
+
case 5:
|
|
1928
|
+
message.signedKey = reader.string();
|
|
1929
|
+
break;
|
|
1930
|
+
case 6:
|
|
1931
|
+
message.errReason = reader.string();
|
|
1932
|
+
break;
|
|
1933
|
+
default:
|
|
1934
|
+
reader.skipType(tag & 7);
|
|
1935
|
+
break;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
return message;
|
|
1939
|
+
},
|
|
1940
|
+
fromJSON(object) {
|
|
1941
|
+
return {
|
|
1942
|
+
creator: isSet(object.creator) ? String(object.creator) : "",
|
|
1943
|
+
txId: isSet(object.txId) ? Number(object.txId) : 0,
|
|
1944
|
+
txHash: isSet(object.txHash) ? String(object.txHash) : "",
|
|
1945
|
+
success: isSet(object.success) ? Boolean(object.success) : false,
|
|
1946
|
+
signedKey: isSet(object.signedKey) ? String(object.signedKey) : "",
|
|
1947
|
+
errReason: isSet(object.errReason) ? String(object.errReason) : "",
|
|
1948
|
+
};
|
|
1949
|
+
},
|
|
1950
|
+
toJSON(message) {
|
|
1951
|
+
const obj = {};
|
|
1952
|
+
message.creator !== undefined && (obj.creator = message.creator);
|
|
1953
|
+
message.txId !== undefined && (obj.txId = Math.round(message.txId));
|
|
1954
|
+
message.txHash !== undefined && (obj.txHash = message.txHash);
|
|
1955
|
+
message.success !== undefined && (obj.success = message.success);
|
|
1956
|
+
message.signedKey !== undefined && (obj.signedKey = message.signedKey);
|
|
1957
|
+
message.errReason !== undefined && (obj.errReason = message.errReason);
|
|
1958
|
+
return obj;
|
|
1959
|
+
},
|
|
1960
|
+
fromPartial(object) {
|
|
1961
|
+
const message = createBaseMsgFinalizeWithdrawTransaction();
|
|
1962
|
+
message.creator = object.creator ?? "";
|
|
1963
|
+
message.txId = object.txId ?? 0;
|
|
1964
|
+
message.txHash = object.txHash ?? "";
|
|
1965
|
+
message.success = object.success ?? false;
|
|
1966
|
+
message.signedKey = object.signedKey ?? "";
|
|
1967
|
+
message.errReason = object.errReason ?? "";
|
|
1968
|
+
return message;
|
|
1969
|
+
},
|
|
1970
|
+
};
|
|
1971
|
+
function createBaseMsgFinalizeWithdrawTransactionResponse() {
|
|
1972
|
+
return { code: "", msg: "" };
|
|
1973
|
+
}
|
|
1974
|
+
exports.MsgFinalizeWithdrawTransactionResponse = {
|
|
1975
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
1976
|
+
if (message.code !== "") {
|
|
1977
|
+
writer.uint32(10).string(message.code);
|
|
1978
|
+
}
|
|
1979
|
+
if (message.msg !== "") {
|
|
1980
|
+
writer.uint32(18).string(message.msg);
|
|
1981
|
+
}
|
|
1982
|
+
return writer;
|
|
1983
|
+
},
|
|
1984
|
+
decode(input, length) {
|
|
1985
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
1986
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1987
|
+
const message = createBaseMsgFinalizeWithdrawTransactionResponse();
|
|
1988
|
+
while (reader.pos < end) {
|
|
1989
|
+
const tag = reader.uint32();
|
|
1990
|
+
switch (tag >>> 3) {
|
|
1991
|
+
case 1:
|
|
1992
|
+
message.code = reader.string();
|
|
1993
|
+
break;
|
|
1994
|
+
case 2:
|
|
1995
|
+
message.msg = reader.string();
|
|
1996
|
+
break;
|
|
1997
|
+
default:
|
|
1998
|
+
reader.skipType(tag & 7);
|
|
1999
|
+
break;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
return message;
|
|
2003
|
+
},
|
|
2004
|
+
fromJSON(object) {
|
|
2005
|
+
return {
|
|
2006
|
+
code: isSet(object.code) ? String(object.code) : "",
|
|
2007
|
+
msg: isSet(object.msg) ? String(object.msg) : "",
|
|
2008
|
+
};
|
|
2009
|
+
},
|
|
2010
|
+
toJSON(message) {
|
|
2011
|
+
const obj = {};
|
|
2012
|
+
message.code !== undefined && (obj.code = message.code);
|
|
2013
|
+
message.msg !== undefined && (obj.msg = message.msg);
|
|
2014
|
+
return obj;
|
|
2015
|
+
},
|
|
2016
|
+
fromPartial(object) {
|
|
2017
|
+
const message = createBaseMsgFinalizeWithdrawTransactionResponse();
|
|
2018
|
+
message.code = object.code ?? "";
|
|
2019
|
+
message.msg = object.msg ?? "";
|
|
2020
|
+
return message;
|
|
2021
|
+
},
|
|
2022
|
+
};
|
|
1662
2023
|
class MsgClientImpl {
|
|
1663
2024
|
rpc;
|
|
1664
2025
|
constructor(rpc) {
|
|
@@ -1676,6 +2037,11 @@ class MsgClientImpl {
|
|
|
1676
2037
|
this.FinalizeDrainTransaction = this.FinalizeDrainTransaction.bind(this);
|
|
1677
2038
|
this.RequestHtlcLock = this.RequestHtlcLock.bind(this);
|
|
1678
2039
|
this.HtlcReclaim = this.HtlcReclaim.bind(this);
|
|
2040
|
+
this.UpdateLiquidityProvisionParams =
|
|
2041
|
+
this.UpdateLiquidityProvisionParams.bind(this);
|
|
2042
|
+
this.UpdateTransferLimitParams = this.UpdateTransferLimitParams.bind(this);
|
|
2043
|
+
this.FinalizeWithdrawTransaction =
|
|
2044
|
+
this.FinalizeWithdrawTransaction.bind(this);
|
|
1679
2045
|
}
|
|
1680
2046
|
RequestTransaction(request) {
|
|
1681
2047
|
const data = exports.MsgRequestTransaction.encode(request).finish();
|
|
@@ -1732,6 +2098,21 @@ class MsgClientImpl {
|
|
|
1732
2098
|
const promise = this.rpc.request("kimablockchain.transaction.Msg", "HtlcReclaim", data);
|
|
1733
2099
|
return promise.then((data) => exports.MsgHtlcReclaimResponse.decode(new minimal_1.default.Reader(data)));
|
|
1734
2100
|
}
|
|
2101
|
+
UpdateLiquidityProvisionParams(request) {
|
|
2102
|
+
const data = exports.MsgUpdateLiquidityProvisionParams.encode(request).finish();
|
|
2103
|
+
const promise = this.rpc.request("kimablockchain.transaction.Msg", "UpdateLiquidityProvisionParams", data);
|
|
2104
|
+
return promise.then((data) => exports.MsgUpdateLiquidityProvisionParamsResponse.decode(new minimal_1.default.Reader(data)));
|
|
2105
|
+
}
|
|
2106
|
+
UpdateTransferLimitParams(request) {
|
|
2107
|
+
const data = exports.MsgUpdateTransferLimitParams.encode(request).finish();
|
|
2108
|
+
const promise = this.rpc.request("kimablockchain.transaction.Msg", "UpdateTransferLimitParams", data);
|
|
2109
|
+
return promise.then((data) => exports.MsgUpdateTransferLimitParamsResponse.decode(new minimal_1.default.Reader(data)));
|
|
2110
|
+
}
|
|
2111
|
+
FinalizeWithdrawTransaction(request) {
|
|
2112
|
+
const data = exports.MsgFinalizeWithdrawTransaction.encode(request).finish();
|
|
2113
|
+
const promise = this.rpc.request("kimablockchain.transaction.Msg", "FinalizeWithdrawTransaction", data);
|
|
2114
|
+
return promise.then((data) => exports.MsgFinalizeWithdrawTransactionResponse.decode(new minimal_1.default.Reader(data)));
|
|
2115
|
+
}
|
|
1735
2116
|
}
|
|
1736
2117
|
exports.MsgClientImpl = MsgClientImpl;
|
|
1737
2118
|
var globalThis = (() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimafinance/kima-transaction-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31-beta.1",
|
|
4
4
|
"description": "A wrapper around Kima's API, enabling sending and monitoring transactions (Beta version)",
|
|
5
5
|
"repository": "https://github.com/kima-finance/kima-transaction-api",
|
|
6
6
|
"author": "",
|
package/src/index.ts
CHANGED
|
@@ -96,7 +96,8 @@ interface RequestTxProps {
|
|
|
96
96
|
originAddress: string;
|
|
97
97
|
targetChain: SupportedNetworks;
|
|
98
98
|
targetAddress: string;
|
|
99
|
-
|
|
99
|
+
originSymbol: CurrencyOptions;
|
|
100
|
+
targetSymbol: CurrencyOptions;
|
|
100
101
|
amount: number;
|
|
101
102
|
fee: number;
|
|
102
103
|
htlcCreationHash: string;
|
|
@@ -115,7 +116,8 @@ export async function submitKimaTransaction({
|
|
|
115
116
|
originAddress,
|
|
116
117
|
targetChain,
|
|
117
118
|
targetAddress,
|
|
118
|
-
|
|
119
|
+
originSymbol,
|
|
120
|
+
targetSymbol,
|
|
119
121
|
amount,
|
|
120
122
|
fee,
|
|
121
123
|
htlcCreationHash,
|
|
@@ -136,7 +138,8 @@ export async function submitKimaTransaction({
|
|
|
136
138
|
originAddress,
|
|
137
139
|
targetChain,
|
|
138
140
|
targetAddress,
|
|
139
|
-
|
|
141
|
+
originSymbol,
|
|
142
|
+
targetSymbol,
|
|
140
143
|
amount: amount.toString(),
|
|
141
144
|
fee: fee.toString(),
|
|
142
145
|
htlcCreationHash,
|
|
@@ -144,6 +147,7 @@ export async function submitKimaTransaction({
|
|
|
144
147
|
htlcExpirationTimestamp,
|
|
145
148
|
htlcVersion,
|
|
146
149
|
senderPubKey,
|
|
150
|
+
options: "",
|
|
147
151
|
};
|
|
148
152
|
|
|
149
153
|
let msg = await client.msgRequestTransaction(params);
|
package/src/kima/common.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SigningStargateClient, StdFee } from "@cosmjs/stargate";
|
|
2
2
|
import dotenv from "dotenv";
|
|
3
|
-
import { Registry, OfflineSigner, EncodeObject } from "@cosmjs/proto-signing";
|
|
3
|
+
import { Registry, OfflineSigner, EncodeObject, coin } from "@cosmjs/proto-signing";
|
|
4
4
|
import {
|
|
5
5
|
MsgRequestHtlcLock,
|
|
6
6
|
MsgRequestTransaction,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
dotenv.config();
|
|
12
12
|
|
|
13
13
|
const defaultFee = {
|
|
14
|
-
amount: [],
|
|
15
|
-
gas: "
|
|
14
|
+
amount: [coin(200, "uKIMA")],
|
|
15
|
+
gas: "200000", // Gas limit
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
interface SignAndBroadcastOptions {
|