@yuants/vendor-huobi 0.11.40 → 0.12.0

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.
Files changed (80) hide show
  1. package/dist/account-info.js +235 -0
  2. package/dist/account-info.js.map +1 -0
  3. package/dist/api/private-api.js +251 -0
  4. package/dist/api/private-api.js.map +1 -0
  5. package/dist/api/public-api.js +145 -0
  6. package/dist/api/public-api.js.map +1 -0
  7. package/dist/api.js +0 -279
  8. package/dist/api.js.map +1 -1
  9. package/dist/index.js +28 -524
  10. package/dist/index.js.map +1 -1
  11. package/dist/interest_rate.js +2 -2
  12. package/dist/interest_rate.js.map +1 -1
  13. package/dist/order-actions-with-credentials.js +31 -0
  14. package/dist/order-actions-with-credentials.js.map +1 -0
  15. package/dist/order-actions.js +29 -0
  16. package/dist/order-actions.js.map +1 -0
  17. package/dist/orders/submitOrder.js +82 -0
  18. package/dist/orders/submitOrder.js.map +1 -0
  19. package/dist/product.js +4 -4
  20. package/dist/product.js.map +1 -1
  21. package/dist/quote.js +5 -5
  22. package/dist/quote.js.map +1 -1
  23. package/dist/transfer.js +248 -0
  24. package/dist/transfer.js.map +1 -0
  25. package/dist/uid.js +22 -0
  26. package/dist/uid.js.map +1 -0
  27. package/lib/account-info.d.ts +35 -0
  28. package/lib/account-info.d.ts.map +1 -0
  29. package/lib/account-info.js +243 -0
  30. package/lib/account-info.js.map +1 -0
  31. package/lib/api/private-api.d.ts +471 -0
  32. package/lib/api/private-api.d.ts.map +1 -0
  33. package/lib/api/private-api.js +280 -0
  34. package/lib/api/private-api.js.map +1 -0
  35. package/lib/api/public-api.d.ts +308 -0
  36. package/lib/api/public-api.d.ts.map +1 -0
  37. package/lib/api/public-api.js +158 -0
  38. package/lib/api/public-api.js.map +1 -0
  39. package/lib/api.d.ts +2 -621
  40. package/lib/api.d.ts.map +1 -1
  41. package/lib/api.js +0 -279
  42. package/lib/api.js.map +1 -1
  43. package/lib/index.d.ts +1 -0
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +26 -522
  46. package/lib/index.js.map +1 -1
  47. package/lib/interest_rate.js +2 -2
  48. package/lib/interest_rate.js.map +1 -1
  49. package/lib/order-actions-with-credentials.d.ts +2 -0
  50. package/lib/order-actions-with-credentials.d.ts.map +1 -0
  51. package/lib/order-actions-with-credentials.js +33 -0
  52. package/lib/order-actions-with-credentials.js.map +1 -0
  53. package/lib/order-actions.d.ts +7 -0
  54. package/lib/order-actions.d.ts.map +1 -0
  55. package/lib/order-actions.js +33 -0
  56. package/lib/order-actions.js.map +1 -0
  57. package/lib/orders/submitOrder.d.ts +11 -0
  58. package/lib/orders/submitOrder.d.ts.map +1 -0
  59. package/lib/orders/submitOrder.js +87 -0
  60. package/lib/orders/submitOrder.js.map +1 -0
  61. package/lib/product.js +4 -4
  62. package/lib/product.js.map +1 -1
  63. package/lib/quote.js +5 -5
  64. package/lib/quote.js.map +1 -1
  65. package/lib/transfer.d.ts +19 -0
  66. package/lib/transfer.d.ts.map +1 -0
  67. package/lib/transfer.js +255 -0
  68. package/lib/transfer.js.map +1 -0
  69. package/lib/uid.d.ts +13 -0
  70. package/lib/uid.d.ts.map +1 -0
  71. package/lib/uid.js +26 -0
  72. package/lib/uid.js.map +1 -0
  73. package/package.json +11 -11
  74. package/temp/package-deps.json +26 -19
  75. package/dist/logger.js +0 -91
  76. package/dist/logger.js.map +0 -1
  77. package/lib/logger.d.ts +0 -21
  78. package/lib/logger.d.ts.map +0 -1
  79. package/lib/logger.js +0 -98
  80. package/lib/logger.js.map +0 -1
@@ -0,0 +1,280 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAccountHistory = exports.getV2ReferenceCurrencies = exports.postSwapSwitchAccountType = exports.getSwapUnifiedAccountType = exports.getSubUserList = exports.postSubUserTransfer = exports.getDepositWithdrawHistory = exports.postWithdraw = exports.postBorrow = exports.postSpotAccountTransfer = exports.postSuperMarginAccountTransferIn = exports.postSuperMarginAccountTransferOut = exports.getAccountLedger = exports.getSpotAccountDepositAddresses = exports.postSwapOrder = exports.postSpotOrder = exports.getSpotTick = exports.getCrossMarginLoanInfo = exports.getSpotAccountBalance = exports.getSwapOpenOrders = exports.getSwapCrossPositionInfo = exports.getUnifiedAccountInfo = exports.getUid = exports.getAccount = exports.privateRequest = exports.getDefaultCredential = void 0;
4
+ const utils_1 = require("@yuants/utils");
5
+ const getDefaultCredential = () => {
6
+ return {
7
+ access_key: process.env.ACCESS_KEY,
8
+ secret_key: process.env.SECRET_KEY,
9
+ };
10
+ };
11
+ exports.getDefaultCredential = getDefaultCredential;
12
+ const privateRequest = async (credential, method, path, api_root, params) => {
13
+ const requestParams = `AccessKeyId=${credential.access_key}&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=${encodeURIComponent(new Date().toISOString().split('.')[0])}${method === 'GET' && params !== undefined
14
+ ? `&${Object.entries(params)
15
+ .sort(([a], [b]) => a.localeCompare(b))
16
+ .map(([k, v]) => `${k}=${v}`)
17
+ .join('&')}`
18
+ : ''}`;
19
+ const body = method === 'GET' ? '' : JSON.stringify(params);
20
+ const requestString = `${method}\n${api_root}\n${path}\n${requestParams}`;
21
+ const str = (0, utils_1.encodeBase64)(await (0, utils_1.HmacSHA256)(new TextEncoder().encode(requestString), new TextEncoder().encode(credential.secret_key)));
22
+ const url = new URL(`https://${api_root}${path}?${requestParams}&Signature=${encodeURIComponent(str)}`);
23
+ // url.searchParams.sort();
24
+ console.info((0, utils_1.formatTime)(Date.now()), method, url.href, body);
25
+ const res = await fetch(url.href, {
26
+ method,
27
+ headers: { 'Content-Type': 'application/json' },
28
+ body: body || undefined,
29
+ });
30
+ const retStr = await res.text();
31
+ console.info((0, utils_1.formatTime)(Date.now()), 'PrivateResponse', url.toString(), res.status);
32
+ try {
33
+ return JSON.parse(retStr);
34
+ }
35
+ catch (e) {
36
+ console.error((0, utils_1.formatTime)(Date.now()), 'huobiRequestFailed', path, JSON.stringify(params), retStr);
37
+ throw e;
38
+ }
39
+ };
40
+ exports.privateRequest = privateRequest;
41
+ /**
42
+ * 获取账户信息
43
+ *
44
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec40743-7773-11ed-9966-0242ac110003
45
+ */
46
+ const getAccount = (credential) => {
47
+ return (0, exports.privateRequest)(credential, 'GET', '/v1/account/accounts', 'api.huobi.pro');
48
+ };
49
+ exports.getAccount = getAccount;
50
+ /**
51
+ * 获取用户ID
52
+ *
53
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec491c9-7773-11ed-9966-0242ac110003
54
+ */
55
+ const getUid = (credential) => {
56
+ return (0, exports.privateRequest)(credential, 'GET', '/v2/user/uid', 'api.huobi.pro');
57
+ };
58
+ exports.getUid = getUid;
59
+ /**
60
+ * 获取统一账户信息
61
+ *
62
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000073-77b7-11ed-9966-0242ac110003
63
+ */
64
+ const getUnifiedAccountInfo = (credential) => {
65
+ return (0, exports.privateRequest)(credential, 'GET', '/linear-swap-api/v3/unified_account_info', 'api.hbdm.com');
66
+ };
67
+ exports.getUnifiedAccountInfo = getUnifiedAccountInfo;
68
+ /**
69
+ * 获取合约持仓信息
70
+ *
71
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb74963-77b5-11ed-9966-0242ac110003
72
+ */
73
+ const getSwapCrossPositionInfo = (credential, params) => {
74
+ return (0, exports.privateRequest)(credential, 'POST', '/linear-swap-api/v1/swap_cross_position_info', 'api.hbdm.com', params);
75
+ };
76
+ exports.getSwapCrossPositionInfo = getSwapCrossPositionInfo;
77
+ /**
78
+ * 获取合约挂单
79
+ *
80
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb784d4-77b5-11ed-9966-0242ac110003
81
+ */
82
+ const getSwapOpenOrders = (credential, params) => {
83
+ return (0, exports.privateRequest)(credential, 'POST', '/linear-swap-api/v1/swap_cross_openorders', 'api.hbdm.com', params);
84
+ };
85
+ exports.getSwapOpenOrders = getSwapOpenOrders;
86
+ /**
87
+ * 获取现货账户余额
88
+ *
89
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec40922-7773-11ed-9966-0242ac110003
90
+ */
91
+ const getSpotAccountBalance = (credential, account_uid) => {
92
+ return (0, exports.privateRequest)(credential, 'GET', `/v1/account/accounts/${account_uid}/balance`, 'api.huobi.pro');
93
+ };
94
+ exports.getSpotAccountBalance = getSpotAccountBalance;
95
+ /**
96
+ * 获取杠杆借贷信息
97
+ *
98
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41863-7773-11ed-9966-0242ac110003
99
+ */
100
+ const getCrossMarginLoanInfo = (credential) => {
101
+ return (0, exports.privateRequest)(credential, 'GET', '/v1/cross-margin/loan-info', 'api.huobi.pro');
102
+ };
103
+ exports.getCrossMarginLoanInfo = getCrossMarginLoanInfo;
104
+ /**
105
+ * 获取现货行情
106
+ *
107
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec3fc25-7773-11ed-9966-0242ac110003
108
+ */
109
+ const getSpotTick = (credential, params) => {
110
+ return (0, exports.privateRequest)(credential, 'GET', `/market/detail/merged`, 'api.huobi.pro', params);
111
+ };
112
+ exports.getSpotTick = getSpotTick;
113
+ /**
114
+ * 现货下单
115
+ *
116
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000065-77b7-11ed-9966-0242ac110003
117
+ */
118
+ const postSpotOrder = (credential, params) => {
119
+ return (0, exports.privateRequest)(credential, 'POST', `/v1/order/auto/place`, 'api.huobi.pro', params);
120
+ };
121
+ exports.postSpotOrder = postSpotOrder;
122
+ /**
123
+ * 合约下单
124
+ *
125
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb77159-77b5-11ed-9966-0242ac110003
126
+ */
127
+ const postSwapOrder = (credential, params) => {
128
+ return (0, exports.privateRequest)(credential, 'POST', '/linear-swap-api/v1/swap_cross_order', 'api.hbdm.com', params);
129
+ };
130
+ exports.postSwapOrder = postSwapOrder;
131
+ /**
132
+ * 获取现货存款地址
133
+ *
134
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec45fb7-7773-11ed-9966-0242ac110003
135
+ */
136
+ const getSpotAccountDepositAddresses = (credential, params) => {
137
+ return (0, exports.privateRequest)(credential, 'GET', `/v2/account/deposit/address`, 'api.huobi.pro', params);
138
+ };
139
+ exports.getSpotAccountDepositAddresses = getSpotAccountDepositAddresses;
140
+ /**
141
+ * 获取账户流水
142
+ *
143
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec4610b-7773-11ed-9966-0242ac110003
144
+ */
145
+ const getAccountLedger = (credential, params) => {
146
+ return (0, exports.privateRequest)(credential, 'GET', `/v2/account/ledger`, 'api.huobi.pro', params);
147
+ };
148
+ exports.getAccountLedger = getAccountLedger;
149
+ /**
150
+ * 超级杠杆转出
151
+ *
152
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41ff0-7773-11ed-9966-0242ac110003
153
+ */
154
+ const postSuperMarginAccountTransferOut = (credential, params) => {
155
+ return (0, exports.privateRequest)(credential, 'POST', `/v1/cross-margin/transfer-out`, 'api.huobi.pro', params);
156
+ };
157
+ exports.postSuperMarginAccountTransferOut = postSuperMarginAccountTransferOut;
158
+ /**
159
+ * 超级杠杆转入
160
+ *
161
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41f0e-7773-11ed-9966-0242ac110003
162
+ */
163
+ const postSuperMarginAccountTransferIn = (credential, params) => {
164
+ return (0, exports.privateRequest)(credential, 'POST', `/v1/cross-margin/transfer-in`, 'api.huobi.pro', params);
165
+ };
166
+ exports.postSuperMarginAccountTransferIn = postSuperMarginAccountTransferIn;
167
+ /**
168
+ * 现货账户转账
169
+ *
170
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000095-77b7-11ed-9966-0242ac110003
171
+ */
172
+ const postSpotAccountTransfer = (credential, params) => {
173
+ return (0, exports.privateRequest)(credential, 'POST', `/v2/account/transfer`, 'api.huobi.pro', params);
174
+ };
175
+ exports.postSpotAccountTransfer = postSpotAccountTransfer;
176
+ /**
177
+ * 借贷
178
+ *
179
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41b5d-7773-11ed-9966-0242ac110003
180
+ */
181
+ const postBorrow = (credential, params) => {
182
+ return (0, exports.privateRequest)(credential, 'POST', `/v1/cross-margin/orders`, 'api.huobi.pro', params);
183
+ };
184
+ exports.postBorrow = postBorrow;
185
+ /**
186
+ * 提现
187
+ *
188
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec42cfd-7773-11ed-9966-0242ac110003
189
+ */
190
+ const postWithdraw = (credential, params) => {
191
+ return (0, exports.privateRequest)(credential, 'POST', `/v1/dw/withdraw/api/create`, 'api.huobi.pro', params);
192
+ };
193
+ exports.postWithdraw = postWithdraw;
194
+ /**
195
+ * 获取充提历史
196
+ *
197
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec44f99-7773-11ed-9966-0242ac110003
198
+ */
199
+ const getDepositWithdrawHistory = (credential, params) => {
200
+ return (0, exports.privateRequest)(credential, 'GET', `/v1/query/deposit-withdraw`, 'api.huobi.pro', params);
201
+ };
202
+ exports.getDepositWithdrawHistory = getDepositWithdrawHistory;
203
+ /**
204
+ * 资产划转(母子用户之间)
205
+ *
206
+ * 接口权限: 交易
207
+ *
208
+ * 限频: 2次/2s
209
+ *
210
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec45d8e-7773-11ed-9966-0242ac110003
211
+ */
212
+ const postSubUserTransfer = (credential, params) => {
213
+ return (0, exports.privateRequest)(credential, 'POST', '/v1/subuser/transfer', 'api.huobi.pro', params);
214
+ };
215
+ exports.postSubUserTransfer = postSubUserTransfer;
216
+ /**
217
+ * 获取子用户列表
218
+ *
219
+ * 接口权限: 读取
220
+ *
221
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec48f09-7773-11ed-9966-0242ac110003
222
+ */
223
+ const getSubUserList = (credential, params) => {
224
+ return (0, exports.privateRequest)(credential, 'GET', `/v2/sub-user/user-list`, 'api.huobi.pro', params);
225
+ };
226
+ exports.getSubUserList = getSubUserList;
227
+ /**
228
+ * 账户类型查询
229
+ *
230
+ * 是否验签: 是
231
+ *
232
+ * 接口权限: 读取
233
+ *
234
+ * 限频: 每个UID 3秒最多 144 次请求(交易接口3秒最多 72 次请求,查询接口3秒最多 72 次请求) (该UID的所有币种和不同到期日的合约的所有私有接口共享该限制) 。
235
+ *
236
+ * 接口描述: 此接口用于客户查询的账号类型,当前U本位合约有统一账户和非统一账户(全仓逐仓账户)类型。统一账户类型资产放在USDT一个账户上,全仓逐仓账户类型资产放在不同的币对。
237
+ * 统一账户类型为最新升级的,当前不支持API下单。若需要用用API下单请切换账户类型为非统一账户。
238
+ *
239
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb71825-77b5-11ed-9966-0242ac110003
240
+ */
241
+ const getSwapUnifiedAccountType = (credential) => {
242
+ return (0, exports.privateRequest)(credential, 'GET', '/linear-swap-api/v3/swap_unified_account_type', 'api.hbdm.com');
243
+ };
244
+ exports.getSwapUnifiedAccountType = getSwapUnifiedAccountType;
245
+ /**
246
+ * 账户类型更改接口
247
+ *
248
+ * 是否验签: 是
249
+ *
250
+ * 接口权限: 交易
251
+ *
252
+ * 限频: 每个UID 3秒最多 144 次请求(交易接口3秒最多 72 次请求,查询接口3秒最多 72 次请求) (该UID的所有币种和不同到期日的合约的所有私有接口共享该限制) 。
253
+ *
254
+ * 接口描述: 调用该接口前需要保证U本位合约无持仓和挂单,当由非统一账户(全仓逐仓账户)变为统一账户还需将资产从逐仓账户划转到全仓账户。
255
+ *
256
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb7196b-77b5-11ed-9966-0242ac110003
257
+ */
258
+ const postSwapSwitchAccountType = (credential, params) => {
259
+ return (0, exports.privateRequest)(credential, 'POST', '/linear-swap-api/v3/swap_switch_account_type', 'api.hbdm.com', params);
260
+ };
261
+ exports.postSwapSwitchAccountType = postSwapSwitchAccountType;
262
+ /**
263
+ * APIv2币链参考信息
264
+ *
265
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec478f0-7773-11ed-9966-0242ac110003
266
+ */
267
+ const getV2ReferenceCurrencies = (credential, params) => {
268
+ return (0, exports.privateRequest)(credential, 'GET', '/v2/reference/currencies', 'api.huobi.pro', params);
269
+ };
270
+ exports.getV2ReferenceCurrencies = getV2ReferenceCurrencies;
271
+ /**
272
+ * 获取账户历史
273
+ *
274
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41049-7773-11ed-9966-0242ac110003
275
+ */
276
+ const getAccountHistory = (credential, params) => {
277
+ return (0, exports.privateRequest)(credential, 'GET', '/v1/account/history', 'api.huobi.pro', params);
278
+ };
279
+ exports.getAccountHistory = getAccountHistory;
280
+ //# sourceMappingURL=private-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-api.js","sourceRoot":"","sources":["../../src/api/private-api.ts"],"names":[],"mappings":";;;AAAA,yCAAqE;AAO9D,MAAM,oBAAoB,GAAG,GAAgB,EAAE;IACpD,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAW;QACnC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAW;KACpC,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,oBAAoB,wBAK/B;AAEK,MAAM,cAAc,GAAG,KAAK,EACjC,UAAuB,EACvB,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,MAAY,EACZ,EAAE;IACF,MAAM,aAAa,GAAG,eACpB,UAAU,CAAC,UACb,4DAA4D,kBAAkB,CAC5E,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACvC,GACC,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,SAAS;QACtC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;aACvB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,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CACvC,UAAuB,EAQtB,EAAE;IACH,OAAO,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,EAAE,+CAA+C,EAAE,cAAc,CAAC,CAAC;AAC5G,CAAC,CAAC;AAXW,QAAA,yBAAyB,6BAWpC;AAEF;;;;;;;;;;;;GAYG;AACI,MAAM,yBAAyB,GAAG,CACvC,UAAuB,EACvB,MAAgC,EAQ/B,EAAE;IACH,OAAO,IAAA,sBAAc,EACnB,UAAU,EACV,MAAM,EACN,8CAA8C,EAC9C,cAAc,EACd,MAAM,CACP,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,yBAAyB,6BAkBpC;AAEF;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,CACtC,UAAuB,EACvB,MAGC,EAkCA,EAAE;IACH,OAAO,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAChG,CAAC,CAAC;AAzCW,QAAA,wBAAwB,4BAyCnC;AAEF;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAC/B,UAAuB,EACvB,MASC,EAmBA,EAAE;IACH,OAAO,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC,CAAC;AAhCW,QAAA,iBAAiB,qBAgC5B","sourcesContent":["import { encodeBase64, formatTime, HmacSHA256 } from '@yuants/utils';\n\nexport interface ICredential {\n access_key: string;\n secret_key: string;\n}\n\nexport const getDefaultCredential = (): ICredential => {\n return {\n access_key: process.env.ACCESS_KEY!,\n secret_key: process.env.SECRET_KEY!,\n };\n};\n\nexport const privateRequest = async (\n credential: ICredential,\n method: string,\n path: string,\n api_root: string,\n params?: any,\n) => {\n const requestParams = `AccessKeyId=${\n credential.access_key\n }&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=${encodeURIComponent(\n new Date().toISOString().split('.')[0],\n )}${\n method === 'GET' && params !== undefined\n ? `&${Object.entries(params)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([k, v]) => `${k}=${v}`)\n .join('&')}`\n : ''\n }`;\n\n const body = method === 'GET' ? '' : JSON.stringify(params);\n\n const requestString = `${method}\\n${api_root}\\n${path}\\n${requestParams}`;\n\n const str = encodeBase64(\n await HmacSHA256(\n new TextEncoder().encode(requestString),\n new TextEncoder().encode(credential.secret_key),\n ),\n );\n\n const url = new URL(`https://${api_root}${path}?${requestParams}&Signature=${encodeURIComponent(str)}`);\n // url.searchParams.sort();\n console.info(formatTime(Date.now()), method, url.href, body);\n const res = await fetch(url.href, {\n method,\n headers: { 'Content-Type': 'application/json' },\n body: body || undefined,\n });\n\n const retStr = await res.text();\n console.info(formatTime(Date.now()), 'PrivateResponse', url.toString(), res.status);\n try {\n return JSON.parse(retStr);\n } catch (e) {\n console.error(formatTime(Date.now()), 'huobiRequestFailed', path, JSON.stringify(params), retStr);\n throw e;\n }\n};\n\n/**\n * 获取账户信息\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec40743-7773-11ed-9966-0242ac110003\n */\nexport const getAccount = (\n credential: ICredential,\n): Promise<{\n status: string;\n data: {\n id: number;\n type: string;\n state: string;\n subtype: string;\n }[];\n}> => {\n return privateRequest(credential, 'GET', '/v1/account/accounts', 'api.huobi.pro');\n};\n\n/**\n * 获取用户ID\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec491c9-7773-11ed-9966-0242ac110003\n */\nexport const getUid = (credential: ICredential): Promise<{ data: number; code: number }> => {\n return privateRequest(credential, 'GET', '/v2/user/uid', 'api.huobi.pro');\n};\n\n/**\n * 获取统一账户信息\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000073-77b7-11ed-9966-0242ac110003\n */\nexport const getUnifiedAccountInfo = (\n credential: ICredential,\n): Promise<{\n status: string;\n code: number;\n msg: string;\n data: {\n margin_asset: string;\n margin_balance: number;\n cross_margin_static: number;\n cross_profit_unreal: number;\n withdraw_available: number;\n }[];\n}> => {\n return privateRequest(credential, 'GET', '/linear-swap-api/v3/unified_account_info', 'api.hbdm.com');\n};\n\n/**\n * 获取合约持仓信息\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb74963-77b5-11ed-9966-0242ac110003\n */\nexport const getSwapCrossPositionInfo = (\n credential: ICredential,\n params?: {\n contract_code?: string;\n pair?: string;\n contract_type: string;\n },\n): Promise<{\n status: string;\n ts: number;\n data: {\n contract_code: string;\n contract_type: string;\n direction: string;\n margin_mode: string;\n volume: number;\n available: number;\n cost_hold: number;\n last_price: number;\n profit_unreal: number;\n lever_rate: number;\n }[];\n}> => {\n return privateRequest(\n credential,\n 'POST',\n '/linear-swap-api/v1/swap_cross_position_info',\n 'api.hbdm.com',\n params,\n );\n};\n\n/**\n * 获取合约挂单\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb784d4-77b5-11ed-9966-0242ac110003\n */\nexport const getSwapOpenOrders = (\n credential: ICredential,\n params?: {\n contract_code?: string;\n pair?: string;\n page_index?: number;\n page_size?: number;\n sort_by?: string;\n trade_type?: string;\n },\n): Promise<{\n status: string;\n data: {\n orders: {\n order_id_str: string;\n contract_code: string;\n order_price_type: string;\n direction: string;\n offset: string;\n volume: number;\n created_at: number;\n price: number;\n trade_volume: number;\n }[];\n };\n}> => {\n return privateRequest(\n credential,\n 'POST',\n '/linear-swap-api/v1/swap_cross_openorders',\n 'api.hbdm.com',\n params,\n );\n};\n\n/**\n * 获取现货账户余额\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec40922-7773-11ed-9966-0242ac110003\n */\nexport const getSpotAccountBalance = (\n credential: ICredential,\n account_uid: number,\n): Promise<{\n status: string;\n data: {\n list: {\n currency: string;\n balance: string;\n type: string;\n }[];\n };\n}> => {\n return privateRequest(credential, 'GET', `/v1/account/accounts/${account_uid}/balance`, 'api.huobi.pro');\n};\n\n/**\n * 获取杠杆借贷信息\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41863-7773-11ed-9966-0242ac110003\n */\nexport const getCrossMarginLoanInfo = (\n credential: ICredential,\n): Promise<{\n status: string;\n code: number;\n data: {\n currency: string;\n 'loanable-amt': string;\n }[];\n}> => {\n return privateRequest(credential, 'GET', '/v1/cross-margin/loan-info', 'api.huobi.pro');\n};\n\n/**\n * 获取现货行情\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec3fc25-7773-11ed-9966-0242ac110003\n */\nexport const getSpotTick = (\n credential: ICredential,\n params: { symbol: string },\n): Promise<{\n status: string;\n tick: {\n close: number;\n };\n}> => {\n return privateRequest(credential, 'GET', `/market/detail/merged`, 'api.huobi.pro', params);\n};\n\n/**\n * 现货下单\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000065-77b7-11ed-9966-0242ac110003\n */\nexport const postSpotOrder = (\n credential: ICredential,\n params: {\n symbol: string;\n 'account-id': string;\n amount: string;\n market_amount?: string;\n 'borrow-amount'?: string;\n type: string;\n 'trade-purpose': string;\n price?: string;\n source: string;\n },\n): Promise<{ success: boolean; code: number; message: string }> => {\n return privateRequest(credential, 'POST', `/v1/order/auto/place`, 'api.huobi.pro', params);\n};\n\n/**\n * 合约下单\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb77159-77b5-11ed-9966-0242ac110003\n */\nexport const postSwapOrder = (\n credential: ICredential,\n params: {\n contract_code: string;\n contract_type: string;\n price?: number;\n volume: number;\n offset: string;\n direction: string;\n lever_rate: number;\n order_price_type: string;\n },\n): Promise<{ status: string; ts: number; data: { order_id: number; order_id_str: string } }> => {\n return privateRequest(credential, 'POST', '/linear-swap-api/v1/swap_cross_order', 'api.hbdm.com', params);\n};\n\n/**\n * 获取现货存款地址\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec45fb7-7773-11ed-9966-0242ac110003\n */\nexport const getSpotAccountDepositAddresses = (\n credential: ICredential,\n params: { currency: string },\n): Promise<{\n code: number;\n message: string;\n data: {\n currency: string;\n chain: string;\n address: string;\n }[];\n}> => {\n return privateRequest(credential, 'GET', `/v2/account/deposit/address`, 'api.huobi.pro', params);\n};\n\n/**\n * 获取账户流水\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec4610b-7773-11ed-9966-0242ac110003\n */\nexport const getAccountLedger = (\n credential: ICredential,\n params: { accountId: string; currency: string },\n): Promise<{\n status: string;\n data: {\n transactTime: number;\n transactAmt: number;\n }[];\n}> => {\n return privateRequest(credential, 'GET', `/v2/account/ledger`, 'api.huobi.pro', params);\n};\n\n/**\n * 超级杠杆转出\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41ff0-7773-11ed-9966-0242ac110003\n */\nexport const postSuperMarginAccountTransferOut = (\n credential: ICredential,\n params: {\n currency: string;\n amount: string;\n },\n): Promise<{ status: string; data: number }> => {\n return privateRequest(credential, 'POST', `/v1/cross-margin/transfer-out`, 'api.huobi.pro', params);\n};\n\n/**\n * 超级杠杆转入\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41f0e-7773-11ed-9966-0242ac110003\n */\nexport const postSuperMarginAccountTransferIn = (\n credential: ICredential,\n params: {\n currency: string;\n amount: string;\n },\n): Promise<{ status: string; data: number }> => {\n return privateRequest(credential, 'POST', `/v1/cross-margin/transfer-in`, 'api.huobi.pro', params);\n};\n\n/**\n * 现货账户转账\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=10000095-77b7-11ed-9966-0242ac110003\n */\nexport const postSpotAccountTransfer = (\n credential: ICredential,\n params: {\n from: string;\n to: string;\n currency: string;\n amount: number;\n 'margin-account': string;\n },\n): Promise<{ success: boolean; data: number; code: number; message: string }> => {\n return privateRequest(credential, 'POST', `/v2/account/transfer`, 'api.huobi.pro', params);\n};\n\n/**\n * 借贷\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41b5d-7773-11ed-9966-0242ac110003\n */\nexport const postBorrow = (\n credential: ICredential,\n params: { currency: string; amount: string },\n): Promise<{\n status: string;\n data: number;\n}> => {\n return privateRequest(credential, 'POST', `/v1/cross-margin/orders`, 'api.huobi.pro', params);\n};\n\n/**\n * 提现\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec42cfd-7773-11ed-9966-0242ac110003\n */\nexport const postWithdraw = (\n credential: ICredential,\n params: {\n address: string;\n amount: string;\n currency: string;\n fee: string;\n chain: string;\n },\n): Promise<{\n status: string;\n data: number;\n}> => {\n return privateRequest(credential, 'POST', `/v1/dw/withdraw/api/create`, 'api.huobi.pro', params);\n};\n\n/**\n * 获取充提历史\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec44f99-7773-11ed-9966-0242ac110003\n */\nexport const getDepositWithdrawHistory = (\n credential: ICredential,\n params: {\n currency: string;\n type: string;\n from?: string;\n size?: string;\n direct?: string;\n },\n): Promise<{\n status: string;\n 'error-code': string;\n 'error-msg': string;\n data: {\n id: number;\n type: string;\n currency: string;\n 'tx-hash': string;\n chain: string;\n amount: string;\n address: string;\n 'address-tag': string;\n fee: string;\n state: string;\n 'create-at': number;\n 'update-at': number;\n }[];\n}> => {\n return privateRequest(credential, 'GET', `/v1/query/deposit-withdraw`, 'api.huobi.pro', params);\n};\n\n/**\n * 资产划转(母子用户之间)\n *\n * 接口权限: 交易\n *\n * 限频: 2次/2s\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec45d8e-7773-11ed-9966-0242ac110003\n */\nexport const postSubUserTransfer = (\n credential: ICredential,\n params: {\n 'sub-uid': number;\n currency: string;\n amount: number;\n 'client-order-id'?: string;\n type: string;\n },\n): Promise<{\n data: number;\n status: string;\n}> => {\n return privateRequest(credential, 'POST', '/v1/subuser/transfer', 'api.huobi.pro', params);\n};\n\n/**\n * 获取子用户列表\n *\n * 接口权限: 读取\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec48f09-7773-11ed-9966-0242ac110003\n */\nexport const getSubUserList = (\n credential: ICredential,\n params?: { fromId?: number },\n): Promise<{\n code: number;\n message?: string;\n data: {\n uid: number;\n userState: string;\n subUserName: string;\n note: string;\n }[];\n nextId?: number;\n ok: boolean;\n}> => {\n return privateRequest(credential, 'GET', `/v2/sub-user/user-list`, 'api.huobi.pro', params);\n};\n\n/**\n * 账户类型查询\n *\n * 是否验签: 是\n *\n * 接口权限: 读取\n *\n * 限频: 每个UID 3秒最多 144 次请求(交易接口3秒最多 72 次请求,查询接口3秒最多 72 次请求) (该UID的所有币种和不同到期日的合约的所有私有接口共享该限制) 。\n *\n * 接口描述: 此接口用于客户查询的账号类型,当前U本位合约有统一账户和非统一账户(全仓逐仓账户)类型。统一账户类型资产放在USDT一个账户上,全仓逐仓账户类型资产放在不同的币对。\n * 统一账户类型为最新升级的,当前不支持API下单。若需要用用API下单请切换账户类型为非统一账户。\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb71825-77b5-11ed-9966-0242ac110003\n */\nexport const getSwapUnifiedAccountType = (\n credential: ICredential,\n): Promise<{\n code: number;\n msg: string;\n ts: number;\n data: {\n account_type: number;\n };\n}> => {\n return privateRequest(credential, 'GET', '/linear-swap-api/v3/swap_unified_account_type', 'api.hbdm.com');\n};\n\n/**\n * 账户类型更改接口\n *\n * 是否验签: 是\n *\n * 接口权限: 交易\n *\n * 限频: 每个UID 3秒最多 144 次请求(交易接口3秒最多 72 次请求,查询接口3秒最多 72 次请求) (该UID的所有币种和不同到期日的合约的所有私有接口共享该限制) 。\n *\n * 接口描述: 调用该接口前需要保证U本位合约无持仓和挂单,当由非统一账户(全仓逐仓账户)变为统一账户还需将资产从逐仓账户划转到全仓账户。\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb7196b-77b5-11ed-9966-0242ac110003\n */\nexport const postSwapSwitchAccountType = (\n credential: ICredential,\n params: { account_type: number },\n): Promise<{\n code: number;\n msg: string;\n ts: number;\n data: {\n account_type: number;\n };\n}> => {\n return privateRequest(\n credential,\n 'POST',\n '/linear-swap-api/v3/swap_switch_account_type',\n 'api.hbdm.com',\n params,\n );\n};\n\n/**\n * APIv2币链参考信息\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec478f0-7773-11ed-9966-0242ac110003\n */\nexport const getV2ReferenceCurrencies = (\n credential: ICredential,\n params: {\n currency?: string;\n authorizedUser?: string;\n },\n): Promise<{\n code: number;\n data: {\n currency: string;\n assetType: number;\n chains: {\n chain: string;\n displayName: string;\n fullName: string;\n baseChain?: string;\n baseChainProtocol?: string;\n isDynamic?: boolean;\n numOfConfirmations: number;\n numOfFastConfirmations: number;\n depositStatus: string;\n minDepositAmt: string;\n withdrawStatus: string;\n minWithdrawAmt: string;\n withdrawPrecision: number;\n maxWithdrawAmt: string;\n withdrawQuotaPerDay: string;\n withdrawQuotaPerYear: null;\n withdrawQuotaTotal: null;\n withdrawFeeType: string;\n transactFeeWithdraw?: string;\n addrWithTag: boolean;\n addrDepositTag: boolean;\n minTransactFeeWithdraw?: string;\n transactFeeRateWithdraw?: string;\n maxTransactFeeWithdraw?: string;\n }[];\n instStatus: string;\n }[];\n}> => {\n return privateRequest(credential, 'GET', '/v2/reference/currencies', 'api.huobi.pro', params);\n};\n\n/**\n * 获取账户历史\n *\n * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec41049-7773-11ed-9966-0242ac110003\n */\nexport const getAccountHistory = (\n credential: ICredential,\n params: {\n 'account-id': string;\n currency?: string;\n 'transact-types'?: number;\n 'start-time'?: number;\n 'end-time'?: number;\n sort?: 'asc' | 'desc';\n size?: number;\n 'from-id'?: number;\n },\n): Promise<{\n // code: number;\n 'transact-amt': string;\n 'avail-balance': string;\n 'acct-balance': string;\n 'transact-time': string;\n 'record-id': string;\n status: string;\n data: {\n 'account-id': string;\n currency: string;\n 'record-id': string;\n 'transact-amt': string;\n 'transact-type': string;\n 'avail-balance': string;\n 'acct-balance': string;\n 'transact-time': string;\n }[];\n}> => {\n return privateRequest(credential, 'GET', '/v1/account/history', 'api.huobi.pro', params);\n};\n"]}
@@ -0,0 +1,308 @@
1
+ /**
2
+ * 获取永续合约产品信息
3
+ *
4
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb72f34-77b5-11ed-9966-0242ac110003
5
+ */
6
+ export declare function getPerpetualContractSymbols(params?: {
7
+ contract_code?: string;
8
+ support_margin_mode?: string;
9
+ pair?: string;
10
+ contract_type?: string;
11
+ business_type?: string;
12
+ }): Promise<{
13
+ status: string;
14
+ data: {
15
+ symbol: string;
16
+ contract_code: string;
17
+ contract_size: number;
18
+ price_tick: number;
19
+ settlement_date: string;
20
+ delivery_time: string;
21
+ create_date: string;
22
+ contract_status: number;
23
+ support_margin_mode: string;
24
+ contract_type: string;
25
+ pair: string;
26
+ business_type: string;
27
+ delivery_date: string;
28
+ }[];
29
+ ts: string;
30
+ }>;
31
+ /**
32
+ * 获取现货产品信息
33
+ *
34
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec47f16-7773-11ed-9966-0242ac110003
35
+ */
36
+ export declare function getSpotSymbols(): Promise<{
37
+ status: string;
38
+ data: {
39
+ si: string;
40
+ scr: string;
41
+ sc: string;
42
+ dn: string;
43
+ bc: string;
44
+ bcdn: string;
45
+ qc: string;
46
+ qcdn: string;
47
+ state: string;
48
+ whe: boolean;
49
+ cd: boolean;
50
+ te: boolean;
51
+ toa: number;
52
+ sp: string;
53
+ w: number;
54
+ ttp: number;
55
+ tap: number;
56
+ tpp: number;
57
+ fp: number;
58
+ suspend_desc: string;
59
+ transfer_board_desc: string;
60
+ tags: string;
61
+ lr: number;
62
+ smlr: number;
63
+ flr: string;
64
+ wr: string;
65
+ d: number;
66
+ elr: number;
67
+ p: any;
68
+ castate: string;
69
+ ca1oa: number;
70
+ ca2oa: number;
71
+ }[];
72
+ ts: string;
73
+ full: number;
74
+ err_code: string;
75
+ err_msg: string;
76
+ }>;
77
+ /**
78
+ * 获取现货行情
79
+ *
80
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec3fc25-7773-11ed-9966-0242ac110003
81
+ */
82
+ export declare function getSpotTick(params: {
83
+ symbol: string;
84
+ }): Promise<{
85
+ status: string;
86
+ tick: {
87
+ close: number;
88
+ };
89
+ }>;
90
+ /**
91
+ * 【通用】批量获取合约资金费率
92
+ *
93
+ * 接口权限: 读取
94
+ *
95
+ * 限频: 其他非行情类的公开接口,比如获取指数信息,限价信息,交割结算、平台持仓信息等,所有用户都是每个IP3秒最多240次请求(所有该IP的非行情类的公开接口请求共享3秒240次的额度)
96
+ *
97
+ * 接口描述: 该接口支持全仓模式和逐仓模式
98
+ *
99
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb71b45-77b5-11ed-9966-0242ac110003
100
+ */
101
+ export declare function getSwapBatchFundingRate(params: {
102
+ contract_code?: string;
103
+ }): Promise<{
104
+ status: string;
105
+ ts: number;
106
+ data: {
107
+ estimated_rate: null;
108
+ funding_rate: string;
109
+ contract_code: string;
110
+ symbol: string;
111
+ fee_asset: string;
112
+ funding_time: string;
113
+ next_funding_time: null;
114
+ trade_partition: string;
115
+ }[];
116
+ }>;
117
+ /**
118
+ * 【通用】获取市场最近成交记录
119
+ *
120
+ * 接口权限: 读取
121
+ *
122
+ * 限频: 行情类的公开接口,比如:获取K线数据、获取聚合行情、市场行情、获取行情深度数据、获取溢价指数K线、获取实时预测资金费率k线,获取基差数据、获取市场最近成交记录:
123
+ *
124
+ * (1) restful接口:同一个IP, 所有业务(交割合约、币本位永续合约和U本位合约)总共1秒最多800个请求
125
+ *
126
+ * 接口描述: 该接口支持全仓模式和逐仓模式
127
+ *
128
+ * 请求参数contract_code支持交割合约代码,格式为BTC-USDT-210625;同时支持合约标识,格式为 BTC-USDT(永续)、BTC-USDT-CW(当周)、BTC-USDT-NW(次周)、BTC-USDT-CQ(当季)、BTC-USDT-NQ(次季)。
129
+ *
130
+ * business_type 在查询交割合约数据时为必填参数。且参数值要传:futures 或 all 。
131
+ *
132
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb73c34-77b5-11ed-9966-0242ac110003
133
+ */
134
+ export declare function getSwapMarketTrade(params: {
135
+ contract_code?: string;
136
+ business_type?: string;
137
+ }): Promise<{
138
+ ch: string;
139
+ status: string;
140
+ tick: {
141
+ data: {
142
+ amount: string;
143
+ quantity: string;
144
+ trade_turnover: string;
145
+ ts: number;
146
+ id: number;
147
+ price: string;
148
+ direction: string;
149
+ contract_code: string;
150
+ business_type: string;
151
+ trade_partition: string;
152
+ }[];
153
+ id: number;
154
+ ts: number;
155
+ };
156
+ ts: number;
157
+ }>;
158
+ /**
159
+ * 获得当前合约的总持仓量
160
+ *
161
+ * https://huobiapi.github.io/docs/usdt_swap/v1/cn/#3218e7531a
162
+ */
163
+ export declare function getSwapOpenInterest(params: {
164
+ contract_code?: string;
165
+ pair?: string;
166
+ contract_type?: string;
167
+ business_type?: string;
168
+ }): Promise<{
169
+ status: string;
170
+ data: {
171
+ volume: number;
172
+ amount: number;
173
+ symbol: string;
174
+ value: number;
175
+ contract_code: string;
176
+ trade_amount: number;
177
+ trade_volume: number;
178
+ trade_turnover: number;
179
+ business_type: string;
180
+ pair: string;
181
+ contract_type: string;
182
+ }[];
183
+ ts: number;
184
+ }>;
185
+ /**
186
+ * 【通用】获取市场最优挂单
187
+ *
188
+ * 接口权限: 读取
189
+ *
190
+ * 限频: 行情类的公开接口,比如:获取K线数据、获取聚合行情、市场行情、获取行情深度数据、获取溢价指数K线、获取实时预测资金费率k线,获取基差数据、获取市场最近成交记录:
191
+ *
192
+ * (1) restful接口:同一个IP, 所有业务(交割合约、币本位永续合约和U本位合约)总共1秒最多800个请求
193
+ *
194
+ * 接口描述: 该接口支持全仓模式和逐仓模式
195
+ *
196
+ * 请求参数contract_code支持交割合约代码,格式为BTC-USDT-210625;同时支持合约标识,格式为 BTC-USDT(永续)、BTC-USDT-CW(当周)、BTC-USDT-NW(次周)、BTC-USDT-CQ(当季)、BTC-USDT-NQ(次季)。
197
+ *
198
+ * business_type 在查询交割合约数据时为必填参数。且参数值要传:futures 或 all 。
199
+ *
200
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb735e0-77b5-11ed-9966-0242ac110003
201
+ */
202
+ export declare function getSwapMarketBbo(params: {
203
+ contract_code?: string;
204
+ }): Promise<{
205
+ status: string;
206
+ ticks: {
207
+ trade_partition: string;
208
+ business_type: string;
209
+ contract_code: string;
210
+ ask: number[] | null;
211
+ bid: number[] | null;
212
+ mrid: number;
213
+ ts: number;
214
+ }[];
215
+ ts: number;
216
+ }>;
217
+ /**
218
+ * 获取合约的历史资金费率
219
+ *
220
+ * 接口权限: 读取
221
+ *
222
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=5d51f1f9-77b6-11ed-9966-0242ac110003
223
+ */
224
+ export declare function getSwapHistoricalFundingRate(params: {
225
+ contract_code: string;
226
+ page_index?: number;
227
+ page_size?: number;
228
+ }): Promise<{
229
+ status: string;
230
+ ts: number;
231
+ data: {
232
+ data: {
233
+ symbol: string;
234
+ contract_code: string;
235
+ fee_asset: string;
236
+ funding_time: string;
237
+ funding_rate: string;
238
+ realized_rate: string;
239
+ avg_premium_index: string;
240
+ }[];
241
+ total_page: number;
242
+ current_page: number;
243
+ total_size: number;
244
+ };
245
+ }>;
246
+ /**
247
+ * 【全仓】获取平台阶梯保证金
248
+ *
249
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=8cb72290-77b5-11ed-9966-0242ac110003
250
+ */
251
+ export declare function getSwapCrossLadderMargin(params?: {
252
+ contract_code?: string;
253
+ pair?: string;
254
+ contract_type?: string;
255
+ business_type?: string;
256
+ }): Promise<{
257
+ status: string;
258
+ data: Array<{
259
+ contract_code: string;
260
+ pair: string;
261
+ list: Array<{
262
+ lever_rate: number;
263
+ }>;
264
+ }>;
265
+ }>;
266
+ /**
267
+ * APIv2币链参考信息
268
+ *
269
+ * https://www.htx.com/zh-cn/opend/newApiPages/?id=7ec478f0-7773-11ed-9966-0242ac110003
270
+ */
271
+ export declare function getV2ReferenceCurrencies(params: {
272
+ currency?: string;
273
+ authorizedUser?: string;
274
+ }): Promise<{
275
+ code: number;
276
+ data: {
277
+ currency: string;
278
+ assetType: number;
279
+ chains: {
280
+ chain: string;
281
+ displayName: string;
282
+ fullName: string;
283
+ baseChain?: string;
284
+ baseChainProtocol?: string;
285
+ isDynamic?: boolean;
286
+ numOfConfirmations: number;
287
+ numOfFastConfirmations: number;
288
+ depositStatus: string;
289
+ minDepositAmt: string;
290
+ withdrawStatus: string;
291
+ minWithdrawAmt: string;
292
+ withdrawPrecision: number;
293
+ maxWithdrawAmt: string;
294
+ withdrawQuotaPerDay: string;
295
+ withdrawQuotaPerYear: null;
296
+ withdrawQuotaTotal: null;
297
+ withdrawFeeType: string;
298
+ transactFeeWithdraw?: string;
299
+ addrWithTag: boolean;
300
+ addrDepositTag: boolean;
301
+ minTransactFeeWithdraw?: string;
302
+ transactFeeRateWithdraw?: string;
303
+ maxTransactFeeWithdraw?: string;
304
+ }[];
305
+ instStatus: string;
306
+ }[];
307
+ }>;
308
+ //# sourceMappingURL=public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/api/public-api.ts"],"names":[],"mappings":"AAyCA;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,CAAC,EAAE;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,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