okx-api 2.0.7 → 3.0.0-beta.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 (382) hide show
  1. package/README.md +336 -11
  2. package/dist/cjs/constants/funding.js.map +1 -0
  3. package/dist/cjs/index.d.ts +43 -0
  4. package/dist/cjs/index.js +64 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/package.json +3 -0
  7. package/{lib → dist/cjs}/rest-client.d.ts +28 -15
  8. package/{lib → dist/cjs}/rest-client.js +41 -68
  9. package/dist/cjs/rest-client.js.map +1 -0
  10. package/dist/cjs/types/rest/client.d.ts +36 -0
  11. package/{lib → dist/cjs}/types/rest/client.js.map +1 -1
  12. package/{lib → dist/cjs}/types/rest/request/account.d.ts +1 -1
  13. package/dist/cjs/types/rest/request/account.js.map +1 -0
  14. package/{lib → dist/cjs}/types/rest/request/block-trading.d.ts +1 -1
  15. package/dist/cjs/types/rest/request/block-trading.js.map +1 -0
  16. package/dist/cjs/types/rest/request/convert.js.map +1 -0
  17. package/dist/cjs/types/rest/request/copy-trading.js.map +1 -0
  18. package/dist/cjs/types/rest/request/funding.js.map +1 -0
  19. package/dist/cjs/types/rest/request/grid-trading.js.map +1 -0
  20. package/dist/cjs/types/rest/request/public.js.map +1 -0
  21. package/dist/cjs/types/rest/request/recurring-buy.js.map +1 -0
  22. package/{lib → dist/cjs}/types/rest/request/shared.d.ts +1 -1
  23. package/dist/cjs/types/rest/request/shared.js.map +1 -0
  24. package/dist/cjs/types/rest/request/signal-bot.js.map +1 -0
  25. package/dist/cjs/types/rest/request/simple-earn.js.map +1 -0
  26. package/dist/cjs/types/rest/request/spread-trading.js.map +1 -0
  27. package/dist/cjs/types/rest/request/subaccount.js.map +1 -0
  28. package/{lib → dist/cjs}/types/rest/request/trade.d.ts +1 -1
  29. package/dist/cjs/types/rest/request/trade.js.map +1 -0
  30. package/{lib → dist/cjs}/types/rest/response/private-account.d.ts +1 -1
  31. package/dist/cjs/types/rest/response/private-account.js.map +1 -0
  32. package/{lib → dist/cjs}/types/rest/response/private-block-trading.d.ts +1 -1
  33. package/dist/cjs/types/rest/response/private-block-trading.js.map +1 -0
  34. package/dist/cjs/types/rest/response/private-copy-trading.js.map +1 -0
  35. package/dist/cjs/types/rest/response/private-flexible-loan.js.map +1 -0
  36. package/{lib → dist/cjs}/types/rest/response/private-funding.d.ts +1 -1
  37. package/dist/cjs/types/rest/response/private-funding.js.map +1 -0
  38. package/dist/cjs/types/rest/response/private-recurring-buy.js.map +1 -0
  39. package/dist/cjs/types/rest/response/private-signal-bot.js.map +1 -0
  40. package/dist/cjs/types/rest/response/private-spread-trading.js.map +1 -0
  41. package/dist/cjs/types/rest/response/private-subaccount.js.map +1 -0
  42. package/{lib → dist/cjs}/types/rest/response/private-trade.d.ts +1 -1
  43. package/dist/cjs/types/rest/response/private-trade.js.map +1 -0
  44. package/{lib → dist/cjs}/types/rest/response/public-data.d.ts +1 -1
  45. package/dist/cjs/types/rest/response/public-data.js.map +1 -0
  46. package/{lib → dist/cjs}/types/rest/shared.d.ts +2 -2
  47. package/dist/cjs/types/rest/shared.js.map +1 -0
  48. package/dist/cjs/types/shared.d.ts +13 -0
  49. package/{lib → dist/cjs}/types/shared.js.map +1 -1
  50. package/dist/cjs/types/websockets/ws-api-request.d.ts +61 -0
  51. package/dist/cjs/types/websockets/ws-api-request.js +3 -0
  52. package/dist/cjs/types/websockets/ws-api-request.js.map +1 -0
  53. package/dist/cjs/types/websockets/ws-api-response.d.ts +28 -0
  54. package/dist/cjs/types/websockets/ws-api-response.js +3 -0
  55. package/dist/cjs/types/websockets/ws-api-response.js.map +1 -0
  56. package/dist/cjs/types/websockets/ws-api.d.ts +139 -0
  57. package/dist/cjs/types/websockets/ws-api.js +38 -0
  58. package/dist/cjs/types/websockets/ws-api.js.map +1 -0
  59. package/{lib/types/websockets/event.d.ts → dist/cjs/types/websockets/ws-events.d.ts} +7 -1
  60. package/dist/cjs/types/websockets/ws-events.js +11 -0
  61. package/dist/cjs/types/websockets/ws-events.js.map +1 -0
  62. package/dist/cjs/types/websockets/ws-general.d.ts +48 -0
  63. package/dist/cjs/types/websockets/ws-general.js +3 -0
  64. package/dist/cjs/types/websockets/ws-general.js.map +1 -0
  65. package/{lib/types/websockets/request.d.ts → dist/cjs/types/websockets/ws-request.d.ts} +0 -22
  66. package/dist/cjs/types/websockets/ws-request.js +3 -0
  67. package/dist/cjs/types/websockets/ws-request.js.map +1 -0
  68. package/{lib → dist/cjs}/util/BaseRestClient.d.ts +1 -1
  69. package/dist/cjs/util/BaseRestClient.js +237 -0
  70. package/dist/cjs/util/BaseRestClient.js.map +1 -0
  71. package/dist/cjs/util/BaseWSClient.d.ts +198 -0
  72. package/dist/cjs/util/BaseWSClient.js +770 -0
  73. package/dist/cjs/util/BaseWSClient.js.map +1 -0
  74. package/dist/cjs/util/WsStore.d.ts +75 -0
  75. package/dist/cjs/util/WsStore.js +303 -0
  76. package/dist/cjs/util/WsStore.js.map +1 -0
  77. package/dist/cjs/util/WsStore.types.d.ts +51 -0
  78. package/dist/cjs/util/WsStore.types.js +14 -0
  79. package/dist/cjs/util/WsStore.types.js.map +1 -0
  80. package/dist/cjs/util/logger.d.ts +8 -0
  81. package/{lib → dist/cjs}/util/logger.js +3 -11
  82. package/dist/cjs/util/logger.js.map +1 -0
  83. package/{lib → dist/cjs}/util/requestUtils.d.ts +2 -1
  84. package/{lib → dist/cjs}/util/requestUtils.js +9 -1
  85. package/dist/cjs/util/requestUtils.js.map +1 -0
  86. package/{lib → dist/cjs}/util/typeGuards.d.ts +4 -2
  87. package/{lib → dist/cjs}/util/typeGuards.js +34 -0
  88. package/dist/cjs/util/typeGuards.js.map +1 -0
  89. package/dist/cjs/util/webCryptoAPI.d.ts +15 -0
  90. package/dist/cjs/util/webCryptoAPI.js +82 -0
  91. package/dist/cjs/util/webCryptoAPI.js.map +1 -0
  92. package/dist/cjs/util/websocket-util.d.ts +142 -0
  93. package/dist/cjs/util/websocket-util.js +533 -0
  94. package/dist/cjs/util/websocket-util.js.map +1 -0
  95. package/dist/cjs/websocket-api-client.d.ts +135 -0
  96. package/dist/cjs/websocket-api-client.js +171 -0
  97. package/dist/cjs/websocket-api-client.js.map +1 -0
  98. package/{lib/websocket-client.d.ts → dist/cjs/websocket-client-legacy.d.ts} +16 -38
  99. package/dist/cjs/websocket-client-legacy.js +524 -0
  100. package/dist/cjs/websocket-client-legacy.js.map +1 -0
  101. package/dist/cjs/websocket-client.d.ts +81 -0
  102. package/dist/cjs/websocket-client.js +548 -0
  103. package/dist/cjs/websocket-client.js.map +1 -0
  104. package/dist/mjs/constants/funding.d.ts +139 -0
  105. package/dist/mjs/constants/funding.js +140 -0
  106. package/dist/mjs/constants/funding.js.map +1 -0
  107. package/dist/mjs/index.d.ts +43 -0
  108. package/dist/mjs/index.js +48 -0
  109. package/dist/mjs/index.js.map +1 -0
  110. package/dist/mjs/package.json +3 -0
  111. package/dist/mjs/rest-client.d.ts +1173 -0
  112. package/dist/mjs/rest-client.js +1271 -0
  113. package/dist/mjs/rest-client.js.map +1 -0
  114. package/dist/mjs/types/rest/client.d.ts +36 -0
  115. package/dist/mjs/types/rest/client.js +2 -0
  116. package/{lib/types/websockets → dist/mjs/types/rest}/client.js.map +1 -1
  117. package/dist/mjs/types/rest/request/account.d.ts +144 -0
  118. package/dist/mjs/types/rest/request/account.js +2 -0
  119. package/dist/mjs/types/rest/request/account.js.map +1 -0
  120. package/dist/mjs/types/rest/request/block-trading.d.ts +76 -0
  121. package/dist/mjs/types/rest/request/block-trading.js +2 -0
  122. package/dist/mjs/types/rest/request/block-trading.js.map +1 -0
  123. package/dist/mjs/types/rest/request/convert.d.ts +19 -0
  124. package/dist/mjs/types/rest/request/convert.js +2 -0
  125. package/dist/mjs/types/rest/request/convert.js.map +1 -0
  126. package/dist/mjs/types/rest/request/copy-trading.d.ts +117 -0
  127. package/dist/mjs/types/rest/request/copy-trading.js +2 -0
  128. package/dist/mjs/types/rest/request/copy-trading.js.map +1 -0
  129. package/dist/mjs/types/rest/request/funding.d.ts +43 -0
  130. package/dist/mjs/types/rest/request/funding.js +2 -0
  131. package/dist/mjs/types/rest/request/funding.js.map +1 -0
  132. package/dist/mjs/types/rest/request/grid-trading.d.ts +66 -0
  133. package/dist/mjs/types/rest/request/grid-trading.js +2 -0
  134. package/dist/mjs/types/rest/request/grid-trading.js.map +1 -0
  135. package/dist/mjs/types/rest/request/public.d.ts +55 -0
  136. package/dist/mjs/types/rest/request/public.js +2 -0
  137. package/dist/mjs/types/rest/request/public.js.map +1 -0
  138. package/dist/mjs/types/rest/request/recurring-buy.d.ts +28 -0
  139. package/dist/mjs/types/rest/request/recurring-buy.js +2 -0
  140. package/dist/mjs/types/rest/request/recurring-buy.js.map +1 -0
  141. package/dist/mjs/types/rest/request/shared.d.ts +7 -0
  142. package/dist/mjs/types/rest/request/shared.js +2 -0
  143. package/dist/mjs/types/rest/request/shared.js.map +1 -0
  144. package/dist/mjs/types/rest/request/signal-bot.d.ts +97 -0
  145. package/dist/mjs/types/rest/request/signal-bot.js +2 -0
  146. package/dist/mjs/types/rest/request/signal-bot.js.map +1 -0
  147. package/dist/mjs/types/rest/request/simple-earn.d.ts +23 -0
  148. package/dist/mjs/types/rest/request/simple-earn.js +2 -0
  149. package/dist/mjs/types/rest/request/simple-earn.js.map +1 -0
  150. package/dist/mjs/types/rest/request/spread-trading.d.ts +69 -0
  151. package/dist/mjs/types/rest/request/spread-trading.js +2 -0
  152. package/dist/mjs/types/rest/request/spread-trading.js.map +1 -0
  153. package/dist/mjs/types/rest/request/subaccount.d.ts +33 -0
  154. package/dist/mjs/types/rest/request/subaccount.js +2 -0
  155. package/dist/mjs/types/rest/request/subaccount.js.map +1 -0
  156. package/dist/mjs/types/rest/request/trade.d.ts +194 -0
  157. package/dist/mjs/types/rest/request/trade.js +2 -0
  158. package/dist/mjs/types/rest/request/trade.js.map +1 -0
  159. package/dist/mjs/types/rest/response/private-account.d.ts +448 -0
  160. package/dist/mjs/types/rest/response/private-account.js +2 -0
  161. package/dist/mjs/types/rest/response/private-account.js.map +1 -0
  162. package/dist/mjs/types/rest/response/private-block-trading.d.ts +124 -0
  163. package/dist/mjs/types/rest/response/private-block-trading.js +2 -0
  164. package/dist/mjs/types/rest/response/private-block-trading.js.map +1 -0
  165. package/dist/mjs/types/rest/response/private-copy-trading.d.ts +259 -0
  166. package/dist/mjs/types/rest/response/private-copy-trading.js +2 -0
  167. package/dist/mjs/types/rest/response/private-copy-trading.js.map +1 -0
  168. package/dist/mjs/types/rest/response/private-flexible-loan.d.ts +72 -0
  169. package/dist/mjs/types/rest/response/private-flexible-loan.js +2 -0
  170. package/dist/mjs/types/rest/response/private-flexible-loan.js.map +1 -0
  171. package/dist/mjs/types/rest/response/private-funding.d.ts +102 -0
  172. package/dist/mjs/types/rest/response/private-funding.js +2 -0
  173. package/dist/mjs/types/rest/response/private-funding.js.map +1 -0
  174. package/dist/mjs/types/rest/response/private-recurring-buy.d.ts +63 -0
  175. package/dist/mjs/types/rest/response/private-recurring-buy.js +2 -0
  176. package/dist/mjs/types/rest/response/private-recurring-buy.js.map +1 -0
  177. package/dist/mjs/types/rest/response/private-signal-bot.d.ts +22 -0
  178. package/dist/mjs/types/rest/response/private-signal-bot.js +2 -0
  179. package/dist/mjs/types/rest/response/private-signal-bot.js.map +1 -0
  180. package/dist/mjs/types/rest/response/private-spread-trading.d.ts +126 -0
  181. package/dist/mjs/types/rest/response/private-spread-trading.js +2 -0
  182. package/dist/mjs/types/rest/response/private-spread-trading.js.map +1 -0
  183. package/dist/mjs/types/rest/response/private-subaccount.d.ts +80 -0
  184. package/dist/mjs/types/rest/response/private-subaccount.js +2 -0
  185. package/dist/mjs/types/rest/response/private-subaccount.js.map +1 -0
  186. package/dist/mjs/types/rest/response/private-trade.d.ts +355 -0
  187. package/dist/mjs/types/rest/response/private-trade.js +2 -0
  188. package/dist/mjs/types/rest/response/private-trade.js.map +1 -0
  189. package/dist/mjs/types/rest/response/public-data.d.ts +174 -0
  190. package/dist/mjs/types/rest/response/public-data.js +2 -0
  191. package/dist/mjs/types/rest/response/public-data.js.map +1 -0
  192. package/dist/mjs/types/rest/shared.d.ts +45 -0
  193. package/dist/mjs/types/rest/shared.js +2 -0
  194. package/dist/mjs/types/rest/shared.js.map +1 -0
  195. package/dist/mjs/types/shared.d.ts +13 -0
  196. package/dist/mjs/types/shared.js +2 -0
  197. package/{lib/types/rest → dist/mjs/types}/shared.js.map +1 -1
  198. package/dist/mjs/types/websockets/ws-api-request.d.ts +61 -0
  199. package/dist/mjs/types/websockets/ws-api-request.js +2 -0
  200. package/dist/mjs/types/websockets/ws-api-request.js.map +1 -0
  201. package/dist/mjs/types/websockets/ws-api-response.d.ts +28 -0
  202. package/dist/mjs/types/websockets/ws-api-response.js +2 -0
  203. package/dist/mjs/types/websockets/ws-api-response.js.map +1 -0
  204. package/dist/mjs/types/websockets/ws-api.d.ts +139 -0
  205. package/dist/mjs/types/websockets/ws-api.js +35 -0
  206. package/dist/mjs/types/websockets/ws-api.js.map +1 -0
  207. package/dist/mjs/types/websockets/ws-events.d.ts +33 -0
  208. package/dist/mjs/types/websockets/ws-events.js +8 -0
  209. package/dist/mjs/types/websockets/ws-events.js.map +1 -0
  210. package/dist/mjs/types/websockets/ws-general.d.ts +48 -0
  211. package/dist/mjs/types/websockets/ws-general.js +2 -0
  212. package/dist/mjs/types/websockets/ws-general.js.map +1 -0
  213. package/dist/mjs/types/websockets/ws-request.d.ts +93 -0
  214. package/dist/mjs/types/websockets/ws-request.js +2 -0
  215. package/dist/mjs/types/websockets/ws-request.js.map +1 -0
  216. package/dist/mjs/util/BaseRestClient.d.ts +29 -0
  217. package/dist/mjs/util/BaseRestClient.js +230 -0
  218. package/dist/mjs/util/BaseRestClient.js.map +1 -0
  219. package/dist/mjs/util/BaseWSClient.d.ts +198 -0
  220. package/dist/mjs/util/BaseWSClient.js +763 -0
  221. package/dist/mjs/util/BaseWSClient.js.map +1 -0
  222. package/dist/mjs/util/WsStore.d.ts +75 -0
  223. package/dist/mjs/util/WsStore.js +298 -0
  224. package/dist/mjs/util/WsStore.js.map +1 -0
  225. package/dist/mjs/util/WsStore.types.d.ts +51 -0
  226. package/dist/mjs/util/WsStore.types.js +11 -0
  227. package/dist/mjs/util/WsStore.types.js.map +1 -0
  228. package/dist/mjs/util/logger.d.ts +8 -0
  229. package/dist/mjs/util/logger.js +14 -0
  230. package/dist/mjs/util/logger.js.map +1 -0
  231. package/dist/mjs/util/requestUtils.d.ts +8 -0
  232. package/dist/mjs/util/requestUtils.js +51 -0
  233. package/dist/mjs/util/requestUtils.js.map +1 -0
  234. package/dist/mjs/util/typeGuards.d.ts +19 -0
  235. package/dist/mjs/util/typeGuards.js +85 -0
  236. package/dist/mjs/util/typeGuards.js.map +1 -0
  237. package/dist/mjs/util/webCryptoAPI.d.ts +15 -0
  238. package/dist/mjs/util/webCryptoAPI.js +77 -0
  239. package/dist/mjs/util/webCryptoAPI.js.map +1 -0
  240. package/dist/mjs/util/websocket-util.d.ts +142 -0
  241. package/dist/mjs/util/websocket-util.js +517 -0
  242. package/dist/mjs/util/websocket-util.js.map +1 -0
  243. package/dist/mjs/websocket-api-client.d.ts +135 -0
  244. package/dist/mjs/websocket-api-client.js +167 -0
  245. package/dist/mjs/websocket-api-client.js.map +1 -0
  246. package/dist/mjs/websocket-client-legacy.d.ts +76 -0
  247. package/dist/mjs/websocket-client-legacy.js +517 -0
  248. package/dist/mjs/websocket-client-legacy.js.map +1 -0
  249. package/dist/mjs/websocket-client.d.ts +81 -0
  250. package/dist/mjs/websocket-client.js +544 -0
  251. package/dist/mjs/websocket-client.js.map +1 -0
  252. package/llms.txt +5604 -3719
  253. package/package.json +28 -13
  254. package/index.js +0 -1
  255. package/lib/constants/funding.js.map +0 -1
  256. package/lib/constants/index.d.ts +0 -1
  257. package/lib/constants/index.js +0 -18
  258. package/lib/constants/index.js.map +0 -1
  259. package/lib/index.d.ts +0 -5
  260. package/lib/index.js +0 -22
  261. package/lib/index.js.map +0 -1
  262. package/lib/rest-client.js.map +0 -1
  263. package/lib/types/index.d.ts +0 -3
  264. package/lib/types/index.js +0 -20
  265. package/lib/types/index.js.map +0 -1
  266. package/lib/types/rest/client.d.ts +0 -20
  267. package/lib/types/rest/index.d.ts +0 -4
  268. package/lib/types/rest/index.js +0 -21
  269. package/lib/types/rest/index.js.map +0 -1
  270. package/lib/types/rest/request/account.js.map +0 -1
  271. package/lib/types/rest/request/announement.d.ts +0 -0
  272. package/lib/types/rest/request/announement.js +0 -1
  273. package/lib/types/rest/request/announement.js.map +0 -1
  274. package/lib/types/rest/request/block-trading.js.map +0 -1
  275. package/lib/types/rest/request/convert.js.map +0 -1
  276. package/lib/types/rest/request/copy-trading.js.map +0 -1
  277. package/lib/types/rest/request/funding.js.map +0 -1
  278. package/lib/types/rest/request/grid-trading.js.map +0 -1
  279. package/lib/types/rest/request/index.d.ts +0 -14
  280. package/lib/types/rest/request/index.js +0 -31
  281. package/lib/types/rest/request/index.js.map +0 -1
  282. package/lib/types/rest/request/public.js.map +0 -1
  283. package/lib/types/rest/request/recurring-buy.js.map +0 -1
  284. package/lib/types/rest/request/shared.js.map +0 -1
  285. package/lib/types/rest/request/signal-bot.js.map +0 -1
  286. package/lib/types/rest/request/simple-earn.js.map +0 -1
  287. package/lib/types/rest/request/spread-trading.js.map +0 -1
  288. package/lib/types/rest/request/subaccount.js.map +0 -1
  289. package/lib/types/rest/request/trade.js.map +0 -1
  290. package/lib/types/rest/response/index.d.ts +0 -11
  291. package/lib/types/rest/response/index.js +0 -28
  292. package/lib/types/rest/response/index.js.map +0 -1
  293. package/lib/types/rest/response/private-account.js.map +0 -1
  294. package/lib/types/rest/response/private-block-trading.js.map +0 -1
  295. package/lib/types/rest/response/private-copy-trading.js.map +0 -1
  296. package/lib/types/rest/response/private-flexible-loan.js.map +0 -1
  297. package/lib/types/rest/response/private-funding.js.map +0 -1
  298. package/lib/types/rest/response/private-recurring-buy.js.map +0 -1
  299. package/lib/types/rest/response/private-signal-bot.js.map +0 -1
  300. package/lib/types/rest/response/private-spread-trading.js.map +0 -1
  301. package/lib/types/rest/response/private-subaccount.js.map +0 -1
  302. package/lib/types/rest/response/private-trade.js.map +0 -1
  303. package/lib/types/rest/response/public-data.js.map +0 -1
  304. package/lib/types/shared.d.ts +0 -6
  305. package/lib/types/websockets/client.d.ts +0 -22
  306. package/lib/types/websockets/client.js +0 -3
  307. package/lib/types/websockets/event.js +0 -3
  308. package/lib/types/websockets/event.js.map +0 -1
  309. package/lib/types/websockets/index.d.ts +0 -3
  310. package/lib/types/websockets/index.js +0 -20
  311. package/lib/types/websockets/index.js.map +0 -1
  312. package/lib/types/websockets/request.js +0 -3
  313. package/lib/types/websockets/request.js.map +0 -1
  314. package/lib/util/BaseRestClient.js +0 -217
  315. package/lib/util/BaseRestClient.js.map +0 -1
  316. package/lib/util/WsStore.d.ts +0 -66
  317. package/lib/util/WsStore.js +0 -168
  318. package/lib/util/WsStore.js.map +0 -1
  319. package/lib/util/browser-support.d.ts +0 -6
  320. package/lib/util/browser-support.js +0 -48
  321. package/lib/util/browser-support.js.map +0 -1
  322. package/lib/util/index.d.ts +0 -4
  323. package/lib/util/index.js +0 -21
  324. package/lib/util/index.js.map +0 -1
  325. package/lib/util/logger.d.ts +0 -9
  326. package/lib/util/logger.js.map +0 -1
  327. package/lib/util/node-support.d.ts +0 -1
  328. package/lib/util/node-support.js +0 -8
  329. package/lib/util/node-support.js.map +0 -1
  330. package/lib/util/requestUtils.js.map +0 -1
  331. package/lib/util/typeGuards.js.map +0 -1
  332. package/lib/util/websocket-util.d.ts +0 -35
  333. package/lib/util/websocket-util.js +0 -282
  334. package/lib/util/websocket-util.js.map +0 -1
  335. package/lib/websocket-client.js +0 -472
  336. package/lib/websocket-client.js.map +0 -1
  337. /package/{lib → dist/cjs}/constants/funding.d.ts +0 -0
  338. /package/{lib → dist/cjs}/constants/funding.js +0 -0
  339. /package/{lib → dist/cjs}/types/rest/client.js +0 -0
  340. /package/{lib → dist/cjs}/types/rest/request/account.js +0 -0
  341. /package/{lib → dist/cjs}/types/rest/request/block-trading.js +0 -0
  342. /package/{lib → dist/cjs}/types/rest/request/convert.d.ts +0 -0
  343. /package/{lib → dist/cjs}/types/rest/request/convert.js +0 -0
  344. /package/{lib → dist/cjs}/types/rest/request/copy-trading.d.ts +0 -0
  345. /package/{lib → dist/cjs}/types/rest/request/copy-trading.js +0 -0
  346. /package/{lib → dist/cjs}/types/rest/request/funding.d.ts +0 -0
  347. /package/{lib → dist/cjs}/types/rest/request/funding.js +0 -0
  348. /package/{lib → dist/cjs}/types/rest/request/grid-trading.d.ts +0 -0
  349. /package/{lib → dist/cjs}/types/rest/request/grid-trading.js +0 -0
  350. /package/{lib → dist/cjs}/types/rest/request/public.d.ts +0 -0
  351. /package/{lib → dist/cjs}/types/rest/request/public.js +0 -0
  352. /package/{lib → dist/cjs}/types/rest/request/recurring-buy.d.ts +0 -0
  353. /package/{lib → dist/cjs}/types/rest/request/recurring-buy.js +0 -0
  354. /package/{lib → dist/cjs}/types/rest/request/shared.js +0 -0
  355. /package/{lib → dist/cjs}/types/rest/request/signal-bot.d.ts +0 -0
  356. /package/{lib → dist/cjs}/types/rest/request/signal-bot.js +0 -0
  357. /package/{lib → dist/cjs}/types/rest/request/simple-earn.d.ts +0 -0
  358. /package/{lib → dist/cjs}/types/rest/request/simple-earn.js +0 -0
  359. /package/{lib → dist/cjs}/types/rest/request/spread-trading.d.ts +0 -0
  360. /package/{lib → dist/cjs}/types/rest/request/spread-trading.js +0 -0
  361. /package/{lib → dist/cjs}/types/rest/request/subaccount.d.ts +0 -0
  362. /package/{lib → dist/cjs}/types/rest/request/subaccount.js +0 -0
  363. /package/{lib → dist/cjs}/types/rest/request/trade.js +0 -0
  364. /package/{lib → dist/cjs}/types/rest/response/private-account.js +0 -0
  365. /package/{lib → dist/cjs}/types/rest/response/private-block-trading.js +0 -0
  366. /package/{lib → dist/cjs}/types/rest/response/private-copy-trading.d.ts +0 -0
  367. /package/{lib → dist/cjs}/types/rest/response/private-copy-trading.js +0 -0
  368. /package/{lib → dist/cjs}/types/rest/response/private-flexible-loan.d.ts +0 -0
  369. /package/{lib → dist/cjs}/types/rest/response/private-flexible-loan.js +0 -0
  370. /package/{lib → dist/cjs}/types/rest/response/private-funding.js +0 -0
  371. /package/{lib → dist/cjs}/types/rest/response/private-recurring-buy.d.ts +0 -0
  372. /package/{lib → dist/cjs}/types/rest/response/private-recurring-buy.js +0 -0
  373. /package/{lib → dist/cjs}/types/rest/response/private-signal-bot.d.ts +0 -0
  374. /package/{lib → dist/cjs}/types/rest/response/private-signal-bot.js +0 -0
  375. /package/{lib → dist/cjs}/types/rest/response/private-spread-trading.d.ts +0 -0
  376. /package/{lib → dist/cjs}/types/rest/response/private-spread-trading.js +0 -0
  377. /package/{lib → dist/cjs}/types/rest/response/private-subaccount.d.ts +0 -0
  378. /package/{lib → dist/cjs}/types/rest/response/private-subaccount.js +0 -0
  379. /package/{lib → dist/cjs}/types/rest/response/private-trade.js +0 -0
  380. /package/{lib → dist/cjs}/types/rest/response/public-data.js +0 -0
  381. /package/{lib → dist/cjs}/types/rest/shared.js +0 -0
  382. /package/{lib → dist/cjs}/types/shared.js +0 -0
@@ -0,0 +1,1271 @@
1
+ import BaseRestClient from './util/BaseRestClient.js';
2
+ export class RestClient extends BaseRestClient {
3
+ /**
4
+ *
5
+ * Custom SDK functions
6
+ *
7
+ */
8
+ /**
9
+ * This method is used to get the latency and time sync between the client and the server.
10
+ * This is not official API endpoint and is only used for internal testing purposes.
11
+ * Use this method to check the latency and time sync between the client and the server.
12
+ * Final values might vary slightly, but it should be within few ms difference.
13
+ * If you have any suggestions or improvements to this measurement, please create an issue or pull request on GitHub.
14
+ */
15
+ async fetchLatencySummary() {
16
+ const clientTimeReqStart = Date.now();
17
+ const serverTime = await this.getServerTime();
18
+ const clientTimeReqEnd = Date.now();
19
+ console.log('serverTime', serverTime);
20
+ const serverTimeMs = serverTime;
21
+ const roundTripTime = clientTimeReqEnd - clientTimeReqStart;
22
+ const estimatedOneWayLatency = Math.floor(roundTripTime / 2);
23
+ // Adjust server time by adding estimated one-way latency
24
+ const adjustedServerTime = serverTimeMs + estimatedOneWayLatency;
25
+ // Calculate time difference between adjusted server time and local time
26
+ const timeDifference = adjustedServerTime - clientTimeReqEnd;
27
+ const result = {
28
+ localTime: clientTimeReqEnd,
29
+ serverTime: serverTimeMs,
30
+ roundTripTime,
31
+ estimatedOneWayLatency,
32
+ adjustedServerTime,
33
+ timeDifference,
34
+ };
35
+ console.log('Time synchronization results:');
36
+ console.log(result);
37
+ console.log(`Your approximate latency to exchange server:
38
+ One way: ${estimatedOneWayLatency}ms.
39
+ Round trip: ${roundTripTime}ms.
40
+ `);
41
+ if (timeDifference > 500) {
42
+ console.warn(`WARNING! Time difference between server and client clock is greater than 500ms. It is currently ${timeDifference}ms.
43
+ Consider adjusting your system clock to avoid unwanted clock sync errors!
44
+ Visit https://github.com/tiagosiebler/awesome-crypto-examples/wiki/Timestamp-for-this-request-is-outside-of-the-recvWindow for more information`);
45
+ }
46
+ else {
47
+ console.log(`Time difference between server and client clock is within acceptable range of 500ms. It is currently ${timeDifference}ms.`);
48
+ }
49
+ return result;
50
+ }
51
+ /**
52
+ *
53
+ * OKX misc endpoints
54
+ *
55
+ */
56
+ async getServerTime() {
57
+ const response = await this.get('/api/v5/public/time');
58
+ const timestamp = Array.isArray(response) ? Number(response[0]?.ts) : NaN;
59
+ if (!Array.isArray(response) ||
60
+ isNaN(timestamp) ||
61
+ typeof timestamp !== 'number') {
62
+ throw response;
63
+ }
64
+ return timestamp;
65
+ }
66
+ /**
67
+ *
68
+ * Trading account endpoints
69
+ *
70
+ */
71
+ getAccountInstruments(params) {
72
+ return this.getPrivate('/api/v5/account/instruments', params);
73
+ }
74
+ getBalance(params) {
75
+ return this.getPrivate('/api/v5/account/balance', params);
76
+ }
77
+ getPositions(params) {
78
+ return this.getPrivate('/api/v5/account/positions', params);
79
+ }
80
+ getPositionsHistory(params) {
81
+ return this.getPrivate('/api/v5/account/positions-history', params);
82
+ }
83
+ getAccountPositionRisk(params) {
84
+ return this.getPrivate('/api/v5/account/account-position-risk', params);
85
+ }
86
+ /** Up to last 7 days */
87
+ getBills(params) {
88
+ return this.getPrivate('/api/v5/account/bills', params);
89
+ }
90
+ /** Last 3 months */
91
+ getBillsArchive(params) {
92
+ return this.getPrivate('/api/v5/account/bills-archive', params);
93
+ }
94
+ /**
95
+ * Apply for bill data since 1 February, 2021 except for the current quarter.
96
+ * Check the file link from the "Get bills details (since 2021)" endpoint in 30 hours to allow for data generation.
97
+ * During peak demand, data generation may take longer. If the file link is still unavailable after 48 hours, reach out to customer support for assistance.
98
+ * It is only applicable to the data from the unified account.
99
+ *
100
+ * This endpoint submits a request for bill data. You can then use getRequestedBillsHistoryLink to get the link to the bill data.
101
+ * It may take some time to generate the data.
102
+ */
103
+ requestBillsHistoryDownloadLink(params) {
104
+ return this.postPrivate('/api/v5/account/bills-history-archive', params);
105
+ }
106
+ /**
107
+ * This endpoint returns the link to the bill data which you can request using requestBillsHistoryDownloadLink.
108
+ */
109
+ getRequestedBillsHistoryLink(params) {
110
+ return this.getPrivate('/api/v5/account/bills-history-archive', params);
111
+ }
112
+ getAccountConfiguration() {
113
+ return this.getPrivate('/api/v5/account/config');
114
+ }
115
+ setPositionMode(params) {
116
+ return this.postPrivate('/api/v5/account/set-position-mode', params);
117
+ }
118
+ setLeverage(params) {
119
+ return this.postPrivate('/api/v5/account/set-leverage', params);
120
+ }
121
+ /** Max buy/sell amount or open amount */
122
+ getMaxBuySellAmount(params) {
123
+ return this.getPrivate('/api/v5/account/max-size', params);
124
+ }
125
+ getMaxAvailableTradableAmount(params) {
126
+ return this.getPrivate('/api/v5/account/max-avail-size', params);
127
+ }
128
+ changePositionMargin(params) {
129
+ return this.postPrivate('/api/v5/account/position/margin-balance', params);
130
+ }
131
+ getLeverage(params) {
132
+ return this.getPrivate('/api/v5/account/leverage-info', params);
133
+ }
134
+ /**
135
+ * @deprecated - will be removed in next major release
136
+ * Use getLeverage() instead
137
+ */
138
+ getLeverageV2(params) {
139
+ return this.getPrivate('/api/v5/account/leverage-info', params);
140
+ }
141
+ getLeverageEstimatedInfo(params) {
142
+ return this.getPrivate('/api/v5/account/adjust-leverage-info', params);
143
+ }
144
+ getMaxLoan(params) {
145
+ return this.getPrivate('/api/v5/account/max-loan', params);
146
+ }
147
+ getFeeRates(params) {
148
+ return this.getPrivate('/api/v5/account/trade-fee', params);
149
+ }
150
+ getInterestAccrued(params) {
151
+ return this.getPrivate('/api/v5/account/interest-accrued', params);
152
+ }
153
+ getInterestRate(params) {
154
+ return this.getPrivate('/api/v5/account/interest-rate', params);
155
+ }
156
+ setGreeksDisplayType(params) {
157
+ return this.postPrivate('/api/v5/account/set-greeks', params);
158
+ }
159
+ setIsolatedMode(params) {
160
+ return this.postPrivate('/api/v5/account/set-isolated-mode', params);
161
+ }
162
+ getMaxWithdrawals(params) {
163
+ return this.getPrivate('/api/v5/account/max-withdrawal', params);
164
+ }
165
+ getAccountRiskState() {
166
+ return this.getPrivate('/api/v5/account/risk-state');
167
+ }
168
+ setAccountCollateralAssets(params) {
169
+ return this.postPrivate('/api/v5/account/set-collateral-assets', params);
170
+ }
171
+ getAccountCollateralAssets(params) {
172
+ return this.getPrivate('/api/v5/account/collateral-assets', params);
173
+ }
174
+ submitQuickMarginBorrowRepay(params) {
175
+ return this.postPrivate('/api/v5/account/quick-margin-borrow-repay', params);
176
+ }
177
+ getQuickMarginBorrowRepayHistory(params) {
178
+ return this.getPrivate('/api/v5/account/quick-margin-borrow-repay-history', params);
179
+ }
180
+ borrowRepayVIPLoan(params) {
181
+ return this.postPrivate('/api/v5/account/borrow-repay', params);
182
+ }
183
+ getVIPLoanBorrowRepayHistory(params) {
184
+ return this.getPrivate('/api/v5/account/borrow-repay-history', params);
185
+ }
186
+ getVIPInterestAccrued(params) {
187
+ return this.getPrivate('/api/v5/account/vip-interest-accrued', params);
188
+ }
189
+ getVIPInterestDeducted(params) {
190
+ return this.getPrivate('/api/v5/account/vip-interest-deducted', params);
191
+ }
192
+ getVIPLoanOrders(params) {
193
+ return this.getPrivate('/api/v5/account/vip-loan-order-list', params);
194
+ }
195
+ getVIPLoanOrder(params) {
196
+ return this.getPrivate('/api/v5/account/vip-loan-order-detail', params);
197
+ }
198
+ getBorrowInterestLimits(params) {
199
+ return this.getPrivate('/api/v5/account/interest-limits', params);
200
+ }
201
+ getFixedLoanBorrowLimit() {
202
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-limit');
203
+ }
204
+ getFixedLoanBorrowQuote(params) {
205
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-quote', params);
206
+ }
207
+ submitFixedLoanBorrowOrder(params) {
208
+ return this.postPrivate('/api/v5/account/fixed-loan/borrowing-order', params);
209
+ }
210
+ updateFixedLoanBorrowOrder(params) {
211
+ return this.postPrivate('/api/v5/account/fixed-loan/amend-borrowing-order', params);
212
+ }
213
+ manualRenewFixedLoanBorrowOrder(params) {
214
+ return this.postPrivate('/api/v5/account/fixed-loan/manual-reborrow', params);
215
+ }
216
+ repayFixedLoanBorrowOrder(params) {
217
+ return this.postPrivate('/api/v5/account/fixed-loan/repay-borrowing-order', params);
218
+ }
219
+ convertFixedLoanToMarketLoan(params) {
220
+ return this.postPrivate('/api/v5/account/fixed-loan/convert-to-market-loan', params);
221
+ }
222
+ reduceFixedLoanLiabilities(params) {
223
+ return this.postPrivate('/api/v5/account/fixed-loan/reduce-liabilities', params);
224
+ }
225
+ getFixedLoanBorrowOrders(params) {
226
+ return this.getPrivate('/api/v5/account/fixed-loan/borrowing-orders-list', params);
227
+ }
228
+ manualBorrowRepay(params) {
229
+ return this.postPrivate('/api/v5/account/spot-manual-borrow-repay', params);
230
+ }
231
+ setAutoRepay(params) {
232
+ return this.postPrivate('/api/v5/account/set-auto-repay', params);
233
+ }
234
+ getBorrowRepayHistory(params) {
235
+ return this.getPrivate('/api/v5/account/spot-borrow-repay-history', params);
236
+ }
237
+ positionBuilder(params) {
238
+ return this.postPrivate('/api/v5/account/position-builder', params);
239
+ }
240
+ updateRiskOffsetAmount(params) {
241
+ return this.postPrivate('/api/v5/account/set-riskOffset-amt', params);
242
+ }
243
+ getGreeks(params) {
244
+ return this.getPrivate('/api/v5/account/greeks', params);
245
+ }
246
+ getPMLimitation(params) {
247
+ return this.getPrivate('/api/v5/account/position-tiers', params);
248
+ }
249
+ updateRiskOffsetType(params) {
250
+ return this.postPrivate('/api/v5/account/set-riskOffset-type', params);
251
+ }
252
+ activateOption() {
253
+ return this.postPrivate('/api/v5/account/activate-option');
254
+ }
255
+ setAutoLoan(params) {
256
+ return this.postPrivate('/api/v5/account/set-auto-loan', params);
257
+ }
258
+ presetAccountLevelSwitch(params) {
259
+ return this.postPrivate('/api/v5/account/account-level-switch-preset', params);
260
+ }
261
+ getAccountSwitchPrecheck(params) {
262
+ return this.getPrivate('/api/v5/account/set-account-switch-precheck', params);
263
+ }
264
+ setAccountMode(params) {
265
+ return this.postPrivate('/api/v5/account/set-account-level', params);
266
+ }
267
+ resetMMPStatus(params) {
268
+ return this.postPrivate('/api/v5/account/mmp-reset', params);
269
+ }
270
+ setMMPConfig(params) {
271
+ return this.postPrivate('/api/v5/account/mmp-config', params);
272
+ }
273
+ getMMPConfig(params) {
274
+ return this.getPrivate('/api/v5/account/mmp-config', params);
275
+ }
276
+ /**
277
+ *
278
+ * Orderbook trading - trade endpoints
279
+ *
280
+ */
281
+ submitOrder(params) {
282
+ return this.postPrivate('/api/v5/trade/order', params);
283
+ }
284
+ submitMultipleOrders(params) {
285
+ return this.postPrivate('/api/v5/trade/batch-orders', params);
286
+ }
287
+ cancelOrder(params) {
288
+ return this.postPrivate('/api/v5/trade/cancel-order', params);
289
+ }
290
+ cancelMultipleOrders(params) {
291
+ return this.postPrivate('/api/v5/trade/cancel-batch-orders', params);
292
+ }
293
+ amendOrder(params) {
294
+ return this.postPrivate('/api/v5/trade/amend-order', params);
295
+ }
296
+ amendMultipleOrders(params) {
297
+ return this.postPrivate('/api/v5/trade/amend-batch-orders', params);
298
+ }
299
+ closePositions(params) {
300
+ return this.postPrivate('/api/v5/trade/close-position', params);
301
+ }
302
+ getOrderDetails(params) {
303
+ return this.getPrivate('/api/v5/trade/order', params);
304
+ }
305
+ getOrderList(params) {
306
+ return this.getPrivate('/api/v5/trade/orders-pending', params);
307
+ }
308
+ /**
309
+ * Get history for last 7 days
310
+ */
311
+ getOrderHistory(params) {
312
+ return this.getPrivate('/api/v5/trade/orders-history', params);
313
+ }
314
+ /**
315
+ * Get history for last 3 months
316
+ */
317
+ getOrderHistoryArchive(params) {
318
+ return this.getPrivate('/api/v5/trade/orders-history-archive', params);
319
+ }
320
+ /**
321
+ * Get history for last 7 days
322
+ */
323
+ getFills(params) {
324
+ return this.getPrivate('/api/v5/trade/fills', params);
325
+ }
326
+ /**
327
+ * Get history for last 3 months
328
+ */
329
+ getFillsHistory(params) {
330
+ return this.getPrivate('/api/v5/trade/fills-history', params);
331
+ }
332
+ /** Get easy convert currency list */
333
+ getEasyConvertCurrencies(params) {
334
+ return this.getPrivate('/api/v5/trade/easy-convert-currency-list', params);
335
+ }
336
+ /**
337
+ *
338
+ * Place easy convert : Convert small currencies to mainstream currencies.
339
+ * Only applicable to the crypto balance less than $10.
340
+ *
341
+ * Maximum 5 currencies can be selected in one order.
342
+ * If there are multiple currencies, separate them with commas in the "from" field.
343
+ *
344
+ */
345
+ submitEasyConvert(params) {
346
+ return this.postPrivate('/api/v5/trade/easy-convert', params);
347
+ }
348
+ /** Get easy convert history : Get the history and status of easy convert trades. */
349
+ getEasyConvertHistory(params) {
350
+ return this.getPrivate('/api/v5/trade/easy-convert-history', params);
351
+ }
352
+ /**
353
+ *
354
+ * Get one-click repay currency list : Get list of debt currency data and repay currencies.
355
+ * Debt currencies include both cross and isolated debts.
356
+ */
357
+ getOneClickRepayCurrencyList(params) {
358
+ return this.getPrivate('/api/v5/trade/one-click-repay-currency-list', params);
359
+ }
360
+ /**
361
+ * Trade one-click repay to repay cross debts.
362
+ * Isolated debts are not applicable.
363
+ * The maximum repayment amount is based on the remaining available balance of funding and trading accounts.
364
+ */
365
+ submitOneClickRepay(params) {
366
+ return this.postPrivate('/api/v5/trade/one-click-repay', params);
367
+ }
368
+ /** Get the history and status of one-click repay trades. */
369
+ getOneClickRepayHistory(params) {
370
+ return this.getPrivate('/api/v5/trade/one-click-repay-history', params);
371
+ }
372
+ cancelMassOrder(params) {
373
+ return this.postPrivate('/api/v5/trade/mass-cancel', params);
374
+ }
375
+ cancelAllAfter(params) {
376
+ return this.postPrivate('/api/v5/trade/cancel-all-after', params);
377
+ }
378
+ getAccountRateLimit() {
379
+ return this.getPrivate('/api/v5/trade/account-rate-limit');
380
+ }
381
+ submitOrderPrecheck(params) {
382
+ return this.postPrivate('/api/v5/trade/order-precheck', params);
383
+ }
384
+ /**
385
+ *
386
+ * Orderbook trading - Algo trading endpoints
387
+ *
388
+ */
389
+ placeAlgoOrder(params) {
390
+ return this.postPrivate('/api/v5/trade/order-algo', params);
391
+ }
392
+ cancelAlgoOrder(params) {
393
+ return this.postPrivate('/api/v5/trade/cancel-algos', params);
394
+ }
395
+ amendAlgoOrder(params) {
396
+ return this.postPrivate('/api/v5/trade/amend-algos', params);
397
+ }
398
+ cancelAdvanceAlgoOrder(params) {
399
+ return this.postPrivate('/api/v5/trade/cancel-advance-algos', params);
400
+ }
401
+ getAlgoOrderDetails(params) {
402
+ return this.getPrivate('/api/v5/trade/order-algo', params);
403
+ }
404
+ getAlgoOrderList(params) {
405
+ return this.getPrivate('/api/v5/trade/orders-algo-pending', params);
406
+ }
407
+ getAlgoOrderHistory(params) {
408
+ return this.getPrivate('/api/v5/trade/orders-algo-history', params);
409
+ }
410
+ /**
411
+ *
412
+ * Orderbook trading - Grid trading endpoints
413
+ *
414
+ */
415
+ placeGridAlgoOrder(params) {
416
+ return this.postPrivate('/api/v5/tradingBot/grid/order-algo', params);
417
+ }
418
+ amendGridAlgoOrder(params) {
419
+ return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', params);
420
+ }
421
+ stopGridAlgoOrder(orders) {
422
+ return this.postPrivate('/api/v5/tradingBot/grid/stop-order-algo', orders);
423
+ }
424
+ closeGridContractPosition(params) {
425
+ return this.postPrivate('/api/v5/tradingBot/grid/close-position', params);
426
+ }
427
+ cancelGridContractCloseOrder(params) {
428
+ return this.postPrivate('/api/v5/tradingBot/grid/cancel-close-order', params);
429
+ }
430
+ instantTriggerGridAlgoOrder(params) {
431
+ return this.postPrivate('/api/v5/tradingBot/grid/order-instant-trigger', params);
432
+ }
433
+ getGridAlgoOrderList(params) {
434
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-pending', params);
435
+ }
436
+ getGridAlgoOrderHistory(params) {
437
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-history', params);
438
+ }
439
+ getGridAlgoOrderDetails(params) {
440
+ return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', params);
441
+ }
442
+ getGridAlgoSubOrders(params) {
443
+ return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', params);
444
+ }
445
+ getGridAlgoOrderPositions(params) {
446
+ return this.getPrivate('/api/v5/tradingBot/grid/positions', params);
447
+ }
448
+ spotGridWithdrawIncome(params) {
449
+ return this.postPrivate('/api/v5/tradingBot/grid/withdraw-income', params);
450
+ }
451
+ computeGridMarginBalance(params) {
452
+ return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', params);
453
+ }
454
+ adjustGridMarginBalance(params) {
455
+ return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', params);
456
+ }
457
+ adjustGridInvestment(params) {
458
+ return this.postPrivate('/api/v5/tradingBot/grid/adjust-investment', params);
459
+ }
460
+ getGridAIParameter(params) {
461
+ return this.get('/api/v5/tradingBot/grid/ai-param', params);
462
+ }
463
+ computeGridMinInvestment(params) {
464
+ return this.post('/api/v5/tradingBot/grid/min-investment', params);
465
+ }
466
+ getRSIBackTesting(params) {
467
+ return this.get('/api/v5/tradingBot/public/rsi-back-testing', params);
468
+ }
469
+ getMaxGridQuantity(params) {
470
+ return this.get('/api/v5/tradingBot/grid/grid-quantity', params);
471
+ }
472
+ /**
473
+ *
474
+ * Orderbook trading - Signal bot trading endpoints
475
+ *
476
+ */
477
+ createSignal(params) {
478
+ return this.postPrivate('/api/v5/tradingBot/signal/create-signal', params);
479
+ }
480
+ getSignals(params) {
481
+ return this.getPrivate('/api/v5/tradingBot/signal/signals', params);
482
+ }
483
+ createSignalBot(params) {
484
+ return this.postPrivate('/api/v5/tradingBot/signal/order-algo', params);
485
+ }
486
+ cancelSignalBots(params) {
487
+ return this.postPrivate('/api/v5/tradingBot/signal/stop-order-algo', params);
488
+ }
489
+ updateSignalMargin(params) {
490
+ return this.postPrivate('/api/v5/tradingBot/signal/margin-balance', params);
491
+ }
492
+ updateSignalTPSL(params) {
493
+ return this.postPrivate('/api/v5/tradingBot/signal/amendTPSL', params);
494
+ }
495
+ setSignalInstruments(params) {
496
+ return this.postPrivate('/api/v5/tradingBot/signal/set-instruments', params);
497
+ }
498
+ getSignalBotOrder(params) {
499
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
500
+ }
501
+ getActiveSignalBot(params) {
502
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-details', params);
503
+ }
504
+ getSignalBotHistory(params) {
505
+ return this.getPrivate('/api/v5/tradingBot/signal/orders-algo-history', params);
506
+ }
507
+ getSignalBotPositions(params) {
508
+ return this.getPrivate('/api/v5/tradingBot/signal/positions', params);
509
+ }
510
+ getSignalBotPositionHistory(params) {
511
+ return this.getPrivate('/api/v5/tradingBot/signal/positions-history', params);
512
+ }
513
+ closeSignalBotPosition(params) {
514
+ return this.postPrivate('/api/v5/tradingBot/signal/close-position', params);
515
+ }
516
+ placeSignalBotSubOrder(params) {
517
+ return this.postPrivate('/api/v5/tradingBot/signal/sub-order', params);
518
+ }
519
+ cancelSubOrder(params) {
520
+ return this.postPrivate('/api/v5/tradingBot/signal/cancel-sub-order', params);
521
+ }
522
+ getSignalBotSubOrders(params) {
523
+ return this.getPrivate('/api/v5/tradingBot/signal/sub-orders', params);
524
+ }
525
+ getSignalBotEventHistory(params) {
526
+ return this.getPrivate('/api/v5/tradingBot/signal/event-history', params);
527
+ }
528
+ /**
529
+ *
530
+ * Orderbook trading - Recurring buy endpoints
531
+ *
532
+ */
533
+ submitRecurringBuyOrder(params) {
534
+ return this.postPrivate('/api/v5/tradingBot/recurring/order-algo', params);
535
+ }
536
+ amendRecurringBuyOrder(params) {
537
+ return this.postPrivate('/api/v5/tradingBot/recurring/amend-order-algo', params);
538
+ }
539
+ stopRecurringBuyOrder(params) {
540
+ return this.postPrivate('/api/v5/tradingBot/recurring/stop-order-algo', params);
541
+ }
542
+ getRecurringBuyOrders(params) {
543
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-pending', params);
544
+ }
545
+ getRecurringBuyOrderHistory(params) {
546
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-history', params);
547
+ }
548
+ getRecurringBuyOrderDetails(params) {
549
+ return this.getPrivate('/api/v5/tradingBot/recurring/orders-algo-details', params);
550
+ }
551
+ getRecurringBuySubOrders(params) {
552
+ return this.getPrivate('/api/v5/tradingBot/recurring/sub-orders', params);
553
+ }
554
+ /**
555
+ *
556
+ * Orderbook trading - Copy trading endpoints
557
+ *
558
+ */
559
+ getCopytradingSubpositions(params) {
560
+ return this.getPrivate('/api/v5/copytrading/current-subpositions', params);
561
+ }
562
+ getCopytradingSubpositionsHistory(params) {
563
+ return this.getPrivate('/api/v5/copytrading/subpositions-history', params);
564
+ }
565
+ submitCopytradingAlgoOrder(params) {
566
+ return this.postPrivate('/api/v5/copytrading/algo-order', params);
567
+ }
568
+ closeCopytradingSubposition(params) {
569
+ return this.postPrivate('/api/v5/copytrading/close-subposition', params);
570
+ }
571
+ getCopytradingInstruments(params) {
572
+ return this.getPrivate('/api/v5/copytrading/instruments', params);
573
+ }
574
+ setCopytradingInstruments(params) {
575
+ return this.postPrivate('/api/v5/copytrading/set-instruments', params);
576
+ }
577
+ getCopytradingProfitDetails(params) {
578
+ return this.getPrivate('/api/v5/copytrading/profit-sharing-details', params);
579
+ }
580
+ getCopytradingTotalProfit(params) {
581
+ return this.getPrivate('/api/v5/copytrading/total-profit-sharing', params);
582
+ }
583
+ getCopytradingUnrealizedProfit(params) {
584
+ return this.getPrivate('/api/v5/copytrading/unrealized-profit-sharing-details', params);
585
+ }
586
+ getCopytradingTotalUnrealizedProfit(params) {
587
+ return this.getPrivate('/api/v5/copytrading/total-unrealized-profit-sharing', params);
588
+ }
589
+ applyCopytradingLeadTrading(params) {
590
+ return this.postPrivate('/api/v5/copytrading/apply-lead-trading', params);
591
+ }
592
+ stopCopytradingLeadTrading(params) {
593
+ return this.postPrivate('/api/v5/copytrading/stop-lead-trading', params);
594
+ }
595
+ updateCopytradingProfitSharing(params) {
596
+ return this.postPrivate('/api/v5/copytrading/amend-profit-sharing-ratio', params);
597
+ }
598
+ getCopytradingAccount() {
599
+ return this.getPrivate('/api/v5/copytrading/config');
600
+ }
601
+ setCopytradingFirstCopy(params) {
602
+ return this.postPrivate('/api/v5/copytrading/first-copy-settings', params);
603
+ }
604
+ updateCopytradingCopySettings(params) {
605
+ return this.postPrivate('/api/v5/copytrading/amend-copy-settings', params);
606
+ }
607
+ stopCopytradingCopy(params) {
608
+ return this.postPrivate('/api/v5/copytrading/stop-copy-trading', params);
609
+ }
610
+ getCopytradingCopySettings(params) {
611
+ return this.getPrivate('/api/v5/copytrading/copy-settings', params);
612
+ }
613
+ getCopytradingBatchLeverageInfo(params) {
614
+ return this.getPrivate('/api/v5/copytrading/batch-leverage-info', params);
615
+ }
616
+ setCopytradingBatchLeverage(params) {
617
+ return this.postPrivate('/api/v5/copytrading/batch-set-leverage', params);
618
+ }
619
+ getCopytradingMyLeadTraders(params) {
620
+ return this.getPrivate('/api/v5/copytrading/current-lead-traders', params);
621
+ }
622
+ getCopytradingLeadTradersHistory(params) {
623
+ return this.getPrivate('/api/v5/copytrading/lead-traders-history', params);
624
+ }
625
+ getCopytradingConfig(params) {
626
+ return this.get('/api/v5/copytrading/public-config', params);
627
+ }
628
+ getCopytradingLeadRanks(params) {
629
+ return this.get('/api/v5/copytrading/public-lead-traders', params);
630
+ }
631
+ getCopytradingLeadWeeklyPnl(params) {
632
+ return this.get('/api/v5/copytrading/public-weekly-pnl', params);
633
+ }
634
+ getCopytradingLeadDailyPnl(params) {
635
+ return this.get('/api/v5/copytrading/public-pnl', params);
636
+ }
637
+ getCopytradingLeadStats(params) {
638
+ return this.get('/api/v5/copytrading/public-stats', params);
639
+ }
640
+ getCopytradingLeadPreferences(params) {
641
+ return this.get('/api/v5/copytrading/public-preference-currency', params);
642
+ }
643
+ getCopytradingLeadOpenPositions(params) {
644
+ return this.get('/api/v5/copytrading/public-current-subpositions', params);
645
+ }
646
+ getCopytradingLeadPositionHistory(params) {
647
+ return this.get('/api/v5/copytrading/public-subpositions-history', params);
648
+ }
649
+ getCopyTraders(params) {
650
+ return this.get('/api/v5/copytrading/public-copy-traders', params);
651
+ }
652
+ getCopytradingLeadPrivateRanks(params) {
653
+ return this.getPrivate('/api/v5/copytrading/lead-traders', params);
654
+ }
655
+ getCopytradingLeadPrivateWeeklyPnl(params) {
656
+ return this.getPrivate('/api/v5/copytrading/weekly-pnl', params);
657
+ }
658
+ getCopytradingPLeadPrivateDailyPnl(params) {
659
+ return this.getPrivate('/api/v5/copytrading/pnl', params);
660
+ }
661
+ geCopytradingLeadPrivateStats(params) {
662
+ return this.getPrivate('/api/v5/copytrading/stats', params);
663
+ }
664
+ getCopytradingLeadPrivatePreferences(params) {
665
+ return this.getPrivate('/api/v5/copytrading/preference-currency', params);
666
+ }
667
+ getCopytradingLeadPrivateOpenPositions(params) {
668
+ return this.getPrivate('/api/v5/copytrading/performance-current-subpositions', params);
669
+ }
670
+ getCopytradingLeadPrivatePositionHistory(params) {
671
+ return this.getPrivate('/api/v5/copytrading/performance-subpositions-history', params);
672
+ }
673
+ getCopyTradersPrivate(params) {
674
+ return this.getPrivate('/api/v5/copytrading/copy-traders', params);
675
+ }
676
+ /**
677
+ *
678
+ * Orderbook trading - Market data endpoints
679
+ *
680
+ */
681
+ getTickers(params) {
682
+ return this.get('/api/v5/market/tickers', params);
683
+ }
684
+ getTicker(params) {
685
+ return this.get('/api/v5/market/ticker', params);
686
+ }
687
+ getOrderBook(params) {
688
+ return this.get('/api/v5/market/books', params);
689
+ }
690
+ getFullOrderBook(params) {
691
+ return this.get('/api/v5/market/books-full', params);
692
+ }
693
+ getCandles(params) {
694
+ return this.get('/api/v5/market/candles', params);
695
+ }
696
+ getHistoricCandles(params) {
697
+ return this.get('/api/v5/market/history-candles', params);
698
+ }
699
+ getTrades(params) {
700
+ return this.get('/api/v5/market/trades', params);
701
+ }
702
+ getHistoricTrades(params) {
703
+ return this.get('/api/v5/market/history-trades', params);
704
+ }
705
+ getOptionTradesByInstrument(params) {
706
+ return this.get('/api/v5/market/option/instrument-family-trades', params);
707
+ }
708
+ getOptionTrades(params) {
709
+ return this.get('/api/v5/public/option-trades', params);
710
+ }
711
+ get24hrTotalVolume() {
712
+ return this.get('/api/v5/market/platform-24-volume');
713
+ }
714
+ /**
715
+ *
716
+ * Block trading - REST endpoints
717
+ *
718
+ */
719
+ getBlockCounterParties() {
720
+ return this.getPrivate('/api/v5/rfq/counterparties');
721
+ }
722
+ createBlockRFQ(params) {
723
+ return this.postPrivate('/api/v5/rfq/create-rfq', params);
724
+ }
725
+ cancelBlockRFQ(params) {
726
+ return this.postPrivate('/api/v5/rfq/cancel-rfq', params);
727
+ }
728
+ cancelMultipleBlockRFQs(params) {
729
+ return this.postPrivate('/api/v5/rfq/cancel-batch-rfqs', params);
730
+ }
731
+ cancelAllRFQs() {
732
+ return this.postPrivate('/api/v5/rfq/cancel-all-rfqs');
733
+ }
734
+ executeBlockQuote(params) {
735
+ return this.postPrivate('/api/v5/rfq/execute-quote', params);
736
+ }
737
+ getQuoteProducts() {
738
+ return this.getPrivate('/api/v5/rfq/maker-instrument-settings');
739
+ }
740
+ updateBlockQuoteProducts(params) {
741
+ return this.postPrivate('/api/v5/rfq/maker-instrument-settings', params);
742
+ }
743
+ resetBlockMmp() {
744
+ return this.postPrivate('/api/v5/rfq/mmp-reset');
745
+ }
746
+ updateBlockMmpConfig(params) {
747
+ return this.postPrivate('/api/v5/rfq/mmp-config', params);
748
+ }
749
+ getBlockMmpConfig() {
750
+ return this.getPrivate('/api/v5/rfq/mmp-config');
751
+ }
752
+ createBlockQuote(params) {
753
+ return this.postPrivate('/api/v5/rfq/create-quote', params);
754
+ }
755
+ cancelBlockQuote(params) {
756
+ return this.postPrivate('/api/v5/rfq/cancel-quote', params);
757
+ }
758
+ cancelMultipleBlockQuotes(params) {
759
+ return this.postPrivate('/api/v5/rfq/cancel-batch-quotes', params);
760
+ }
761
+ cancelAllBlockQuotes() {
762
+ return this.postPrivate('/api/v5/rfq/cancel-all-quotes');
763
+ }
764
+ cancelAllBlockAfter(params) {
765
+ return this.postPrivate('/api/v5/rfq/cancel-all-after', params);
766
+ }
767
+ getBlockRFQs(params) {
768
+ return this.getPrivate('/api/v5/rfq/rfqs', params);
769
+ }
770
+ getBlockQuotes(params) {
771
+ return this.getPrivate('/api/v5/rfq/quotes', params);
772
+ }
773
+ getBlockTrades(params) {
774
+ return this.getPrivate('/api/v5/rfq/trades', params);
775
+ }
776
+ getPublicRFQBlockTrades(params) {
777
+ return this.get('/api/v5/rfq/public-trades', params);
778
+ }
779
+ getBlockTickers(params) {
780
+ return this.get('/api/v5/market/block-tickers', params);
781
+ }
782
+ getBlockTicker(params) {
783
+ return this.get('/api/v5/market/block-ticker', params);
784
+ }
785
+ getBlockPublicTrades(params) {
786
+ return this.get('/api/v5/public/block-trades', params);
787
+ }
788
+ /**
789
+ *
790
+ * Spread trading - REST endpoints
791
+ *
792
+ */
793
+ submitSpreadOrder(params) {
794
+ return this.postPrivate('/api/v5/sprd/order', params);
795
+ }
796
+ cancelSpreadOrder(params) {
797
+ return this.postPrivate('/api/v5/sprd/cancel-order', params);
798
+ }
799
+ cancelAllSpreadOrders(params) {
800
+ return this.postPrivate('/api/v5/sprd/mass-cancel', params);
801
+ }
802
+ updateSpreadOrder(params) {
803
+ return this.postPrivate('/api/v5/sprd/amend-order', params);
804
+ }
805
+ getSpreadOrder(params) {
806
+ return this.getPrivate('/api/v5/sprd/order', params);
807
+ }
808
+ getSpreadActiveOrders(params) {
809
+ return this.getPrivate('/api/v5/sprd/orders-pending', params);
810
+ }
811
+ getSpreadOrdersRecent(params) {
812
+ return this.getPrivate('/api/v5/sprd/orders-history', params);
813
+ }
814
+ getSpreadOrdersArchive(params) {
815
+ return this.getPrivate('/api/v5/sprd/orders-history-archive', params);
816
+ }
817
+ getSpreadTrades(params) {
818
+ return this.getPrivate('/api/v5/sprd/trades', params);
819
+ }
820
+ getSpreads(params) {
821
+ return this.get('/api/v5/sprd/spreads', params);
822
+ }
823
+ getSpreadOrderBook(params) {
824
+ return this.get('/api/v5/sprd/books', params);
825
+ }
826
+ getSpreadTicker(params) {
827
+ return this.get('/api/v5/market/sprd-ticker', params);
828
+ }
829
+ getSpreadPublicTrades(params) {
830
+ return this.get('/api/v5/sprd/public-trades', params);
831
+ }
832
+ getSpreadCandles(params) {
833
+ return this.get('/api/v5/market/sprd-candles', params);
834
+ }
835
+ getSpreadHistoryCandles(params) {
836
+ return this.get('/api/v5/market/sprd-history-candles', params);
837
+ }
838
+ cancelSpreadAllAfter(params) {
839
+ return this.postPrivate('/api/v5/sprd/cancel-all-after', params);
840
+ }
841
+ /**
842
+ *
843
+ * Public data - rest endpoints
844
+ *
845
+ */
846
+ getInstruments(params) {
847
+ return this.get('/api/v5/public/instruments', params);
848
+ }
849
+ getDeliveryExerciseHistory(params) {
850
+ return this.get('/api/v5/public/delivery-exercise-history', params);
851
+ }
852
+ getOpenInterest(params) {
853
+ return this.get('/api/v5/public/open-interest', params);
854
+ }
855
+ getFundingRate(params) {
856
+ return this.get('/api/v5/public/funding-rate', params);
857
+ }
858
+ getFundingRateHistory(params) {
859
+ return this.get('/api/v5/public/funding-rate-history', params);
860
+ }
861
+ getMinMaxLimitPrice(params) {
862
+ return this.get('/api/v5/public/price-limit', params);
863
+ }
864
+ getOptionMarketData(params) {
865
+ return this.get('/api/v5/public/opt-summary', params);
866
+ }
867
+ getEstimatedDeliveryExercisePrice(params) {
868
+ return this.get('/api/v5/public/estimated-price', params);
869
+ }
870
+ getDiscountRateAndInterestFreeQuota(params) {
871
+ return this.get('/api/v5/public/discount-rate-interest-free-quota', params);
872
+ }
873
+ getSystemTime(params) {
874
+ return this.get('/api/v5/public/time', params);
875
+ }
876
+ getMarkPrice(params) {
877
+ return this.get('/api/v5/public/mark-price', params);
878
+ }
879
+ getPositionTiers(params) {
880
+ return this.get('/api/v5/public/position-tiers', params);
881
+ }
882
+ getInterestRateAndLoanQuota(params) {
883
+ return this.get('/api/v5/public/interest-rate-loan-quota', params);
884
+ }
885
+ getVIPInterestRateAndLoanQuota(params) {
886
+ return this.get('/api/v5/public/vip-interest-rate-loan-quota', params);
887
+ }
888
+ getUnderlying(params) {
889
+ return this.get('/api/v5/public/underlying', params);
890
+ }
891
+ getInsuranceFund(params) {
892
+ return this.get('/api/v5/public/insurance-fund', params);
893
+ }
894
+ getUnitConvert(params) {
895
+ return this.get('/api/v5/public/convert-contract-coin', params);
896
+ }
897
+ getOptionTickBands(params) {
898
+ return this.get('/api/v5/public/instrument-tick-bands', params);
899
+ }
900
+ getPremiumHistory(params) {
901
+ return this.get('/api/v5/public/premium-history', params);
902
+ }
903
+ getIndexTickers(params) {
904
+ return this.get('/api/v5/market/index-tickers', params);
905
+ }
906
+ getIndexCandles(params) {
907
+ return this.get('/api/v5/market/index-candles', params);
908
+ }
909
+ getHistoricIndexCandles(params) {
910
+ return this.get('/api/v5/market/history-index-candles', params);
911
+ }
912
+ getMarkPriceCandles(params) {
913
+ return this.get('/api/v5/market/mark-price-candles', params);
914
+ }
915
+ getHistoricMarkPriceCandles(params) {
916
+ return this.get('/api/v5/market/history-mark-price-candles', params);
917
+ }
918
+ getOracle() {
919
+ return this.get('/api/v5/market/open-oracle');
920
+ }
921
+ getExchangeRate() {
922
+ return this.get('/api/v5/market/exchange-rate');
923
+ }
924
+ getIndexComponents(params) {
925
+ return this.get('/api/v5/market/index-components', params);
926
+ }
927
+ getEconomicCalendar(params) {
928
+ return this.getPrivate('/api/v5/public/economic-calendar', params);
929
+ }
930
+ getPublicBlockTrades(params) {
931
+ return this.get('/api/v5/market/block-trades', params);
932
+ }
933
+ /**
934
+ *
935
+ * Trading statistics - REST endpoints
936
+ *
937
+ */
938
+ getSupportCoin() {
939
+ return this.get('/api/v5/rubik/stat/trading-data/support-coin');
940
+ }
941
+ getOpenInterestHistory(params) {
942
+ return this.get('/api/v5/rubik/stat/contracts/open-interest-history', params);
943
+ }
944
+ getTakerVolume(params) {
945
+ return this.get('/api/v5/rubik/stat/taker-volume', params);
946
+ }
947
+ getContractTakerVolume(params) {
948
+ return this.get('/api/v5/rubik/stat/taker-volume-contract', params);
949
+ }
950
+ getMarginLendingRatio(params) {
951
+ return this.get('/api/v5/rubik/stat/margin/loan-ratio', params);
952
+ }
953
+ getTopTradersAccountRatio(params) {
954
+ return this.get('/api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader', params);
955
+ }
956
+ getTopTradersContractPositionRatio(params) {
957
+ return this.get('/api/v5/rubik/stat/contracts/long-short-position-ratio-contract-top-trader', params);
958
+ }
959
+ getLongShortContractRatio(params) {
960
+ return this.get('/api/v5/rubik/stat/contracts/long-short-account-ratio-contract', params);
961
+ }
962
+ getLongShortRatio(params) {
963
+ return this.get('/api/v5/rubik/stat/contracts/long-short-account-ratio', params);
964
+ }
965
+ getContractsOpenInterestAndVolume(params) {
966
+ return this.get('/api/v5/rubik/stat/contracts/open-interest-volume', params);
967
+ }
968
+ getOptionsOpenInterestAndVolume(params) {
969
+ return this.get('/api/v5/rubik/stat/option/open-interest-volume', params);
970
+ }
971
+ getPutCallRatio(params) {
972
+ return this.get('/api/v5/rubik/stat/option/open-interest-volume-ratio', params);
973
+ }
974
+ getOpenInterestAndVolumeExpiry(params) {
975
+ return this.get('/api/v5/rubik/stat/option/open-interest-volume-expiry', params);
976
+ }
977
+ getOpenInterestAndVolumeStrike(params) {
978
+ return this.get('/api/v5/rubik/stat/option/open-interest-volume-strike', params);
979
+ }
980
+ getTakerFlow(params) {
981
+ return this.get('/api/v5/rubik/stat/option/taker-block-volume', params);
982
+ }
983
+ /**
984
+ *
985
+ * Funding account - REST endpoints
986
+ *
987
+ */
988
+ getCurrencies(params) {
989
+ return this.getPrivate('/api/v5/asset/currencies', params);
990
+ }
991
+ getBalances(params) {
992
+ return this.getPrivate('/api/v5/asset/balances', params);
993
+ }
994
+ getNonTradableAssets(params) {
995
+ return this.getPrivate('/api/v5/asset/non-tradable-assets', params);
996
+ }
997
+ getAccountAssetValuation(params) {
998
+ return this.getPrivate('/api/v5/asset/asset-valuation', params);
999
+ }
1000
+ fundsTransfer(params) {
1001
+ return this.postPrivate('/api/v5/asset/transfer', params);
1002
+ }
1003
+ /** Either parameter transId or clientId is required. */
1004
+ getFundsTransferState(params) {
1005
+ return this.getPrivate('/api/v5/asset/transfer-state', params);
1006
+ }
1007
+ getAssetBillsDetails(params) {
1008
+ return this.getPrivate('/api/v5/asset/bills', params);
1009
+ }
1010
+ getLightningDeposits(params) {
1011
+ return this.getPrivate('/api/v5/asset/deposit-lightning', params);
1012
+ }
1013
+ getDepositAddress(params) {
1014
+ return this.getPrivate('/api/v5/asset/deposit-address', params);
1015
+ }
1016
+ getDepositHistory(params) {
1017
+ return this.getPrivate('/api/v5/asset/deposit-history', params);
1018
+ }
1019
+ submitWithdraw(params) {
1020
+ return this.postPrivate('/api/v5/asset/withdrawal', params);
1021
+ }
1022
+ submitWithdrawLightning(params) {
1023
+ return this.postPrivate('/api/v5/asset/withdrawal-lightning', params);
1024
+ }
1025
+ cancelWithdrawal(params) {
1026
+ return this.postPrivate('/api/v5/asset/cancel-withdrawal', params);
1027
+ }
1028
+ getWithdrawalHistory(params) {
1029
+ return this.getPrivate('/api/v5/asset/withdrawal-history', params);
1030
+ }
1031
+ getDepositWithdrawStatus(params) {
1032
+ return this.getPrivate('/api/v5/asset/deposit-withdraw-status', params);
1033
+ }
1034
+ getExchanges() {
1035
+ return this.get('/api/v5/asset/exchange-list');
1036
+ }
1037
+ applyForMonthlyStatement(params) {
1038
+ return this.postPrivate('/api/v5/asset/monthly-statement', params);
1039
+ }
1040
+ getMonthlyStatement(params) {
1041
+ return this.getPrivate('/api/v5/asset/monthly-statement', params);
1042
+ }
1043
+ getConvertCurrencies() {
1044
+ return this.getPrivate('/api/v5/asset/convert/currencies');
1045
+ }
1046
+ getConvertCurrencyPair(params) {
1047
+ return this.getPrivate('/api/v5/asset/convert/currency-pair', params);
1048
+ }
1049
+ estimateConvertQuote(params) {
1050
+ return this.postPrivate('/api/v5/asset/convert/estimate-quote', params);
1051
+ }
1052
+ convertTrade(params) {
1053
+ return this.postPrivate('/api/v5/asset/convert/trade', params);
1054
+ }
1055
+ getConvertHistory(params) {
1056
+ return this.getPrivate('/api/v5/asset/convert/history', params);
1057
+ }
1058
+ /**
1059
+ *
1060
+ * Subaccount - REST endpoints
1061
+ *
1062
+ */
1063
+ /** View sub-account list */
1064
+ getSubAccountList(params) {
1065
+ return this.getPrivate('/api/v5/users/subaccount/list', params);
1066
+ }
1067
+ resetSubAccountAPIKey(params) {
1068
+ return this.postPrivate('/api/v5/users/subaccount/modify-apikey', params);
1069
+ }
1070
+ getSubAccountBalances(params) {
1071
+ return this.getPrivate('/api/v5/account/subaccount/balances', params);
1072
+ }
1073
+ getSubAccountFundingBalances(params) {
1074
+ return this.getPrivate('/api/v5/asset/subaccount/balances', params);
1075
+ }
1076
+ getSubAccountMaxWithdrawal(params) {
1077
+ return this.getPrivate('/api/v5/account/subaccount/max-withdrawal', params);
1078
+ }
1079
+ /** History of sub-account transfer */
1080
+ getSubAccountTransferHistory(params) {
1081
+ return this.getPrivate('/api/v5/asset/subaccount/bills', params);
1082
+ }
1083
+ getManagedSubAccountTransferHistory(params) {
1084
+ return this.getPrivate('/api/v5/asset/subaccount/managed-subaccount-bills', params);
1085
+ }
1086
+ /** Master accounts manage the transfers between sub-accounts */
1087
+ transferSubAccountBalance(params) {
1088
+ return this.postPrivate('/api/v5/asset/subaccount/transfer', params);
1089
+ }
1090
+ setSubAccountTransferOutPermission(params) {
1091
+ return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', params);
1092
+ }
1093
+ getSubAccountCustodyTradingList(params) {
1094
+ return this.getPrivate('/api/v5/users/entrust-subaccount-list', params);
1095
+ }
1096
+ setSubAccountLoanAllocation(params) {
1097
+ return this.postPrivate('/api/v5/account/subaccount/set-loan-allocation', params);
1098
+ }
1099
+ getSubAccountBorrowInterestAndLimit(params) {
1100
+ return this.getPrivate('/api/v5/account/subaccount/interest-limits', params);
1101
+ }
1102
+ /**
1103
+ *
1104
+ * Financial product - on chain earn endpoints
1105
+ *
1106
+ */
1107
+ /** Get earn offers */
1108
+ getStakingOffers(params) {
1109
+ return this.getPrivate('/api/v5/finance/staking-defi/offers', params);
1110
+ }
1111
+ submitStake(params) {
1112
+ return this.postPrivate('/api/v5/finance/staking-defi/purchase', params);
1113
+ }
1114
+ redeemStake(params) {
1115
+ return this.postPrivate('/api/v5/finance/staking-defi/redeem', params);
1116
+ }
1117
+ cancelStakingRequest(params) {
1118
+ return this.postPrivate('/api/v5/finance/staking-defi/cancel', params);
1119
+ }
1120
+ /** Earn/staking get active orders */
1121
+ getActiveStakingOrders(params) {
1122
+ return this.getPrivate('/api/v5/finance/staking-defi/orders-active', params);
1123
+ }
1124
+ /** Earn/staking get order history */
1125
+ getStakingOrderHistory(params) {
1126
+ return this.getPrivate('/api/v5/finance/staking-defi/orders-history', params);
1127
+ }
1128
+ /**
1129
+ *
1130
+ * Financial product - ETH staking endpoints
1131
+ *
1132
+ */
1133
+ getETHStakingProductInfo() {
1134
+ return this.get('/api/v5/finance/staking-defi/eth/product-info');
1135
+ }
1136
+ purchaseETHStaking(params) {
1137
+ return this.postPrivate('/api/v5/finance/staking-defi/eth/purchase', params);
1138
+ }
1139
+ redeemETHStaking(params) {
1140
+ return this.postPrivate('/api/v5/finance/staking-defi/eth/redeem', params);
1141
+ }
1142
+ getETHStakingBalance() {
1143
+ return this.getPrivate('/api/v5/finance/staking-defi/eth/balance');
1144
+ }
1145
+ getETHStakingHistory(params) {
1146
+ return this.getPrivate('/api/v5/finance/staking-defi/eth/purchase-redeem-history', params);
1147
+ }
1148
+ getAPYHistory(params) {
1149
+ return this.get('/api/v5/finance/staking-defi/eth/apy-history', params);
1150
+ }
1151
+ /**
1152
+ *
1153
+ * Financial product - simple earn flexible endpoints
1154
+ *
1155
+ */
1156
+ getSavingBalance(params) {
1157
+ return this.getPrivate('/api/v5/finance/savings/balance', params);
1158
+ }
1159
+ savingsPurchaseRedemption(params) {
1160
+ return this.postPrivate('/api/v5/finance/savings/purchase-redempt', params);
1161
+ }
1162
+ setLendingRate(params) {
1163
+ return this.postPrivate('/api/v5/finance/savings/set-lending-rate', params);
1164
+ }
1165
+ getLendingHistory(params) {
1166
+ return this.getPrivate('/api/v5/finance/savings/lending-history', params);
1167
+ }
1168
+ getPublicBorrowInfo(params) {
1169
+ return this.get('/api/v5/finance/savings/lending-rate-summary', params);
1170
+ }
1171
+ getPublicBorrowHistory(params) {
1172
+ return this.get('/api/v5/finance/savings/lending-rate-history', params);
1173
+ }
1174
+ /**
1175
+ *
1176
+ * Financial product - simple earn fixed endpoints
1177
+ *
1178
+ */
1179
+ getLendingOffers(params) {
1180
+ return this.get('/api/v5/finance/fixed-loan/lending-offers', params);
1181
+ }
1182
+ getLendingAPYHistory(params) {
1183
+ return this.get('/api/v5/finance/fixed-loan/lending-apy-history', params);
1184
+ }
1185
+ getLendingVolume(params) {
1186
+ return this.get('/api/v5/finance/fixed-loan/pending-lending-volume', params);
1187
+ }
1188
+ placeLendingOrder(params) {
1189
+ return this.postPrivate('/api/v5/finance/fixed-loan/lending-order', params);
1190
+ }
1191
+ amendLendingOrder(params) {
1192
+ return this.postPrivate('/api/v5/finance/fixed-loan/amend-lending-order', params);
1193
+ }
1194
+ getLendingOrders(params) {
1195
+ return this.getPrivate('/api/v5/finance/fixed-loan/lending-orders-list', params);
1196
+ }
1197
+ getLendingSubOrders(params) {
1198
+ return this.getPrivate('/api/v5/finance/fixed-loan/lending-sub-orders', params);
1199
+ }
1200
+ /**
1201
+ *
1202
+ * Financial product - Flexible loan endpoints
1203
+ *
1204
+ */
1205
+ getBorrowableCurrencies() {
1206
+ return this.get('/api/v5/finance/flexible-loan/borrow-currencies');
1207
+ }
1208
+ getCollateralAssets(params) {
1209
+ return this.get('/api/v5/finance/flexible-loan/collateral-assets', params);
1210
+ }
1211
+ getMaxLoanAmount(params) {
1212
+ return this.postPrivate('/api/v5/finance/flexible-loan/max-loan', params);
1213
+ }
1214
+ adjustCollateral(params) {
1215
+ return this.postPrivate('/api/v5/finance/flexible-loan/adjust-collateral', params);
1216
+ }
1217
+ getLoanInfo() {
1218
+ return this.getPrivate('/api/v5/finance/flexible-loan/loan-info');
1219
+ }
1220
+ getLoanHistory(params) {
1221
+ return this.getPrivate('/api/v5/finance/flexible-loan/loan-history', params);
1222
+ }
1223
+ getAccruedInterest(params) {
1224
+ return this.getPrivate('/api/v5/finance/flexible-loan/interest-accrued', params);
1225
+ }
1226
+ /**
1227
+ *
1228
+ * Affiliate endpoints
1229
+ *
1230
+ */
1231
+ getInviteeDetail(params) {
1232
+ return this.getPrivate('/api/v5/affiliate/invitee/detail', params);
1233
+ }
1234
+ getAffiliateRebateInfo(params) {
1235
+ return this.getPrivate('/api/v5/users/partner/if-rebate', params);
1236
+ }
1237
+ /**
1238
+ *
1239
+ * Status endpoints (public)
1240
+ *
1241
+ */
1242
+ getSystemStatus(params) {
1243
+ return this.get('/api/v5/system/status', params);
1244
+ }
1245
+ /**
1246
+ *
1247
+ * Announcement endpoints
1248
+ *
1249
+ */
1250
+ getAnnouncements(params) {
1251
+ return this.get('/api/v5/support/announcements', params);
1252
+ }
1253
+ getAnnouncementTypes() {
1254
+ return this.get('/api/v5/support/announcement-types');
1255
+ }
1256
+ /**
1257
+ *
1258
+ * Broker endpoints (private)
1259
+ *
1260
+ */
1261
+ createSubAccount(params) {
1262
+ return this.postPrivate('/api/v5/broker/nd/create-subaccount', params);
1263
+ }
1264
+ deleteSubAccount(params) {
1265
+ return this.postPrivate('/api/v5/broker/nd/delete-subaccount', params);
1266
+ }
1267
+ createSubAccountAPIKey(params) {
1268
+ return this.postPrivate('/api/v5/broker/nd/subaccount/apikey', params);
1269
+ }
1270
+ }
1271
+ //# sourceMappingURL=rest-client.js.map