bitget-api 2.3.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/README.md +272 -18
  2. package/{lib → dist/cjs}/broker-client.d.ts +3 -2
  3. package/{lib → dist/cjs}/broker-client.js +4 -4
  4. package/dist/cjs/broker-client.js.map +1 -0
  5. package/{lib → dist/cjs}/constants/enum.d.ts +3 -0
  6. package/{lib → dist/cjs}/constants/enum.js +3 -0
  7. package/dist/cjs/constants/enum.js.map +1 -0
  8. package/{lib → dist/cjs}/futures-client.d.ts +5 -2
  9. package/{lib → dist/cjs}/futures-client.js +18 -9
  10. package/dist/cjs/futures-client.js.map +1 -0
  11. package/dist/cjs/index.d.ts +50 -0
  12. package/dist/cjs/index.js +67 -0
  13. package/dist/cjs/index.js.map +1 -0
  14. package/dist/cjs/package.json +3 -0
  15. package/{lib → dist/cjs}/rest-client-v2.d.ts +17 -2
  16. package/{lib → dist/cjs}/rest-client-v2.js +62 -74
  17. package/dist/cjs/rest-client-v2.js.map +1 -0
  18. package/dist/cjs/rest-client-v3.d.ts +440 -0
  19. package/dist/cjs/rest-client-v3.js +573 -0
  20. package/dist/cjs/rest-client-v3.js.map +1 -0
  21. package/{lib → dist/cjs}/spot-client.d.ts +5 -2
  22. package/{lib → dist/cjs}/spot-client.js +21 -23
  23. package/dist/cjs/spot-client.js.map +1 -0
  24. package/{lib → dist/cjs}/types/request/shared.d.ts +4 -4
  25. package/dist/cjs/types/request/shared.js.map +1 -0
  26. package/{lib → dist/cjs}/types/request/v1/brokerV1.d.ts +1 -1
  27. package/dist/cjs/types/request/v1/brokerV1.js.map +1 -0
  28. package/{lib → dist/cjs}/types/request/v1/futuresV1.d.ts +10 -10
  29. package/dist/cjs/types/request/v1/futuresV1.js.map +1 -0
  30. package/{lib → dist/cjs}/types/request/v1/spotV1.d.ts +4 -4
  31. package/dist/cjs/types/request/v1/spotV1.js.map +1 -0
  32. package/{lib → dist/cjs}/types/request/v2/broker.d.ts +3 -3
  33. package/dist/cjs/types/request/v2/broker.js.map +1 -0
  34. package/{lib → dist/cjs}/types/request/v2/common.d.ts +1 -1
  35. package/dist/cjs/types/request/v2/common.js.map +1 -0
  36. package/{lib → dist/cjs}/types/request/v2/copytrading.d.ts +5 -5
  37. package/dist/cjs/types/request/v2/copytrading.js.map +1 -0
  38. package/dist/cjs/types/request/v2/earn.js.map +1 -0
  39. package/{lib → dist/cjs}/types/request/v2/futures.d.ts +9 -9
  40. package/dist/cjs/types/request/v2/futures.js.map +1 -0
  41. package/{lib → dist/cjs}/types/request/v2/margin.d.ts +5 -5
  42. package/dist/cjs/types/request/v2/margin.js.map +1 -0
  43. package/{lib → dist/cjs}/types/request/v2/spot.d.ts +12 -12
  44. package/dist/cjs/types/request/v2/spot.js.map +1 -0
  45. package/dist/cjs/types/request/v3/account.d.ts +162 -0
  46. package/dist/cjs/types/request/v3/account.js +4 -0
  47. package/dist/cjs/types/request/v3/account.js.map +1 -0
  48. package/dist/cjs/types/request/v3/loan.d.ts +31 -0
  49. package/dist/cjs/types/request/v3/loan.js +3 -0
  50. package/dist/cjs/types/request/v3/loan.js.map +1 -0
  51. package/dist/cjs/types/request/v3/public.d.ts +65 -0
  52. package/dist/cjs/types/request/v3/public.js +3 -0
  53. package/dist/cjs/types/request/v3/public.js.map +1 -0
  54. package/dist/cjs/types/request/v3/strategy.d.ts +46 -0
  55. package/dist/cjs/types/request/v3/strategy.js +3 -0
  56. package/dist/cjs/types/request/v3/strategy.js.map +1 -0
  57. package/dist/cjs/types/request/v3/trade.d.ts +112 -0
  58. package/dist/cjs/types/request/v3/trade.js +3 -0
  59. package/dist/cjs/types/request/v3/trade.js.map +1 -0
  60. package/{lib → dist/cjs}/types/response/v1/futures.d.ts +1 -1
  61. package/dist/cjs/types/response/v1/futures.js.map +1 -0
  62. package/dist/cjs/types/response/v1/shared.js.map +1 -0
  63. package/dist/cjs/types/response/v1/spot.js.map +1 -0
  64. package/dist/cjs/types/response/v2/broker.js.map +1 -0
  65. package/dist/cjs/types/response/v2/common.js.map +1 -0
  66. package/dist/cjs/types/response/v2/copy-trading.js.map +1 -0
  67. package/dist/cjs/types/response/v2/earn.js.map +1 -0
  68. package/{lib → dist/cjs}/types/response/v2/futures.d.ts +1 -1
  69. package/dist/cjs/types/response/v2/futures.js.map +1 -0
  70. package/dist/cjs/types/response/v2/margin.js.map +1 -0
  71. package/{lib → dist/cjs}/types/response/v2/spot.d.ts +1 -1
  72. package/dist/cjs/types/response/v2/spot.js.map +1 -0
  73. package/dist/cjs/types/response/v3/account.d.ts +197 -0
  74. package/dist/cjs/types/response/v3/account.js +3 -0
  75. package/dist/cjs/types/response/v3/account.js.map +1 -0
  76. package/dist/cjs/types/response/v3/loan.d.ts +85 -0
  77. package/dist/cjs/types/response/v3/loan.js +3 -0
  78. package/dist/cjs/types/response/v3/loan.js.map +1 -0
  79. package/dist/cjs/types/response/v3/public.d.ts +142 -0
  80. package/dist/cjs/types/response/v3/public.js +3 -0
  81. package/dist/cjs/types/response/v3/public.js.map +1 -0
  82. package/dist/cjs/types/response/v3/strategy.d.ts +26 -0
  83. package/dist/cjs/types/response/v3/strategy.js +3 -0
  84. package/dist/cjs/types/response/v3/strategy.js.map +1 -0
  85. package/dist/cjs/types/response/v3/trade.d.ts +193 -0
  86. package/dist/cjs/types/response/v3/trade.js +3 -0
  87. package/dist/cjs/types/response/v3/trade.js.map +1 -0
  88. package/dist/cjs/types/shared.d.ts +8 -0
  89. package/{lib → dist/cjs}/types/shared.js.map +1 -1
  90. package/dist/cjs/types/websockets/ws-api-request.d.ts +20 -0
  91. package/dist/cjs/types/websockets/ws-api-request.js +3 -0
  92. package/dist/cjs/types/websockets/ws-api-request.js.map +1 -0
  93. package/dist/cjs/types/websockets/ws-api-response.d.ts +6 -0
  94. package/dist/cjs/types/websockets/ws-api-response.js +3 -0
  95. package/dist/cjs/types/websockets/ws-api-response.js.map +1 -0
  96. package/dist/cjs/types/websockets/ws-api.d.ts +91 -0
  97. package/dist/cjs/types/websockets/ws-api.js +11 -0
  98. package/dist/cjs/types/websockets/ws-api.js.map +1 -0
  99. package/{lib/types/websockets/events.d.ts → dist/cjs/types/websockets/ws-events.d.ts} +6 -0
  100. package/dist/cjs/types/websockets/ws-events.js +11 -0
  101. package/dist/cjs/types/websockets/ws-events.js.map +1 -0
  102. package/dist/cjs/types/websockets/ws-general.d.ts +112 -0
  103. package/dist/cjs/types/websockets/ws-general.js +3 -0
  104. package/dist/cjs/types/websockets/ws-general.js.map +1 -0
  105. package/{lib → dist/cjs}/util/BaseRestClient.d.ts +3 -2
  106. package/dist/cjs/util/BaseRestClient.js +274 -0
  107. package/dist/cjs/util/BaseRestClient.js.map +1 -0
  108. package/dist/cjs/util/BaseWSClient.d.ts +197 -0
  109. package/dist/cjs/util/BaseWSClient.js +759 -0
  110. package/dist/cjs/util/BaseWSClient.js.map +1 -0
  111. package/dist/cjs/util/WsStore.d.ts +74 -0
  112. package/dist/cjs/util/WsStore.js +287 -0
  113. package/dist/cjs/util/WsStore.js.map +1 -0
  114. package/{lib → dist/cjs}/util/WsStore.types.d.ts +27 -1
  115. package/{lib → dist/cjs}/util/WsStore.types.js +3 -2
  116. package/dist/cjs/util/WsStore.types.js.map +1 -0
  117. package/dist/cjs/util/logger.d.ts +8 -0
  118. package/{lib → dist/cjs}/util/logger.js +2 -10
  119. package/dist/cjs/util/logger.js.map +1 -0
  120. package/{lib → dist/cjs}/util/requestUtils.d.ts +18 -1
  121. package/{lib → dist/cjs}/util/requestUtils.js +6 -5
  122. package/dist/cjs/util/requestUtils.js.map +1 -0
  123. package/{lib → dist/cjs}/util/type-guards.d.ts +4 -1
  124. package/{lib → dist/cjs}/util/type-guards.js +20 -10
  125. package/dist/cjs/util/type-guards.js.map +1 -0
  126. package/dist/cjs/util/webCryptoAPI.d.ts +14 -0
  127. package/dist/cjs/util/webCryptoAPI.js +80 -0
  128. package/dist/cjs/util/webCryptoAPI.js.map +1 -0
  129. package/dist/cjs/util/websocket-util.d.ts +88 -0
  130. package/dist/cjs/util/websocket-util.js +241 -0
  131. package/dist/cjs/util/websocket-util.js.map +1 -0
  132. package/dist/cjs/websocket-api-client.d.ts +89 -0
  133. package/dist/cjs/websocket-api-client.js +122 -0
  134. package/dist/cjs/websocket-api-client.js.map +1 -0
  135. package/{lib/websocket-client.d.ts → dist/cjs/websocket-client-legacy-v1.d.ts} +6 -6
  136. package/{lib/websocket-client.js → dist/cjs/websocket-client-legacy-v1.js} +211 -156
  137. package/dist/cjs/websocket-client-legacy-v1.js.map +1 -0
  138. package/dist/cjs/websocket-client-v2.d.ts +79 -0
  139. package/dist/cjs/websocket-client-v2.js +339 -0
  140. package/dist/cjs/websocket-client-v2.js.map +1 -0
  141. package/dist/cjs/websocket-client-v3.d.ts +84 -0
  142. package/dist/cjs/websocket-client-v3.js +408 -0
  143. package/dist/cjs/websocket-client-v3.js.map +1 -0
  144. package/dist/mjs/broker-client.d.ts +127 -0
  145. package/dist/mjs/broker-client.js +158 -0
  146. package/dist/mjs/broker-client.js.map +1 -0
  147. package/dist/mjs/constants/enum.d.ts +31 -0
  148. package/dist/mjs/constants/enum.js +32 -0
  149. package/dist/mjs/constants/enum.js.map +1 -0
  150. package/dist/mjs/futures-client.d.ts +184 -0
  151. package/dist/mjs/futures-client.js +473 -0
  152. package/dist/mjs/futures-client.js.map +1 -0
  153. package/dist/mjs/index.d.ts +50 -0
  154. package/dist/mjs/index.js +51 -0
  155. package/dist/mjs/index.js.map +1 -0
  156. package/dist/mjs/package.json +3 -0
  157. package/dist/mjs/rest-client-v2.d.ts +1098 -0
  158. package/dist/mjs/rest-client-v2.js +1092 -0
  159. package/dist/mjs/rest-client-v2.js.map +1 -0
  160. package/dist/mjs/rest-client-v3.d.ts +440 -0
  161. package/dist/mjs/rest-client-v3.js +566 -0
  162. package/dist/mjs/rest-client-v3.js.map +1 -0
  163. package/dist/mjs/spot-client.d.ts +154 -0
  164. package/dist/mjs/spot-client.js +273 -0
  165. package/dist/mjs/spot-client.js.map +1 -0
  166. package/dist/mjs/types/request/shared.d.ts +23 -0
  167. package/dist/mjs/types/request/shared.js +2 -0
  168. package/dist/mjs/types/request/shared.js.map +1 -0
  169. package/dist/mjs/types/request/v1/brokerV1.d.ts +23 -0
  170. package/dist/mjs/types/request/v1/brokerV1.js +2 -0
  171. package/dist/mjs/types/request/v1/brokerV1.js.map +1 -0
  172. package/dist/mjs/types/request/v1/futuresV1.d.ts +168 -0
  173. package/dist/mjs/types/request/v1/futuresV1.js +2 -0
  174. package/dist/mjs/types/request/v1/futuresV1.js.map +1 -0
  175. package/dist/mjs/types/request/v1/spotV1.d.ts +105 -0
  176. package/dist/mjs/types/request/v1/spotV1.js +2 -0
  177. package/dist/mjs/types/request/v1/spotV1.js.map +1 -0
  178. package/dist/mjs/types/request/v2/broker.d.ts +69 -0
  179. package/dist/mjs/types/request/v2/broker.js +7 -0
  180. package/dist/mjs/types/request/v2/broker.js.map +1 -0
  181. package/dist/mjs/types/request/v2/common.d.ts +163 -0
  182. package/dist/mjs/types/request/v2/common.js +2 -0
  183. package/dist/mjs/types/request/v2/common.js.map +1 -0
  184. package/dist/mjs/types/request/v2/copytrading.d.ts +196 -0
  185. package/dist/mjs/types/request/v2/copytrading.js +9 -0
  186. package/dist/mjs/types/request/v2/copytrading.js.map +1 -0
  187. package/dist/mjs/types/request/v2/earn.d.ts +121 -0
  188. package/dist/mjs/types/request/v2/earn.js +9 -0
  189. package/dist/mjs/types/request/v2/earn.js.map +1 -0
  190. package/dist/mjs/types/request/v2/futures.d.ts +363 -0
  191. package/dist/mjs/types/request/v2/futures.js +2 -0
  192. package/dist/mjs/types/request/v2/futures.js.map +1 -0
  193. package/dist/mjs/types/request/v2/margin.d.ts +121 -0
  194. package/dist/mjs/types/request/v2/margin.js +7 -0
  195. package/dist/mjs/types/request/v2/margin.js.map +1 -0
  196. package/dist/mjs/types/request/v2/spot.d.ts +265 -0
  197. package/dist/mjs/types/request/v2/spot.js +2 -0
  198. package/dist/mjs/types/request/v2/spot.js.map +1 -0
  199. package/dist/mjs/types/request/v3/account.d.ts +162 -0
  200. package/dist/mjs/types/request/v3/account.js +3 -0
  201. package/dist/mjs/types/request/v3/account.js.map +1 -0
  202. package/dist/mjs/types/request/v3/loan.d.ts +31 -0
  203. package/dist/mjs/types/request/v3/loan.js +2 -0
  204. package/dist/mjs/types/request/v3/loan.js.map +1 -0
  205. package/dist/mjs/types/request/v3/public.d.ts +65 -0
  206. package/dist/mjs/types/request/v3/public.js +2 -0
  207. package/dist/mjs/types/request/v3/public.js.map +1 -0
  208. package/dist/mjs/types/request/v3/strategy.d.ts +46 -0
  209. package/dist/mjs/types/request/v3/strategy.js +2 -0
  210. package/dist/mjs/types/request/v3/strategy.js.map +1 -0
  211. package/dist/mjs/types/request/v3/trade.d.ts +112 -0
  212. package/dist/mjs/types/request/v3/trade.js +2 -0
  213. package/dist/mjs/types/request/v3/trade.js.map +1 -0
  214. package/dist/mjs/types/response/v1/futures.d.ts +72 -0
  215. package/dist/mjs/types/response/v1/futures.js +2 -0
  216. package/dist/mjs/types/response/v1/futures.js.map +1 -0
  217. package/dist/mjs/types/response/v1/shared.d.ts +15 -0
  218. package/dist/mjs/types/response/v1/shared.js +2 -0
  219. package/dist/mjs/types/response/v1/shared.js.map +1 -0
  220. package/dist/mjs/types/response/v1/spot.d.ts +65 -0
  221. package/dist/mjs/types/response/v1/spot.js +2 -0
  222. package/dist/mjs/types/response/v1/spot.js.map +1 -0
  223. package/dist/mjs/types/response/v2/broker.d.ts +135 -0
  224. package/dist/mjs/types/response/v2/broker.js +7 -0
  225. package/dist/mjs/types/response/v2/broker.js.map +1 -0
  226. package/dist/mjs/types/response/v2/common.d.ts +384 -0
  227. package/dist/mjs/types/response/v2/common.js +7 -0
  228. package/dist/mjs/types/response/v2/common.js.map +1 -0
  229. package/dist/mjs/types/response/v2/copy-trading.d.ts +385 -0
  230. package/dist/mjs/types/response/v2/copy-trading.js +9 -0
  231. package/dist/mjs/types/response/v2/copy-trading.js.map +1 -0
  232. package/dist/mjs/types/response/v2/earn.d.ts +294 -0
  233. package/dist/mjs/types/response/v2/earn.js +9 -0
  234. package/dist/mjs/types/response/v2/earn.js.map +1 -0
  235. package/dist/mjs/types/response/v2/futures.d.ts +546 -0
  236. package/dist/mjs/types/response/v2/futures.js +7 -0
  237. package/dist/mjs/types/response/v2/futures.js.map +1 -0
  238. package/dist/mjs/types/response/v2/margin.d.ts +277 -0
  239. package/dist/mjs/types/response/v2/margin.js +7 -0
  240. package/dist/mjs/types/response/v2/margin.js.map +1 -0
  241. package/dist/mjs/types/response/v2/spot.d.ts +385 -0
  242. package/dist/mjs/types/response/v2/spot.js +7 -0
  243. package/dist/mjs/types/response/v2/spot.js.map +1 -0
  244. package/dist/mjs/types/response/v3/account.d.ts +197 -0
  245. package/dist/mjs/types/response/v3/account.js +2 -0
  246. package/dist/mjs/types/response/v3/account.js.map +1 -0
  247. package/dist/mjs/types/response/v3/loan.d.ts +85 -0
  248. package/dist/mjs/types/response/v3/loan.js +2 -0
  249. package/dist/mjs/types/response/v3/loan.js.map +1 -0
  250. package/dist/mjs/types/response/v3/public.d.ts +142 -0
  251. package/dist/mjs/types/response/v3/public.js +2 -0
  252. package/dist/mjs/types/response/v3/public.js.map +1 -0
  253. package/dist/mjs/types/response/v3/strategy.d.ts +26 -0
  254. package/dist/mjs/types/response/v3/strategy.js +2 -0
  255. package/dist/mjs/types/response/v3/strategy.js.map +1 -0
  256. package/dist/mjs/types/response/v3/trade.d.ts +193 -0
  257. package/dist/mjs/types/response/v3/trade.js +2 -0
  258. package/dist/mjs/types/response/v3/trade.js.map +1 -0
  259. package/dist/mjs/types/shared.d.ts +8 -0
  260. package/dist/mjs/types/shared.js +2 -0
  261. package/{lib/types/request → dist/mjs/types}/shared.js.map +1 -1
  262. package/dist/mjs/types/websockets/ws-api-request.d.ts +20 -0
  263. package/dist/mjs/types/websockets/ws-api-request.js +2 -0
  264. package/dist/mjs/types/websockets/ws-api-request.js.map +1 -0
  265. package/dist/mjs/types/websockets/ws-api-response.d.ts +6 -0
  266. package/dist/mjs/types/websockets/ws-api-response.js +2 -0
  267. package/dist/mjs/types/websockets/ws-api-response.js.map +1 -0
  268. package/dist/mjs/types/websockets/ws-api.d.ts +91 -0
  269. package/dist/mjs/types/websockets/ws-api.js +8 -0
  270. package/dist/mjs/types/websockets/ws-api.js.map +1 -0
  271. package/dist/mjs/types/websockets/ws-events.d.ts +81 -0
  272. package/dist/mjs/types/websockets/ws-events.js +8 -0
  273. package/dist/mjs/types/websockets/ws-events.js.map +1 -0
  274. package/dist/mjs/types/websockets/ws-general.d.ts +112 -0
  275. package/dist/mjs/types/websockets/ws-general.js +2 -0
  276. package/dist/mjs/types/websockets/ws-general.js.map +1 -0
  277. package/dist/mjs/util/BaseRestClient.d.ts +40 -0
  278. package/dist/mjs/util/BaseRestClient.js +268 -0
  279. package/dist/mjs/util/BaseRestClient.js.map +1 -0
  280. package/dist/mjs/util/BaseWSClient.d.ts +197 -0
  281. package/dist/mjs/util/BaseWSClient.js +752 -0
  282. package/dist/mjs/util/BaseWSClient.js.map +1 -0
  283. package/dist/mjs/util/WsStore.d.ts +74 -0
  284. package/dist/mjs/util/WsStore.js +282 -0
  285. package/dist/mjs/util/WsStore.js.map +1 -0
  286. package/dist/mjs/util/WsStore.types.d.ts +52 -0
  287. package/dist/mjs/util/WsStore.types.js +11 -0
  288. package/dist/mjs/util/WsStore.types.js.map +1 -0
  289. package/dist/mjs/util/logger.d.ts +8 -0
  290. package/dist/mjs/util/logger.js +14 -0
  291. package/dist/mjs/util/logger.js.map +1 -0
  292. package/dist/mjs/util/requestUtils.d.ts +61 -0
  293. package/dist/mjs/util/requestUtils.js +50 -0
  294. package/dist/mjs/util/requestUtils.js.map +1 -0
  295. package/dist/mjs/util/type-guards.d.ts +16 -0
  296. package/dist/mjs/util/type-guards.js +62 -0
  297. package/dist/mjs/util/type-guards.js.map +1 -0
  298. package/dist/mjs/util/webCryptoAPI.d.ts +14 -0
  299. package/dist/mjs/util/webCryptoAPI.js +76 -0
  300. package/dist/mjs/util/webCryptoAPI.js.map +1 -0
  301. package/dist/mjs/util/websocket-util.d.ts +88 -0
  302. package/dist/mjs/util/websocket-util.js +227 -0
  303. package/dist/mjs/util/websocket-util.js.map +1 -0
  304. package/dist/mjs/websocket-api-client.d.ts +89 -0
  305. package/dist/mjs/websocket-api-client.js +118 -0
  306. package/dist/mjs/websocket-api-client.js.map +1 -0
  307. package/{lib/util/BaseWSClient.d.ts → dist/mjs/websocket-client-legacy-v1.d.ts} +44 -27
  308. package/dist/mjs/websocket-client-legacy-v1.js +502 -0
  309. package/dist/mjs/websocket-client-legacy-v1.js.map +1 -0
  310. package/dist/mjs/websocket-client-v2.d.ts +79 -0
  311. package/dist/mjs/websocket-client-v2.js +335 -0
  312. package/dist/mjs/websocket-client-v2.js.map +1 -0
  313. package/dist/mjs/websocket-client-v3.d.ts +84 -0
  314. package/dist/mjs/websocket-client-v3.js +404 -0
  315. package/dist/mjs/websocket-client-v3.js.map +1 -0
  316. package/package.json +33 -15
  317. package/index.js +0 -1
  318. package/lib/broker-client.js.map +0 -1
  319. package/lib/constants/enum.js.map +0 -1
  320. package/lib/futures-client.js.map +0 -1
  321. package/lib/index.d.ts +0 -10
  322. package/lib/index.js +0 -27
  323. package/lib/index.js.map +0 -1
  324. package/lib/rest-client-v2.js.map +0 -1
  325. package/lib/spot-client.js.map +0 -1
  326. package/lib/types/index.d.ts +0 -4
  327. package/lib/types/index.js +0 -21
  328. package/lib/types/index.js.map +0 -1
  329. package/lib/types/request/index.d.ts +0 -11
  330. package/lib/types/request/index.js +0 -28
  331. package/lib/types/request/index.js.map +0 -1
  332. package/lib/types/request/v1/brokerV1.js.map +0 -1
  333. package/lib/types/request/v1/futuresV1.js.map +0 -1
  334. package/lib/types/request/v1/spotV1.js.map +0 -1
  335. package/lib/types/request/v2/broker.js.map +0 -1
  336. package/lib/types/request/v2/common.js.map +0 -1
  337. package/lib/types/request/v2/copytrading.js.map +0 -1
  338. package/lib/types/request/v2/earn.js.map +0 -1
  339. package/lib/types/request/v2/futures.js.map +0 -1
  340. package/lib/types/request/v2/margin.js.map +0 -1
  341. package/lib/types/request/v2/spot.js.map +0 -1
  342. package/lib/types/response/index.d.ts +0 -10
  343. package/lib/types/response/index.js +0 -27
  344. package/lib/types/response/index.js.map +0 -1
  345. package/lib/types/response/v1/futures.js.map +0 -1
  346. package/lib/types/response/v1/shared.js.map +0 -1
  347. package/lib/types/response/v1/spot.js.map +0 -1
  348. package/lib/types/response/v2/broker.js.map +0 -1
  349. package/lib/types/response/v2/common.js.map +0 -1
  350. package/lib/types/response/v2/copy-trading.js.map +0 -1
  351. package/lib/types/response/v2/earn.js.map +0 -1
  352. package/lib/types/response/v2/futures.js.map +0 -1
  353. package/lib/types/response/v2/margin.js.map +0 -1
  354. package/lib/types/response/v2/spot.js.map +0 -1
  355. package/lib/types/shared.d.ts +0 -8
  356. package/lib/types/websockets/client.d.ts +0 -76
  357. package/lib/types/websockets/client.js +0 -3
  358. package/lib/types/websockets/client.js.map +0 -1
  359. package/lib/types/websockets/events.js +0 -3
  360. package/lib/types/websockets/events.js.map +0 -1
  361. package/lib/types/websockets/index.d.ts +0 -2
  362. package/lib/types/websockets/index.js +0 -19
  363. package/lib/types/websockets/index.js.map +0 -1
  364. package/lib/util/BaseRestClient.js +0 -221
  365. package/lib/util/BaseRestClient.js.map +0 -1
  366. package/lib/util/BaseWSClient.js +0 -395
  367. package/lib/util/BaseWSClient.js.map +0 -1
  368. package/lib/util/WsStore.d.ts +0 -26
  369. package/lib/util/WsStore.js +0 -126
  370. package/lib/util/WsStore.js.map +0 -1
  371. package/lib/util/WsStore.types.js.map +0 -1
  372. package/lib/util/browser-support.d.ts +0 -1
  373. package/lib/util/browser-support.js +0 -45
  374. package/lib/util/browser-support.js.map +0 -1
  375. package/lib/util/index.d.ts +0 -6
  376. package/lib/util/index.js +0 -23
  377. package/lib/util/index.js.map +0 -1
  378. package/lib/util/logger.d.ts +0 -9
  379. package/lib/util/logger.js.map +0 -1
  380. package/lib/util/node-support.d.ts +0 -2
  381. package/lib/util/node-support.js +0 -34
  382. package/lib/util/node-support.js.map +0 -1
  383. package/lib/util/requestUtils.js.map +0 -1
  384. package/lib/util/type-guards.js.map +0 -1
  385. package/lib/util/websocket-util.d.ts +0 -47
  386. package/lib/util/websocket-util.js +0 -154
  387. package/lib/util/websocket-util.js.map +0 -1
  388. package/lib/websocket-client-v2.d.ts +0 -33
  389. package/lib/websocket-client-v2.js +0 -104
  390. package/lib/websocket-client-v2.js.map +0 -1
  391. package/lib/websocket-client.js.map +0 -1
  392. /package/{lib → dist/cjs}/types/request/shared.js +0 -0
  393. /package/{lib → dist/cjs}/types/request/v1/brokerV1.js +0 -0
  394. /package/{lib → dist/cjs}/types/request/v1/futuresV1.js +0 -0
  395. /package/{lib → dist/cjs}/types/request/v1/spotV1.js +0 -0
  396. /package/{lib → dist/cjs}/types/request/v2/broker.js +0 -0
  397. /package/{lib → dist/cjs}/types/request/v2/common.js +0 -0
  398. /package/{lib → dist/cjs}/types/request/v2/copytrading.js +0 -0
  399. /package/{lib → dist/cjs}/types/request/v2/earn.d.ts +0 -0
  400. /package/{lib → dist/cjs}/types/request/v2/earn.js +0 -0
  401. /package/{lib → dist/cjs}/types/request/v2/futures.js +0 -0
  402. /package/{lib → dist/cjs}/types/request/v2/margin.js +0 -0
  403. /package/{lib → dist/cjs}/types/request/v2/spot.js +0 -0
  404. /package/{lib → dist/cjs}/types/response/v1/futures.js +0 -0
  405. /package/{lib → dist/cjs}/types/response/v1/shared.d.ts +0 -0
  406. /package/{lib → dist/cjs}/types/response/v1/shared.js +0 -0
  407. /package/{lib → dist/cjs}/types/response/v1/spot.d.ts +0 -0
  408. /package/{lib → dist/cjs}/types/response/v1/spot.js +0 -0
  409. /package/{lib → dist/cjs}/types/response/v2/broker.d.ts +0 -0
  410. /package/{lib → dist/cjs}/types/response/v2/broker.js +0 -0
  411. /package/{lib → dist/cjs}/types/response/v2/common.d.ts +0 -0
  412. /package/{lib → dist/cjs}/types/response/v2/common.js +0 -0
  413. /package/{lib → dist/cjs}/types/response/v2/copy-trading.d.ts +0 -0
  414. /package/{lib → dist/cjs}/types/response/v2/copy-trading.js +0 -0
  415. /package/{lib → dist/cjs}/types/response/v2/earn.d.ts +0 -0
  416. /package/{lib → dist/cjs}/types/response/v2/earn.js +0 -0
  417. /package/{lib → dist/cjs}/types/response/v2/futures.js +0 -0
  418. /package/{lib → dist/cjs}/types/response/v2/margin.d.ts +0 -0
  419. /package/{lib → dist/cjs}/types/response/v2/margin.js +0 -0
  420. /package/{lib → dist/cjs}/types/response/v2/spot.js +0 -0
  421. /package/{lib → dist/cjs}/types/shared.js +0 -0
@@ -0,0 +1,1092 @@
1
+ import BaseRestClient from './util/BaseRestClient.js';
2
+ import { REST_CLIENT_TYPE_ENUM } from './util/requestUtils.js';
3
+ import { assertMarginType } from './util/type-guards.js';
4
+ /**
5
+ * REST API client for all V2 endpoints
6
+ */
7
+ export class RestClientV2 extends BaseRestClient {
8
+ getClientType() {
9
+ return REST_CLIENT_TYPE_ENUM.v2;
10
+ }
11
+ /**
12
+ *
13
+ * Custom SDK functions
14
+ *
15
+ */
16
+ /**
17
+ * This method is used to get the latency and time sync between the client and the server.
18
+ * This is not official API endpoint and is only used for internal testing purposes.
19
+ * Use this method to check the latency and time sync between the client and the server.
20
+ * Final values might vary slightly, but it should be within few ms difference.
21
+ * If you have any suggestions or improvements to this measurement, please create an issue or pull request on GitHub.
22
+ */
23
+ async fetchLatencySummary() {
24
+ const clientTimeReqStart = Date.now();
25
+ const serverTime = await this.getServerTime();
26
+ const clientTimeReqEnd = Date.now();
27
+ console.log('serverTime', serverTime);
28
+ const serverTimeMs = Number(serverTime.data.serverTime);
29
+ const roundTripTime = clientTimeReqEnd - clientTimeReqStart;
30
+ const estimatedOneWayLatency = Math.floor(roundTripTime / 2);
31
+ // Adjust server time by adding estimated one-way latency
32
+ const adjustedServerTime = serverTimeMs + estimatedOneWayLatency;
33
+ // Calculate time difference between adjusted server time and local time
34
+ const timeDifference = adjustedServerTime - clientTimeReqEnd;
35
+ const result = {
36
+ localTime: clientTimeReqEnd,
37
+ serverTime: serverTimeMs,
38
+ roundTripTime,
39
+ estimatedOneWayLatency,
40
+ adjustedServerTime,
41
+ timeDifference,
42
+ };
43
+ console.log('Time synchronization results:');
44
+ console.log(result);
45
+ console.log(`Your approximate latency to exchange server:
46
+ One way: ${estimatedOneWayLatency}ms.
47
+ Round trip: ${roundTripTime}ms.
48
+ `);
49
+ if (timeDifference > 500) {
50
+ console.warn(`WARNING! Time difference between server and client clock is greater than 500ms. It is currently ${timeDifference}ms.
51
+ Consider adjusting your system clock to avoid unwanted clock sync errors!
52
+ Visit https://github.com/tiagosiebler/awesome-crypto-examples/wiki/Timestamp-for-this-request-is-outside-of-the-recvWindow for more information`);
53
+ }
54
+ else {
55
+ console.log(`Time difference between server and client clock is within acceptable range of 500ms. It is currently ${timeDifference}ms.`);
56
+ }
57
+ return result;
58
+ }
59
+ async fetchServerTime() {
60
+ const res = await this.getServerTime();
61
+ return Number(res.data);
62
+ }
63
+ /**
64
+ *
65
+ * Bitget misc functions
66
+ *
67
+ */
68
+ /**
69
+ *
70
+ *
71
+ * Common
72
+ *
73
+ *
74
+ */
75
+ /**
76
+ *
77
+ * * Common | Notice
78
+ *
79
+ */
80
+ getAnnouncements(params) {
81
+ return this.get('/api/v2/public/annoucements', params);
82
+ }
83
+ /**
84
+ *
85
+ * * Common | Public
86
+ *
87
+ */
88
+ getServerTime() {
89
+ return this.get('/api/v2/public/time');
90
+ }
91
+ getTradeRate(params) {
92
+ return this.getPrivate('/api/v2/common/trade-rate', params);
93
+ }
94
+ /**
95
+ *
96
+ * * Common | Tax
97
+ *
98
+ */
99
+ getSpotTransactionRecords(params) {
100
+ return this.getPrivate('/api/v2/tax/spot-record', params);
101
+ }
102
+ getFuturesTransactionRecords(params) {
103
+ return this.getPrivate('/api/v2/tax/future-record', params);
104
+ }
105
+ getMarginTransactionRecords(params) {
106
+ return this.getPrivate('/api/v2/tax/margin-record', params);
107
+ }
108
+ getP2PTransactionRecords(params) {
109
+ return this.getPrivate('/api/v2/tax/p2p-record', params);
110
+ }
111
+ /**
112
+ *
113
+ * * Common | P2P
114
+ *
115
+ */
116
+ getP2PMerchantList(params) {
117
+ return this.getPrivate('/api/v2/p2p/merchantList', params);
118
+ }
119
+ getP2PMerchantInfo() {
120
+ return this.getPrivate('/api/v2/p2p/merchantInfo');
121
+ }
122
+ getP2PMerchantOrders(params) {
123
+ return this.getPrivate('/api/v2/p2p/orderList', params);
124
+ }
125
+ getP2PMerchantAdvertisementList(params) {
126
+ return this.getPrivate('/api/v2/p2p/advList', params);
127
+ }
128
+ /**
129
+ *
130
+ * * Common | Trading insights
131
+ *
132
+ */
133
+ getSpotWhaleNetFlowData(params) {
134
+ return this.getPrivate('/api/v2/spot/market/whale-net-flow', params);
135
+ }
136
+ getFuturesActiveTakerBuySellVolumeData(params) {
137
+ return this.get('/api/v2/mix/market/taker-buy-sell', params);
138
+ }
139
+ getFuturesActiveLongShortPositionData(params) {
140
+ return this.get('/api/v2/mix/market/position-long-short', params);
141
+ }
142
+ getFuturesLongShortRatio(params) {
143
+ return this.get('/api/v2/mix/market/long-short-ratio', params);
144
+ }
145
+ getMarginLoanGrowthRate(params) {
146
+ return this.get('/api/v2/mix/market/loan-growth', params);
147
+ }
148
+ getIsolatedMarginBorrowingRatio(params) {
149
+ return this.get('/api/v2/mix/market/isolated-borrow-rate', params);
150
+ }
151
+ getFuturesActiveBuySellVolumeData(params) {
152
+ return this.get('/api/v2/mix/market/long-short', params);
153
+ }
154
+ getSpotFundFlow(params) {
155
+ return this.get('/api/v2/spot/market/fund-flow', params);
156
+ }
157
+ getTradeDataSupportSymbols() {
158
+ return this.get('/api/v2/spot/market/support-symbols');
159
+ }
160
+ getSpotFundNetFlowData(params) {
161
+ return this.get('/api/v2/spot/market/fund-net-flow', params);
162
+ }
163
+ getFuturesActiveLongShortAccountData(params) {
164
+ return this.get('/api/v2/mix/market/account-long-short', params);
165
+ }
166
+ /**
167
+ *
168
+ * * Common | Virtual Subaccount
169
+ *
170
+ */
171
+ createVirtualSubaccount(params) {
172
+ return this.postPrivate('/api/v2/user/create-virtual-subaccount', params);
173
+ }
174
+ modifyVirtualSubaccount(params) {
175
+ return this.postPrivate('/api/v2/user/modify-virtual-subaccount', params);
176
+ }
177
+ batchCreateVirtualSubaccountAndAPIKey(params) {
178
+ return this.postPrivate('/api/v2/user/batch-create-subaccount-and-apikey', params);
179
+ }
180
+ getVirtualSubaccounts(params) {
181
+ return this.getPrivate('/api/v2/user/virtual-subaccount-list', params);
182
+ }
183
+ createVirtualSubaccountAPIKey(params) {
184
+ return this.postPrivate('/api/v2/user/create-virtual-subaccount-apikey', params);
185
+ }
186
+ modifyVirtualSubaccountAPIKey(params) {
187
+ return this.postPrivate('/api/v2/user/modify-virtual-subaccount-apikey', params);
188
+ }
189
+ getVirtualSubaccountAPIKeys(params) {
190
+ return this.getPrivate('/api/v2/user/virtual-subaccount-apikey-list', params);
191
+ }
192
+ /**
193
+ *
194
+ * * Common | Assets
195
+ *
196
+ */
197
+ getFundingAssets(params) {
198
+ return this.getPrivate('/api/v2/account/funding-assets', params);
199
+ }
200
+ getBotAccount(params) {
201
+ return this.getPrivate('/api/v2/account/bot-assets', params);
202
+ }
203
+ /** Get assets overview */
204
+ getBalances() {
205
+ return this.getPrivate('/api/v2/account/all-account-balance');
206
+ }
207
+ /**
208
+ *
209
+ * * Common | Convert
210
+ *
211
+ */
212
+ getConvertCoins() {
213
+ return this.getPrivate('/api/v2/convert/currencies');
214
+ }
215
+ getConvertQuotedPrice(params) {
216
+ return this.getPrivate('/api/v2/convert/quoted-price', params);
217
+ }
218
+ convert(params) {
219
+ return this.postPrivate('/api/v2/convert/trade', params);
220
+ }
221
+ getConvertHistory(params) {
222
+ return this.getPrivate('/api/v2/convert/convert-record', params);
223
+ }
224
+ /**
225
+ *
226
+ * * Common | BGB Convert
227
+ *
228
+ */
229
+ getConvertBGBCoins() {
230
+ return this.getPrivate('/api/v2/convert/bgb-convert-coin-list');
231
+ }
232
+ convertBGB(params) {
233
+ return this.postPrivate('/api/v2/convert/bgb-convert', params);
234
+ }
235
+ getConvertBGBHistory(params) {
236
+ return this.getPrivate('/api/v2/convert/bgb-convert-records', params);
237
+ }
238
+ /**
239
+ *
240
+ *
241
+ * Spot
242
+ *
243
+ *
244
+ */
245
+ /**
246
+ *
247
+ * * Spot | Market
248
+ *
249
+ */
250
+ getSpotCoinInfo(params) {
251
+ return this.getPrivate('/api/v2/spot/public/coins', params);
252
+ }
253
+ getSpotSymbolInfo(params) {
254
+ return this.getPrivate('/api/v2/spot/public/symbols', params);
255
+ }
256
+ getSpotVIPFeeRate() {
257
+ return this.getPrivate('/api/v2/spot/market/vip-fee-rate');
258
+ }
259
+ getSpotTicker(params) {
260
+ return this.getPrivate('/api/v2/spot/market/tickers', params);
261
+ }
262
+ getSpotMergeDepth(params) {
263
+ return this.getPrivate('/api/v2/spot/market/merge-depth', params);
264
+ }
265
+ getSpotOrderBookDepth(params) {
266
+ return this.getPrivate('/api/v2/spot/market/orderbook', params);
267
+ }
268
+ getSpotCandles(params) {
269
+ return this.getPrivate('/api/v2/spot/market/candles', params);
270
+ }
271
+ getSpotHistoricCandles(params) {
272
+ return this.getPrivate('/api/v2/spot/market/history-candles', params);
273
+ }
274
+ getSpotRecentTrades(params) {
275
+ return this.getPrivate('/api/v2/spot/market/fills', params);
276
+ }
277
+ getSpotHistoricTrades(params) {
278
+ return this.getPrivate('/api/v2/spot/market/fills-history', params);
279
+ }
280
+ /**
281
+ *
282
+ * * Spot | Trade
283
+ *
284
+ */
285
+ spotSubmitOrder(params) {
286
+ return this.postPrivate('/api/v2/spot/trade/place-order', params);
287
+ }
288
+ spotCancelandSubmitOrder(params) {
289
+ return this.postPrivate('/api/v2/spot/trade/cancel-replace-order', params);
290
+ }
291
+ spotBatchCancelandSubmitOrder(params) {
292
+ return this.postPrivate('/api/v2/spot/trade/batch-cancel-replace-order', params);
293
+ }
294
+ spotCancelOrder(params) {
295
+ return this.postPrivate('/api/v2/spot/trade/cancel-order', params);
296
+ }
297
+ spotBatchSubmitOrders(params) {
298
+ return this.postPrivate('/api/v2/spot/trade/batch-orders', params);
299
+ }
300
+ spotBatchCancelOrders(params) {
301
+ return this.postPrivate('/api/v2/spot/trade/batch-cancel-order', params);
302
+ }
303
+ spotCancelSymbolOrder(params) {
304
+ return this.postPrivate('/api/v2/spot/trade/cancel-symbol-order', params);
305
+ }
306
+ getSpotOrder(params) {
307
+ return this.getPrivate('/api/v2/spot/trade/orderInfo', params);
308
+ }
309
+ getSpotOpenOrders(params) {
310
+ return this.getPrivate('/api/v2/spot/trade/unfilled-orders', params);
311
+ }
312
+ getSpotHistoricOrders(params) {
313
+ return this.getPrivate('/api/v2/spot/trade/history-orders', params);
314
+ }
315
+ getSpotFills(params) {
316
+ return this.getPrivate('/api/v2/spot/trade/fills', params);
317
+ }
318
+ /**
319
+ *
320
+ * * Spot | Trigger Orders
321
+ *
322
+ */
323
+ spotSubmitPlanOrder(params) {
324
+ return this.postPrivate('/api/v2/spot/trade/place-plan-order', params);
325
+ }
326
+ spotModifyPlanOrder(params) {
327
+ return this.postPrivate('/api/v2/spot/trade/modify-plan-order', params);
328
+ }
329
+ spotCancelPlanOrder(params) {
330
+ return this.postPrivate('/api/v2/spot/trade/cancel-plan-order', params);
331
+ }
332
+ getSpotCurrentPlanOrders(params) {
333
+ return this.getPrivate('/api/v2/spot/trade/current-plan-order', params);
334
+ }
335
+ getSpotPlanSubOrder(params) {
336
+ return this.getPrivate('/api/v2/spot/trade/plan-sub-order', params);
337
+ }
338
+ getSpotHistoricPlanOrders(params) {
339
+ return this.getPrivate('/api/v2/spot/trade/history-plan-order', params);
340
+ }
341
+ spotCancelPlanOrders(params) {
342
+ return this.postPrivate('/api/v2/spot/trade/batch-cancel-plan-order', params);
343
+ }
344
+ /**
345
+ *
346
+ * * Spot | Account
347
+ *
348
+ */
349
+ getSpotAccount() {
350
+ return this.getPrivate('/api/v2/spot/account/info');
351
+ }
352
+ getSpotAccountAssets(params) {
353
+ return this.getPrivate('/api/v2/spot/account/assets', params);
354
+ }
355
+ getSpotSubAccountAssets() {
356
+ return this.getPrivate('/api/v2/spot/account/subaccount-assets');
357
+ }
358
+ spotModifyDepositAccount(params) {
359
+ return this.postPrivate('/api/v2/spot/wallet/modify-deposit-account', params);
360
+ }
361
+ getSpotAccountBills(params) {
362
+ return this.getPrivate('/api/v2/spot/account/bills', params);
363
+ }
364
+ spotTransfer(params) {
365
+ return this.postPrivate('/api/v2/spot/wallet/transfer', params);
366
+ }
367
+ getSpotTransferableCoins(params) {
368
+ return this.getPrivate('/api/v2/spot/wallet/transfer-coin-info', params);
369
+ }
370
+ spotSubTransfer(params) {
371
+ return this.postPrivate('/api/v2/spot/wallet/subaccount-transfer', params);
372
+ }
373
+ spotWithdraw(params) {
374
+ return this.postPrivate('/api/v2/spot/wallet/withdrawal', params);
375
+ }
376
+ getSpotMainSubTransferRecord(params) {
377
+ return this.getPrivate('/api/v2/spot/account/sub-main-trans-record', params);
378
+ }
379
+ getSpotTransferHistory(params) {
380
+ return this.getPrivate('/api/v2/spot/account/transferRecords', params);
381
+ }
382
+ spotSwitchBGBDeduct(params) {
383
+ return this.postPrivate('/api/v2/spot/account/switch-deduct', params);
384
+ }
385
+ getSpotDepositAddress(params) {
386
+ return this.getPrivate('/api/v2/spot/wallet/deposit-address', params);
387
+ }
388
+ getSpotSubDepositAddress(params) {
389
+ return this.getPrivate('/api/v2/spot/wallet/subaccount-deposit-address', params);
390
+ }
391
+ getSpotBGBDeductInfo() {
392
+ return this.getPrivate('/api/v2/spot/account/deduct-info');
393
+ }
394
+ spotCancelWithdrawal(params) {
395
+ return this.postPrivate('/api/v2/spot/wallet/cancel-withdrawal', params);
396
+ }
397
+ getSubAccountDepositRecords(params) {
398
+ return this.getPrivate('/api/v2/spot/wallet/subaccount-deposit-records', params);
399
+ }
400
+ getSpotWithdrawalHistory(params) {
401
+ return this.getPrivate('/api/v2/spot/wallet/withdrawal-records', params);
402
+ }
403
+ getSpotDepositHistory(params) {
404
+ return this.getPrivate('/api/v2/spot/wallet/deposit-records', params);
405
+ }
406
+ /**
407
+ *
408
+ *
409
+ * Futures
410
+ *
411
+ *
412
+ */
413
+ /**
414
+ *
415
+ * * Futures | Market
416
+ *
417
+ */
418
+ getFuturesVIPFeeRate() {
419
+ return this.get('/api/v2/mix/market/vip-fee-rate');
420
+ }
421
+ getFuturesInterestRateHistory(params) {
422
+ return this.get('/api/v2/mix/market/union-interest-rate-history', params);
423
+ }
424
+ getFuturesInterestExchangeRate() {
425
+ return this.get('/api/v2/mix/market/exchange-rate');
426
+ }
427
+ getFuturesDiscountRate() {
428
+ return this.get('/api/v2/mix/market/discount-rate');
429
+ }
430
+ getFuturesMergeDepth(params) {
431
+ return this.get('/api/v2/mix/market/merge-depth', params);
432
+ }
433
+ getFuturesTicker(params) {
434
+ return this.get('/api/v2/mix/market/ticker', params);
435
+ }
436
+ getFuturesAllTickers(params) {
437
+ return this.get('/api/v2/mix/market/tickers', params);
438
+ }
439
+ getFuturesRecentTrades(params) {
440
+ return this.get('/api/v2/mix/market/fills', params);
441
+ }
442
+ getFuturesHistoricTrades(params) {
443
+ return this.get('/api/v2/mix/market/fills-history', params);
444
+ }
445
+ getFuturesCandles(params) {
446
+ return this.get('/api/v2/mix/market/candles', params);
447
+ }
448
+ getFuturesHistoricCandles(params) {
449
+ return this.get('/api/v2/mix/market/history-candles', params);
450
+ }
451
+ getFuturesHistoricIndexPriceCandles(params) {
452
+ return this.get('/api/v2/mix/market/history-index-candles', params);
453
+ }
454
+ getFuturesHistoricMarkPriceCandles(params) {
455
+ return this.get('/api/v2/mix/market/history-mark-candles', params);
456
+ }
457
+ getFuturesOpenInterest(params) {
458
+ return this.get('/api/v2/mix/market/open-interest', params);
459
+ }
460
+ getFuturesNextFundingTime(params) {
461
+ return this.get('/api/v2/mix/market/funding-time', params);
462
+ }
463
+ getFuturesSymbolPrice(params) {
464
+ return this.get('/api/v2/mix/market/symbol-price', params);
465
+ }
466
+ getFuturesHistoricFundingRates(params) {
467
+ return this.get('/api/v2/mix/market/history-fund-rate', params);
468
+ }
469
+ getFuturesCurrentFundingRate(params) {
470
+ return this.get('/api/v2/mix/market/current-fund-rate', params);
471
+ }
472
+ getFuturesContractConfig(params) {
473
+ return this.get('/api/v2/mix/market/contracts', params);
474
+ }
475
+ /**
476
+ *
477
+ * * Futures | Account
478
+ *
479
+ */
480
+ getFuturesAccountAsset(params) {
481
+ return this.getPrivate('/api/v2/mix/account/account', params);
482
+ }
483
+ getFuturesAccountAssets(params) {
484
+ return this.getPrivate('/api/v2/mix/account/accounts', params);
485
+ }
486
+ getFuturesSubAccountAssets(params) {
487
+ return this.getPrivate('/api/v2/mix/account/sub-account-assets', params);
488
+ }
489
+ getFuturesInterestHistory(params) {
490
+ return this.getPrivate('/api/v2/mix/account/interest-history', params);
491
+ }
492
+ getFuturesOpenCount(params) {
493
+ return this.getPrivate('/api/v2/mix/account/open-count', params);
494
+ }
495
+ setFuturesPositionAutoMargin(params) {
496
+ return this.postPrivate('/api/v2/mix/account/set-auto-margin', params);
497
+ }
498
+ setFuturesLeverage(params) {
499
+ return this.postPrivate('/api/v2/mix/account/set-leverage', params);
500
+ }
501
+ setFuturesPositionMargin(params) {
502
+ return this.postPrivate('/api/v2/mix/account/set-margin', params);
503
+ }
504
+ setFuturesAssetMode(params) {
505
+ return this.postPrivate('/api/v2/mix/account/set-asset-mode', params);
506
+ }
507
+ setFuturesMarginMode(params) {
508
+ return this.postPrivate('/api/v2/mix/account/set-margin-mode', params);
509
+ }
510
+ setFuturesPositionMode(params) {
511
+ return this.postPrivate('/api/v2/mix/account/set-position-mode', params);
512
+ }
513
+ getFuturesAccountBills(params) {
514
+ return this.getPrivate('/api/v2/mix/account/bill', params);
515
+ }
516
+ /**
517
+ *
518
+ * * Futures | Position
519
+ *
520
+ */
521
+ getFuturesPositionTier(params) {
522
+ return this.get('/api/v2/mix/market/query-position-lever', params);
523
+ }
524
+ getFuturesPosition(params) {
525
+ return this.getPrivate('/api/v2/mix/position/single-position', params);
526
+ }
527
+ getFuturesPositions(params) {
528
+ return this.getPrivate('/api/v2/mix/position/all-position', params);
529
+ }
530
+ getFuturesHistoricPositions(params) {
531
+ return this.getPrivate('/api/v2/mix/position/history-position', params);
532
+ }
533
+ /**
534
+ *
535
+ * * Futures | Trade
536
+ *
537
+ */
538
+ futuresSubmitOrder(params) {
539
+ return this.postPrivate('/api/v2/mix/order/place-order', params);
540
+ }
541
+ futuresSubmitReversal(params) {
542
+ return this.postPrivate('/api/v2/mix/order/click-backhand', params);
543
+ }
544
+ futuresBatchSubmitOrders(params) {
545
+ return this.postPrivate('/api/v2/mix/order/batch-place-order', params);
546
+ }
547
+ futuresModifyOrder(params) {
548
+ return this.postPrivate('/api/v2/mix/order/modify-order', params);
549
+ }
550
+ futuresCancelOrder(params) {
551
+ return this.postPrivate('/api/v2/mix/order/cancel-order', params);
552
+ }
553
+ futuresBatchCancelOrders(params) {
554
+ return this.postPrivate('/api/v2/mix/order/batch-cancel-orders', params);
555
+ }
556
+ futuresFlashClosePositions(params) {
557
+ return this.postPrivate('/api/v2/mix/order/close-positions', params);
558
+ }
559
+ getFuturesOrder(params) {
560
+ return this.getPrivate('/api/v2/mix/order/detail', params);
561
+ }
562
+ getFuturesFills(params) {
563
+ return this.getPrivate('/api/v2/mix/order/fills', params);
564
+ }
565
+ getFuturesHistoricOrderFills(params) {
566
+ return this.getPrivate('/api/v2/mix/order/fill-history', params);
567
+ }
568
+ getFuturesOpenOrders(params) {
569
+ return this.getPrivate('/api/v2/mix/order/orders-pending', params);
570
+ }
571
+ getFuturesHistoricOrders(params) {
572
+ return this.getPrivate('/api/v2/mix/order/orders-history', params);
573
+ }
574
+ futuresCancelAllOrders(params) {
575
+ return this.postPrivate('/api/v2/mix/order/cancel-all-orders', params);
576
+ }
577
+ /**
578
+ *
579
+ * * Futures | Trigger Orders
580
+ *
581
+ */
582
+ getFuturesTriggerSubOrder(params) {
583
+ return this.getPrivate('/api/v2/mix/order/plan-sub-order', params);
584
+ }
585
+ futuresSubmitTPSLOrder(params) {
586
+ return this.postPrivate('/api/v2/mix/order/place-tpsl-order', params);
587
+ }
588
+ futuresSubmitPlanOrder(params) {
589
+ return this.postPrivate('/api/v2/mix/order/place-plan-order', params);
590
+ }
591
+ futuresModifyTPSLPOrder(params) {
592
+ return this.postPrivate('/api/v2/mix/order/modify-tpsl-order', params);
593
+ }
594
+ futuresModifyPlanOrder(params) {
595
+ return this.postPrivate('/api/v2/mix/order/modify-plan-order', params);
596
+ }
597
+ getFuturesPlanOrders(params) {
598
+ return this.getPrivate('/api/v2/mix/order/orders-plan-pending', params);
599
+ }
600
+ futuresCancelPlanOrder(params) {
601
+ return this.postPrivate('/api/v2/mix/order/cancel-plan-order', params);
602
+ }
603
+ getFuturesHistoricPlanOrders(params) {
604
+ return this.getPrivate('/api/v2/mix/order/orders-plan-history', params);
605
+ }
606
+ /**
607
+ *
608
+ *
609
+ * Broker
610
+ *
611
+ *
612
+ */
613
+ /**
614
+ *
615
+ * * Broker | Subaccount
616
+ *
617
+ */
618
+ modifySubaccountEmail(params) {
619
+ return this.postPrivate('/api/v2/broker/account/modify-subaccount-email', params);
620
+ }
621
+ getBrokerInfo() {
622
+ return this.getPrivate('/api/v2/broker/account/info');
623
+ }
624
+ createSubaccount(params) {
625
+ return this.postPrivate('/api/v2/broker/account/create-subaccount', params);
626
+ }
627
+ getSubaccounts(params) {
628
+ return this.getPrivate('/api/v2/broker/account/subaccount-list', params);
629
+ }
630
+ modifySubaccount(params) {
631
+ return this.postPrivate('/api/v2/broker/account/modify-subaccount', params);
632
+ }
633
+ getSubaccountEmail(params) {
634
+ return this.getPrivate('/api/v2/broker/account/subaccount-email', params);
635
+ }
636
+ getSubaccountSpotAssets(params) {
637
+ return this.getPrivate('/api/v2/broker/account/subaccount-spot-assets', params);
638
+ }
639
+ getSubaccountFuturesAssets(params) {
640
+ return this.getPrivate('/api/v2/broker/account/subaccount-future-assets', params);
641
+ }
642
+ createSubaccountDepositAddress(params) {
643
+ return this.postPrivate('/api/v2/broker/account/subaccount-address', params);
644
+ }
645
+ subaccountWithdrawal(params) {
646
+ return this.postPrivate('/api/v2/broker/account/subaccount-withdrawal', params);
647
+ }
648
+ subaccountSetAutoTransfer(params) {
649
+ return this.postPrivate('/api/v2/broker/account/set-subaccount-autotransfer', params);
650
+ }
651
+ subaccountDepositRecords(params) {
652
+ return this.postPrivate('/api/v2/broker/subaccount-deposit', params);
653
+ }
654
+ subaccountWithdrawalRecords(params) {
655
+ return this.postPrivate('/api/v2/broker/subaccount-withdrawal', params);
656
+ }
657
+ /**
658
+ *
659
+ * Broker | Api Key
660
+ *
661
+ */
662
+ createSubaccountApiKey(params) {
663
+ return this.postPrivate('/api/v2/broker/manage/create-subaccount-apikey', params);
664
+ }
665
+ getSubaccountApiKey(params) {
666
+ return this.getPrivate('/api/v2/broker/manage/subaccount-apikey-list', params);
667
+ }
668
+ modifySubaccountApiKey(params) {
669
+ return this.postPrivate('/api/v2/broker/manage/modify-subaccount-apikey', params);
670
+ }
671
+ /**
672
+ *
673
+ *
674
+ * Margin
675
+ *
676
+ *
677
+ */
678
+ /**
679
+ *
680
+ * * Margin | Common
681
+ *
682
+ */
683
+ getMarginCurrencies() {
684
+ return this.get('/api/v2/margin/currencies');
685
+ }
686
+ /**
687
+ *
688
+ * * Margin | Cross/Isolated | Order Record
689
+ *
690
+ */
691
+ getMarginBorrowHistory(marginType, params) {
692
+ assertMarginType(marginType);
693
+ return this.getPrivate(`/api/v2/margin/${marginType}/borrow-history`, params);
694
+ }
695
+ getMarginRepayHistory(marginType, params) {
696
+ assertMarginType(marginType);
697
+ return this.getPrivate(`/api/v2/margin/${marginType}/repay-history`, params);
698
+ }
699
+ getMarginInterestHistory(marginType, params) {
700
+ assertMarginType(marginType);
701
+ return this.getPrivate(`/api/v2/margin/${marginType}/interest-history`, params);
702
+ }
703
+ getMarginLiquidationHistory(marginType, params) {
704
+ assertMarginType(marginType);
705
+ return this.getPrivate(`/api/v2/margin/${marginType}/liquidation-history`, params);
706
+ }
707
+ getMarginFinancialHistory(marginType, params) {
708
+ assertMarginType(marginType);
709
+ return this.getPrivate(`/api/v2/margin/${marginType}/financial-records`, params);
710
+ }
711
+ /**
712
+ *
713
+ * * Margin | Cross/Isolated | Account
714
+ *
715
+ */
716
+ getMarginAccountAssets(marginType, params) {
717
+ assertMarginType(marginType);
718
+ return this.getPrivate(`/api/v2/margin/${marginType}/account/assets`, params);
719
+ }
720
+ marginBorrow(marginType, params) {
721
+ assertMarginType(marginType);
722
+ return this.postPrivate(`/api/v2/margin/${marginType}/account/borrow`, params);
723
+ }
724
+ marginRepay(marginType, params) {
725
+ assertMarginType(marginType);
726
+ return this.postPrivate(`/api/v2/margin/${marginType}/account/repay`, params);
727
+ }
728
+ getMarginRiskRate(marginType) {
729
+ assertMarginType(marginType);
730
+ return this.getPrivate(`/api/v2/margin/${marginType}/account/risk-rate`);
731
+ }
732
+ getMarginMaxBorrowable(marginType, params) {
733
+ assertMarginType(marginType);
734
+ return this.getPrivate('/api/v2/margin/${marginType}/account/max-borrowable-amount', params);
735
+ }
736
+ getMarginMaxTransferable(marginType, params) {
737
+ assertMarginType(marginType);
738
+ return this.getPrivate('/api/v2/margin/${marginType}/account/max-transfer-out-amount', params);
739
+ }
740
+ getMarginInterestRateAndMaxBorrowable(marginType, params) {
741
+ assertMarginType(marginType);
742
+ return this.getPrivate('/api/v2/margin/${marginType}/interest-rate-and-limit', params);
743
+ }
744
+ getMarginTierConfiguration(marginType, params) {
745
+ assertMarginType(marginType);
746
+ return this.getPrivate(`/api/v2/margin/${marginType}/tier-data`, params);
747
+ }
748
+ marginFlashRepay(marginType, params) {
749
+ assertMarginType(marginType);
750
+ return this.postPrivate('/api/v2/margin/${marginType}/account/flash-repay', params);
751
+ }
752
+ getMarginFlashRepayResult(marginType, params) {
753
+ assertMarginType(marginType);
754
+ return this.getPrivate('/api/v2/margin/${marginType}/account/query-flash-repay-status', params);
755
+ }
756
+ /**
757
+ *
758
+ * * Margin | Cross/Isolated | Trade
759
+ *
760
+ */
761
+ marginSubmitOrder(marginType, params) {
762
+ assertMarginType(marginType);
763
+ return this.postPrivate(`/api/v2/margin/${marginType}/place-order`, params);
764
+ }
765
+ marginBatchSubmitOrders(marginType, params) {
766
+ assertMarginType(marginType);
767
+ return this.postPrivate(`/api/v2/margin/${marginType}/batch-place-order`, params);
768
+ }
769
+ marginCancelOrder(marginType, params) {
770
+ assertMarginType(marginType);
771
+ return this.postPrivate(`/api/v2/margin/${marginType}/cancel-order`, params);
772
+ }
773
+ marginBatchCancelOrders(marginType, params) {
774
+ assertMarginType(marginType);
775
+ return this.postPrivate('/api/v2/margin/${marginType}/batch-cancel-order', params);
776
+ }
777
+ getMarginOpenOrders(marginType, params) {
778
+ assertMarginType(marginType);
779
+ return this.getPrivate(`/api/v2/margin/${marginType}/open-orders`, params);
780
+ }
781
+ getMarginHistoricOrders(marginType, params) {
782
+ assertMarginType(marginType);
783
+ return this.getPrivate(`/api/v2/margin/${marginType}/history-orders`, params);
784
+ }
785
+ getMarginHistoricOrderFills(marginType, params) {
786
+ assertMarginType(marginType);
787
+ return this.getPrivate(`/api/v2/margin/${marginType}/fills`, params);
788
+ }
789
+ getMarginLiquidationOrders(marginType, params) {
790
+ assertMarginType(marginType);
791
+ return this.getPrivate(`/api/v2/margin/${marginType}/liquidation-order`, params);
792
+ }
793
+ /**
794
+ *
795
+ *
796
+ * Copy Trading
797
+ *
798
+ *
799
+ */
800
+ /**
801
+ *
802
+ *
803
+ * Copy Trading | Future copy trading | Trader Api
804
+ *
805
+ *
806
+ */
807
+ getFuturesTraderCurrentOrder(params) {
808
+ return this.getPrivate('/api/v2/copy/mix-trader/order-current-track', params);
809
+ }
810
+ getFuturesTraderHistoryOrders(params) {
811
+ return this.getPrivate('/api/v2/copy/mix-trader/order-history-track', params);
812
+ }
813
+ modifyFuturesTraderOrderTPSL(params) {
814
+ return this.postPrivate('/api/v2/copy/mix-trader/order-modify-tpsl', params);
815
+ }
816
+ getFuturesTraderOrder() {
817
+ return this.getPrivate('/api/v2/copy/mix-trader/order-total-detail');
818
+ }
819
+ getFuturesTraderProfitHistory() {
820
+ return this.getPrivate('/api/v2/copy/mix-trader/profit-history-summarys');
821
+ }
822
+ getFuturesTraderProfitShareHistory(params) {
823
+ return this.getPrivate('/api/v2/copy/mix-trader/profit-history-details', params);
824
+ }
825
+ closeFuturesTraderOrder(params) {
826
+ return this.postPrivate('/api/v2/copy/mix-trader/order-close-positions', params);
827
+ }
828
+ getFuturesTraderProfitShare(params) {
829
+ return this.getPrivate('/api/v2/copy/mix-trader/profit-details', params);
830
+ }
831
+ getFuturesTraderProfitShareGroup(params) {
832
+ return this.getPrivate('/api/v2/copy/mix-trader/profits-group-coin-date', params);
833
+ }
834
+ getFuturesTraderSymbolSettings(params) {
835
+ return this.getPrivate('/api/v2/copy/mix-trader/config-query-symbols', params);
836
+ }
837
+ updateFuturesTraderSymbolSettings(params) {
838
+ return this.postPrivate('/api/v2/copy/mix-trader/config-setting-symbols', params);
839
+ }
840
+ updateFuturesTraderGlobalSettings(params) {
841
+ return this.postPrivate('/api/v2/copy/mix-trader/config-settings-base', params);
842
+ }
843
+ getFuturesTraderFollowers(params) {
844
+ return this.getPrivate('/api/v2/copy/mix-trader/config-query-followers', params);
845
+ }
846
+ removeFuturesTraderFollower(params) {
847
+ return this.postPrivate('/api/v2/copy/mix-trader/config-remove-follower', params);
848
+ }
849
+ /**
850
+ *
851
+ *
852
+ * Copy Trading | Future copy trading | Follower Api
853
+ *
854
+ *
855
+ */
856
+ getFuturesFollowerCurrentOrders(params) {
857
+ return this.getPrivate('/api/v2/copy/mix-follower/query-current-orders', params);
858
+ }
859
+ getFuturesFollowerHistoryOrders(params) {
860
+ return this.getPrivate('/api/v2/copy/mix-follower/query-history-orders', params);
861
+ }
862
+ updateFuturesFollowerTPSL(params) {
863
+ return this.postPrivate('/api/v2/copy/mix-follower/setting-tpsl', params);
864
+ }
865
+ updateFuturesFollowerSettings(params) {
866
+ return this.postPrivate('/api/v2/copy/mix-follower/settings', params);
867
+ }
868
+ getFuturesFollowerSettings(params) {
869
+ return this.getPrivate('/api/v2/copy/mix-follower/query-settings', params);
870
+ }
871
+ closeFuturesFollowerPositions(params) {
872
+ return this.postPrivate('/api/v2/copy/mix-follower/close-positions', params);
873
+ }
874
+ getFuturesFollowerTraders(params) {
875
+ return this.getPrivate('/api/v2/copy/mix-follower/query-traders', params);
876
+ }
877
+ getFuturesFollowerFollowLimit(params) {
878
+ return this.getPrivate('/api/v2/copy/mix-follower/query-quantity-limit', params);
879
+ }
880
+ unfollowFuturesTrader(params) {
881
+ return this.postPrivate('/api/v2/copy/mix-follower/cancel-trader', params);
882
+ }
883
+ /**
884
+ *
885
+ *
886
+ * Copy Trading | Future copy trading | Broker api
887
+ *
888
+ *
889
+ */
890
+ getBrokerTraders(params) {
891
+ return this.getPrivate('/api/v2/copy/mix-broker/query-traders', params);
892
+ }
893
+ getBrokerTradersHistoricalOrders(params) {
894
+ return this.getPrivate('/api/v2/copy/mix-broker/query-history-traces', params);
895
+ }
896
+ getBrokerTradersPendingOrders(params) {
897
+ return this.getPrivate('/api/v2/copy/mix-broker/query-current-traces', params);
898
+ }
899
+ /**
900
+ *
901
+ *
902
+ * Copy Trading | Spot copy trading | Trader api
903
+ *
904
+ *
905
+ */
906
+ getSpotTraderProfit() {
907
+ return this.getPrivate('/api/v2/copy/spot-trader/profit-summarys');
908
+ }
909
+ getSpotTraderHistoryProfit(params) {
910
+ return this.getPrivate('/api/v2/copy/spot-trader/profit-history-details', params);
911
+ }
912
+ getSpotTraderUnrealizedProfit(params) {
913
+ return this.getPrivate('/api/v2/copy/spot-trader/profit-details', params);
914
+ }
915
+ getSpotTraderOrder() {
916
+ return this.getPrivate('/api/v2/copy/spot-trader/order-total-detail');
917
+ }
918
+ modifySpotTraderOrderTPSL(params) {
919
+ return this.postPrivate('/api/v2/copy/spot-trader/order-modify-tpsl', params);
920
+ }
921
+ getSpotTraderHistoryOrders(params) {
922
+ return this.getPrivate('/api/v2/copy/spot-trader/order-history-track', params);
923
+ }
924
+ getSpotTraderCurrentOrders(params) {
925
+ return this.getPrivate('/api/v2/copy/spot-trader/order-current-track', params);
926
+ }
927
+ sellSpotTrader(params) {
928
+ return this.postPrivate('/api/v2/copy/spot-trader/order-close-tracking', params);
929
+ }
930
+ getSpotTraderSymbolSettings(params) {
931
+ return this.postPrivate('/api/v2/copy/spot-trader/config-setting-symbols', params);
932
+ }
933
+ removeSpotTraderFollowers(params) {
934
+ return this.postPrivate('/api/v2/copy/spot-trader/config-remove-follower', params);
935
+ }
936
+ getSpotTraderConfiguration() {
937
+ return this.getPrivate('/api/v2/copy/spot-trader/config-query-settings');
938
+ }
939
+ getSpotTraderFollowers(params) {
940
+ return this.getPrivate('/api/v2/copy/spot-trader/config-query-followers', params);
941
+ }
942
+ /**
943
+ *
944
+ *
945
+ * Copy Trading | Spot copy trading | Follower api
946
+ *
947
+ *
948
+ */
949
+ cancelSpotFollowerOrder(params) {
950
+ return this.postPrivate('/api/v2/copy/spot-follower/stop-order', params);
951
+ }
952
+ updateSpotFollowerSettings(params) {
953
+ return this.postPrivate('/api/v2/copy/spot-follower/settings', params);
954
+ }
955
+ updateSpotFollowerTPSL(params) {
956
+ return this.postPrivate('/api/v2/copy/spot-follower/setting-tpsl', params);
957
+ }
958
+ getSpotFollowerTraders(params) {
959
+ return this.getPrivate('/api/v2/copy/spot-follower/query-traders', params);
960
+ }
961
+ getSpotFollowerCurrentTraderSymbols(params) {
962
+ return this.getPrivate('/api/v2/copy/spot-follower/query-trader-symbols', params);
963
+ }
964
+ getSpotFollowerSettings(params) {
965
+ return this.getPrivate('/api/v2/copy/spot-follower/query-settings', params);
966
+ }
967
+ getSpotFollowerHistoryOrders(params) {
968
+ return this.getPrivate('/api/v2/copy/spot-follower/query-history-orders', params);
969
+ }
970
+ getSpotFollowerOpenOrders(params) {
971
+ return this.getPrivate('/api/v2/copy/spot-follower/query-current-orders', params);
972
+ }
973
+ sellSpotFollower(params) {
974
+ return this.postPrivate('/api/v2/copy/spot-follower/order-close-tracking', params);
975
+ }
976
+ unfollowSpotTrader(params) {
977
+ return this.postPrivate('/api/v2/copy/spot-follower/cancel-trader', params);
978
+ }
979
+ /**
980
+ *
981
+ *
982
+ * Earn | Savings
983
+ *
984
+ *
985
+ */
986
+ getEarnSavingsProducts(params) {
987
+ return this.getPrivate('/api/v2/earn/savings/product', params);
988
+ }
989
+ getEarnSavingsAccount() {
990
+ return this.getPrivate('/api/v2/earn/savings/account');
991
+ }
992
+ getEarnSavingsAssets(params) {
993
+ return this.getPrivate('/api/v2/earn/savings/assets', params);
994
+ }
995
+ getEarnSavingsRecords(params) {
996
+ return this.getPrivate('/api/v2/earn/savings/records', params);
997
+ }
998
+ getEarnSavingsSubscription(params) {
999
+ return this.getPrivate('/api/v2/earn/savings/subscribe-info', params);
1000
+ }
1001
+ earnSubscribeSavings(params) {
1002
+ return this.postPrivate('/api/v2/earn/savings/subscribe', params);
1003
+ }
1004
+ getEarnSavingsSubscriptionResult(params) {
1005
+ return this.getPrivate('/api/v2/earn/savings/subscribe-result', params);
1006
+ }
1007
+ earnRedeemSavings(params) {
1008
+ return this.postPrivate('/api/v2/earn/savings/redeem', params);
1009
+ }
1010
+ getEarnSavingsRedemptionResult(params) {
1011
+ return this.getPrivate('/api/v2/earn/savings/redeem-result', params);
1012
+ }
1013
+ /**
1014
+ *
1015
+ *
1016
+ * Earn | Earn Account
1017
+ *
1018
+ *
1019
+ */
1020
+ getEarnAccount(params) {
1021
+ return this.getPrivate('/api/v2/earn/account/assets', params);
1022
+ }
1023
+ /**
1024
+ *
1025
+ *
1026
+ * Earn | Shark Fin
1027
+ *
1028
+ *
1029
+ */
1030
+ getSharkfinProducts(params) {
1031
+ return this.getPrivate('/api/v2/earn/sharkfin/product', params);
1032
+ }
1033
+ getSharkfinAccount() {
1034
+ return this.getPrivate('/api/v2/earn/sharkfin/account');
1035
+ }
1036
+ getSharkfinAssets(params) {
1037
+ return this.getPrivate('/api/v2/earn/sharkfin/assets', params);
1038
+ }
1039
+ getSharkfinRecords(params) {
1040
+ return this.getPrivate('/api/v2/earn/sharkfin/records', params);
1041
+ }
1042
+ getSharkfinSubscription(params) {
1043
+ return this.getPrivate('/api/v2/earn/sharkfin/subscribe-info', params);
1044
+ }
1045
+ subscribeSharkfin(params) {
1046
+ return this.postPrivate('/api/v2/earn/sharkfin/subscribe', params);
1047
+ }
1048
+ getSharkfinSubscriptionResult(params) {
1049
+ return this.getPrivate('/api/v2/earn/sharkfin/subscribe-result', params);
1050
+ }
1051
+ /**
1052
+ *
1053
+ *
1054
+ * Earn | Loan
1055
+ *
1056
+ *
1057
+ */
1058
+ getLoanCurrencies(params) {
1059
+ return this.get('/api/v2/earn/loan/public/coinInfos', params);
1060
+ }
1061
+ getLoanEstInterestAndBorrowable(params) {
1062
+ return this.get('/api/v2/earn/loan/public/hour-interest', params);
1063
+ }
1064
+ borrowLoan(params) {
1065
+ return this.postPrivate('/api/v2/earn/loan/borrow', params);
1066
+ }
1067
+ getOngoingLoanOrders(params) {
1068
+ return this.getPrivate('/api/v2/earn/loan/ongoing-orders', params);
1069
+ }
1070
+ repayLoan(params) {
1071
+ return this.postPrivate('/api/v2/earn/loan/repay', params);
1072
+ }
1073
+ getRepayHistory(params) {
1074
+ return this.getPrivate('/api/v2/earn/loan/repay-history', params);
1075
+ }
1076
+ updateLoanPledgeRate(params) {
1077
+ return this.postPrivate('/api/v2/earn/loan/revise-pledge', params);
1078
+ }
1079
+ getLoanPledgeRateHistory(params) {
1080
+ return this.getPrivate('/api/v2/earn/loan/revise-history', params);
1081
+ }
1082
+ getLoanHistory(params) {
1083
+ return this.getPrivate('/api/v2/earn/loan/borrow-history', params);
1084
+ }
1085
+ getLoanDebts() {
1086
+ return this.getPrivate('/api/v2/earn/loan/debts');
1087
+ }
1088
+ getLoanLiquidationRecords(params) {
1089
+ return this.getPrivate('/api/v2/earn/loan/reduces', params);
1090
+ }
1091
+ }
1092
+ //# sourceMappingURL=rest-client-v2.js.map