gateio-api 0.0.1 → 1.0.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.
Files changed (320) hide show
  1. package/README.md +251 -106
  2. package/dist/cjs/RestClient.d.ts +2534 -0
  3. package/dist/cjs/RestClient.js +2700 -0
  4. package/dist/cjs/RestClient.js.map +1 -0
  5. package/dist/cjs/WebsocketClient.d.ts +107 -0
  6. package/dist/cjs/WebsocketClient.js +504 -0
  7. package/dist/cjs/WebsocketClient.js.map +1 -0
  8. package/dist/cjs/index.d.ts +43 -0
  9. package/dist/cjs/index.js +64 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/lib/BaseRestClient.d.ts +63 -0
  12. package/dist/cjs/lib/BaseRestClient.js +324 -0
  13. package/dist/cjs/lib/BaseRestClient.js.map +1 -0
  14. package/dist/cjs/lib/BaseWSClient.d.ts +172 -0
  15. package/dist/cjs/lib/BaseWSClient.js +619 -0
  16. package/dist/cjs/lib/BaseWSClient.js.map +1 -0
  17. package/dist/cjs/lib/logger.d.ts +6 -0
  18. package/dist/cjs/lib/logger.js +16 -0
  19. package/dist/cjs/lib/logger.js.map +1 -0
  20. package/dist/cjs/lib/misc-util.d.ts +1 -0
  21. package/dist/cjs/lib/misc-util.js +8 -0
  22. package/dist/cjs/lib/misc-util.js.map +1 -0
  23. package/dist/cjs/lib/requestUtils.d.ts +38 -0
  24. package/dist/cjs/lib/requestUtils.js +47 -0
  25. package/dist/cjs/lib/requestUtils.js.map +1 -0
  26. package/dist/cjs/lib/webCryptoAPI.d.ts +10 -0
  27. package/dist/cjs/lib/webCryptoAPI.js +57 -0
  28. package/dist/cjs/lib/webCryptoAPI.js.map +1 -0
  29. package/dist/cjs/lib/websocket/WsStore.d.ts +57 -0
  30. package/dist/cjs/lib/websocket/WsStore.js +249 -0
  31. package/dist/cjs/lib/websocket/WsStore.js.map +1 -0
  32. package/dist/cjs/lib/websocket/WsStore.types.d.ts +44 -0
  33. package/dist/cjs/lib/websocket/WsStore.types.js +13 -0
  34. package/dist/cjs/lib/websocket/WsStore.types.js.map +1 -0
  35. package/dist/cjs/lib/websocket/websocket-util.d.ts +78 -0
  36. package/dist/cjs/lib/websocket/websocket-util.js +153 -0
  37. package/dist/cjs/lib/websocket/websocket-util.js.map +1 -0
  38. package/dist/cjs/package.json +3 -0
  39. package/dist/cjs/types/request/account.d.ts +10 -0
  40. package/dist/cjs/types/request/account.js +7 -0
  41. package/dist/cjs/types/request/account.js.map +1 -0
  42. package/dist/cjs/types/request/collateralLoan.d.ts +39 -0
  43. package/dist/cjs/types/request/collateralLoan.js +7 -0
  44. package/dist/cjs/types/request/collateralLoan.js.map +1 -0
  45. package/dist/cjs/types/request/delivery.d.ts +89 -0
  46. package/dist/cjs/types/request/delivery.js +7 -0
  47. package/dist/cjs/types/request/delivery.js.map +1 -0
  48. package/dist/cjs/types/request/earn.d.ts +16 -0
  49. package/dist/cjs/types/request/earn.js +7 -0
  50. package/dist/cjs/types/request/earn.js.map +1 -0
  51. package/dist/cjs/types/request/earnuni.d.ts +30 -0
  52. package/dist/cjs/types/request/earnuni.js +7 -0
  53. package/dist/cjs/types/request/earnuni.js.map +1 -0
  54. package/dist/cjs/types/request/flashswap.d.ts +28 -0
  55. package/dist/cjs/types/request/flashswap.js +7 -0
  56. package/dist/cjs/types/request/flashswap.js.map +1 -0
  57. package/dist/cjs/types/request/futures.d.ts +168 -0
  58. package/dist/cjs/types/request/futures.js +7 -0
  59. package/dist/cjs/types/request/futures.js.map +1 -0
  60. package/dist/cjs/types/request/margin.d.ts +47 -0
  61. package/dist/cjs/types/request/margin.js +7 -0
  62. package/dist/cjs/types/request/margin.js.map +1 -0
  63. package/dist/cjs/types/request/marginuni.d.ts +29 -0
  64. package/dist/cjs/types/request/marginuni.js +7 -0
  65. package/dist/cjs/types/request/marginuni.js.map +1 -0
  66. package/dist/cjs/types/request/multicollateralLoan.d.ts +55 -0
  67. package/dist/cjs/types/request/multicollateralLoan.js +7 -0
  68. package/dist/cjs/types/request/multicollateralLoan.js.map +1 -0
  69. package/dist/cjs/types/request/options.d.ts +81 -0
  70. package/dist/cjs/types/request/options.js +3 -0
  71. package/dist/cjs/types/request/options.js.map +1 -0
  72. package/dist/cjs/types/request/rebate.d.ts +26 -0
  73. package/dist/cjs/types/request/rebate.js +3 -0
  74. package/dist/cjs/types/request/rebate.js.map +1 -0
  75. package/dist/cjs/types/request/spot.d.ts +115 -0
  76. package/dist/cjs/types/request/spot.js +7 -0
  77. package/dist/cjs/types/request/spot.js.map +1 -0
  78. package/dist/cjs/types/request/subaccount.d.ts +19 -0
  79. package/dist/cjs/types/request/subaccount.js +3 -0
  80. package/dist/cjs/types/request/subaccount.js.map +1 -0
  81. package/dist/cjs/types/request/unified.d.ts +64 -0
  82. package/dist/cjs/types/request/unified.js +3 -0
  83. package/dist/cjs/types/request/unified.js.map +1 -0
  84. package/dist/cjs/types/request/wallet.d.ts +50 -0
  85. package/dist/cjs/types/request/wallet.js +3 -0
  86. package/dist/cjs/types/request/wallet.js.map +1 -0
  87. package/dist/cjs/types/request/withdrawal.d.ts +12 -0
  88. package/dist/cjs/types/request/withdrawal.js +7 -0
  89. package/dist/cjs/types/request/withdrawal.js.map +1 -0
  90. package/dist/cjs/types/response/account.d.ts +24 -0
  91. package/dist/cjs/types/response/account.js +7 -0
  92. package/dist/cjs/types/response/account.js.map +1 -0
  93. package/dist/cjs/types/response/collateralloan.d.ts +58 -0
  94. package/dist/cjs/types/response/collateralloan.js +7 -0
  95. package/dist/cjs/types/response/collateralloan.js.map +1 -0
  96. package/dist/cjs/types/response/delivery.d.ts +144 -0
  97. package/dist/cjs/types/response/delivery.js +7 -0
  98. package/dist/cjs/types/response/delivery.js.map +1 -0
  99. package/dist/cjs/types/response/earn.d.ts +60 -0
  100. package/dist/cjs/types/response/earn.js +7 -0
  101. package/dist/cjs/types/response/earn.js.map +1 -0
  102. package/dist/cjs/types/response/earnuni.d.ts +40 -0
  103. package/dist/cjs/types/response/earnuni.js +7 -0
  104. package/dist/cjs/types/response/earnuni.js.map +1 -0
  105. package/dist/cjs/types/response/flashswap.d.ts +32 -0
  106. package/dist/cjs/types/response/flashswap.js +7 -0
  107. package/dist/cjs/types/response/flashswap.js.map +1 -0
  108. package/dist/cjs/types/response/futures.d.ts +398 -0
  109. package/dist/cjs/types/response/futures.js +7 -0
  110. package/dist/cjs/types/response/futures.js.map +1 -0
  111. package/dist/cjs/types/response/margin.d.ts +96 -0
  112. package/dist/cjs/types/response/margin.js +7 -0
  113. package/dist/cjs/types/response/margin.js.map +1 -0
  114. package/dist/cjs/types/response/marginuni.d.ts +39 -0
  115. package/dist/cjs/types/response/marginuni.js +7 -0
  116. package/dist/cjs/types/response/marginuni.js.map +1 -0
  117. package/dist/cjs/types/response/multicollateralLoan.d.ts +151 -0
  118. package/dist/cjs/types/response/multicollateralLoan.js +7 -0
  119. package/dist/cjs/types/response/multicollateralLoan.js.map +1 -0
  120. package/dist/cjs/types/response/options.d.ts +192 -0
  121. package/dist/cjs/types/response/options.js +7 -0
  122. package/dist/cjs/types/response/options.js.map +1 -0
  123. package/dist/cjs/types/response/rebate.d.ts +40 -0
  124. package/dist/cjs/types/response/rebate.js +3 -0
  125. package/dist/cjs/types/response/rebate.js.map +1 -0
  126. package/dist/cjs/types/response/shared.d.ts +5 -0
  127. package/dist/cjs/types/response/shared.js +3 -0
  128. package/dist/cjs/types/response/shared.js.map +1 -0
  129. package/dist/cjs/types/response/spot.d.ts +224 -0
  130. package/dist/cjs/types/response/spot.js +7 -0
  131. package/dist/cjs/types/response/spot.js.map +1 -0
  132. package/dist/cjs/types/response/subaccount.d.ts +40 -0
  133. package/dist/cjs/types/response/subaccount.js +3 -0
  134. package/dist/cjs/types/response/subaccount.js.map +1 -0
  135. package/dist/cjs/types/response/unified.d.ts +113 -0
  136. package/dist/cjs/types/response/unified.js +3 -0
  137. package/dist/cjs/types/response/unified.js.map +1 -0
  138. package/dist/cjs/types/response/wallet.d.ts +181 -0
  139. package/dist/cjs/types/response/wallet.js +3 -0
  140. package/dist/cjs/types/response/wallet.js.map +1 -0
  141. package/dist/cjs/types/response/withdrawal.d.ts +12 -0
  142. package/dist/cjs/types/response/withdrawal.js +3 -0
  143. package/dist/cjs/types/response/withdrawal.js.map +1 -0
  144. package/dist/cjs/types/shared.d.ts +16 -0
  145. package/dist/cjs/types/shared.js +3 -0
  146. package/dist/cjs/types/shared.js.map +1 -0
  147. package/dist/cjs/types/websockets/client.d.ts +44 -0
  148. package/dist/cjs/types/websockets/client.js +6 -0
  149. package/dist/cjs/types/websockets/client.js.map +1 -0
  150. package/dist/cjs/types/websockets/events.d.ts +5 -0
  151. package/dist/cjs/types/websockets/events.js +3 -0
  152. package/dist/cjs/types/websockets/events.js.map +1 -0
  153. package/dist/cjs/types/websockets/requests.d.ts +36 -0
  154. package/dist/cjs/types/websockets/requests.js +3 -0
  155. package/dist/cjs/types/websockets/requests.js.map +1 -0
  156. package/dist/cjs/types/websockets/wsAPI.d.ts +101 -0
  157. package/dist/cjs/types/websockets/wsAPI.js +8 -0
  158. package/dist/cjs/types/websockets/wsAPI.js.map +1 -0
  159. package/dist/mjs/RestClient.d.ts +2534 -0
  160. package/dist/mjs/RestClient.js +2696 -0
  161. package/dist/mjs/RestClient.js.map +1 -0
  162. package/dist/mjs/WebsocketClient.d.ts +107 -0
  163. package/dist/mjs/WebsocketClient.js +500 -0
  164. package/dist/mjs/WebsocketClient.js.map +1 -0
  165. package/dist/mjs/index.d.ts +43 -0
  166. package/dist/mjs/index.js +48 -0
  167. package/dist/mjs/index.js.map +1 -0
  168. package/dist/mjs/lib/BaseRestClient.d.ts +63 -0
  169. package/dist/mjs/lib/BaseRestClient.js +317 -0
  170. package/dist/mjs/lib/BaseRestClient.js.map +1 -0
  171. package/dist/mjs/lib/BaseWSClient.d.ts +172 -0
  172. package/dist/mjs/lib/BaseWSClient.js +612 -0
  173. package/dist/mjs/lib/BaseWSClient.js.map +1 -0
  174. package/dist/mjs/lib/logger.d.ts +6 -0
  175. package/dist/mjs/lib/logger.js +13 -0
  176. package/dist/mjs/lib/logger.js.map +1 -0
  177. package/dist/mjs/lib/misc-util.d.ts +1 -0
  178. package/dist/mjs/lib/misc-util.js +4 -0
  179. package/dist/mjs/lib/misc-util.js.map +1 -0
  180. package/dist/mjs/lib/requestUtils.d.ts +38 -0
  181. package/dist/mjs/lib/requestUtils.js +41 -0
  182. package/dist/mjs/lib/requestUtils.js.map +1 -0
  183. package/dist/mjs/lib/webCryptoAPI.d.ts +10 -0
  184. package/dist/mjs/lib/webCryptoAPI.js +52 -0
  185. package/dist/mjs/lib/webCryptoAPI.js.map +1 -0
  186. package/dist/mjs/lib/websocket/WsStore.d.ts +57 -0
  187. package/dist/mjs/lib/websocket/WsStore.js +244 -0
  188. package/dist/mjs/lib/websocket/WsStore.js.map +1 -0
  189. package/dist/mjs/lib/websocket/WsStore.types.d.ts +44 -0
  190. package/dist/mjs/lib/websocket/WsStore.types.js +10 -0
  191. package/dist/mjs/lib/websocket/WsStore.types.js.map +1 -0
  192. package/dist/mjs/lib/websocket/websocket-util.d.ts +78 -0
  193. package/dist/mjs/lib/websocket/websocket-util.js +145 -0
  194. package/dist/mjs/lib/websocket/websocket-util.js.map +1 -0
  195. package/dist/mjs/package.json +3 -0
  196. package/dist/mjs/types/request/account.d.ts +10 -0
  197. package/dist/mjs/types/request/account.js +6 -0
  198. package/dist/mjs/types/request/account.js.map +1 -0
  199. package/dist/mjs/types/request/collateralLoan.d.ts +39 -0
  200. package/dist/mjs/types/request/collateralLoan.js +6 -0
  201. package/dist/mjs/types/request/collateralLoan.js.map +1 -0
  202. package/dist/mjs/types/request/delivery.d.ts +89 -0
  203. package/dist/mjs/types/request/delivery.js +6 -0
  204. package/dist/mjs/types/request/delivery.js.map +1 -0
  205. package/dist/mjs/types/request/earn.d.ts +16 -0
  206. package/dist/mjs/types/request/earn.js +6 -0
  207. package/dist/mjs/types/request/earn.js.map +1 -0
  208. package/dist/mjs/types/request/earnuni.d.ts +30 -0
  209. package/dist/mjs/types/request/earnuni.js +6 -0
  210. package/dist/mjs/types/request/earnuni.js.map +1 -0
  211. package/dist/mjs/types/request/flashswap.d.ts +28 -0
  212. package/dist/mjs/types/request/flashswap.js +6 -0
  213. package/dist/mjs/types/request/flashswap.js.map +1 -0
  214. package/dist/mjs/types/request/futures.d.ts +168 -0
  215. package/dist/mjs/types/request/futures.js +6 -0
  216. package/dist/mjs/types/request/futures.js.map +1 -0
  217. package/dist/mjs/types/request/margin.d.ts +47 -0
  218. package/dist/mjs/types/request/margin.js +6 -0
  219. package/dist/mjs/types/request/margin.js.map +1 -0
  220. package/dist/mjs/types/request/marginuni.d.ts +29 -0
  221. package/dist/mjs/types/request/marginuni.js +6 -0
  222. package/dist/mjs/types/request/marginuni.js.map +1 -0
  223. package/dist/mjs/types/request/multicollateralLoan.d.ts +55 -0
  224. package/dist/mjs/types/request/multicollateralLoan.js +6 -0
  225. package/dist/mjs/types/request/multicollateralLoan.js.map +1 -0
  226. package/dist/mjs/types/request/options.d.ts +81 -0
  227. package/dist/mjs/types/request/options.js +2 -0
  228. package/dist/mjs/types/request/options.js.map +1 -0
  229. package/dist/mjs/types/request/rebate.d.ts +26 -0
  230. package/dist/mjs/types/request/rebate.js +2 -0
  231. package/dist/mjs/types/request/rebate.js.map +1 -0
  232. package/dist/mjs/types/request/spot.d.ts +115 -0
  233. package/dist/mjs/types/request/spot.js +6 -0
  234. package/dist/mjs/types/request/spot.js.map +1 -0
  235. package/dist/mjs/types/request/subaccount.d.ts +19 -0
  236. package/dist/mjs/types/request/subaccount.js +2 -0
  237. package/dist/mjs/types/request/subaccount.js.map +1 -0
  238. package/dist/mjs/types/request/unified.d.ts +64 -0
  239. package/dist/mjs/types/request/unified.js +2 -0
  240. package/dist/mjs/types/request/unified.js.map +1 -0
  241. package/dist/mjs/types/request/wallet.d.ts +50 -0
  242. package/dist/mjs/types/request/wallet.js +2 -0
  243. package/dist/mjs/types/request/wallet.js.map +1 -0
  244. package/dist/mjs/types/request/withdrawal.d.ts +12 -0
  245. package/dist/mjs/types/request/withdrawal.js +6 -0
  246. package/dist/mjs/types/request/withdrawal.js.map +1 -0
  247. package/dist/mjs/types/response/account.d.ts +24 -0
  248. package/dist/mjs/types/response/account.js +6 -0
  249. package/dist/mjs/types/response/account.js.map +1 -0
  250. package/dist/mjs/types/response/collateralloan.d.ts +58 -0
  251. package/dist/mjs/types/response/collateralloan.js +6 -0
  252. package/dist/mjs/types/response/collateralloan.js.map +1 -0
  253. package/dist/mjs/types/response/delivery.d.ts +144 -0
  254. package/dist/mjs/types/response/delivery.js +6 -0
  255. package/dist/mjs/types/response/delivery.js.map +1 -0
  256. package/dist/mjs/types/response/earn.d.ts +60 -0
  257. package/dist/mjs/types/response/earn.js +6 -0
  258. package/dist/mjs/types/response/earn.js.map +1 -0
  259. package/dist/mjs/types/response/earnuni.d.ts +40 -0
  260. package/dist/mjs/types/response/earnuni.js +6 -0
  261. package/dist/mjs/types/response/earnuni.js.map +1 -0
  262. package/dist/mjs/types/response/flashswap.d.ts +32 -0
  263. package/dist/mjs/types/response/flashswap.js +6 -0
  264. package/dist/mjs/types/response/flashswap.js.map +1 -0
  265. package/dist/mjs/types/response/futures.d.ts +398 -0
  266. package/dist/mjs/types/response/futures.js +6 -0
  267. package/dist/mjs/types/response/futures.js.map +1 -0
  268. package/dist/mjs/types/response/margin.d.ts +96 -0
  269. package/dist/mjs/types/response/margin.js +6 -0
  270. package/dist/mjs/types/response/margin.js.map +1 -0
  271. package/dist/mjs/types/response/marginuni.d.ts +39 -0
  272. package/dist/mjs/types/response/marginuni.js +6 -0
  273. package/dist/mjs/types/response/marginuni.js.map +1 -0
  274. package/dist/mjs/types/response/multicollateralLoan.d.ts +151 -0
  275. package/dist/mjs/types/response/multicollateralLoan.js +6 -0
  276. package/dist/mjs/types/response/multicollateralLoan.js.map +1 -0
  277. package/dist/mjs/types/response/options.d.ts +192 -0
  278. package/dist/mjs/types/response/options.js +6 -0
  279. package/dist/mjs/types/response/options.js.map +1 -0
  280. package/dist/mjs/types/response/rebate.d.ts +40 -0
  281. package/dist/mjs/types/response/rebate.js +2 -0
  282. package/dist/mjs/types/response/rebate.js.map +1 -0
  283. package/dist/mjs/types/response/shared.d.ts +5 -0
  284. package/dist/mjs/types/response/shared.js +2 -0
  285. package/dist/mjs/types/response/shared.js.map +1 -0
  286. package/dist/mjs/types/response/spot.d.ts +224 -0
  287. package/dist/mjs/types/response/spot.js +6 -0
  288. package/dist/mjs/types/response/spot.js.map +1 -0
  289. package/dist/mjs/types/response/subaccount.d.ts +40 -0
  290. package/dist/mjs/types/response/subaccount.js +2 -0
  291. package/dist/mjs/types/response/subaccount.js.map +1 -0
  292. package/dist/mjs/types/response/unified.d.ts +113 -0
  293. package/dist/mjs/types/response/unified.js +2 -0
  294. package/dist/mjs/types/response/unified.js.map +1 -0
  295. package/dist/mjs/types/response/wallet.d.ts +181 -0
  296. package/dist/mjs/types/response/wallet.js +2 -0
  297. package/dist/mjs/types/response/wallet.js.map +1 -0
  298. package/dist/mjs/types/response/withdrawal.d.ts +12 -0
  299. package/dist/mjs/types/response/withdrawal.js +2 -0
  300. package/dist/mjs/types/response/withdrawal.js.map +1 -0
  301. package/dist/mjs/types/shared.d.ts +16 -0
  302. package/dist/mjs/types/shared.js +2 -0
  303. package/dist/mjs/types/shared.js.map +1 -0
  304. package/dist/mjs/types/websockets/client.d.ts +44 -0
  305. package/dist/mjs/types/websockets/client.js +5 -0
  306. package/dist/mjs/types/websockets/client.js.map +1 -0
  307. package/dist/mjs/types/websockets/events.d.ts +5 -0
  308. package/dist/mjs/types/websockets/events.js +2 -0
  309. package/dist/mjs/types/websockets/events.js.map +1 -0
  310. package/dist/mjs/types/websockets/requests.d.ts +36 -0
  311. package/dist/mjs/types/websockets/requests.js +2 -0
  312. package/dist/mjs/types/websockets/requests.js.map +1 -0
  313. package/dist/mjs/types/websockets/wsAPI.d.ts +101 -0
  314. package/dist/mjs/types/websockets/wsAPI.js +7 -0
  315. package/dist/mjs/types/websockets/wsAPI.js.map +1 -0
  316. package/package.json +49 -38
  317. package/index.js +0 -1
  318. package/lib/index.d.ts +0 -1
  319. package/lib/index.js +0 -16
  320. package/lib/index.js.map +0 -1
@@ -0,0 +1,2534 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { BaseRestClient, RestClientType } from './lib/BaseRestClient.js';
3
+ import { RestClientOptions } from './lib/requestUtils.js';
4
+ import { CreateStpGroupReq } from './types/request/account.js';
5
+ import { GetLoanCollateralRecordsReq, GetLoanOrdersReq, GetLoanRepaymentHistoryReq, SubmitLoanOrderReq, UpdateLoanCollateralReq } from './types/request/collateralLoan.js';
6
+ import { GetDeliveryAutoOrdersReq, GetDeliveryBookReq, GetDeliveryCandlesReq, GetDeliveryClosedPositionsReq, GetDeliveryLiquidationHistoryReq, GetDeliveryOrderBookReq, GetDeliveryOrdersReq, GetDeliverySettlementHistoryReq, GetDeliveryTradesReq, GetDeliveryTradingHistoryReq, SubmitDeliveryFuturesOrderReq } from './types/request/delivery.js';
7
+ import { GetStructuredProductListReq, GetStructuredProductOrdersReq } from './types/request/earn.js';
8
+ import { GetLendingInterestRecordsReq, GetLendingOrdersReq, GetLendingRecordsReq, SubmitLendOrRedeemReq } from './types/request/earnuni.js';
9
+ import { GetFlashSwapOrdersReq, SubmitFlashSwapOrderPreviewReq, SubmitFlashSwapOrderReq } from './types/request/flashswap.js';
10
+ import { DeleteAllFuturesOrdersReq, GetFuturesAccountBookReq, GetFuturesAutoOrdersReq, GetFuturesCandlesReq, GetFuturesLiquidationHistoryReq, GetFuturesOrderBookReq, GetFuturesOrdersByTimeRangeReq, GetFuturesOrdersReq, GetFuturesPositionHistoryReq, GetFuturesPositionsReq, GetFuturesStatsReq, GetFuturesTradesReq, GetFuturesTradingHistoryReq, GetLiquidationHistoryReq, GetRiskLimitTiersReq, SubmitFuturesOrderReq, SubmitFuturesTriggeredOrderReq, UpdateDualModePositionLeverageReq, UpdateDualModePositionMarginReq, UpdateFuturesOrderReq } from './types/request/futures.js';
11
+ import { GetCrossMarginAccountHistoryReq, GetCrossMarginBorrowHistoryReq, GetCrossMarginInterestRecordsReq, GetCrossMarginRepaymentsReq, GetMarginBalanceHistoryReq, SubmitCrossMarginBorrowLoanReq } from './types/request/margin.js';
12
+ import { GetMarginUNIInterestRecordsReq, GetMarginUNILoanRecordsReq, GetMarginUNILoansReq, GetMarginUNIMaxBorrowReq } from './types/request/marginuni.js';
13
+ import { GetMultiLoanAdjustmentRecordsReq, GetMultiLoanOrdersReq, GetMultiLoanRepayRecordsReq, RepayMultiLoanReq, SubmitMultiLoanOrderReq, UpdateMultiLoanReq } from './types/request/multicollateralLoan.js';
14
+ import { GetOptionsAccountChangeReq, GetOptionsCandlesReq, GetOptionsMySettlementsReq, GetOptionsOrderBookReq, GetOptionsOrdersReq, GetOptionsPersonalHistoryReq, GetOptionsSettlementHistoryReq, GetOptionsTradesReq, GetOptionsUnderlyingCandlesReq, SubmitOptionsOrderReq } from './types/request/options.js';
15
+ import { GetAgencyCommissionHistoryReq, GetAgencyTransactionHistoryReq, GetBrokerCommissionHistoryReq, GetBrokerTransactionHistoryReq } from './types/request/rebate.js';
16
+ import { CancelSpotBatchOrdersReq, DeleteSpotOrderReq, GetSpotAccountBookReq, GetSpotAutoOrdersReq, GetSpotCandlesReq, GetSpotOrderBookReq, GetSpotOrderReq, GetSpotOrdersReq, GetSpotTradesReq, GetSpotTradingHistoryReq, SubmitSpotClosePosCrossDisabledReq, SubmitSpotOrderReq, UpdateSpotBatchOrdersReq, UpdateSpotOrderReq } from './types/request/spot.js';
17
+ import { CreateSubAccountApiKeyReq, CreateSubAccountReq, UpdateSubAccountApiKeyReq } from './types/request/subaccount.js';
18
+ import { GetUnifiedInterestRecordsReq, GetUnifiedLoanRecordsReq, GetUnifiedLoansReq, PortfolioMarginCalculatorReq, SetUnifiedAccountModeReq, SubmitUnifiedBorrowOrRepayReq } from './types/request/unified.js';
19
+ import { GetMainSubTransfersReq, GetSavedAddressReq, GetSmallBalanceHistoryReq, GetWithdrawalDepositRecordsReq, SubmitMainSubTransferReq, SubmitSubToSubTransferReq, SubmitTransferReq } from './types/request/wallet.js';
20
+ import { SubmitWithdrawalReq } from './types/request/withdrawal.js';
21
+ import { AccountDetail, StpGroup, StpGroupUser } from './types/response/account.js';
22
+ import { LoanCollateralRatio, LoanCollateralRecord, LoanOrder, LoanRepaymentHistoryRecord } from './types/response/collateralloan.js';
23
+ import { DeliveryAccount, DeliveryBook, DeliveryCandle, DeliveryClosedPosition, DeliveryLiquidationHistoryRecord, DeliveryOrderBook, DeliverySettlementHistoryRecord, DeliveryTicker, DeliveryTrade, DeliveryTradingHistoryRecord } from './types/response/delivery.js';
24
+ import { DualInvestmentOrder, DualInvestmentProduct, StructuredProduct, StructuredProductOrder } from './types/response/earn.js';
25
+ import { LendingCurrency, LendingInterestRecord, LendingOrder, LendingRecord } from './types/response/earnuni.js';
26
+ import { FlashSwapCurrencyPair, FlashSwapOrder, SubmitFlashSwapOrderPreviewResp } from './types/response/flashswap.js';
27
+ import { DeleteFuturesBatchOrdersResp, FuturesAccount, FuturesAutoDeleveragingHistoryRecord, FuturesCandle, FuturesContract, FuturesDeliveryContract, FuturesLiquidationHistoryRecord, FuturesOrder, FuturesOrderBook, FuturesPosition, FuturesPositionHistoryRecord, FuturesPriceTriggeredOrder, FuturesStats, FuturesTicker, FuturesTrade, FuturesTradingHistoryRecord, IndexConstituents, LiquidationHistoryRecord, PremiumIndexKLine, RiskLimitTier, UpdateFuturesDualModeResp } from './types/response/futures.js';
28
+ import { CrossMarginAccount, CrossMarginAccountHistoryRecord, CrossMarginCurrency, CrossMarginMorrowLoanRecord, MarginAccount, MarginBalanceHistoryRecord } from './types/response/margin.js';
29
+ import { LendingMarket, MarginUNIInterestRecord, MarginUNILoan, MarginUNILoanRecord, MarginUNIMaxBorrowable } from './types/response/marginuni.js';
30
+ import { MultiLoanAdjustmentRecord, MultiLoanCurrencyQuota, MultiLoanFixedRate, MultiLoanOrder, MultiLoanRatio, MultiLoanRepayRecord, MultiLoanSupportedCurrencies, RepayMultiLoanResp, UpdateMultiLoanResp } from './types/response/multicollateralLoan.js';
31
+ import { GetOptionsLiquidationResp, OptionsAccount, OptionsAccountChangeRecord, OptionsCandle, OptionsContract, OptionsOrderBook, OptionsPositionsUnderlying, OptionsSettlementHistoryRecord, OptionsTicker, OptionsTrade, OptionsUnderlyingCandle, OptionsUserHistoryRecord, OptionsUserSettlement, SubmitOptionsOrderResp } from './types/response/options.js';
32
+ import { AgencyCommissionHistoryRecord, AgencyTransactionHistoryRecord, BrokerCommissionHistoryRecord, BrokerTransactionHistoryRecord } from './types/response/rebate.js';
33
+ import { APIResponse } from './types/response/shared.js';
34
+ import { DeleteSpotBatchOrdersResp, GetSpotOpenOrdersResp, SpotAccount, SpotAccountBook, SpotCandle, SpotCurrency, SpotFeeRates, SpotHistoricTradeRecord, SpotOrder, SpotOrderBook, SpotPriceTriggeredOrder, SpotTicker, SpotTrade, SubmitSpotBatchOrdersResp } from './types/response/spot.js';
35
+ import { CreatedSubAccountAPIKey, SubAccount, SubAccountAPIKey } from './types/response/subaccount.js';
36
+ import { PortfolioMarginCalculation, UnifiedAccountInfo, UnifiedCurrencyDiscountTiers, UnifiedInterestRecord, UnifiedLoan, UnifiedLoanRecord, UnifiedRiskUnitDetails } from './types/response/unified.js';
37
+ import { CreateDepositAddressResp, CurrencyChain, GetBalancesResp, SavedAddress, SmallBalanceHistoryRecord, SmallBalanceRecord, SubAccountCrossMarginBalancesResp, SubAccountFuturesBalancesResp, SubAccountMarginBalance, SubAccountTransferRecord, TradingFees, WithdrawalStatus } from './types/response/wallet.js';
38
+ import { WithdrawalRecord } from './types/response/withdrawal.js';
39
+ import { CurrencyPair } from './types/shared.js';
40
+ /**
41
+ * Unified REST API client for all of Gate's REST APIs
42
+ */
43
+ export declare class RestClient extends BaseRestClient {
44
+ constructor(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig);
45
+ getClientType(): RestClientType;
46
+ getSystemMaintenanceStatus(): Promise<APIResponse<any>>;
47
+ /**================================================================================================================================
48
+ * WITHDRAW
49
+ * ==========================================================================================================================
50
+ */
51
+ /**
52
+ * Withdraw
53
+ *
54
+ * Withdrawals to Gate addresses do not incur transaction fees.
55
+ *
56
+ * @param params Withdrawal parameters
57
+ * @returns Promise<APIResponse<Withdraw>>
58
+ */
59
+ submitWithdrawal(params: SubmitWithdrawalReq): Promise<APIResponse<WithdrawalRecord>>;
60
+ /**
61
+ * Cancel withdrawal with specified ID
62
+ *
63
+ * @param params Parameters containing the withdrawal ID
64
+ * @returns Promise<APIResponse<Withdraw>>
65
+ */
66
+ cancelWithdrawal(params: {
67
+ withdrawal_id: string;
68
+ }): Promise<APIResponse<WithdrawalRecord>>;
69
+ /**==========================================================================================================================
70
+ * WALLET
71
+ * ==========================================================================================================================
72
+ */
73
+ /**
74
+ * List chains supported for specified currency
75
+ *
76
+ * @param params Parameters containing the currency name
77
+ * @returns Promise<APIResponse< GetCurrencyChainsResp[][]>>
78
+ */
79
+ getCurrencyChains(params: {
80
+ currency: string;
81
+ }): Promise<APIResponse<CurrencyChain[]>>;
82
+ /**
83
+ * Generate currency deposit address
84
+ *
85
+ * @param params Parameters containing the currency name
86
+ * @returns Promise<APIResponse<CreateDepositAddressResp>>
87
+ */
88
+ createDepositAddress(params: {
89
+ currency: string;
90
+ }): Promise<APIResponse<CreateDepositAddressResp>>;
91
+ /**
92
+ * Retrieve withdrawal records
93
+ *
94
+ * Record time range cannot exceed 30 days
95
+ *
96
+ * @param params Parameters for filtering withdrawal records
97
+ * @returns Promise<APIResponse<Withdraw[]>>
98
+ */
99
+ getWithdrawalRecords(params?: GetWithdrawalDepositRecordsReq): Promise<APIResponse<WithdrawalRecord[]>>;
100
+ /**
101
+ * Retrieve deposit records
102
+ *
103
+ * Record time range cannot exceed 30 days
104
+ *
105
+ * @param params Parameters for filtering deposit records
106
+ * @returns Promise<APIResponse<Withdraw[]>>
107
+ */
108
+ getDepositRecords(params?: GetWithdrawalDepositRecordsReq): Promise<APIResponse<WithdrawalRecord[]>>;
109
+ /**
110
+ * Transfer between trading accounts
111
+ *
112
+ * Transfer between different accounts. Currently support transfers between the following:
113
+ * - spot - margin
114
+ * - spot - futures(perpetual)
115
+ * - spot - delivery
116
+ * - spot - cross margin
117
+ * - spot - options
118
+ *
119
+ * @param params Transfer parameters
120
+ * @returns Promise<APIResponse<TransferResponse>>
121
+ */
122
+ submitTransfer(params: SubmitTransferReq): Promise<APIResponse<{
123
+ tx_id: number;
124
+ }>>;
125
+ /**
126
+ * Transfer between main and sub accounts
127
+ *
128
+ * Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated.
129
+ *
130
+ * @param params Transfer parameters
131
+ * @returns Promise<APIResponse<any>>
132
+ */
133
+ submitMainSubTransfer(params: SubmitMainSubTransferReq): Promise<APIResponse<any>>;
134
+ /**
135
+ * Retrieve transfer records between main and sub accounts
136
+ *
137
+ * Record time range cannot exceed 30 days
138
+ *
139
+ * Note: only records after 2020-04-10 can be retrieved
140
+ *
141
+ * @param params Parameters for filtering transfer records
142
+ * @returns Promise<APIResponse<SubAccountTransferRecordResp[]>>
143
+ */
144
+ getMainSubTransfers(params?: GetMainSubTransfersReq): Promise<APIResponse<SubAccountTransferRecord[]>>;
145
+ /**
146
+ * Sub-account transfers to sub-account
147
+ *
148
+ * It is possible to perform balance transfers between two sub-accounts under the same main account. You can use either the API Key of the main account or the API Key of the sub-account to initiate the transfer.
149
+ *
150
+ * @param params Transfer parameters
151
+ * @returns Promise<APIResponse<any>>
152
+ */
153
+ submitSubToSubTransfer(params: SubmitSubToSubTransferReq): Promise<APIResponse<any>>;
154
+ /**
155
+ * Retrieve withdrawal status
156
+ *
157
+ * @param params Parameters for retrieving withdrawal status
158
+ * @returns Promise<APIResponse<GetWithdrawalStatusResp[]>>
159
+ */
160
+ getWithdrawalStatus(params?: {
161
+ currency?: string;
162
+ }): Promise<APIResponse<WithdrawalStatus[]>>;
163
+ /**
164
+ * Retrieve sub account balances
165
+ *
166
+ * @param params Parameters for retrieving sub account balances
167
+ * @returns Promise<APIResponse<{
168
+ uid: string;
169
+ available: { [key: string]: string };
170
+ }[]>>
171
+ */
172
+ getSubBalance(params?: {
173
+ sub_uid?: string;
174
+ }): Promise<APIResponse<{
175
+ uid: string;
176
+ available: {
177
+ [key: string]: string;
178
+ };
179
+ }[]>>;
180
+ /**
181
+ * Query sub accounts' margin balances
182
+ *
183
+ * @param params Parameters for querying sub accounts' margin balances
184
+ * @returns Promise<APIResponse<SubAccountMarginBalancesResp[]>>
185
+ */
186
+ getSubMarginBalances(params?: {
187
+ sub_uid?: string;
188
+ }): Promise<APIResponse<{
189
+ uid: string;
190
+ available: SubAccountMarginBalance[];
191
+ }>>;
192
+ /**
193
+ * Query sub accounts' futures account balances
194
+ *
195
+ * @param params Parameters for querying sub accounts' futures account balances
196
+ * @returns Promise<APIResponse<SubAccountFuturesBalancesResp[]>>
197
+ */
198
+ getSubFuturesBalances(params?: {
199
+ sub_uid?: string;
200
+ settle?: string;
201
+ }): Promise<APIResponse<SubAccountFuturesBalancesResp[]>>;
202
+ /**
203
+ * Query subaccount's cross_margin account info
204
+ *
205
+ * @param params Parameters for querying subaccount's cross_margin account info
206
+ * @returns Promise<APIResponse<SubAccountCrossMarginBalancesResp[]>>
207
+ */
208
+ getSubCrossMarginBalances(params?: {
209
+ sub_uid?: string;
210
+ }): Promise<APIResponse<SubAccountCrossMarginBalancesResp[]>>;
211
+ /**
212
+ * Query saved addresses
213
+ *
214
+ * @param params Parameters for querying saved address
215
+ * @returns Promise<APIResponse<GetSavedAddressResp[]>>
216
+ */
217
+ getSavedAddresses(params: GetSavedAddressReq): Promise<APIResponse<SavedAddress[]>>;
218
+ /**
219
+ * Retrieve personal trading fee
220
+ *
221
+ * @param params Parameters for retrieving personal trading fee
222
+ * @returns Promise<APIResponse<GetTradingFeesResp>>
223
+ */
224
+ getTradingFees(params?: {
225
+ currency_pair?: string;
226
+ settle?: 'BTC' | 'USDT' | 'USD';
227
+ }): Promise<APIResponse<TradingFees>>;
228
+ /**
229
+ * Retrieve user's total balances
230
+ *
231
+ * This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.
232
+ * The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation.
233
+ *
234
+ * For trading calculation, use the corresponding account query endpoint for each account type. For example:
235
+ * - GET /spot/accounts to query spot account balance
236
+ * - GET /margin/accounts to query margin account balance
237
+ * - GET /futures/{settle}/accounts to query futures account balance
238
+ *
239
+ * @param params Parameters for retrieving total balances
240
+ * @returns Promise<APIResponse<GetBalancesResp>>
241
+ */
242
+ getBalances(params?: {
243
+ currency?: string;
244
+ }): Promise<APIResponse<GetBalancesResp>>;
245
+ /**
246
+ * List small balance
247
+ *
248
+ * @returns Promise<APIResponse<GetSmallBalancesResp>>
249
+ */
250
+ getSmallBalances(): Promise<APIResponse<SmallBalanceRecord>>;
251
+ /**
252
+ * Convert small balance
253
+ *
254
+ * @param params Parameters for converting small balance
255
+ * @returns Promise<APIResponse<any>>
256
+ */
257
+ convertSmallBalance(params?: {
258
+ currency?: string[];
259
+ }): Promise<APIResponse<any>>;
260
+ /**
261
+ * List small balance history
262
+ *
263
+ * @param params Parameters for listing small balance history
264
+ * @returns Promise<APIResponse<GetSmallBalanceHistoryResp[]>>
265
+ */
266
+ getSmallBalanceHistory(params?: GetSmallBalanceHistoryReq): Promise<APIResponse<SmallBalanceHistoryRecord[]>>;
267
+ /**==========================================================================================================================
268
+ * SUBACCOUNT
269
+ * ==========================================================================================================================
270
+ */
271
+ /**
272
+ * Create a new sub-account
273
+ *
274
+ * @param params Parameters for creating a new sub-account
275
+ * @returns Promise<APIResponse<CreateSubAccountResp>>
276
+ */
277
+ createSubAccount(params: CreateSubAccountReq): Promise<APIResponse<SubAccount>>;
278
+ /**
279
+ * List sub-accounts
280
+ *
281
+ * @param params Parameters for listing sub-accounts
282
+ * @returns Promise<APIResponse<GetSubAccountsResp[]>>
283
+ */
284
+ getSubAccounts(params?: {
285
+ type?: string;
286
+ }): Promise<APIResponse<SubAccount[]>>;
287
+ /**
288
+ * Get the sub-account
289
+ *
290
+ * @param params Parameters containing the sub-account user ID
291
+ * @returns Promise<APIResponse<SubAccountResp>>
292
+ */
293
+ getSubAccount(params: {
294
+ user_id: number;
295
+ }): Promise<APIResponse<SubAccount>>;
296
+ /**
297
+ * Create API Key of the sub-account
298
+ *
299
+ * @param params Parameters for creating API Key of the sub-account
300
+ * @returns Promise<APIResponse<CreateSubAccountApiKeyResp>>
301
+ */
302
+ createSubAccountApiKey(params: CreateSubAccountApiKeyReq): Promise<APIResponse<CreatedSubAccountAPIKey>>;
303
+ /**
304
+ * List all API Key of the sub-account
305
+ *
306
+ * @param params Parameters containing the sub-account user ID
307
+ * @returns Promise<APIResponse<SubAccountKey[]>>
308
+ */
309
+ getSubAccountApiKeys(params: {
310
+ user_id: number;
311
+ }): Promise<APIResponse<SubAccountAPIKey[]>>;
312
+ /**
313
+ * Update API key of the sub-account
314
+ *
315
+ * @param params Parameters for updating API key of the sub-account
316
+ * @returns Promise<APIResponse<any>>
317
+ */
318
+ updateSubAccountApiKey(params: UpdateSubAccountApiKeyReq): Promise<APIResponse<any>>;
319
+ /**
320
+ * Delete API key of the sub-account
321
+ *
322
+ * @param params Parameters for deleting API key of the sub-account
323
+ * @returns Promise<APIResponse<any>>
324
+ */
325
+ deleteSubAccountApiKey(params: {
326
+ user_id: number;
327
+ key: string;
328
+ }): Promise<APIResponse<any>>;
329
+ /**
330
+ * Get the API Key of the sub-account
331
+ *
332
+ * @param params Parameters containing the sub-account user ID and API key
333
+ * @returns Promise<APIResponse<SubAccountKey>>
334
+ */
335
+ getSubAccountApiKey(params: {
336
+ user_id: number;
337
+ key: string;
338
+ }): Promise<APIResponse<SubAccountAPIKey>>;
339
+ /**
340
+ * Lock the sub-account
341
+ *
342
+ * @param params Parameters containing the sub-account user ID
343
+ * @returns Promise<APIResponse<any>>
344
+ */
345
+ lockSubAccount(params: {
346
+ user_id: number;
347
+ }): Promise<APIResponse<any>>;
348
+ /**
349
+ * Unlock the sub-account
350
+ *
351
+ * @param params Parameters containing the sub-account user ID
352
+ * @returns Promise<APIResponse<any>>
353
+ */
354
+ unlockSubAccount(params: {
355
+ user_id: number;
356
+ }): Promise<APIResponse<any>>;
357
+ /**==========================================================================================================================
358
+ * UNIFIED
359
+ * ==========================================================================================================================
360
+ */
361
+ /**
362
+ * Get unified account information
363
+ *
364
+ * The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account.
365
+ *
366
+ * @param params Parameters for retrieving unified account information
367
+ * @returns Promise<APIResponse<GetUnifiedAccountInfoResp>>
368
+ */
369
+ getUnifiedAccountInfo(params?: {
370
+ currency?: string;
371
+ }): Promise<APIResponse<UnifiedAccountInfo>>;
372
+ /**
373
+ * Query about the maximum borrowing for the unified account
374
+ *
375
+ * @param params Parameters for querying the maximum borrowing for the unified account
376
+ * @returns Promise<APIResponse<{
377
+ * currency: string;
378
+ * amount: string;
379
+ * }>>
380
+ */
381
+ getUnifiedMaxBorrow(params: {
382
+ currency: string;
383
+ }): Promise<APIResponse<{
384
+ currency: string;
385
+ amount: string;
386
+ }>>;
387
+ /**
388
+ * Query about the maximum transferable for the unified account
389
+ *
390
+ * @param params Parameters for querying the maximum transferable for the unified account
391
+ * @returns Promise<APIResponse<{
392
+ * currency: string;
393
+ * amount: string;
394
+ * }>>
395
+ */
396
+ getUnifiedMaxTransferable(params: {
397
+ currency: string;
398
+ }): Promise<APIResponse<{
399
+ currency: string;
400
+ amount: string;
401
+ }>>;
402
+ /**
403
+ * Borrow or repay
404
+ *
405
+ * When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user.
406
+ *
407
+ * The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount.
408
+ *
409
+ * For repayment, the option to repay the entire borrowed amount is available by setting the parameter repaid_all=true
410
+ *
411
+ * @param params Parameters for borrowing or repaying
412
+ * @returns Promise<APIResponse<any>>
413
+ */
414
+ submitUnifiedBorrowOrRepay(params: SubmitUnifiedBorrowOrRepayReq): Promise<APIResponse<any>>;
415
+ /**
416
+ * List loans
417
+ *
418
+ * @param params Parameters for listing loans
419
+ * @returns Promise<APIResponse<GetUnifiedLoansResp[]>>
420
+ */
421
+ getUnifiedLoans(params?: GetUnifiedLoansReq): Promise<APIResponse<UnifiedLoan[]>>;
422
+ /**
423
+ * Get loan records
424
+ *
425
+ * @param params Parameters for getting loan records
426
+ * @returns Promise<APIResponse<GetUnifiedLoanRecordsResp[]>>
427
+ */
428
+ getUnifiedLoanRecords(params?: GetUnifiedLoanRecordsReq): Promise<APIResponse<UnifiedLoanRecord[]>>;
429
+ /**
430
+ * List interest records
431
+ *
432
+ * @param params Parameters for listing interest records
433
+ * @returns Promise<APIResponse<GetUnifiedInterestRecordsResp[]>>
434
+ */
435
+ getUnifiedInterestRecords(params?: GetUnifiedInterestRecordsReq): Promise<APIResponse<UnifiedInterestRecord[]>>;
436
+ /**
437
+ * Retrieve user risk unit details, only valid in portfolio margin mode
438
+ *
439
+ * @returns Promise<APIResponse<GetUnifiedRiskUnitDetailsResp>>
440
+ */
441
+ getUnifiedRiskUnitDetails(): Promise<APIResponse<UnifiedRiskUnitDetails>>;
442
+ /**
443
+ * Set mode of the unified account
444
+ *
445
+ * Switching between different account modes requires only passing the parameters corresponding to the target account mode. It also supports opening or closing configuration switches for the corresponding account mode when switching.
446
+ *
447
+ * @param params Parameters for setting the mode of the unified account
448
+ * @returns Promise<APIResponse<any>>
449
+ */
450
+ setUnifiedAccountMode(params: SetUnifiedAccountModeReq): Promise<APIResponse<any>>;
451
+ /**
452
+ * Query mode of the unified account
453
+ *
454
+ * @returns Promise<APIResponse<{
455
+ * mode: 'classic' | 'multi_currency' | 'portfolio';
456
+ * settings: {
457
+ * usdt_futures?: boolean;
458
+ * spot_hedge?: boolean;
459
+ * };
460
+ * }>>
461
+ */
462
+ getUnifiedAccountMode(): Promise<APIResponse<SetUnifiedAccountModeReq>>;
463
+ /**
464
+ * Get unified estimate rate
465
+ *
466
+ * Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. When a currency is not supported, the interest rate returned will be an empty string.
467
+ *
468
+ * @param params Parameters for querying estimate rates
469
+ * @returns Promise<APIResponse<{ [key: string]: string }>>
470
+ */
471
+ getUnifiedEstimateRate(params: {
472
+ currencies: string[];
473
+ }): Promise<APIResponse<{
474
+ [key: string]: string;
475
+ }>>;
476
+ /**
477
+ * List currency discount tiers
478
+ *
479
+ * @returns Promise<APIResponse<GetUnifiedCurrencyDiscountTiersResp[]>>
480
+ */
481
+ getUnifiedCurrencyDiscountTiers(): Promise<APIResponse<UnifiedCurrencyDiscountTiers[]>>;
482
+ /**
483
+ * Portfolio margin calculator
484
+ *
485
+ * Portfolio Margin Calculator When inputting a simulated position portfolio, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included.
486
+ *
487
+ * @param params Parameters for portfolio margin calculator
488
+ * @returns Promise<APIResponse<PortfolioMarginCalculatorResp>>
489
+ */
490
+ portfolioMarginCalculate(params: PortfolioMarginCalculatorReq): Promise<APIResponse<PortfolioMarginCalculation>>;
491
+ /**==========================================================================================================================
492
+ * SPOT
493
+ * ==========================================================================================================================
494
+ */
495
+ /**
496
+ * List all currencies' details
497
+ *
498
+ * Currency has two forms:
499
+ * - Only currency name, e.g., BTC, USDT
500
+ * - <currency>_<chain>, e.g., HT_ETH
501
+ *
502
+ * The latter one occurs when one currency has multiple chains. Currency detail contains a chain field whatever the form is. To retrieve all chains of one currency, you can use all the details which have the name of the currency or name starting with <currency>_.
503
+ *
504
+ * @returns Promise<APIResponse<GetSpotCurrenciesResp[]>>
505
+ */
506
+ getSpotCurrencies(): Promise<APIResponse<SpotCurrency[]>>;
507
+ /**
508
+ * Get details of a specific currency
509
+ *
510
+ * @param params Parameters for retrieving details of a specific currency
511
+ * @returns Promise<APIResponse<GetSpotCurrenciesResp>>
512
+ */
513
+ getSpotCurrency(params: {
514
+ currency: string;
515
+ }): Promise<APIResponse<SpotCurrency>>;
516
+ /**
517
+ * List all currency pairs supported
518
+ *
519
+ * @returns Promise<APIResponse<CurrencyPair[]>>
520
+ */
521
+ getSpotCurrencyPairs(): Promise<APIResponse<CurrencyPair[]>>;
522
+ /**
523
+ * Get details of a specific currency pair
524
+ *
525
+ * @param params Parameters for retrieving details of a specific currency pair
526
+ * @returns Promise<APIResponse<CurrencyPair>>
527
+ */
528
+ getSpotCurrencyPair(params: {
529
+ currency_pair: string;
530
+ }): Promise<APIResponse<CurrencyPair>>;
531
+ /**
532
+ * Retrieve ticker information
533
+ *
534
+ * Return only related data if currency_pair is specified; otherwise return all of them.
535
+ *
536
+ * @param params Parameters for retrieving ticker information
537
+ * @returns Promise<APIResponse<GetSpotTickerResp[]>>
538
+ */
539
+ getSpotTicker(params?: {
540
+ currency_pair?: string;
541
+ timezone?: 'utc0' | 'utc8' | 'all';
542
+ }): Promise<APIResponse<SpotTicker[]>>;
543
+ /**
544
+ * Retrieve order book
545
+ *
546
+ * Order book will be sorted by price from high to low on bids; low to high on asks.
547
+ *
548
+ * @param params Parameters for retrieving order book
549
+ * @returns Promise<APIResponse<GetSpotOrderBookResp>>
550
+ */
551
+ getSpotOrderBook(params: GetSpotOrderBookReq): Promise<APIResponse<SpotOrderBook>>;
552
+ /**
553
+ * Retrieve market trades
554
+ *
555
+ * You can use from and to to query by time range, or use last_id by scrolling page. The default behavior is by time range.
556
+ * Scrolling query using last_id is not recommended any more. If last_id is specified, time range query parameters will be ignored.
557
+ *
558
+ * @param params Parameters for retrieving market trades
559
+ * @returns Promise<APIResponse<GetSpotTradesResp[]>>
560
+ */
561
+ getSpotTrades(params: GetSpotTradesReq): Promise<APIResponse<SpotTrade[]>>;
562
+ /**
563
+ * Market Candles
564
+ *
565
+ * Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
566
+ *
567
+ * @param params Parameters for retrieving market Candles
568
+ * @returns Promise<APIResponse<GetSpotCandlesResp>>
569
+ */
570
+ getSpotCandles(params: GetSpotCandlesReq): Promise<APIResponse<SpotCandle[]>>;
571
+ /**
572
+ * Query user trading fee rates
573
+ *
574
+ * This API is deprecated in favour of new fee retrieving API /wallet/fee.
575
+ *
576
+ * @param params Parameters for querying user trading fee rates
577
+ * @returns Promise<APIResponse<GetSpotFeeRatesResp>>
578
+ */
579
+ getSpotFeeRates(params?: {
580
+ currency_pair?: string;
581
+ }): Promise<APIResponse<SpotFeeRates>>;
582
+ /**
583
+ * Query a batch of user trading fee rates
584
+ *
585
+ * @param params Parameters for querying a batch of user trading fee rates
586
+ */
587
+ getSpotBatchFeeRates(params: {
588
+ currency_pairs: string;
589
+ }): Promise<APIResponse<Record<string, SpotFeeRates>>>;
590
+ /**
591
+ * List spot accounts
592
+ *
593
+ * @param params Parameters for listing spot accounts
594
+ * @returns Promise<APIResponse<GetSpotAccountsResp[]>>
595
+ */
596
+ getSpotAccounts(params?: {
597
+ currency?: string;
598
+ }): Promise<APIResponse<SpotAccount[]>>;
599
+ /**
600
+ * Query account book
601
+ *
602
+ * Record time range cannot exceed 30 days.
603
+ *
604
+ * @param params Parameters for querying account book
605
+ * @returns Promise<APIResponse<GetSpotAccountBookResp[]>>
606
+ */
607
+ getSpotAccountBook(params?: GetSpotAccountBookReq): Promise<APIResponse<SpotAccountBook[]>>;
608
+ /**
609
+ * Create a batch of orders
610
+ *
611
+ * Batch orders requirements:
612
+ * - custom order field text is required
613
+ * - At most 4 currency pairs, maximum 10 orders each, are allowed in one request
614
+ * - No mixture of spot orders and margin orders, i.e. account must be identical for all orders
615
+ *
616
+ * @param params Parameters for creating a batch of orders
617
+ * @returns Promise<APIResponse<SubmitSpotBatchOrdersResp[]>>
618
+ */
619
+ submitSpotBatchOrders(params: SpotOrder[]): Promise<APIResponse<SubmitSpotBatchOrdersResp[]>>;
620
+ /**
621
+ * List all open orders
622
+ *
623
+ * List open orders in all currency pairs.
624
+ * Note that pagination parameters affect record number in each currency pair's open order list. No pagination is applied to the number of currency pairs returned. All currency pairs with open orders will be returned.
625
+ * Spot, portfolio, and margin orders are returned by default. To list cross margin orders, account must be set to cross_margin.
626
+ *
627
+ * @param params Parameters for listing all open orders
628
+ * @returns Promise<APIResponse<GetSpotOpenOrdersResp[]>>
629
+ */
630
+ getSpotOpenOrders(params?: {
631
+ page?: number;
632
+ limit?: number;
633
+ account?: 'spot' | 'margin' | 'cross_margin' | 'unified';
634
+ }): Promise<APIResponse<GetSpotOpenOrdersResp[]>>;
635
+ /**
636
+ * Close position when cross-currency is disabled
637
+ *
638
+ * Currently, only cross-margin accounts are supported to close position when cross currencies are disabled. Maximum buy quantity = (unpaid principal and interest - currency balance - the amount of the currency in the order book) / 0.998
639
+ *
640
+ * @param params Parameters for closing position when cross-currency is disabled
641
+ * @returns Promise<APIResponse<Order>>
642
+ */
643
+ submitSpotClosePosCrossDisabled(params: SubmitSpotClosePosCrossDisabledReq): Promise<APIResponse<SpotOrder>>;
644
+ /**
645
+ * Create an order
646
+ *
647
+ * You can place orders with spot, portfolio, margin or cross margin account through setting the account field. It defaults to spot, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account.
648
+ *
649
+ * @param params Parameters for creating an order
650
+ * @returns Promise<APIResponse<Order>>
651
+ */
652
+ submitSpotOrder(params: SubmitSpotOrderReq): Promise<APIResponse<SpotOrder>>;
653
+ /**
654
+ * List orders
655
+ *
656
+ * Spot, portfolio and margin orders are returned by default. If cross margin orders are needed, account must be set to cross_margin.
657
+ *
658
+ * @param params Parameters for listing orders
659
+ * @returns Promise<APIResponse<Order[]>>
660
+ */
661
+ getSpotOrders(params: GetSpotOrdersReq): Promise<APIResponse<SpotOrder[]>>;
662
+ /**
663
+ * Cancel all open orders in specified currency pair
664
+ *
665
+ * If account is not set, all open orders, including spot, portfolio, margin and cross margin ones, will be cancelled.
666
+ * You can set account to cancel only orders within the specified account.
667
+ *
668
+ * @param params Parameters for cancelling all open orders in specified currency pair
669
+ * @returns Promise<APIResponse<Order[]>>
670
+ */
671
+ cancelSpotOpenOrders(params: {
672
+ currency_pair: string;
673
+ side?: 'buy' | 'sell';
674
+ account?: 'spot' | 'margin' | 'cross_margin' | 'unified';
675
+ action_mode?: 'ACK' | 'RESULT' | 'FULL';
676
+ }): Promise<APIResponse<SpotOrder[]>>;
677
+ /**
678
+ * Cancel a batch of orders with an ID list
679
+ *
680
+ * Multiple currency pairs can be specified, but maximum 20 orders are allowed per request.
681
+ *
682
+ * @param params Parameters for cancelling a batch of orders
683
+ * @returns Promise<APIResponse<DeleteSpotBatchOrdersResp[]>>
684
+ */
685
+ batchCancelSpotOrders(params: CancelSpotBatchOrdersReq[]): Promise<APIResponse<DeleteSpotBatchOrdersResp[]>>;
686
+ /**
687
+ * Get a single order
688
+ *
689
+ * Spot, portfolio and margin orders are queried by default. If cross margin orders are needed or portfolio margin account are used, account must be set to cross_margin.
690
+ *
691
+ * @param params Parameters for getting a single order
692
+ * @returns Promise<APIResponse<Order>>
693
+ */
694
+ getSpotOrder(params: GetSpotOrderReq): Promise<APIResponse<SpotOrder>>;
695
+ /**
696
+ * Amend an order
697
+ *
698
+ * By default, the orders of spot, portfolio and margin account are updated. If you need to modify orders of the cross-margin account, you must specify account as cross_margin. For portfolio margin account, only cross_margin account is supported.
699
+ *
700
+ * Currently, only supports modification of price or amount fields.
701
+ *
702
+ * @param params Parameters for amending an order
703
+ * @returns Promise<APIResponse<Order>>
704
+ */
705
+ updateSpotOrder(params: UpdateSpotOrderReq): Promise<APIResponse<SpotOrder>>;
706
+ /**
707
+ * Cancel a single order
708
+ *
709
+ * Spot, portfolio and margin orders are cancelled by default. If trying to cancel cross margin orders or portfolio margin account are used, account must be set to cross_margin.
710
+ *
711
+ * @param params Parameters for cancelling a single order
712
+ * @returns Promise<APIResponse<Order>>
713
+ */
714
+ cancelSpotOrder(params: DeleteSpotOrderReq): Promise<APIResponse<SpotOrder>>;
715
+ /**
716
+ * List personal trading history
717
+ *
718
+ * Spot, portfolio and margin trades are queried by default. If cross margin trades are needed, account must be set to cross_margin.
719
+ *
720
+ * You can also set from and/or to to query by time range. If you don't specify from and/or to parameters, only the last 7 days of data will be returned. The range of from and to is not allowed to exceed 30 days. Time range parameters are handled as order finish time.
721
+ *
722
+ * @param params Parameters for listing personal trading history
723
+ * @returns Promise<APIResponse<GetSpotTradingHistoryResp[]>>
724
+ */
725
+ getSpotTradingHistory(params?: GetSpotTradingHistoryReq): Promise<APIResponse<SpotHistoricTradeRecord[]>>;
726
+ /**
727
+ * Get server current time
728
+ *
729
+ * @returns Promise<APIResponse<{
730
+ * server_time: number;
731
+ * }>>
732
+ */
733
+ getServerTime(): Promise<APIResponse<{
734
+ server_time: number;
735
+ }>>;
736
+ /**
737
+ * Countdown cancel orders
738
+ *
739
+ * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown.
740
+ *
741
+ * @param params Parameters for setting countdown cancel orders
742
+ * @returns Promise<APIResponse<{
743
+ * triggerTime: number;
744
+ * }>>
745
+ */
746
+ submitSpotCountdownOrders(params: {
747
+ timeout: number;
748
+ currency_pair?: string;
749
+ }): Promise<APIResponse<{
750
+ triggerTime: number;
751
+ }>>;
752
+ /**
753
+ * Batch modification of orders
754
+ *
755
+ * Default modification of orders for spot, portfolio, and margin accounts. To modify orders for a cross margin account, the account parameter must be specified as cross_margin. For portfolio margin accounts, the account parameter can only be specified as cross_margin. Currently, only modifications to price or quantity (choose one) are supported.
756
+ *
757
+ * @param params Parameters for batch modification of orders
758
+ * @returns Promise<APIResponse<Order[]>>
759
+ */
760
+ batchUpdateSpotOrders(params: UpdateSpotBatchOrdersReq[]): Promise<APIResponse<SpotOrder[]>>;
761
+ /**
762
+ * Create a price-triggered order
763
+ *
764
+ * @param params Parameters for creating a price-triggered order
765
+ * @returns Promise<APIResponse<{
766
+ * id: number;
767
+ * }>>
768
+ */
769
+ submitSpotPriceTriggerOrder(params: SpotPriceTriggeredOrder): Promise<APIResponse<{
770
+ id: number;
771
+ }>>;
772
+ /**
773
+ * Retrieve running auto order list
774
+ *
775
+ * @param params Parameters for retrieving running auto order list
776
+ * @returns Promise<APIResponse<SpotPriceTriggeredOrder[]>>
777
+ */
778
+ getSpotAutoOrders(params: GetSpotAutoOrdersReq): Promise<APIResponse<SpotPriceTriggeredOrder[]>>;
779
+ /**
780
+ * Cancel all open orders
781
+ *
782
+ * @param params Parameters for cancelling all open orders
783
+ * @returns Promise<APIResponse<SpotPriceTriggeredOrder[]>>
784
+ */
785
+ cancelAllOpenSpotOrders(params?: {
786
+ market?: string;
787
+ account?: 'normal' | 'margin' | 'cross_margin';
788
+ }): Promise<APIResponse<SpotPriceTriggeredOrder[]>>;
789
+ /**
790
+ * Get a price-triggered order
791
+ *
792
+ * @param params Parameters for getting a price-triggered order
793
+ * @returns Promise<APIResponse<SpotPriceTriggeredOrder>>
794
+ */
795
+ getPriceTriggeredOrder(params: {
796
+ order_id: string;
797
+ }): Promise<APIResponse<SpotPriceTriggeredOrder>>;
798
+ /**
799
+ * Cancel a price-triggered order
800
+ *
801
+ * @param params Parameters for cancelling a price-triggered order
802
+ * @returns Promise<APIResponse<SpotPriceTriggeredOrder>>
803
+ */
804
+ cancelSpotTriggeredOrder(params: {
805
+ order_id: string;
806
+ }): Promise<APIResponse<SpotPriceTriggeredOrder>>;
807
+ /**==========================================================================================================================
808
+ * MARGIN
809
+ * ==========================================================================================================================
810
+ */
811
+ /**
812
+ * Margin account list
813
+ *
814
+ * @param params Parameters for listing margin accounts
815
+ * @returns Promise<APIResponse<GetMarginAccountsResp[]>>
816
+ */
817
+ getMarginAccounts(params?: {
818
+ currency_pair?: string;
819
+ }): Promise<APIResponse<MarginAccount[]>>;
820
+ /**
821
+ * List margin account balance change history
822
+ *
823
+ * Only transferals from and to margin account are provided for now. Time range allows 30 days at most.
824
+ *
825
+ * @param params Parameters for listing margin account balance change history
826
+ * @returns Promise<APIResponse<GetMarginBalanceHistoryResp[]>>
827
+ */
828
+ getMarginBalanceHistory(params?: GetMarginBalanceHistoryReq): Promise<APIResponse<MarginBalanceHistoryRecord[]>>;
829
+ /**
830
+ * Funding account list
831
+ *
832
+ * @param params Parameters for listing funding accounts
833
+ * @returns Promise<APIResponse<{
834
+ * currency: string;
835
+ * available: string;
836
+ * locked: string;
837
+ * lent: string;
838
+ * total_lent: string;
839
+ * }[]>>
840
+ */
841
+ getFundingAccounts(params?: {
842
+ currency?: string;
843
+ }): Promise<APIResponse<{
844
+ currency: string;
845
+ available: string;
846
+ locked: string;
847
+ lent: string;
848
+ total_lent: string;
849
+ }[]>>;
850
+ /**
851
+ * Update user's auto repayment setting
852
+ *
853
+ * @param params Parameters for updating auto repayment setting
854
+ * @returns Promise<APIResponse<{ status: 'on' | 'off' }>>
855
+ */
856
+ updateAutoRepaymentSetting(params: {
857
+ status: 'on' | 'off';
858
+ }): Promise<APIResponse<{
859
+ status: 'on' | 'off';
860
+ }>>;
861
+ /**
862
+ * Retrieve user auto repayment setting
863
+ *
864
+ * @returns Promise<APIResponse<{ status: 'on' | 'off' }>>
865
+ */
866
+ getAutoRepaymentSetting(): Promise<APIResponse<{
867
+ status: 'on' | 'off';
868
+ }>>;
869
+ /**
870
+ * Get the max transferable amount for a specific margin currency
871
+ *
872
+ * @param params Parameters for retrieving the max transferable amount
873
+ * @returns Promise<APIResponse<{
874
+ * currency: string;
875
+ * currency_pair?: string;
876
+ * amount: string;
877
+ * }>>
878
+ */
879
+ getMarginTransferableAmount(params: {
880
+ currency: string;
881
+ currency_pair?: string;
882
+ }): Promise<APIResponse<{
883
+ currency: string;
884
+ currency_pair?: string;
885
+ amount: string;
886
+ }>>;
887
+ /**
888
+ * Currencies supported by cross margin
889
+ *
890
+ * @returns Promise<APIResponse<GetCrossMarginCurrenciesResp[]>>
891
+ */
892
+ getCrossMarginCurrencies(): Promise<APIResponse<CrossMarginCurrency[]>>;
893
+ /**
894
+ * Retrieve detail of one single currency supported by cross margin
895
+ *
896
+ * @param params Parameters containing the currency name
897
+ * @returns Promise<APIResponse<GetCrossMarginCurrenciesResp>>
898
+ */
899
+ getCrossMarginCurrency(params: {
900
+ currency: string;
901
+ }): Promise<APIResponse<CrossMarginCurrency>>;
902
+ /**
903
+ * Retrieve cross margin account
904
+ *
905
+ * @returns Promise<APIResponse<GetCrossMarginAccountResp>>
906
+ */
907
+ getCrossMarginAccount(): Promise<APIResponse<CrossMarginAccount>>;
908
+ /**
909
+ * Retrieve cross margin account change history
910
+ *
911
+ * Record time range cannot exceed 30 days.
912
+ *
913
+ * @param params Parameters for retrieving cross margin account change history
914
+ * @returns Promise<APIResponse<GetCrossMarginAccountHistoryResp[]>>
915
+ */
916
+ getCrossMarginAccountHistory(params?: GetCrossMarginAccountHistoryReq): Promise<APIResponse<CrossMarginAccountHistoryRecord[]>>;
917
+ /**
918
+ * Create a cross margin borrow loan
919
+ *
920
+ * Borrow amount cannot be less than currency minimum borrow amount.
921
+ *
922
+ * @param params Parameters for creating a cross margin borrow loan
923
+ * @returns Promise<APIResponse<SubmitCrossMarginBorrowLoanResp>>
924
+ */
925
+ submitCrossMarginBorrowLoan(params: SubmitCrossMarginBorrowLoanReq): Promise<APIResponse<CrossMarginMorrowLoanRecord>>;
926
+ /**
927
+ * List cross margin borrow history
928
+ *
929
+ * Sort by creation time in descending order by default. Set reverse=false to return ascending results.
930
+ *
931
+ * @param params Parameters for listing cross margin borrow history
932
+ * @returns Promise<APIResponse<SubmitCrossMarginBorrowLoanResp[]>>
933
+ */
934
+ getCrossMarginBorrowHistory(params: GetCrossMarginBorrowHistoryReq): Promise<APIResponse<CrossMarginMorrowLoanRecord[]>>;
935
+ /**
936
+ * Retrieve single borrow loan detail
937
+ *
938
+ * @param params Parameters containing the borrow loan ID
939
+ * @returns Promise<APIResponse<SubmitCrossMarginBorrowLoanResp>>
940
+ */
941
+ getCrossMarginBorrowLoan(params: {
942
+ loan_id: string;
943
+ }): Promise<APIResponse<CrossMarginMorrowLoanRecord>>;
944
+ /**
945
+ * Cross margin repayments
946
+ *
947
+ * When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred. When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first.
948
+ *
949
+ * @param params Parameters for cross margin repayments
950
+ * @returns Promise<APIResponse<SubmitCrossMarginBorrowLoanResp[]>>
951
+ */
952
+ submitCrossMarginRepayment(params: {
953
+ currency: string;
954
+ amount: string;
955
+ }): Promise<APIResponse<CrossMarginMorrowLoanRecord[]>>;
956
+ /**
957
+ * Retrieve cross margin repayments
958
+ *
959
+ * Sort by creation time in descending order by default. Set reverse=false to return ascending results.
960
+ *
961
+ * @param params Parameters for retrieving cross margin repayments
962
+ * @returns Promise<APIResponse<GetCrossMarginRepaymentsResp[]>>
963
+ */
964
+ getCrossMarginRepayments(params?: GetCrossMarginRepaymentsReq): Promise<APIResponse<CrossMarginAccount[]>>;
965
+ /**
966
+ * Interest records for the cross margin account
967
+ *
968
+ * @param params Parameters for retrieving interest records
969
+ * @returns Promise<APIResponse<GetCrossMarginInterestRecordsResp[]>>
970
+ */
971
+ getCrossMarginInterestRecords(params?: GetCrossMarginInterestRecordsReq): Promise<APIResponse<GetCrossMarginInterestRecordsReq[]>>;
972
+ /**
973
+ * Get the max transferable amount for a specific cross margin currency
974
+ *
975
+ * @param params Parameters for retrieving the max transferable amount
976
+ * @returns Promise<APIResponse<{
977
+ * currency: string;
978
+ * amount: string;
979
+ * }>>
980
+ */
981
+ getCrossMarginTransferableAmount(params: {
982
+ currency: string;
983
+ }): Promise<APIResponse<{
984
+ currency: string;
985
+ amount: string;
986
+ }>>;
987
+ /**
988
+ * Estimated interest rates
989
+ *
990
+ * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
991
+ *
992
+ * @param params Parameters for retrieving estimated interest rates
993
+ * @returns Promise<APIResponse<any>>
994
+ */
995
+ getEstimatedInterestRates(params: {
996
+ currencies: string[];
997
+ }): Promise<APIResponse<any>>;
998
+ /**
999
+ * Get the max borrowable amount for a specific cross margin currency
1000
+ *
1001
+ * @param params Parameters for retrieving the max borrowable amount
1002
+ * @returns Promise<APIResponse<{
1003
+ * currency: string;
1004
+ * amount: string;
1005
+ * }>>
1006
+ */
1007
+ getCrossMarginBorrowableAmount(params: {
1008
+ currency: string;
1009
+ }): Promise<APIResponse<{
1010
+ currency: string;
1011
+ amount: string;
1012
+ }>>;
1013
+ /**==========================================================================================================================
1014
+ * MARGIN UNI
1015
+ * ==========================================================================================================================
1016
+ */
1017
+ /**
1018
+ * List lending markets
1019
+ *
1020
+ * @returns Promise<APIResponse<GetLendingMarketsResp[]>>
1021
+ */
1022
+ getLendingMarkets(): Promise<APIResponse<LendingMarket[]>>;
1023
+ /**
1024
+ * Get detail of lending market
1025
+ *
1026
+ * @param params Parameters containing the currency pair
1027
+ * @returns Promise<APIResponse<{
1028
+ * currency_pair: string;
1029
+ * base_min_borrow_amount: string;
1030
+ * quote_min_borrow_amount: string;
1031
+ * leverage: string;
1032
+ * }>>
1033
+ */
1034
+ getLendingMarket(params: {
1035
+ currency_pair: string;
1036
+ }): Promise<APIResponse<LendingMarket>>;
1037
+ /**
1038
+ * Estimate interest rate
1039
+ *
1040
+ * Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
1041
+ *
1042
+ * @param params Parameters for retrieving estimated interest rates
1043
+ * @returns Promise<APIResponse<any>>
1044
+ */
1045
+ getEstimatedInterestRate(params: {
1046
+ currencies: string[];
1047
+ }): Promise<APIResponse<any>>;
1048
+ /**
1049
+ * Borrow or repay
1050
+ *
1051
+ * @param params Parameters for borrowing or repaying
1052
+ * @returns Promise<any>
1053
+ */
1054
+ submitMarginUNIBorrowOrRepay(params: {
1055
+ currency: string;
1056
+ type: 'borrow' | 'repay';
1057
+ amount: string;
1058
+ currency_pair: string;
1059
+ repaid_all?: boolean;
1060
+ }): Promise<any>;
1061
+ /**
1062
+ * List loans
1063
+ *
1064
+ * @param params Parameters for listing loans
1065
+ * @returns Promise<APIResponse<GetMarginUNILoansResp[]>>
1066
+ */
1067
+ getMarginUNILoans(params?: GetMarginUNILoansReq): Promise<APIResponse<MarginUNILoan[]>>;
1068
+ /**
1069
+ * Get loan records
1070
+ *
1071
+ * @param params Parameters for retrieving loan records
1072
+ * @returns Promise<APIResponse<GetMarginUNILoanRecordsResp[]>>
1073
+ */
1074
+ getMarginUNILoanRecords(params?: GetMarginUNILoanRecordsReq): Promise<APIResponse<MarginUNILoanRecord[]>>;
1075
+ /**
1076
+ * List interest records
1077
+ *
1078
+ * @param params Parameters for listing interest records
1079
+ * @returns Promise<APIResponse<GetMarginUNIInterestRecordsResp[]>>
1080
+ */
1081
+ getMarginUNIInterestRecords(params?: GetMarginUNIInterestRecordsReq): Promise<APIResponse<MarginUNIInterestRecord[]>>;
1082
+ /**
1083
+ * Get maximum borrowable
1084
+ *
1085
+ * @param params Parameters for retrieving the maximum borrowable amount
1086
+ * @returns Promise<APIResponse<GetMarginUNIMaxBorrowResp>>
1087
+ */
1088
+ getMarginUNIMaxBorrow(params: GetMarginUNIMaxBorrowReq): Promise<APIResponse<MarginUNIMaxBorrowable>>;
1089
+ /**==========================================================================================================================
1090
+ * FLASH SWAP
1091
+ * ==========================================================================================================================
1092
+ */
1093
+ /**
1094
+ * List All Supported Currency Pairs In Flash Swap
1095
+ *
1096
+ * @param params Parameters for retrieving data of the specified currency
1097
+ * @returns Promise<APIResponse<GetFlashSwapCurrencyPairsResp[]>>
1098
+ */
1099
+ getFlashSwapCurrencyPairs(params?: {
1100
+ currency?: string;
1101
+ }): Promise<APIResponse<FlashSwapCurrencyPair[]>>;
1102
+ /**
1103
+ * Create a flash swap order
1104
+ *
1105
+ * Initiate a flash swap preview in advance because order creation requires a preview result.
1106
+ *
1107
+ * @param params Parameters for creating a flash swap order
1108
+ * @returns Promise<APIResponse<SubmitFlashSwapOrderResp>>
1109
+ */
1110
+ submitFlashSwapOrder(params: SubmitFlashSwapOrderReq): Promise<APIResponse<FlashSwapOrder>>;
1111
+ /**
1112
+ * List all flash swap orders
1113
+ *
1114
+ * @param params Parameters for listing flash swap orders
1115
+ * @returns Promise<APIResponse<GetFlashSwapOrdersResp[]>>
1116
+ */
1117
+ getFlashSwapOrders(params?: GetFlashSwapOrdersReq): Promise<APIResponse<FlashSwapOrder[]>>;
1118
+ /**
1119
+ * Get a single flash swap order's detail
1120
+ *
1121
+ * @param params Parameters containing the flash swap order ID
1122
+ * @returns Promise<APIResponse<GetFlashSwapOrderResp>>
1123
+ */
1124
+ getFlashSwapOrder(params: {
1125
+ order_id: number;
1126
+ }): Promise<APIResponse<FlashSwapOrder>>;
1127
+ /**
1128
+ * Initiate a flash swap order preview
1129
+ *
1130
+ * @param params Parameters for initiating a flash swap order preview
1131
+ * @returns Promise<APIResponse<SubmitFlashSwapOrderPreviewResp>>
1132
+ */
1133
+ submitFlashSwapOrderPreview(params: SubmitFlashSwapOrderPreviewReq): Promise<APIResponse<SubmitFlashSwapOrderPreviewResp>>;
1134
+ /**==========================================================================================================================
1135
+ * FUTURES
1136
+ * ==========================================================================================================================
1137
+ */
1138
+ /**
1139
+ * List all futures contracts
1140
+ *
1141
+ * @param params Parameters for listing futures contracts
1142
+ * @returns Promise<APIResponse<Contract[]>>
1143
+ */
1144
+ getFuturesContracts(params: {
1145
+ settle: 'btc' | 'usdt' | 'usd';
1146
+ limit?: number;
1147
+ offset?: number;
1148
+ }): Promise<APIResponse<FuturesContract[]>>;
1149
+ /**
1150
+ * Get a single contract
1151
+ *
1152
+ * @param params Parameters for retrieving a single contract
1153
+ * @returns Promise<APIResponse<Contract>>
1154
+ */
1155
+ getFuturesContract(params: {
1156
+ settle: 'btc' | 'usdt' | 'usd';
1157
+ contract: string;
1158
+ }): Promise<APIResponse<FuturesContract>>;
1159
+ /**
1160
+ * Futures order book
1161
+ *
1162
+ * Bids will be sorted by price from high to low, while asks sorted reversely.
1163
+ *
1164
+ * @param params Parameters for retrieving the futures order book
1165
+ * @returns Promise<APIResponse<GetFuturesOrderBookResp>>
1166
+ */
1167
+ getFuturesOrderBook(params: GetFuturesOrderBookReq): Promise<APIResponse<FuturesOrderBook>>;
1168
+ /**
1169
+ * Futures trading history
1170
+ *
1171
+ * @param params Parameters for retrieving futures trading history
1172
+ * @returns Promise<APIResponse<GetFuturesTradesResp[]>>
1173
+ */
1174
+ getFuturesTrades(params: GetFuturesTradesReq): Promise<APIResponse<FuturesTrade[]>>;
1175
+ /**
1176
+ * Get futures Candles
1177
+ *
1178
+ * Return specified contract Candles. If prefix contract with mark_, the contract's mark price Candles are returned; if prefix with index_, index price Candles will be returned.
1179
+ *
1180
+ * Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
1181
+ *
1182
+ * @param params Parameters for retrieving futures Candles
1183
+ * @returns Promise<APIResponse<GetFuturesCandlesResp[]>>
1184
+ */
1185
+ getFuturesCandles(params: GetFuturesCandlesReq): Promise<APIResponse<FuturesCandle[]>>;
1186
+ /**
1187
+ * Premium Index K-Line
1188
+ *
1189
+ * Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval.
1190
+ *
1191
+ * @param params Parameters for retrieving premium index K-Line
1192
+ * @returns Promise<APIResponse<GetPremiumIndexKLineResp[]>>
1193
+ */
1194
+ getPremiumIndexKLines(params: GetFuturesCandlesReq): Promise<APIResponse<PremiumIndexKLine[]>>;
1195
+ /**
1196
+ * List futures tickers
1197
+ *
1198
+ * @param params Parameters for listing futures tickers
1199
+ * @returns Promise<APIResponse<GetFuturesTickersResp[]>>
1200
+ */
1201
+ getFuturesTickers(params: {
1202
+ settle: 'btc' | 'usdt' | 'usd';
1203
+ contract?: string;
1204
+ }): Promise<APIResponse<FuturesTicker[]>>;
1205
+ /**
1206
+ * Funding rate history
1207
+ *
1208
+ * @param params Parameters for retrieving funding rate history
1209
+ * @returns Promise<APIResponse<{
1210
+ * t: number;
1211
+ * r: string;
1212
+ * }[]>>
1213
+ */
1214
+ getFundingRates(params: {
1215
+ settle: 'btc' | 'usdt' | 'usd';
1216
+ contract: string;
1217
+ limit?: number;
1218
+ }): Promise<APIResponse<{
1219
+ t: number;
1220
+ r: string;
1221
+ }[]>>;
1222
+ /**
1223
+ * Futures insurance balance history
1224
+ *
1225
+ * @param params Parameters for retrieving futures insurance balance history
1226
+ * @returns Promise<APIResponse<{
1227
+ * t: number;
1228
+ * b: string;
1229
+ * }[]>>
1230
+ */
1231
+ getFuturesInsuranceBalanceHistory(params: {
1232
+ settle: 'btc' | 'usdt' | 'usd';
1233
+ limit?: number;
1234
+ }): Promise<APIResponse<{
1235
+ t: number;
1236
+ b: string;
1237
+ }[]>>;
1238
+ /**
1239
+ * Futures stats
1240
+ *
1241
+ * @param params Parameters for retrieving futures stats
1242
+ * @returns Promise<APIResponse<GetFuturesStatsResp[]>>
1243
+ */
1244
+ getFuturesStats(params: GetFuturesStatsReq): Promise<APIResponse<FuturesStats[]>>;
1245
+ /**
1246
+ * Get index constituents
1247
+ *
1248
+ * @param params Parameters for retrieving index constituents
1249
+ * @returns Promise<APIResponse<GetIndexConstituentsResp>>
1250
+ */
1251
+ getIndexConstituents(params: {
1252
+ settle: 'btc' | 'usdt' | 'usd';
1253
+ index: string;
1254
+ }): Promise<APIResponse<IndexConstituents>>;
1255
+ /**
1256
+ * Retrieve liquidation history
1257
+ *
1258
+ * Interval between from and to cannot exceed 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail.
1259
+ *
1260
+ * @param params Parameters for retrieving liquidation history
1261
+ * @returns Promise<APIResponse<GetLiquidationHistoryResp[]>>
1262
+ */
1263
+ getLiquidationHistory(params: GetLiquidationHistoryReq): Promise<APIResponse<LiquidationHistoryRecord[]>>;
1264
+ /**
1265
+ * List risk limit tiers
1266
+ *
1267
+ * When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets.
1268
+ * 'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array.
1269
+ * This only takes effect when the 'contract' parameter is empty.
1270
+ *
1271
+ * @param params Parameters for listing risk limit tiers
1272
+ * @returns Promise<APIResponse<GetRiskLimitTiersResp[]>>
1273
+ */
1274
+ getRiskLimitTiers(params: GetRiskLimitTiersReq): Promise<APIResponse<RiskLimitTier[]>>;
1275
+ /**
1276
+ * Query futures account
1277
+ *
1278
+ * @param params Parameters for querying futures account
1279
+ * @returns Promise<APIResponse<GetFuturesAccountResp>>
1280
+ */
1281
+ getFuturesAccount(params: {
1282
+ settle: 'btc' | 'usdt' | 'usd';
1283
+ }): Promise<APIResponse<FuturesAccount>>;
1284
+ /**
1285
+ * Query account book
1286
+ *
1287
+ * If the contract field is provided, it can only filter records that include this field after 2023-10-30.
1288
+ *
1289
+ * @param params Parameters for querying account book
1290
+ * @returns Promise<APIResponse<GetFuturesAccountBookResp[]>>
1291
+ */
1292
+ getFuturesAccountBook(params: GetFuturesAccountBookReq): Promise<APIResponse<GetFuturesAccountBookReq[]>>;
1293
+ /**
1294
+ * List all positions of a user
1295
+ *
1296
+ * @param params Parameters for listing all positions of a user
1297
+ * @returns Promise<APIResponse<Position[]>>
1298
+ */
1299
+ getFuturesPositions(params: GetFuturesPositionsReq): Promise<APIResponse<FuturesPosition[]>>;
1300
+ /**
1301
+ * Get single position
1302
+ *
1303
+ * @param params Parameters for retrieving a single position
1304
+ * @returns Promise<APIResponse<Position>>
1305
+ */
1306
+ getFuturesPosition(params: {
1307
+ settle: 'btc' | 'usdt' | 'usd';
1308
+ contract: string;
1309
+ }): Promise<APIResponse<FuturesPosition>>;
1310
+ /**
1311
+ * Update position margin
1312
+ *
1313
+ * @param params Parameters for updating position margin
1314
+ * @returns Promise<APIResponse<Position>>
1315
+ */
1316
+ updateFuturesMargin(params: {
1317
+ settle: 'btc' | 'usdt' | 'usd';
1318
+ contract: string;
1319
+ change: string;
1320
+ }): Promise<APIResponse<FuturesPosition>>;
1321
+ /**
1322
+ * Update position leverage
1323
+ *
1324
+ * @param params Parameters for updating position leverage
1325
+ * @returns Promise<APIResponse<Position>>
1326
+ */
1327
+ updateFuturesLeverage(params: {
1328
+ settle: 'btc' | 'usdt' | 'usd';
1329
+ contract: string;
1330
+ leverage: string;
1331
+ cross_leverage_limit?: string;
1332
+ }): Promise<APIResponse<FuturesPosition>>;
1333
+ /**
1334
+ * Update position risk limit
1335
+ *
1336
+ * @param params Parameters for updating position risk limit
1337
+ * @returns Promise<APIResponse<Position>>
1338
+ */
1339
+ updatePositionRiskLimit(params: {
1340
+ settle: 'btc' | 'usdt' | 'usd';
1341
+ contract: string;
1342
+ risk_limit: string;
1343
+ }): Promise<APIResponse<FuturesPosition>>;
1344
+ /**
1345
+ * Enable or disable dual mode
1346
+ *
1347
+ * Before setting dual mode, make sure all positions are closed and no orders are open.
1348
+ *
1349
+ * @param params Parameters for enabling or disabling dual mode
1350
+ * @returns Promise<APIResponse<ToggleFuturesDualModeResp>>
1351
+ */
1352
+ updateFuturesDualMode(params: {
1353
+ settle: 'btc' | 'usdt' | 'usd';
1354
+ dual_mode: boolean;
1355
+ }): Promise<APIResponse<UpdateFuturesDualModeResp>>;
1356
+ /**
1357
+ * Retrieve position detail in dual mode
1358
+ *
1359
+ * @param params Parameters for retrieving position detail in dual mode
1360
+ * @returns Promise<APIResponse<Position[]>>
1361
+ */
1362
+ getDualModePosition(params: {
1363
+ settle: 'btc' | 'usdt' | 'usd';
1364
+ contract: string;
1365
+ }): Promise<APIResponse<FuturesPosition[]>>;
1366
+ /**
1367
+ * Update position margin in dual mode
1368
+ *
1369
+ * @param params Parameters for updating position margin in dual mode
1370
+ * @returns Promise<APIResponse<Position[]>>
1371
+ */
1372
+ updateDualModePositionMargin(params: UpdateDualModePositionMarginReq): Promise<APIResponse<FuturesPosition[]>>;
1373
+ /**
1374
+ * Update position leverage in dual mode
1375
+ *
1376
+ * @param params Parameters for updating position leverage in dual mode
1377
+ * @returns Promise<APIResponse<Position[]>>
1378
+ */
1379
+ updateDualModePositionLeverage(params: UpdateDualModePositionLeverageReq): Promise<APIResponse<FuturesPosition[]>>;
1380
+ /**
1381
+ * Update position risk limit in dual mode
1382
+ *
1383
+ * @param params Parameters for updating position risk limit in dual mode
1384
+ * @returns Promise<APIResponse<Position[]>>
1385
+ */
1386
+ updateDualModePositionRiskLimit(params: {
1387
+ settle: 'btc' | 'usdt' | 'usd';
1388
+ contract: string;
1389
+ risk_limit: string;
1390
+ }): Promise<APIResponse<FuturesPosition[]>>;
1391
+ /**
1392
+ * Create a futures order
1393
+ *
1394
+ * Creating futures orders requires size, which is the number of contracts instead of currency amount. You can use quanto_multiplier in the contract detail response to know how much currency 1 size contract represents.
1395
+ * Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders.
1396
+ * Set reduce_only to true to keep the position from changing side when reducing position size.
1397
+ * In single position mode, to close a position, you need to set size to 0 and close to true.
1398
+ * In dual position mode, to close one side position, you need to set auto_size side, reduce_only to true, and size to 0.
1399
+ * Set stp_act to decide the strategy of self-trade prevention. For detailed usage, refer to the stp_act parameter in the request body.
1400
+ *
1401
+ * @param params Parameters for creating a futures order
1402
+ * @returns Promise<APIResponse<SubmitFuturesOrderReq>>
1403
+ */
1404
+ submitFuturesOrder(params: SubmitFuturesOrderReq): Promise<APIResponse<FuturesOrder>>;
1405
+ /**
1406
+ * List futures orders
1407
+ *
1408
+ * Zero-fill order cannot be retrieved for 10 minutes after cancellation.
1409
+ * Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/orders_timerange.
1410
+ *
1411
+ * @param params Parameters for listing futures orders
1412
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1413
+ */
1414
+ getFuturesOrders(params: GetFuturesOrdersReq): Promise<APIResponse<FuturesOrder[]>>;
1415
+ /**
1416
+ * Cancel all open orders matched
1417
+ *
1418
+ * Zero-filled order cannot be retrieved 10 minutes after order cancellation.
1419
+ *
1420
+ * @param params Parameters for cancelling all open orders matched
1421
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1422
+ */
1423
+ cancelAllFuturesOrders(params: DeleteAllFuturesOrdersReq): Promise<APIResponse<FuturesOrder[]>>;
1424
+ /**
1425
+ * List Futures Orders By Time Range
1426
+ *
1427
+ * @param params Parameters for listing futures orders by time range
1428
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1429
+ */
1430
+ getFuturesOrdersByTimeRange(params: GetFuturesOrdersByTimeRangeReq): Promise<APIResponse<FuturesOrder[]>>;
1431
+ /**
1432
+ * Create a batch of futures orders
1433
+ *
1434
+ * Up to 10 orders per request.
1435
+ * If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly.
1436
+ * If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders.
1437
+ * The returned result is in array format, and the order corresponds to the orders in the request body.
1438
+ * In the returned result, the succeeded field of type bool indicates whether the execution was successful or not.
1439
+ * If the execution is successful, the normal order content is included; if the execution fails, the label field is included to indicate the cause of the error.
1440
+ * In the rate limiting, each order is counted individually.
1441
+ *
1442
+ * @param params Parameters for creating a batch of futures orders
1443
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1444
+ */
1445
+ submitFuturesBatchOrders(params: {
1446
+ settle: 'btc' | 'usdt' | 'usd';
1447
+ orders: SubmitFuturesOrderReq[];
1448
+ }): Promise<APIResponse<FuturesOrder[]>>;
1449
+ /**
1450
+ * Get a single order
1451
+ *
1452
+ * Zero-fill order cannot be retrieved for 10 minutes after cancellation.
1453
+ * Historical orders, by default, only data within the past 6 months is supported.
1454
+ *
1455
+ * @param params Parameters for retrieving a single order
1456
+ * @returns Promise<APIResponse<FuturesOrder>>
1457
+ */
1458
+ getFuturesOrder(params: {
1459
+ settle: 'btc' | 'usdt' | 'usd';
1460
+ order_id: string;
1461
+ }): Promise<APIResponse<FuturesOrder>>;
1462
+ /**
1463
+ * Cancel a single order
1464
+ *
1465
+ * @param params Parameters for cancelling a single order
1466
+ * @returns Promise<APIResponse<FuturesOrder>>
1467
+ */
1468
+ cancelFuturesOrder(params: {
1469
+ settle: 'btc' | 'usdt' | 'usd';
1470
+ order_id: string;
1471
+ }): Promise<APIResponse<FuturesOrder>>;
1472
+ /**
1473
+ * Amend an order
1474
+ *
1475
+ * @param params Parameters for amending an order
1476
+ * @returns Promise<APIResponse<FuturesOrder>>
1477
+ */
1478
+ updateFuturesOrder(params: UpdateFuturesOrderReq): Promise<APIResponse<FuturesOrder>>;
1479
+ /**
1480
+ * List personal trading history
1481
+ *
1482
+ * By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use GET /futures/{settle}/my_trades_timerange.
1483
+ *
1484
+ * @param params Parameters for listing personal trading history
1485
+ * @returns Promise<APIResponse<GetFuturesTradingHistoryResp[]>>
1486
+ */
1487
+ getFuturesTradingHistory(params: GetFuturesTradingHistoryReq): Promise<APIResponse<FuturesTradingHistoryRecord[]>>;
1488
+ /**
1489
+ * List position close history
1490
+ *
1491
+ * @param params Parameters for listing position close history
1492
+ * @returns Promise<APIResponse<GetFuturesPositionHistoryResp[]>>
1493
+ */
1494
+ getFuturesPositionHistory(params: GetFuturesPositionHistoryReq): Promise<APIResponse<FuturesPositionHistoryRecord[]>>;
1495
+ /**
1496
+ * List liquidation history
1497
+ *
1498
+ * @param params Parameters for listing liquidation history
1499
+ * @returns Promise<APIResponse<GetFuturesLiquidationHistoryResp[]>>
1500
+ */
1501
+ getFuturesLiquidationHistory(params: GetFuturesLiquidationHistoryReq): Promise<APIResponse<FuturesLiquidationHistoryRecord[]>>;
1502
+ /**
1503
+ * List Auto-Deleveraging History
1504
+ *
1505
+ * @param params Parameters for listing auto-deleveraging history
1506
+ * @returns Promise<APIResponse<GetFuturesAutoDeleveragingHistoryResp[]>>
1507
+ */
1508
+ getFuturesAutoDeleveragingHistory(params: GetFuturesLiquidationHistoryReq): Promise<APIResponse<FuturesAutoDeleveragingHistoryRecord[]>>;
1509
+ /**
1510
+ * Countdown cancel orders
1511
+ *
1512
+ * When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown.
1513
+ * For example, call this endpoint at 30s intervals, each countdown timeout is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified market will be automatically cancelled, if no market is specified, all market pending orders will be cancelled.
1514
+ * If the timeout is set to 0 within 30 seconds, the countdown timer will expire and the cancel function will be cancelled.
1515
+ *
1516
+ * @param params Parameters for setting countdown cancel orders
1517
+ * @returns Promise<APIResponse<{ triggerTime: number }>>
1518
+ */
1519
+ setFuturesOrderCancelCountdown(params: {
1520
+ settle: 'btc' | 'usdt' | 'usd';
1521
+ timeout: number;
1522
+ contract?: string;
1523
+ }): Promise<APIResponse<{
1524
+ triggerTime: number;
1525
+ }>>;
1526
+ /**
1527
+ * Query user trading fee rates
1528
+ *
1529
+ * @param params Parameters for querying user trading fee rates
1530
+ * @returns Promise<APIResponse<any>>>
1531
+ */
1532
+ getFuturesUserTradingFees(params: {
1533
+ settle: 'btc' | 'usdt' | 'usd';
1534
+ contract?: string;
1535
+ }): Promise<APIResponse<any>>;
1536
+ /**
1537
+ * Cancel a batch of orders with an ID list
1538
+ *
1539
+ * Multiple distinct order ID list can be specified. Each request can cancel a maximum of 20 records.
1540
+ *
1541
+ * @param params Parameters for cancelling a batch of orders with an ID list
1542
+ * @returns Promise<APIResponse<DeleteFuturesBatchOrdersResp[]>>
1543
+ */
1544
+ batchCancelFuturesOrders(params: {
1545
+ settle: 'btc' | 'usdt' | 'usd';
1546
+ orderIds: string[];
1547
+ }): Promise<APIResponse<DeleteFuturesBatchOrdersResp[]>>;
1548
+ /**
1549
+ * Create a price-triggered order
1550
+ *
1551
+ * @param params Parameters for creating a price-triggered order
1552
+ * @returns Promise<APIResponse<{ id: number }>>
1553
+ */
1554
+ submitFuturesPriceTriggeredOrder(params: SubmitFuturesTriggeredOrderReq): Promise<APIResponse<{
1555
+ id: number;
1556
+ }>>;
1557
+ /**
1558
+ * List all auto orders
1559
+ *
1560
+ * @param params Parameters for listing all auto orders
1561
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder[]>>
1562
+ */
1563
+ getFuturesAutoOrders(params: GetFuturesAutoOrdersReq): Promise<APIResponse<FuturesPriceTriggeredOrder[]>>;
1564
+ /**
1565
+ * Cancel all open orders
1566
+ *
1567
+ * @param params Parameters for cancelling all open orders
1568
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder[]>>
1569
+ */
1570
+ cancelAllOpenFuturesOrders(params: {
1571
+ settle: 'btc' | 'usdt' | 'usd';
1572
+ contract: string;
1573
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder[]>>;
1574
+ /**
1575
+ * Get a price-triggered order
1576
+ *
1577
+ * @param params Parameters for retrieving a price-triggered order
1578
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder>>
1579
+ */
1580
+ getFuturesPriceTriggeredOrder(params: {
1581
+ settle: 'btc' | 'usdt' | 'usd';
1582
+ order_id: string;
1583
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder>>;
1584
+ /**
1585
+ * Cancel a price-triggered order
1586
+ *
1587
+ * @param params Parameters for cancelling a price-triggered order
1588
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder>>
1589
+ */
1590
+ cancelFuturesPriceTriggeredOrder(params: {
1591
+ settle: 'btc' | 'usdt' | 'usd';
1592
+ order_id: string;
1593
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder>>;
1594
+ /**==========================================================================================================================
1595
+ * DELIVERY
1596
+ * ==========================================================================================================================
1597
+ */
1598
+ /**
1599
+ * List all futures contracts
1600
+ *
1601
+ * @param params Parameters for listing all futures contracts
1602
+ * @returns Promise<APIResponse<DeliveryContract[]>>
1603
+ */
1604
+ getAllDeliveryContracts(params: {
1605
+ settle: 'usdt';
1606
+ }): Promise<APIResponse<FuturesDeliveryContract[]>>;
1607
+ /**
1608
+ * Get a single contract
1609
+ *
1610
+ * @param params Parameters for retrieving a single contract
1611
+ * @returns Promise<APIResponse<DeliveryContract>>
1612
+ */
1613
+ getDeliveryContract(params: {
1614
+ settle: 'usdt';
1615
+ contract: string;
1616
+ }): Promise<APIResponse<FuturesDeliveryContract>>;
1617
+ /**
1618
+ * Futures order book
1619
+ *
1620
+ * Bids will be sorted by price from high to low, while asks sorted reversely
1621
+ *
1622
+ * @param params Parameters for retrieving the futures order book
1623
+ * @returns Promise<APIResponse<GetDeliveryOrderBookResp>>
1624
+ */
1625
+ getDeliveryOrderBook(params: GetDeliveryOrderBookReq): Promise<APIResponse<DeliveryOrderBook>>;
1626
+ /**
1627
+ * Futures trading history
1628
+ *
1629
+ * @param params Parameters for retrieving the futures trading history
1630
+ * @returns Promise<APIResponse<GetDeliveryTradesResp[]>>
1631
+ */
1632
+ getDeliveryTrades(params: GetDeliveryTradesReq): Promise<APIResponse<DeliveryTrade[]>>;
1633
+ /**
1634
+ * Get futures Candles
1635
+ *
1636
+ * Return specified contract Candles. If prefix contract with mark_, the contract's mark price Candles are returned; if prefix with index_, index price Candles will be returned.
1637
+ * Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying from, to and interval.
1638
+ *
1639
+ * @param params Parameters for retrieving futures Candles
1640
+ * @returns Promise<APIResponse<GetDeliveryCandlesResp[]>>
1641
+ */
1642
+ getDeliveryCandles(params: GetDeliveryCandlesReq): Promise<APIResponse<DeliveryCandle[]>>;
1643
+ /**
1644
+ * List futures tickers
1645
+ *
1646
+ * @param params Parameters for listing futures tickers
1647
+ * @returns Promise<APIResponse<GetDeliveryTickersResp[]>>
1648
+ */
1649
+ getDeliveryTickers(params: {
1650
+ settle: 'usdt';
1651
+ contract?: string;
1652
+ }): Promise<APIResponse<DeliveryTicker[]>>;
1653
+ /**
1654
+ * Futures insurance balance history
1655
+ *
1656
+ * @param params Parameters for retrieving the futures insurance balance history
1657
+ * @returns Promise<APIResponse<{
1658
+ * t: number;
1659
+ * b: string;
1660
+ * }[]>>
1661
+ */
1662
+ getDeliveryInsuranceBalanceHistory(params: {
1663
+ settle: 'usdt';
1664
+ limit?: number;
1665
+ }): Promise<APIResponse<{
1666
+ t: number;
1667
+ b: string;
1668
+ }[]>>;
1669
+ /**
1670
+ * Query futures account
1671
+ *
1672
+ * @param params Parameters for querying futures account
1673
+ * @returns Promise<APIResponse<GetDeliveryAccountResp>>
1674
+ */
1675
+ getDeliveryAccount(params: {
1676
+ settle: 'usdt';
1677
+ }): Promise<APIResponse<DeliveryAccount>>;
1678
+ /**
1679
+ * Query account book
1680
+ *
1681
+ * @param params Parameters for querying account book
1682
+ * @returns Promise<APIResponse<GetDeliveryBookResp[]>>
1683
+ */
1684
+ getDeliveryBook(params: GetDeliveryBookReq): Promise<APIResponse<DeliveryBook[]>>;
1685
+ /**
1686
+ * List all positions of a user
1687
+ *
1688
+ * @param params Parameters for listing all positions of a user
1689
+ * @returns Promise<APIResponse<Position[]>>
1690
+ */
1691
+ getDeliveryPositions(params: {
1692
+ settle: 'usdt';
1693
+ }): Promise<APIResponse<FuturesPosition[]>>;
1694
+ /**
1695
+ * Get single position
1696
+ *
1697
+ * @param params Parameters for retrieving a single position
1698
+ * @returns Promise<APIResponse<Position>>
1699
+ */
1700
+ getDeliveryPosition(params: {
1701
+ settle: 'usdt';
1702
+ contract: string;
1703
+ }): Promise<APIResponse<FuturesPosition>>;
1704
+ /**
1705
+ * Update position margin
1706
+ *
1707
+ * @param params Parameters for updating position margin
1708
+ * @returns Promise<APIResponse<Position>>
1709
+ */
1710
+ updateDeliveryMargin(params: {
1711
+ settle: 'usdt';
1712
+ contract: string;
1713
+ change: string;
1714
+ }): Promise<APIResponse<FuturesPosition>>;
1715
+ /**
1716
+ * Update position leverage
1717
+ *
1718
+ * @param params Parameters for updating position leverage
1719
+ * @returns Promise<APIResponse<Position>>
1720
+ */
1721
+ updateDeliveryLeverage(params: {
1722
+ settle: 'usdt';
1723
+ contract: string;
1724
+ leverage: string;
1725
+ }): Promise<APIResponse<FuturesPosition>>;
1726
+ /**
1727
+ * Update position risk limit
1728
+ *
1729
+ * @param params Parameters for updating position risk limit
1730
+ * @returns Promise<APIResponse<Position>>
1731
+ */
1732
+ updateDeliveryRiskLimit(params: {
1733
+ settle: 'usdt';
1734
+ contract: string;
1735
+ risk_limit: string;
1736
+ }): Promise<APIResponse<FuturesPosition>>;
1737
+ /**
1738
+ * Create a futures order
1739
+ *
1740
+ * Zero-filled order cannot be retrieved 10 minutes after order cancellation
1741
+ *
1742
+ * @param params Parameters for creating a futures order
1743
+ * @returns Promise<APIResponse<FuturesOrder>>
1744
+ */
1745
+ submitDeliveryOrder(params: SubmitDeliveryFuturesOrderReq): Promise<APIResponse<FuturesOrder>>;
1746
+ /**
1747
+ * List futures orders
1748
+ *
1749
+ * Zero-fill order cannot be retrieved 10 minutes after order cancellation.
1750
+ *
1751
+ * @param params Parameters for listing futures orders
1752
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1753
+ */
1754
+ getDeliveryOrders(params: GetDeliveryOrdersReq): Promise<APIResponse<FuturesOrder[]>>;
1755
+ /**
1756
+ * Cancel all open orders matched
1757
+ *
1758
+ * Zero-filled order cannot be retrieved 10 minutes after order cancellation
1759
+ *
1760
+ * @param params Parameters for cancelling all open orders matched
1761
+ * @returns Promise<APIResponse<FuturesOrder[]>>
1762
+ */
1763
+ cancelAllDeliveryOrders(params: {
1764
+ settle: 'usdt';
1765
+ contract: string;
1766
+ side?: 'ask' | 'bid';
1767
+ }): Promise<APIResponse<FuturesOrder[]>>;
1768
+ /**
1769
+ * Get a single order
1770
+ *
1771
+ * Zero-filled order cannot be retrieved 10 minutes after order cancellation
1772
+ *
1773
+ * @param params Parameters for retrieving a single order
1774
+ * @returns Promise<APIResponse<FuturesOrder>>
1775
+ */
1776
+ getDeliveryOrder(params: {
1777
+ settle: 'usdt';
1778
+ order_id: string;
1779
+ }): Promise<APIResponse<FuturesOrder>>;
1780
+ /**
1781
+ * Cancel a single order
1782
+ *
1783
+ * @param params Parameters for cancelling a single order
1784
+ * @returns Promise<APIResponse<FuturesOrder>>
1785
+ */
1786
+ cancelDeliveryOrder(params: {
1787
+ settle: 'usdt';
1788
+ order_id: string;
1789
+ }): Promise<APIResponse<FuturesOrder>>;
1790
+ /**
1791
+ * List personal trading history
1792
+ *
1793
+ * @param params Parameters for listing personal trading history
1794
+ * @returns Promise<APIResponse<GetDeliveryTradingHistoryResp[]>>
1795
+ */
1796
+ getDeliveryTradingHistory(params: GetDeliveryTradingHistoryReq): Promise<APIResponse<DeliveryTradingHistoryRecord[]>>;
1797
+ /**
1798
+ * List position close history
1799
+ *
1800
+ * @param params Parameters for listing position close history
1801
+ * @returns Promise<APIResponse<GetDeliveryClosedPositionsResp[]>>
1802
+ */
1803
+ getDeliveryClosedPositions(params: GetDeliveryClosedPositionsReq): Promise<APIResponse<DeliveryClosedPosition[]>>;
1804
+ /**
1805
+ * List liquidation history
1806
+ *
1807
+ * @param params Parameters for listing liquidation history
1808
+ * @returns Promise<APIResponse<GetDeliveryLiquidationHistoryResp[]>>
1809
+ */
1810
+ getDeliveryLiquidationHistory(params: GetDeliveryLiquidationHistoryReq): Promise<APIResponse<DeliveryLiquidationHistoryRecord[]>>;
1811
+ /**
1812
+ * List settlement history
1813
+ *
1814
+ * @param params Parameters for listing settlement history
1815
+ * @returns Promise<APIResponse<GetDeliverySettlementHistoryResp[]>>
1816
+ */
1817
+ getDeliverySettlementHistory(params: GetDeliverySettlementHistoryReq): Promise<APIResponse<DeliverySettlementHistoryRecord[]>>;
1818
+ /**
1819
+ * Create a price-triggered order
1820
+ *
1821
+ * @param params Parameters for creating a price-triggered order
1822
+ * @returns Promise<APIResponse<{ id: number }>>
1823
+ */
1824
+ submitDeliveryTriggeredOrder(params: SubmitFuturesTriggeredOrderReq): Promise<APIResponse<{
1825
+ id: number;
1826
+ }>>;
1827
+ /**
1828
+ * List all auto orders
1829
+ *
1830
+ * @param params Parameters for listing all auto orders
1831
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder[]>>
1832
+ */
1833
+ getDeliveryAutoOrders(params: GetDeliveryAutoOrdersReq): Promise<APIResponse<FuturesPriceTriggeredOrder[]>>;
1834
+ /**
1835
+ * Cancel all open orders
1836
+ *
1837
+ * @param params Parameters for cancelling all open orders
1838
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder[]>>
1839
+ */
1840
+ cancelAllOpenDeliveryOrders(params: {
1841
+ settle: 'usdt';
1842
+ contract: string;
1843
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder[]>>;
1844
+ /**
1845
+ * Get a price-triggered order
1846
+ *
1847
+ * @param params Parameters for retrieving a price-triggered order
1848
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder>>
1849
+ */
1850
+ getDeliveryTriggeredOrder(params: {
1851
+ settle: 'usdt';
1852
+ order_id: string;
1853
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder>>;
1854
+ /**
1855
+ * Cancel a price-triggered order
1856
+ *
1857
+ * @param params Parameters for cancelling a price-triggered order
1858
+ * @returns Promise<APIResponse<FuturesPriceTriggeredOrder>>
1859
+ */
1860
+ cancelTriggeredDeliveryOrder(params: {
1861
+ settle: 'usdt';
1862
+ order_id: string;
1863
+ }): Promise<APIResponse<FuturesPriceTriggeredOrder>>;
1864
+ /**==========================================================================================================================
1865
+ * OPTIONS
1866
+ * ==========================================================================================================================
1867
+ */
1868
+ /**
1869
+ * List all underlyings
1870
+ *
1871
+ * @returns Promise<APIResponse<{ name: string; index_price: string }[]>>
1872
+ */
1873
+ getOptionsUnderlyings(): Promise<APIResponse<{
1874
+ name: string;
1875
+ index_price: string;
1876
+ }[]>>;
1877
+ /**
1878
+ * List all expiration times
1879
+ *
1880
+ * @param params Parameters for listing expiration times
1881
+ * @returns Promise<APIResponse<number[]>>
1882
+ */
1883
+ getOptionsExpirationTimes(params: {
1884
+ underlying: string;
1885
+ }): Promise<APIResponse<number[]>>;
1886
+ /**
1887
+ * List all the contracts with specified underlying and expiration time
1888
+ *
1889
+ * @param params Parameters for listing contracts
1890
+ * @returns Promise<APIResponse<GetOptionsContractsResp[]>>
1891
+ */
1892
+ getOptionsContracts(params: {
1893
+ underlying: string;
1894
+ expiration?: number;
1895
+ }): Promise<APIResponse<OptionsContract[]>>;
1896
+ /**
1897
+ * Query specified contract detail
1898
+ *
1899
+ * @param params Parameters for querying specified contract detail
1900
+ * @returns Promise<APIResponse<GetOptionsContractsResp>>
1901
+ */
1902
+ getOptionsContract(params: {
1903
+ contract: string;
1904
+ }): Promise<APIResponse<OptionsContract>>;
1905
+ /**
1906
+ * List settlement history
1907
+ *
1908
+ * @param params Parameters for listing settlement history
1909
+ * @returns Promise<APIResponse<GetOptionsSettlementHistoryResp[]>>
1910
+ */
1911
+ getOptionsSettlementHistory(params: GetOptionsSettlementHistoryReq): Promise<APIResponse<OptionsSettlementHistoryRecord[]>>;
1912
+ /**
1913
+ * Get specified contract's settlement
1914
+ *
1915
+ * @param params Parameters for retrieving specified contract's settlement
1916
+ * @returns Promise<APIResponse<GetOptionsSettlementHistoryResp}>>
1917
+ */
1918
+ getOptionsContractSettlement(params: {
1919
+ contract: string;
1920
+ underlying: string;
1921
+ at: number;
1922
+ }): Promise<APIResponse<OptionsSettlementHistoryRecord>>;
1923
+ /**
1924
+ * List my options settlements
1925
+ *
1926
+ * @param params Parameters for listing my options settlements
1927
+ * @returns Promise<APIResponse<GetOptionsMySettlementsResp[]>>
1928
+ */
1929
+ getOptionsMySettlements(params: GetOptionsMySettlementsReq): Promise<APIResponse<OptionsUserSettlement[]>>;
1930
+ /**
1931
+ * Options order book
1932
+ *
1933
+ * Bids will be sorted by price from high to low, while asks sorted reversely
1934
+ *
1935
+ * @param params Parameters for retrieving options order book
1936
+ * @returns Promise<APIResponse<GetOptionsOrderBookResp>>
1937
+ */
1938
+ getOptionsOrderBook(params: GetOptionsOrderBookReq): Promise<APIResponse<OptionsOrderBook>>;
1939
+ /**
1940
+ * List tickers of options contracts
1941
+ *
1942
+ * @param params Parameters for listing tickers of options contracts
1943
+ * @returns Promise<APIResponse<GetOptionsTickersResp[]>>
1944
+ */
1945
+ getOptionsTickers(params: {
1946
+ underlying: string;
1947
+ }): Promise<APIResponse<OptionsTicker[]>>;
1948
+ /**
1949
+ * Get underlying ticker
1950
+ *
1951
+ * @param params Parameters for retrieving underlying ticker
1952
+ * @returns Promise<APIResponse<{
1953
+ * trade_put: number;
1954
+ * trade_call: number;
1955
+ * index_price: string;
1956
+ * }>>
1957
+ */
1958
+ getOptionsUnderlyingTicker(params: {
1959
+ underlying: string;
1960
+ }): Promise<APIResponse<{
1961
+ trade_put: number;
1962
+ trade_call: number;
1963
+ index_price: string;
1964
+ }>>;
1965
+ /**
1966
+ * Get options Candles
1967
+ *
1968
+ * @param params Parameters for retrieving options Candles
1969
+ * @returns Promise<APIResponse<GetOptionsCandlesResp[]>>
1970
+ */
1971
+ getOptionsCandles(params: GetOptionsCandlesReq): Promise<APIResponse<OptionsCandle[]>>;
1972
+ /**
1973
+ * Mark price Candles of an underlying
1974
+ *
1975
+ * @param params Parameters for retrieving mark price Candles of an underlying
1976
+ * @returns Promise<APIResponse<GetOptionsUnderlyingCandlesResp[]>>
1977
+ */
1978
+ getOptionsUnderlyingCandles(params: GetOptionsUnderlyingCandlesReq): Promise<APIResponse<OptionsUnderlyingCandle[]>>;
1979
+ /**
1980
+ * Options trade history
1981
+ *
1982
+ * @param params Parameters for retrieving options trade history
1983
+ * @returns Promise<APIResponse<GetOptionsTradesResp[]>>
1984
+ */
1985
+ getOptionsTrades(params: GetOptionsTradesReq): Promise<APIResponse<OptionsTrade[]>>;
1986
+ /**
1987
+ * List options account
1988
+ *
1989
+ * @returns Promise<APIResponse<GetOptionsAccountResp>>
1990
+ */
1991
+ getOptionsAccount(): Promise<APIResponse<OptionsAccount>>;
1992
+ /**
1993
+ * List account changing history
1994
+ *
1995
+ * @param params Parameters for listing account changing history
1996
+ * @returns Promise<APIResponse<GetOptionsAccountChangeResp[]>>
1997
+ */
1998
+ getOptionsAccountChange(params?: GetOptionsAccountChangeReq): Promise<APIResponse<OptionsAccountChangeRecord[]>>;
1999
+ /**
2000
+ * List user's positions of specified underlying
2001
+ *
2002
+ * @param params Parameters for listing user's positions of specified underlying
2003
+ * @returns Promise<APIResponse<GetOptionsPositionsUnderlyingResp[]>>
2004
+ */
2005
+ getOptionsPositionsUnderlying(params: {
2006
+ underlying?: string;
2007
+ }): Promise<APIResponse<OptionsPositionsUnderlying[]>>;
2008
+ /**
2009
+ * Get specified contract position
2010
+ *
2011
+ * @param params Parameters for retrieving specified contract position
2012
+ * @returns Promise<APIResponse<GetOptionsPositionsUnderlyingResp>>
2013
+ */
2014
+ getOptionsPositionContract(params: {
2015
+ contract: string;
2016
+ }): Promise<APIResponse<OptionsPositionsUnderlying>>;
2017
+ /**
2018
+ * List user's liquidation history of specified underlying
2019
+ *
2020
+ * @param params Parameters for listing user's liquidation history of specified underlying
2021
+ * @returns Promise<APIResponse<GetOptionsLiquidationResp[]>>
2022
+ */
2023
+ getOptionsLiquidation(params: {
2024
+ underlying: string;
2025
+ contract?: string;
2026
+ }): Promise<APIResponse<GetOptionsLiquidationResp[]>>;
2027
+ /**
2028
+ * Create an options order
2029
+ *
2030
+ * @param params Parameters for creating an options order
2031
+ * @returns Promise<APIResponse<SubmitOptionsOrderResp>>
2032
+ */
2033
+ submitOptionsOrder(params: SubmitOptionsOrderReq): Promise<APIResponse<SubmitOptionsOrderResp>>;
2034
+ /**
2035
+ * List options orders
2036
+ *
2037
+ * @param params Parameters for listing options orders
2038
+ * @returns Promise<APIResponse<SubmitOptionsOrderResp[]>>
2039
+ */
2040
+ getOptionsOrders(params: GetOptionsOrdersReq): Promise<APIResponse<SubmitOptionsOrderResp[]>>;
2041
+ /**
2042
+ * Cancel all open orders matched
2043
+ *
2044
+ * @param params Parameters for canceling all open orders matched
2045
+ * @returns Promise<APIResponse<SubmitOptionsOrderResp[]>>
2046
+ */
2047
+ cancelAllOpenOptionsOrders(params: {
2048
+ contract?: string;
2049
+ underlying?: string;
2050
+ side?: 'ask' | 'bid';
2051
+ }): Promise<APIResponse<SubmitOptionsOrderResp[]>>;
2052
+ /**
2053
+ * Get a single order
2054
+ *
2055
+ * @param params Parameters for retrieving a single order
2056
+ * @returns Promise<APIResponse<SubmitOptionsOrderResp>>
2057
+ */
2058
+ getOptionsOrder(params: {
2059
+ order_id: number;
2060
+ }): Promise<APIResponse<SubmitOptionsOrderResp>>;
2061
+ /**
2062
+ * Cancel a single order
2063
+ *
2064
+ * @param params Parameters for canceling a single order
2065
+ * @returns Promise<APIResponse<SubmitOptionsOrderResp>>
2066
+ */
2067
+ cancelOptionsOrder(params: {
2068
+ order_id: number;
2069
+ }): Promise<APIResponse<SubmitOptionsOrderResp>>;
2070
+ /**
2071
+ * List personal trading history
2072
+ *
2073
+ * @param params Parameters for listing personal trading history
2074
+ * @returns Promise<APIResponse<GetOptionsPersonalHistoryResp[]>>
2075
+ */
2076
+ getOptionsPersonalHistory(params: GetOptionsPersonalHistoryReq): Promise<APIResponse<OptionsUserHistoryRecord[]>>;
2077
+ /**==========================================================================================================================
2078
+ * EARN UNI
2079
+ * ==========================================================================================================================
2080
+ */
2081
+ /**
2082
+ * List currencies for lending
2083
+ *
2084
+ * @returns Promise<APIResponse<GetLendingCurrenciesResp[]>>
2085
+ */
2086
+ getLendingCurrencies(): Promise<APIResponse<LendingCurrency[]>>;
2087
+ /**
2088
+ * Get currency detail for lending
2089
+ *
2090
+ * @param params Parameters for retrieving currency detail for lending
2091
+ * @returns Promise<APIResponse<GetLendingCurrenciesResp>>
2092
+ */
2093
+ getLendingCurrency(params: {
2094
+ currency: string;
2095
+ }): Promise<APIResponse<LendingCurrency>>;
2096
+ /**
2097
+ * Lend or redeem
2098
+ *
2099
+ * @param params Parameters for lending or redeeming
2100
+ * @returns Promise<APIResponse<any>>
2101
+ */
2102
+ submitLendOrRedeemOrder(params: SubmitLendOrRedeemReq): Promise<APIResponse<any>>;
2103
+ /**
2104
+ * List user's lending orders
2105
+ *
2106
+ * @param params Parameters for listing user's lending orders
2107
+ * @returns Promise<APIResponse<GetLendingOrdersResp[]>>
2108
+ */
2109
+ getLendingOrders(params?: GetLendingOrdersReq): Promise<APIResponse<LendingOrder[]>>;
2110
+ /**
2111
+ * Amend lending order
2112
+ *
2113
+ * Currently only supports amending the minimum interest rate (hour)
2114
+ *
2115
+ * @param params Parameters for amending lending order
2116
+ * @returns Promise<APIResponse<any>>
2117
+ */
2118
+ updateLendingOrder(params: {
2119
+ currency?: string;
2120
+ min_rate?: string;
2121
+ }): Promise<APIResponse<any>>;
2122
+ /**
2123
+ * List records of lending
2124
+ *
2125
+ * @param params Parameters for listing records of lending
2126
+ * @returns Promise<APIResponse<GetLendingRecordsResp[]>>
2127
+ */
2128
+ getLendingRecords(params?: GetLendingRecordsReq): Promise<APIResponse<LendingRecord[]>>;
2129
+ /**
2130
+ * Get the user's total interest income of specified currency
2131
+ *
2132
+ * @param params Parameters for retrieving the user's total interest income of specified currency
2133
+ * @returns Promise<APIResponse<{
2134
+ * currency: string;
2135
+ * interest: string;
2136
+ * }>>
2137
+ */
2138
+ getLendingTotalInterest(params: {
2139
+ currency: string;
2140
+ }): Promise<APIResponse<{
2141
+ currency: string;
2142
+ interest: string;
2143
+ }>>;
2144
+ /**
2145
+ * List interest records
2146
+ *
2147
+ * @param params Parameters for listing interest records
2148
+ * @returns Promise<APIResponse<GetLendingInterestRecordsResp[]>>
2149
+ */
2150
+ getLendingInterestRecords(params?: GetLendingInterestRecordsReq): Promise<APIResponse<LendingInterestRecord[]>>;
2151
+ /**
2152
+ * Set interest reinvestment toggle
2153
+ *
2154
+ * @param params Parameters for setting interest reinvestment toggle
2155
+ * @returns Promise<APIResponse<any>>
2156
+ */
2157
+ updateInterestReinvestment(params: {
2158
+ currency: string;
2159
+ status: boolean;
2160
+ }): Promise<APIResponse<any>>;
2161
+ /**
2162
+ * Query currency interest compounding status
2163
+ *
2164
+ * @param params Parameters for querying currency interest compounding status
2165
+ * @returns Promise<APIResponse<{
2166
+ * currency: string;
2167
+ * interest_status: string;
2168
+ * }>>
2169
+ */
2170
+ getLendingInterestStatus(params: {
2171
+ currency: string;
2172
+ }): Promise<APIResponse<{
2173
+ currency: string;
2174
+ interest_status: string;
2175
+ }>>;
2176
+ /**==========================================================================================================================
2177
+ * COLLATERAL LOAN
2178
+ * ==========================================================================================================================
2179
+ */
2180
+ /**
2181
+ * Place order
2182
+ *
2183
+ * @param params Parameters for placing an order
2184
+ * @returns Promise<APIResponse<{ order_id: number }>>
2185
+ */
2186
+ submitLoanOrder(params: SubmitLoanOrderReq): Promise<APIResponse<{
2187
+ order_id: number;
2188
+ }>>;
2189
+ /**
2190
+ * List Orders
2191
+ *
2192
+ * @param params Parameters for listing orders
2193
+ * @returns Promise<APIResponse<GetLoanOrdersResp[]>>
2194
+ */
2195
+ getLoanOrders(params?: GetLoanOrdersReq): Promise<APIResponse<LoanOrder[]>>;
2196
+ /**
2197
+ * Get a single order
2198
+ *
2199
+ * @param params Parameters for retrieving a single order
2200
+ * @returns Promise<APIResponse<GetLoanOrdersResp>>
2201
+ */
2202
+ getLoanOrder(params: {
2203
+ order_id: number;
2204
+ }): Promise<APIResponse<LoanOrder>>;
2205
+ /**
2206
+ * Repayment
2207
+ *
2208
+ * @param params Parameters for repayment
2209
+ * @returns Promise<APIResponse<{
2210
+ * repaid_principal: string;
2211
+ * repaid_interest: string;
2212
+ * }>>
2213
+ */
2214
+ submitLoanRepay(params: {
2215
+ order_id: number;
2216
+ repay_amount: string;
2217
+ repaid_all: boolean;
2218
+ }): Promise<APIResponse<{
2219
+ repaid_principal: string;
2220
+ repaid_interest: string;
2221
+ }>>;
2222
+ /**
2223
+ * Repayment history
2224
+ *
2225
+ * @param params Parameters for retrieving repayment history
2226
+ * @returns Promise<APIResponse<GetLoanRepaymentHistoryResp[]>>
2227
+ */
2228
+ getLoanRepaymentHistory(params: GetLoanRepaymentHistoryReq): Promise<APIResponse<LoanRepaymentHistoryRecord[]>>;
2229
+ /**
2230
+ * Increase or redeem collateral
2231
+ *
2232
+ * @param params Parameters for increasing or redeeming collateral
2233
+ * @returns Promise<APIResponse<any>>
2234
+ */
2235
+ updateLoanCollateral(params: UpdateLoanCollateralReq): Promise<APIResponse<any>>;
2236
+ /**
2237
+ * Query collateral adjustment records
2238
+ *
2239
+ * @param params Parameters for querying collateral adjustment records
2240
+ * @returns Promise<APIResponse<GetLoanCollateralRecordsResp[]>>
2241
+ */
2242
+ getLoanCollateralRecords(params?: GetLoanCollateralRecordsReq): Promise<APIResponse<LoanCollateralRecord[]>>;
2243
+ /**
2244
+ * Query the total borrowing and collateral amount for the user
2245
+ *
2246
+ * @returns Promise<APIResponse<{
2247
+ * borrow_amount: string;
2248
+ * collateral_amount: string;
2249
+ * }>>
2250
+ */
2251
+ getLoanTotalAmount(): Promise<APIResponse<{
2252
+ borrow_amount: string;
2253
+ collateral_amount: string;
2254
+ }>>;
2255
+ /**
2256
+ * Query user's collateralization ratio
2257
+ *
2258
+ * @param params Parameters for querying user's collateralization ratio
2259
+ * @returns Promise<APIResponse<GetLoanCollateralizationRatioResp>>
2260
+ */
2261
+ getLoanCollateralizationRatio(params: {
2262
+ collateral_currency: string;
2263
+ borrow_currency: string;
2264
+ }): Promise<APIResponse<LoanCollateralRatio>>;
2265
+ /**
2266
+ * Query supported borrowing and collateral currencies
2267
+ *
2268
+ * @param params Parameters for querying supported borrowing and collateral currencies
2269
+ * @returns Promise<APIResponse<{
2270
+ * loan_currency: string;
2271
+ * collateral_currency: string[];
2272
+ * }[]>>
2273
+ */
2274
+ getLoanSupportedCurrencies(params?: {
2275
+ loan_currency?: string;
2276
+ }): Promise<APIResponse<{
2277
+ loan_currency: string;
2278
+ collateral_currency: string[];
2279
+ }[]>>;
2280
+ /**==========================================================================================================================
2281
+ * MULTI COLLATERAL LOAN
2282
+ * ==========================================================================================================================
2283
+ */
2284
+ /**
2285
+ * Create Multi-Collateral Order
2286
+ *
2287
+ * @param params Parameters for creating a multi-collateral order
2288
+ * @returns Promise<APIResponse<{ order_id: number }>>
2289
+ */
2290
+ submitMultiLoanOrder(params: SubmitMultiLoanOrderReq): Promise<APIResponse<{
2291
+ order_id: number;
2292
+ }>>;
2293
+ /**
2294
+ * List Multi-Collateral Orders
2295
+ *
2296
+ * @param params Parameters for listing multi-collateral orders
2297
+ * @returns Promise<APIResponse<GetMultiLoanOrdersResp[]>>
2298
+ */
2299
+ getMultiLoanOrders(params?: GetMultiLoanOrdersReq): Promise<APIResponse<MultiLoanOrder[]>>;
2300
+ /**
2301
+ * Get Multi-Collateral Order Detail
2302
+ *
2303
+ * @param params Parameters for retrieving a multi-collateral order detail
2304
+ * @returns Promise<APIResponse<GetMultiLoanOrdersResp>>
2305
+ */
2306
+ getMultiLoanOrder(params: {
2307
+ order_id: string;
2308
+ }): Promise<APIResponse<MultiLoanOrder>>;
2309
+ /**
2310
+ * Repay Multi-Collateral Loan
2311
+ *
2312
+ * @param params Parameters for repaying a multi-collateral loan
2313
+ * @returns Promise<APIResponse<RepayMultiLoanResp>>
2314
+ */
2315
+ repayMultiLoan(params: RepayMultiLoanReq): Promise<APIResponse<RepayMultiLoanResp>>;
2316
+ /**
2317
+ * List Multi-Collateral Repay Records
2318
+ *
2319
+ * @param params Parameters for listing multi-collateral repay records
2320
+ * @returns Promise<APIResponse<GetMultiLoanRepayRecordsResp[]>>
2321
+ */
2322
+ getMultiLoanRepayRecords(params: GetMultiLoanRepayRecordsReq): Promise<APIResponse<MultiLoanRepayRecord[]>>;
2323
+ /**
2324
+ * Operate Multi-Collateral
2325
+ *
2326
+ * @param params Parameters for operating multi-collateral
2327
+ * @returns Promise<APIResponse<UpdateMultiLoanResp>>
2328
+ */
2329
+ updateMultiLoan(params: UpdateMultiLoanReq): Promise<APIResponse<UpdateMultiLoanResp>>;
2330
+ /**
2331
+ * Query collateral adjustment records
2332
+ *
2333
+ * @param params Parameters for querying collateral adjustment records
2334
+ * @returns Promise<APIResponse<GetMultiLoanAdjustmentRecordsResp[]>>
2335
+ */
2336
+ getMultiLoanAdjustmentRecords(params?: GetMultiLoanAdjustmentRecordsReq): Promise<APIResponse<MultiLoanAdjustmentRecord[]>>;
2337
+ /**
2338
+ * List User Currency Quota
2339
+ *
2340
+ * @param params Parameters for listing user currency quota
2341
+ * @returns Promise<APIResponse<GetMultiLoanCurrencyQuotaResp[]>>
2342
+ */
2343
+ getMultiLoanCurrencyQuota(params: {
2344
+ type: 'collateral' | 'borrow';
2345
+ currency: string;
2346
+ }): Promise<APIResponse<MultiLoanCurrencyQuota[]>>;
2347
+ /**
2348
+ * Query supported borrowing and collateral currencies in Multi-Collateral
2349
+ *
2350
+ * @returns Promise<APIResponse<GetMultiLoanSupportedCurrenciesResp>>
2351
+ */
2352
+ getMultiLoanSupportedCurrencies(): Promise<APIResponse<MultiLoanSupportedCurrencies>>;
2353
+ /**
2354
+ * Get Multi-Collateral ratio
2355
+ *
2356
+ * @returns Promise<APIResponse<GetMultiLoanRatioResp>>
2357
+ */
2358
+ getMultiLoanRatio(): Promise<APIResponse<MultiLoanRatio>>;
2359
+ /**
2360
+ * Query fixed interest rates for the currency for 7 days and 30 days
2361
+ *
2362
+ * @returns Promise<APIResponse<GetMultiLoanFixedRatesResp[]>>
2363
+ */
2364
+ getMultiLoanFixedRates(): Promise<APIResponse<MultiLoanFixedRate[]>>;
2365
+ /**==========================================================================================================================
2366
+ * EARN
2367
+ * ==========================================================================================================================
2368
+ */
2369
+ /**
2370
+ * ETH2 swap
2371
+ *
2372
+ * @param params Parameters for ETH2 swap
2373
+ * @returns Promise<APIResponse<any>>
2374
+ */
2375
+ submitEth2Swap(params: {
2376
+ side: '1' | '2';
2377
+ amount: string;
2378
+ }): Promise<APIResponse<any>>;
2379
+ /**
2380
+ * Dual Investment product list
2381
+ *
2382
+ * @returns Promise<APIResponse<GetDualInvestmentProductsResp[]>>
2383
+ */
2384
+ getDualInvestmentProducts(): Promise<APIResponse<DualInvestmentProduct[]>>;
2385
+ /**
2386
+ * Dual Investment order list
2387
+ *
2388
+ * @returns Promise<APIResponse<GetDualInvestmentOrdersResp[]>>
2389
+ */
2390
+ getDualInvestmentOrders(): Promise<APIResponse<DualInvestmentOrder[]>>;
2391
+ /**
2392
+ * Place Dual Investment order
2393
+ *
2394
+ * @param params Parameters for placing a dual investment order
2395
+ * @returns Promise<APIResponse<any>>
2396
+ */
2397
+ submitDualInvestmentOrder(params: {
2398
+ plan_id: string;
2399
+ copies: string;
2400
+ }): Promise<APIResponse<any>>;
2401
+ /**
2402
+ * Structured Product List
2403
+ *
2404
+ * @param params Parameters for listing structured products
2405
+ * @returns Promise<APIResponse<GetStructuredProductListResp[]>>
2406
+ */
2407
+ getStructuredProducts(params: GetStructuredProductListReq): Promise<APIResponse<StructuredProduct[]>>;
2408
+ /**
2409
+ * Structured Product Order List
2410
+ *
2411
+ * @param params Parameters for listing structured product orders
2412
+ * @returns Promise<APIResponse<GetStructuredProductOrdersResp[]>>
2413
+ */
2414
+ getStructuredProductOrders(params?: GetStructuredProductOrdersReq): Promise<APIResponse<StructuredProductOrder[]>>;
2415
+ /**
2416
+ * Place Structured Product Order
2417
+ *
2418
+ * @param params Parameters for placing a structured product order
2419
+ * @returns Promise<APIResponse<any>>
2420
+ */
2421
+ submitStructuredProductOrder(params: {
2422
+ pid?: string;
2423
+ amount?: string;
2424
+ }): Promise<APIResponse<any>>;
2425
+ /**==========================================================================================================================
2426
+ * ACCOUNT
2427
+ * ==========================================================================================================================
2428
+ */
2429
+ /**
2430
+ * Get account detail
2431
+ *
2432
+ * @returns Promise<APIResponse<GetAccountDetailResp>>
2433
+ */
2434
+ getAccountDetail(): Promise<APIResponse<AccountDetail>>;
2435
+ /**
2436
+ * Create STP Group
2437
+ *
2438
+ * @param params Parameters for creating an STP group
2439
+ * @returns Promise<APIResponse<CreateStpGroupResp>>
2440
+ */
2441
+ createStpGroup(params: CreateStpGroupReq): Promise<APIResponse<StpGroup>>;
2442
+ /**
2443
+ * List STP Groups
2444
+ *
2445
+ * @param params Parameters for listing STP groups
2446
+ * @returns Promise<APIResponse<CreateStpGroupResp[]>>
2447
+ */
2448
+ getStpGroups(params?: {
2449
+ name?: string;
2450
+ }): Promise<APIResponse<StpGroup[]>>;
2451
+ /**
2452
+ * List users of the STP group
2453
+ *
2454
+ * @param params Parameters for listing users of the STP group
2455
+ * @returns Promise<APIResponse<StpResp[]>>
2456
+ */
2457
+ getStpGroupUsers(params: {
2458
+ stp_id: number;
2459
+ }): Promise<APIResponse<StpGroupUser[]>>;
2460
+ /**
2461
+ * Add users to the STP group
2462
+ *
2463
+ * @param params Parameters for adding users to the STP group
2464
+ * @returns Promise<APIResponse<StpResp[]>>
2465
+ */
2466
+ addUsersToStpGroup(params: {
2467
+ stp_id: number;
2468
+ body: number[];
2469
+ }): Promise<APIResponse<StpGroupUser[]>>;
2470
+ /**
2471
+ * Delete the user in the STP group
2472
+ *
2473
+ * @param params Parameters for deleting users from the STP group
2474
+ * @returns Promise<APIResponse<StpResp[]>>
2475
+ */
2476
+ deleteUserFromStpGroup(params: {
2477
+ stp_id: number;
2478
+ user_id: number;
2479
+ }): Promise<APIResponse<StpGroupUser[]>>;
2480
+ /**==========================================================================================================================
2481
+ * REBATES
2482
+ * ==========================================================================================================================
2483
+ */
2484
+ /**
2485
+ * The agency obtains the transaction history of the recommended user.
2486
+ * Record time range cannot exceed 30 days.
2487
+ *
2488
+ * @param params Parameters for retrieving transaction history
2489
+ * @returns Promise<APIResponse<GetAgencyTransactionHistoryResp>>
2490
+ */
2491
+ getAgencyTransactionHistory(params: GetAgencyTransactionHistoryReq): Promise<APIResponse<{
2492
+ total: number;
2493
+ list: AgencyTransactionHistoryRecord[];
2494
+ }>>;
2495
+ /**
2496
+ * The agency obtains the commission history of the recommended user.
2497
+ * Record time range cannot exceed 30 days.
2498
+ *
2499
+ * @param params Parameters for retrieving commission history
2500
+ * @returns Promise<APIResponse<GetAgencyCommissionHistoryResp>>
2501
+ */
2502
+ getAgencyCommissionHistory(params: GetAgencyCommissionHistoryReq): Promise<APIResponse<{
2503
+ total: number;
2504
+ list: AgencyCommissionHistoryRecord[];
2505
+ }>>;
2506
+ /**
2507
+ * The broker obtains the user's commission rebate records.
2508
+ * Record time range cannot exceed 30 days.
2509
+ *
2510
+ * @param params Parameters for retrieving commission rebate records
2511
+ * @returns Promise<APIResponse<GetBrokerCommissionHistoryResp>>
2512
+ */
2513
+ getBrokerCommissionHistory(params: GetBrokerCommissionHistoryReq): Promise<APIResponse<{
2514
+ total: number;
2515
+ list: BrokerCommissionHistoryRecord[];
2516
+ }>>;
2517
+ /**
2518
+ * The broker obtains the user's trading history.
2519
+ * Record time range cannot exceed 30 days.
2520
+ *
2521
+ * @param params Parameters for retrieving trading history
2522
+ * @returns Promise<APIResponse<GetBrokerTransactionHistoryResp>>
2523
+ */
2524
+ getBrokerTransactionHistory(params: GetBrokerTransactionHistoryReq): Promise<APIResponse<{
2525
+ total: number;
2526
+ list: BrokerTransactionHistoryRecord[];
2527
+ }>>;
2528
+ /**
2529
+ * User retrieves rebate information.
2530
+ */
2531
+ getUserRebateInfo(): Promise<APIResponse<{
2532
+ invite_uid: number;
2533
+ }>>;
2534
+ }