okx-api 2.0.6 → 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 +344 -13
  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 +13 -5
  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 +43 -10
  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 -39
  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 +9266 -0
  253. package/package.json +30 -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 -49
  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 -9
  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
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Node.js & Typescript OKX (OKEX) API & WebSocket SDK
2
2
 
3
- [![E2E Tests](https://github.com/tiagosiebler/okx-api/actions/workflows/e2etest.yml/badge.svg?branch=master)](https://github.com/tiagosiebler/okx-api/actions/workflows/e2etest.yml) [![npm downloads](https://img.shields.io/npm/dt/okx-api)][1] [![npm version](https://img.shields.io/npm/v/okx-api)][1] [![npm size](https://img.shields.io/bundlephobia/min/okx-api/latest)][1] [![last commit](https://img.shields.io/github/last-commit/tiagosiebler/okx-api)][1] [![CodeFactor](https://www.codefactor.io/repository/github/tiagosiebler/okx-api/badge)](https://www.codefactor.io/repository/github/tiagosiebler/okx-api)
3
+ [![E2E Tests](https://github.com/tiagosiebler/okx-api/actions/workflows/e2etest.yml/badge.svg?branch=master)](https://github.com/tiagosiebler/okx-api/actions/workflows/e2etest.yml)
4
+ [![npm downloads](https://img.shields.io/npm/dt/okx-api)][1]
5
+ [![npm version](https://img.shields.io/npm/v/okx-api)][1]
6
+ [![npm size](https://img.shields.io/bundlephobia/min/okx-api/latest)][1]
7
+ [![last commit](https://img.shields.io/github/last-commit/tiagosiebler/okx-api)][1]
8
+ [![CodeFactor](https://www.codefactor.io/repository/github/tiagosiebler/okx-api/badge)](https://www.codefactor.io/repository/github/tiagosiebler/okx-api)
4
9
 
5
10
  <p align="center">
6
11
  <a href="https://www.npmjs.com/package/okx-api">
@@ -15,15 +20,52 @@
15
20
 
16
21
  Complete, updated & performant Node.js SDK for the OKX(OKEX) APIs and WebSockets:
17
22
 
18
- - Complete integration with all OKX APIs, including the v5 APIs.
23
+ - Complete integration with OKX REST APIs, WebSockets & WebSocket APIs.
19
24
  - TypeScript support (with type declarations for most API requests & responses).
20
25
  - Over 100 end-to-end tests making real API calls & WebSocket connections, validating any changes before they reach npm.
26
+ - Supports all available OKX regions:
27
+ - OKX Global (www.okx.com), by default.
28
+ - OKX EEA (my.okx.com), by setting `market: 'EEA'`.
29
+ - OKX US (app.okx.com), by setting `market: 'US'`.
30
+ - Actively maintained with a modern, promise-driven interface.
21
31
  - Robust WebSocket integration
22
32
  - Configurable connection heartbeats (automatically detect failing connections).
23
33
  - Automatic reconnect then resubscribe workflows.
24
34
  - Automatic authentication and heartbeat handling.
35
+ - Supports WebSocket API in all supported regions & product groups:
36
+ - Use the WebsocketClient's event-driven `sendWSAPIRequest()` method, or;
37
+ - Use the WebsocketAPIClient for a REST-like experience.
38
+ - Use the WebSocket API like a REST API!
39
+ - Automatic routing to business vs private WebSocket endpoints.
40
+ - End to end types.
41
+ - See [examples/ws-api-client.ts](./examples/ws-api-client.ts) for a demonstration.
25
42
  - Browser support (via webpack bundle - see "Browser Usage" below).
26
43
 
44
+ ## Table of Contents
45
+
46
+ - [Installation](#installation)
47
+ - [Issues & Discussion](#issues--discussion)
48
+ - [Related Projects](#related-projects)
49
+ - [Documentation](#documentation)
50
+ - [Contributions & Thanks](#contributions--thanks)
51
+ - [Structure](#structure)
52
+ - [Usage](#usage)
53
+ - [REST Client](#rest-client)
54
+ - [Requests & Responses](#requests--responses)
55
+ - [Example](#example)
56
+ - [WebSockets](#websockets)
57
+ - [Sending Orders via WebSockets](#sending-orders-via-websockets)
58
+ - [Receiving Realtime Data](#receiving-realtime-data)
59
+ - [Public Events](#public-events)
60
+ - [Private Events](#private-events)
61
+ - [Browser/Frontend Usage](#browserfrontend-usage)
62
+ - [Import](#import)
63
+ - [Webpack](#webpack)
64
+ - [Use with LLMs & AI](#use-with-llms--ai)
65
+ - [Contributions & Pull Requests](#contributions--pull-requests)
66
+ - [Used By](#used-by)
67
+ - [Star History](#star-history)
68
+
27
69
  ## Installation
28
70
 
29
71
  ```bash
@@ -38,7 +80,7 @@ npm install okx-api
38
80
 
39
81
  <!-- template_related_projects -->
40
82
 
41
- ## Related projects
83
+ ## Related Projects
42
84
 
43
85
  Check out my related JavaScript/TypeScript/Node.js projects:
44
86
 
@@ -65,7 +107,6 @@ Most methods accept JS objects. These can be populated using parameters specifie
65
107
  - [RestClient](src/rest-client.ts)
66
108
  - [OKX API Documentation](https://www.okx.com/docs-v5/en/#rest-api)
67
109
  - [REST Endpoint Function List](./docs/endpointFunctionList.md)
68
- - [TSDoc Documentation (generated using typedoc via npm module)](https://tsdocs.dev/docs/okx-api)
69
110
 
70
111
  ## Contributions & Thanks
71
112
 
@@ -88,11 +129,11 @@ This project uses typescript. Resources are stored in 3 key structures:
88
129
 
89
130
  ---
90
131
 
91
- # Usage
132
+ ## Usage
92
133
 
93
134
  Create API credentials at okx
94
135
 
95
- - [OKX my-api](https://www.okx.com/account/my-api)
136
+ - [OKX/account/API](https://www.okx.com/account/my-api)
96
137
 
97
138
  ## REST Client
98
139
 
@@ -104,15 +145,24 @@ Create API credentials at okx
104
145
  - If the response looks successful (HTTP 200 and "code" in the response body === "0"), only the `data` property is directly (without the `code`, `data` & `msg` properties).
105
146
  - If the response looks like an error (HTTP error OR the "code" property in the response does not equal "0"), the full response is thrown (including `code` and `msg` properties). See the interface for [APIResponse<T>](./src/types/rest/shared.ts).
106
147
 
107
- ### Example
148
+ ### Example
108
149
 
109
150
  ```ts
110
151
  import { RestClient } from 'okx-api';
111
152
 
112
153
  const client = new RestClient({
113
- apiKey: 'apiKeyHere',
154
+ apiKey: 'apiKeyHere',
114
155
  apiSecret: 'apiSecretHere',
115
156
  apiPass: 'apiPassHere',
157
+ // For Global users (www.okx.com), you don't need to set the market.
158
+ // It will use global by default.
159
+ // Not needed: market: 'GLOBAL',
160
+
161
+ // For EEA users (my.okx.com), set market to "EEA":
162
+ // market: 'EEA',
163
+
164
+ // For US users (app.okx.com), set market to "US":
165
+ // market: 'US',
116
166
  });
117
167
 
118
168
  // Submit a buy and sell market order
@@ -146,9 +196,9 @@ const client = new RestClient({
146
196
  })();
147
197
  ```
148
198
 
149
- ## Websocket Client
199
+ ## WebSockets
150
200
 
151
- This connector includes a high-performance node.js & typescript websocket client for the OKX public & private websockets.
201
+ This connector includes a high-performance Node.js, TypeScript & JavaScript WebSocket client for the OKX public & private WebSocket, including the OKX WebSocket API for order placement. API credentials are optional unless private streams will be used (such as account order updates).
152
202
 
153
203
  - If your IDE doesn't have IntelliSense, check the [websocket-client.ts](./src/websocket-client.ts) for a list of methods, params & return types.
154
204
  - When subscribing to channels, only the "args" should be passed as an object or array when calling the websocket client subcribe() function: [API docs](https://www.okx.com/docs-v5/en/#websocket-api-subscribe).
@@ -173,13 +223,282 @@ This connector includes a high-performance node.js & typescript websocket client
173
223
  - Rename the file to `ws-private.js`
174
224
  - And execute with node: `node examples/ws-private.js`
175
225
 
176
- ### Public Events
226
+ ### Sending orders via WebSockets
227
+
228
+ OKX supports some order management capabilities via a persisted WebSocket connection. This SDK supports this with two convenient approaches.
229
+
230
+ The recommended route is to use the dedicated WebsocketAPIClient class, included with this SDK:
231
+
232
+ - Dedicated functions for every available WebSocket API operation
233
+ - Fully typed requests and responses
234
+ - Asynchronous promisified wrapper around WS API commands.
235
+
236
+ It looks & feels like a REST API client, but uses WebSockets, via the WebsocketClient's sendWSAPIRequest method (which you can use directly if you prefer).
237
+
238
+ A simple example is below but for a more thorough example, check the example here: [./examples/ws-api-client.ts](./examples/ws-api-client.ts).
239
+
240
+ ```typescript
241
+ import { WebsocketAPIClient } from 'okx-api';
242
+ // or if you prefer require:
243
+ // const { WebsocketAPIClient } = require("okx-api");
244
+
245
+ // For private events, all 3 of the following are required (per account):
246
+ const API_KEY = process.env.API_KEY_COM;
247
+ const API_SECRET = process.env.API_SECRET_COM;
248
+ const API_PASSPHRASE = process.env.API_PASSPHRASE_COM;
249
+
250
+ // If running from CLI in unix, you can pass env vars as such:
251
+ // API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts
252
+
253
+ const wsClient = new WebsocketAPIClient({
254
+ // For Global users (www.okx.com), you don't need to set the market.
255
+ // It will use global by default.
256
+ // Not needed: market: 'GLOBAL',
257
+
258
+ // For EEA users (my.okx.com), set market to "EEA":
259
+ // market: 'EEA',
260
+
261
+ // For US users (app.okx.com), set market to "US":
262
+ // market: 'US',
263
+
264
+ accounts: [
265
+ {
266
+ apiKey: API_KEY,
267
+ apiSecret: API_SECRET,
268
+ apiPass: API_PASSPHRASE,
269
+ },
270
+ ],
271
+ });
272
+
273
+ async function start() {
274
+ // Optional: prepare the WebSocket API connection in advance.
275
+ // This happens automatically but you can do this early before making any API calls, to prevent delays from a cold start.
276
+ // await wsClient.connectWSAPI();
277
+
278
+ /**
279
+ * OKX's WebSocket API be used like a REST API, through this SDK's WebsocketAPIClient. The WebsocketAPIClient is a utility class wrapped around WebsocketClient's sendWSAPIRequest() capabilities.
280
+ *
281
+ * Each request sent via the WebsocketAPIClient will automatically:
282
+ * - route via the active WS API connection
283
+ * - return a Promise, which automatically resolves/rejects when a matching response is received
284
+ */
285
+
286
+ /**
287
+ * Place Order
288
+ * https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-place-order
289
+ */
290
+ try {
291
+ const res = await wsClient.submitNewOrder({
292
+ instId: 'BTC-USDT',
293
+ tdMode: 'cash',
294
+ side: 'buy',
295
+ ordType: 'market',
296
+ sz: '100',
297
+ });
298
+ /**
299
+ const res = {
300
+ id: '2',
301
+ op: 'order',
302
+ code: '1',
303
+ msg: '',
304
+ data: [
305
+ {
306
+ tag: '159881cb7207BCDE',
307
+ ts: '1753714603721',
308
+ ordId: '',
309
+ clOrdId: '',
310
+ sCode: '51008',
311
+ sMsg: 'Order failed. Insufficient USDT balance in account.'
312
+ }
313
+ ],
314
+ inTime: '1753714603720755',
315
+ outTime: '1753714603721942',
316
+ wsKey: 'prodPrivate',
317
+ isWSAPIResponse: false
318
+ }
319
+
320
+ const res = {
321
+ id: '2',
322
+ op: 'order',
323
+ code: '1',
324
+ msg: '',
325
+ data: [
326
+ {
327
+ tag: '159881cb7207BCDE',
328
+ ts: '1753714567149',
329
+ ordId: '',
330
+ clOrdId: '',
331
+ sCode: '51010',
332
+ sMsg: "You can't complete this request under your current account mode."
333
+ }
334
+ ],
335
+ inTime: '1753714567149196',
336
+ outTime: '1753714567149913',
337
+ wsKey: 'prodPrivate',
338
+ isWSAPIResponse: false
339
+ }
340
+ */
341
+
342
+ console.log(new Date(), 'WS API "submitNewOrder()" result: ', res);
343
+ } catch (e) {
344
+ console.error(new Date(), 'Exception with WS API "submitNewOrder()": ', e);
345
+ }
346
+
347
+ /**
348
+ * Submit multiple orders in a batch
349
+ * https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-place-multiple-orders
350
+ */
351
+ try {
352
+ const res = await wsClient.submitMultipleOrders([
353
+ {
354
+ instId: 'BTC-USDT',
355
+ tdMode: 'cash',
356
+ side: 'buy',
357
+ ordType: 'market',
358
+ sz: '100',
359
+ },
360
+ {
361
+ instId: 'BTC-USDT',
362
+ tdMode: 'cash',
363
+ side: 'buy',
364
+ ordType: 'market',
365
+ sz: '50',
366
+ },
367
+ ]);
368
+ console.log(new Date(), 'WS API "submitMultipleOrders()" result: ', res);
369
+ } catch (e) {
370
+ console.error(
371
+ new Date(),
372
+ 'Exception with WS API "submitMultipleOrders()": ',
373
+ e,
374
+ );
375
+ }
376
+ }
377
+
378
+ start();
379
+ ```
380
+
381
+ ### Receiving realtime data
382
+
383
+ The below example demonstrates connecting as a consumer, to receive WebSocket events from OKX, using the included WebsocketClient:
384
+
385
+ ```javascript
386
+ import { WebsocketClient } from 'okx-api';
387
+ // or if you prefer require:
388
+ // const { WebsocketClient } = require("okx-api");
389
+
390
+ // For private events, all 3 of the following are required (per account):
391
+ const API_KEY = process.env.API_KEY_COM;
392
+ const API_SECRET = process.env.API_SECRET_COM;
393
+ const API_PASSPHRASE = process.env.API_PASSPHRASE_COM;
394
+
395
+ // If running from CLI in unix, you can pass env vars as such:
396
+ // API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts
397
+
398
+ // Note the single quotes, preventing special characters such as $ from being incorrectly passed
399
+
400
+ const wsClient = new WebsocketClient({
401
+ // For Global users (www.okx.com), you don't need to set the market.
402
+ // It will use global by default.
403
+ // Not needed: market: 'GLOBAL',
404
+
405
+ // For EEA users (my.okx.com), set market to "EEA":
406
+ // market: 'EEA',
407
+
408
+ // For US users (app.okx.com), set market to "US":
409
+ // market: 'US',
410
+
411
+ accounts: [
412
+ // For private topics, include one or more accounts in an array. Otherwise only public topics will work
413
+ {
414
+ apiKey: API_KEY,
415
+ apiSecret: API_SECRET,
416
+ apiPass: API_PASSPHRASE,
417
+ },
418
+ // {
419
+ // apiKey: 'yourApiKeyHere',
420
+ // apiSecret: 'yourApiSecretHere',
421
+ // apiPass: 'yourApiPassHere',
422
+ // },
423
+ // {
424
+ // apiKey: 'anotherAccountKey',
425
+ // apiSecret: 'anotherAccountSecret',
426
+ // apiPass: 'anotherAccountPass',
427
+ // },
428
+ ],
429
+ });
430
+
431
+ // Raw data will arrive on the 'update' event
432
+ wsClient.on('update', (data) => {
433
+ console.log('ws update (raw data received)', JSON.stringify(data));
434
+ });
435
+
436
+ wsClient.on('open', (data) => {
437
+ console.log('connection opened open:', data.wsKey);
438
+ });
439
+
440
+ // Replies (e.g. authenticating or subscribing to channels) will arrive on the 'response' event
441
+ wsClient.on('response', (data) => {
442
+ // console.log('ws response: ', JSON.stringify(data, null, 2));
443
+ console.log('ws response: ', JSON.stringify(data));
444
+ });
445
+
446
+ wsClient.on('reconnect', ({ wsKey }) => {
447
+ console.log('ws automatically reconnecting.... ', wsKey);
448
+ });
449
+ wsClient.on('reconnected', (data) => {
450
+ console.log('ws has reconnected ', data?.wsKey);
451
+ });
452
+ wsClient.on('exception', (data) => {
453
+ console.error('ws exception: ', data);
454
+ });
455
+
456
+ /**
457
+ * Simply call subscribe to request the channels that you're interested in.
458
+ *
459
+ * If authentication is required, the WSClient will automatically authenticate with the available credentials.
460
+ */
461
+
462
+ // Subscribe one event at a time:
463
+ wsClient.subscribe({
464
+ channel: 'account',
465
+ });
466
+
467
+ // OR, combine multiple subscription events into one request using an array instead of an object:
468
+ wsClient.subscribe([
469
+ {
470
+ channel: 'account',
471
+ },
472
+ {
473
+ channel: 'positions',
474
+ instType: 'ANY',
475
+ },
476
+ ]);
477
+
478
+ // Public topics, for comparison. These do not require authentication / api keys:
479
+ wsClient.subscribe([
480
+ {
481
+ channel: 'instruments',
482
+ instType: 'SPOT',
483
+ },
484
+ {
485
+ channel: 'instruments',
486
+ instType: 'FUTURES',
487
+ },
488
+ {
489
+ channel: 'tickers',
490
+ instId: 'LTC-BTC',
491
+ },
492
+ ]);
493
+ ```
494
+
495
+ #### Public Events
177
496
 
178
497
  See [examples/ws-public.ts](./examples/ws-public.ts) for a full example:
179
498
 
180
499
  ![typescript-events-public](./docs/images/subscribe-events-public.gif)
181
500
 
182
- ### Private Events
501
+ #### Private Events
183
502
 
184
503
  See [examples/ws-private.ts](./examples/ws-private.ts) for a full example:
185
504
 
@@ -225,6 +544,12 @@ Build a bundle using webpack:
225
544
 
226
545
  The bundle can be found in `dist/`. Altough usage should be largely consistent, smaller differences will exist. Documentation is still TODO.
227
546
 
547
+ ## Use with LLMs & AI
548
+
549
+ This SDK includes a bundled `llms.txt` file in the root of the repository. If you're developing with LLMs, use the included `llms.txt` with your LLM - it will significantly improve the LLMs understanding of how to correctly use this SDK.
550
+
551
+ This file contains AI optimised structure of all the functions in this package, and their parameters for easier use with any learning models or artificial intelligence.
552
+
228
553
  ---
229
554
 
230
555
  <!-- template_contributions -->
@@ -248,10 +573,16 @@ old ones:
248
573
  -->
249
574
  <!-- template_contributions_end -->
250
575
 
251
- ### Contributions & Pull Requests
576
+ ## Contributions & Pull Requests
252
577
 
253
578
  Contributions are encouraged, I will review any incoming pull requests. See the issues tab for todo items.
254
579
 
580
+ ## Used By
581
+
582
+ The following represents some of the known public projects that use this SDK on GitHub:
583
+
584
+ [![Repository Users Preview Image](https://dependents.info/tiagosiebler/okx-api/image)](https://github.com/tiagosiebler/okx-api/network/dependents)
585
+
255
586
  <!-- template_star_history -->
256
587
 
257
588
  ## Star History
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funding.js","sourceRoot":"","sources":["../../../src/constants/funding.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,eAqIX;AArID,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,mCAAgB,CAAA;IAChB,6CAA0B,CAAA;IAC1B,iDAA8B,CAAA;IAC9B,mDAAgC,CAAA;IAChC,+BAAY,CAAA;IACZ,yCAAsB,CAAA;IACtB,kDAA+B,CAAA;IAC/B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,oDAAiC,CAAA;IACjC,yCAAsB,CAAA;IACtB,6CAA0B,CAAA;IAC1B,6CAA0B,CAAA;IAC1B,oCAAiB,CAAA;IACjB,2CAAwB,CAAA;IACxB,gDAA6B,CAAA;IAC7B,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,iDAA8B,CAAA;IAC9B,+CAA4B,CAAA;IAC5B,oCAAiB,CAAA;IACjB,iCAAc,CAAA;IACd,qCAAkB,CAAA;IAClB,mCAAgB,CAAA;IAChB,yCAAsB,CAAA;IACtB,8CAA2B,CAAA;IAC3B,uCAAoB,CAAA;IACpB,uCAAoB,CAAA;IACpB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,iCAAc,CAAA;IACd,mCAAgB,CAAA;IAChB,8CAA2B,CAAA;IAC3B,8CAA2B,CAAA;IAC3B,wCAAqB,CAAA;IACrB,2CAAwB,CAAA;IACxB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;IACvB,kDAA+B,CAAA;IAC/B,uDAAoC,CAAA;IACpC,2DAAwC,CAAA;IACxC,0DAAuC,CAAA;IACvC,4DAAyC,CAAA;IACzC,6DAA0C,CAAA;IAC1C,6CAA0B,CAAA;IAC1B,8CAA2B,CAAA;IAC3B,qDAAkC,CAAA;IAClC,sDAAmC,CAAA;IACnC,2DAAwC,CAAA;IACxC,0DAAuC,CAAA;IACvC,wEAAqD,CAAA;IACrD,yEAAsD,CAAA;IACtD,oEAAiD,CAAA;IACjD,qEAAkD,CAAA;IAClD,wDAAqC,CAAA;IACrC,0DAAuC,CAAA;IACvC,yCAAsB,CAAA;IACtB,2CAAwB,CAAA;IACxB,0CAAuB,CAAA;IACvB,mDAAgC,CAAA;IAChC,gDAA6B,CAAA;IAC7B,qDAAkC,CAAA;IAClC,sDAAmC,CAAA;IACnC,uDAAoC,CAAA;IACpC,8CAA2B,CAAA;IAC3B,yCAAsB,CAAA;IACtB,2CAAwB,CAAA;IACxB,wDAAqC,CAAA;IACrC,yDAAsC,CAAA;IACtC,iDAA8B,CAAA;IAC9B,2DAAwC,CAAA;IACxC,yDAAsC,CAAA;IACtC,qDAAkC,CAAA;IAClC,uDAAoC,CAAA;IACpC,0DAAuC,CAAA;IACvC,+CAA4B,CAAA;IAC5B,kCAAe,CAAA;IACf,+CAA4B,CAAA;IAC5B,2CAAwB,CAAA;IACxB,2CAAwB,CAAA;IACxB,0CAAuB,CAAA;IACvB,2CAAwB,CAAA;IACxB,yCAAsB,CAAA;IACtB,kEAA+C,CAAA;IAC/C,yCAAsB,CAAA;IACtB,4CAAyB,CAAA;IACzB,+CAA4B,CAAA;IAC5B,+CAA4B,CAAA;IAC5B,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,6CAA0B,CAAA;IAC1B,2CAAwB,CAAA;IACxB,uCAAoB,CAAA;IACpB,2CAAwB,CAAA;IACxB,oDAAiC,CAAA;IACjC,qDAAkC,CAAA;IAClC,iDAA8B,CAAA;IAC9B,iDAA8B,CAAA;IAC9B,gDAA6B,CAAA;IAC7B,qDAAkC,CAAA;IAClC,gDAA6B,CAAA;IAC7B,mDAAgC,CAAA;IAChC,uCAAoB,CAAA;IACpB,8BAAW,CAAA;IACX,4CAAyB,CAAA;IACzB,+BAAY,CAAA;IACZ,2CAAwB,CAAA;IACxB,8CAA2B,CAAA;IAC3B,oCAAiB,CAAA;IACjB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,0CAAuB,CAAA;IACvB,iDAA8B,CAAA;IAC9B,iDAA8B,CAAA;IAC9B,gDAA6B,CAAA;IAC7B,kCAAe,CAAA;IACf,2CAAwB,CAAA;IACxB,kDAA+B,CAAA;IAC/B,4CAAyB,CAAA;IACzB,6CAA0B,CAAA;IAC1B,6CAA0B,CAAA;IAC1B,sDAAmC,CAAA;IACnC,8DAA2C,CAAA;IAC3C,mDAAgC,CAAA;IAChC,wDAAqC,CAAA;IACrC,wDAAqC,CAAA;IACrC,8BAAW,CAAA;IACX,kDAA+B,CAAA;AACjC,CAAC,EArIW,eAAe,+BAAf,eAAe,QAqI1B"}
@@ -0,0 +1,43 @@
1
+ export * from './constants/funding.js';
2
+ export * from './rest-client.js';
3
+ export * from './types/rest/client.js';
4
+ export * from './types/rest/shared.js';
5
+ export * from './types/rest/request/account.js';
6
+ export * from './types/rest/request/block-trading.js';
7
+ export * from './types/rest/request/convert.js';
8
+ export * from './types/rest/request/copy-trading.js';
9
+ export * from './types/rest/request/funding.js';
10
+ export * from './types/rest/request/grid-trading.js';
11
+ export * from './types/rest/request/public.js';
12
+ export * from './types/rest/request/recurring-buy.js';
13
+ export * from './types/rest/request/shared.js';
14
+ export * from './types/rest/request/signal-bot.js';
15
+ export * from './types/rest/request/simple-earn.js';
16
+ export * from './types/rest/request/spread-trading.js';
17
+ export * from './types/rest/request/subaccount.js';
18
+ export * from './types/rest/request/trade.js';
19
+ export * from './types/rest/response/private-account.js';
20
+ export * from './types/rest/response/private-block-trading.js';
21
+ export * from './types/rest/response/private-copy-trading.js';
22
+ export * from './types/rest/response/private-flexible-loan.js';
23
+ export * from './types/rest/response/private-funding.js';
24
+ export * from './types/rest/response/private-recurring-buy.js';
25
+ export * from './types/rest/response/private-signal-bot.js';
26
+ export * from './types/rest/response/private-spread-trading.js';
27
+ export * from './types/rest/response/private-subaccount.js';
28
+ export * from './types/rest/response/private-trade.js';
29
+ export * from './types/rest/response/public-data.js';
30
+ export * from './types/shared.js';
31
+ export * from './types/websockets/ws-api.js';
32
+ export * from './types/websockets/ws-api-request.js';
33
+ export * from './types/websockets/ws-api-response.js';
34
+ export * from './types/websockets/ws-events.js';
35
+ export * from './types/websockets/ws-general.js';
36
+ export * from './types/websockets/ws-request.js';
37
+ export * from './util/logger.js';
38
+ export * from './util/typeGuards.js';
39
+ export * from './util/websocket-util.js';
40
+ export * from './util/WsStore.js';
41
+ export * from './websocket-api-client.js';
42
+ export * from './websocket-client.js';
43
+ export * from './websocket-client-legacy.js';
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants/funding.js"), exports);
18
+ __exportStar(require("./rest-client.js"), exports);
19
+ // Top level REST types
20
+ __exportStar(require("./types/rest/client.js"), exports);
21
+ __exportStar(require("./types/rest/shared.js"), exports);
22
+ // REST/request
23
+ __exportStar(require("./types/rest/request/account.js"), exports);
24
+ __exportStar(require("./types/rest/request/block-trading.js"), exports);
25
+ __exportStar(require("./types/rest/request/convert.js"), exports);
26
+ __exportStar(require("./types/rest/request/copy-trading.js"), exports);
27
+ __exportStar(require("./types/rest/request/funding.js"), exports);
28
+ __exportStar(require("./types/rest/request/grid-trading.js"), exports);
29
+ __exportStar(require("./types/rest/request/public.js"), exports);
30
+ __exportStar(require("./types/rest/request/recurring-buy.js"), exports);
31
+ __exportStar(require("./types/rest/request/shared.js"), exports);
32
+ __exportStar(require("./types/rest/request/signal-bot.js"), exports);
33
+ __exportStar(require("./types/rest/request/simple-earn.js"), exports);
34
+ __exportStar(require("./types/rest/request/spread-trading.js"), exports);
35
+ __exportStar(require("./types/rest/request/subaccount.js"), exports);
36
+ __exportStar(require("./types/rest/request/trade.js"), exports);
37
+ // REST/response
38
+ __exportStar(require("./types/rest/response/private-account.js"), exports);
39
+ __exportStar(require("./types/rest/response/private-block-trading.js"), exports);
40
+ __exportStar(require("./types/rest/response/private-copy-trading.js"), exports);
41
+ __exportStar(require("./types/rest/response/private-flexible-loan.js"), exports);
42
+ __exportStar(require("./types/rest/response/private-funding.js"), exports);
43
+ __exportStar(require("./types/rest/response/private-recurring-buy.js"), exports);
44
+ __exportStar(require("./types/rest/response/private-signal-bot.js"), exports);
45
+ __exportStar(require("./types/rest/response/private-spread-trading.js"), exports);
46
+ __exportStar(require("./types/rest/response/private-subaccount.js"), exports);
47
+ __exportStar(require("./types/rest/response/private-trade.js"), exports);
48
+ __exportStar(require("./types/rest/response/public-data.js"), exports);
49
+ //
50
+ __exportStar(require("./types/shared.js"), exports);
51
+ __exportStar(require("./types/websockets/ws-api.js"), exports);
52
+ __exportStar(require("./types/websockets/ws-api-request.js"), exports);
53
+ __exportStar(require("./types/websockets/ws-api-response.js"), exports);
54
+ __exportStar(require("./types/websockets/ws-events.js"), exports);
55
+ __exportStar(require("./types/websockets/ws-general.js"), exports);
56
+ __exportStar(require("./types/websockets/ws-request.js"), exports);
57
+ __exportStar(require("./util/logger.js"), exports);
58
+ __exportStar(require("./util/typeGuards.js"), exports);
59
+ __exportStar(require("./util/websocket-util.js"), exports);
60
+ __exportStar(require("./util/WsStore.js"), exports);
61
+ __exportStar(require("./websocket-api-client.js"), exports);
62
+ __exportStar(require("./websocket-client.js"), exports);
63
+ __exportStar(require("./websocket-client-legacy.js"), exports);
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,mDAAiC;AACjC,uBAAuB;AACvB,yDAAuC;AACvC,yDAAuC;AACvC,eAAe;AACf,kEAAgD;AAChD,wEAAsD;AACtD,kEAAgD;AAChD,uEAAqD;AACrD,kEAAgD;AAChD,uEAAqD;AACrD,iEAA+C;AAC/C,wEAAsD;AACtD,iEAA+C;AAC/C,qEAAmD;AACnD,sEAAoD;AACpD,yEAAuD;AACvD,qEAAmD;AACnD,gEAA8C;AAC9C,gBAAgB;AAChB,2EAAyD;AACzD,iFAA+D;AAC/D,gFAA8D;AAC9D,iFAA+D;AAC/D,2EAAyD;AACzD,iFAA+D;AAC/D,8EAA4D;AAC5D,kFAAgE;AAChE,8EAA4D;AAC5D,yEAAuD;AACvD,uEAAqD;AACrD,EAAE;AACF,oDAAkC;AAClC,+DAA6C;AAC7C,uEAAqD;AACrD,wEAAsD;AACtD,kEAAgD;AAChD,mEAAiD;AACjD,mEAAiD;AACjD,mDAAiC;AACjC,uDAAqC;AACrC,2DAAyC;AACzC,oDAAkC;AAClC,4DAA0C;AAC1C,wDAAsC;AACtC,+DAA6C"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -1,19 +1,32 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import { ASSET_BILL_TYPE } from './constants';
3
- import { AccountAssetValuation, AccountBalance, AccountBill, AccountChangeMarginResult, AccountConfiguration, AccountFeeRate, AccountHistoryBill, AccountInstrument, AccountIsolatedMode, AccountLevel, AccountLeverage, AccountLeverageResult, AccountMaxLoan, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountModeResult, AccountPosition, AccountPositionModeResult, AccountPositionRisk, AccountRiskState, AdjustLeverageInfo, AdjustMarginBalanceRequest, AlgoLongHistoryRequest, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, AlgoOrderListItem, AlgoOrderRequest, AlgoOrderResult, AlgoRecentHistoryRequest, AmendAlgoOrderRequest, AmendAlgoOrderResult, AmendedOrder, AmendOrderRequest, AmendRecurringBuyOrderRequest, AmendTPSLRequest, Announcement, APICredentials, APIMarket, APIResponse, AssetBillDetails, AutoLoanResult, BlockCounterParty, BlockMakerInstrumentSettings, BlockMMPConfig, BlockRFQResult, BorrowRepayHistoryItem, CancelAlgoOrderRequest, CancelAllAfterResponse, CancelBlockQuoteRequest, CancelBlockQuoteResult, CancelBlockRFQRequest, CancelBlockRFQResult, CancelledOrderResult, CancelMultipleBlockQuoteRequest, CancelMultipleBlockRFQRequest, CancelSignalBotsResult, CancelSpreadOrderResponse, CancelSubOrderRequest, Candle, CandleNoVolume, CandleRequest, ChangePositionMarginRequest, CloseContractGridPositionRequest, ClosedPositions, ClosePositionRequest, CloseSubpositionRequest, ContractGridDirection, ConvertQuoteEstimateRequest, ConvertTradeRequest, CopySettingsRequest, CreateBlockQuoteRequest, CreateBlockQuoteResult, CreateBlockRFQRequest, CreateRFQResult, CreateSignalBotRequest, CreateSignalBotResult, CreateSignalRequest, CreateSignalResult, CurrentSubposition, EconomicCalendarData, EconomicCalendarRequest, ExecuteBlockQuoteRequest, ExecuteBlockQuoteResult, FillsHistoryRequest, FixedLoanBorrowingLimit, FixedLoanBorrowQuote, FundingBalance, FundingCurrency, FundingRateRequest, FundsTransferRequest, FundTransferResult, FundTransferState, GetAccountConfigurationResult, GetActiveSpreadOrdersRequest, GetBlockQuoteParams, GetBlockQuoteResult, GetBlockRFQSParams, GetBorrowRepayHistoryRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, GetCopySettingsResult, GetCopyTradersRequest, GetCopyTradersResult, GetCopyTradingConfigResult, GetCTBatchLeverageInfoRequest, GetCTBatchLeverageInfoResult, GetCTHistoryLeadTradersRequest, GetCTHistoryLeadTradersResult, GetCTMyLeadTradersResult, GetCTProfitDetailsRequest, GetCTProfitDetailsResult, GetCTTotalProfitResult, GetCTUnrealizedProfitResult, GetCurrentSubpositionsRequest, GetDepositWithdrawStatusRequest, GetFixedLoanBorrowingOrdersListRequest, GetFixedLoanBorrowQuoteRequest, GetGridAlgoOrdersRequest, GetHistoricPositionParams, GetInstrumentsRequest, GetLeadTraderPositionsRequest, GetLeadTraderRanksRequest, GetLeadTraderRanksResult, GetLeadTraderStatsRequest, GetLendingOrderListRequest, GetLendingSubOrderListRequest, GetManagedSubAccountTransferHistoryRequest, GetOptionTradesRequest, GetPositionsParams, GetPremiumHistoryRequest, GetPrivateLeadTraderRanksRequest, GetPrivateLeadTraderRanksResult, GetQuickMarginBorrowRepayHistoryRequest, GetRecurringBuyOrderListRequest, GetRSIBackTestingRequest, GetSignalBotEventHistoryRequest, GetSignalBotPositionHistoryRequest, GetSignalBotRequest, GetSignalBotSubOrdersRequest, GetSignalsRequest, GetSignalsResult, GetSpreadCandlesRequest, GetSpreadOrderHistoryArchiveRequest, GetSpreadOrderHistoryRequest, GetSpreadsRequest, GetSpreadTradesRequest, GetSubAccountMaxWithdrawalsRequest, GetSubpositionsHistoryRequest, GetTopTradersContractLongShortRatioRequest, GetVIPInterestRequest, GetVIPLoanOrderDetailRequest, GetVIPLoanOrderListRequest, Greeks, GridAlgoOrderRequest, GridAlgoOrderType, GridAlgoSubOrderType, HistoricAccountPosition, HistoricAlgoOrder, HistoricOrder, IndexTicker, Instrument, InstrumentType, InterestAccrued, InterestRate, LeadTraderCurrentPosition, LeadTraderPnl, LeadTraderPositionHistory, LeadTraderPreference, LeadTraderStats, LendingOrder, ManagedSubAccountTransfer, MarginMode, MaxGridQuantityRequest, MaxWithdrawal, MMPConfig, NonTradableAsset, numberInString, OptionTrade, OptionTrades, OrderBook, OrderDetails, OrderFill, OrderHistoryRequest, OrderIdRequest, OrderListItem, OrderPrecheckRequest, OrderRequest, OrderResult, PaginatedSymbolRequest, Pagination, PlaceCTAlgoOrderRequest, PlaceCTAlgoOrderResult, PlaceRecurringBuyOrderRequest, PlaceSpreadOrderRequest, PlaceSpreadOrderResponse, PlaceSubOrderRequest, PositionBuilderRequest, PositionSide, PosMode, PublicBlockTrade, PublicSpreadTrade, QuickMarginBorrowRepayRecord, QuickMarginBorrowRepayRequest, QuickMarginBorrowRepayResult, RecurringBuyOrder, RecurringBuyOrderResult, RecurringBuySubOrder, RestClientOptions, SetCTBatchLeverageRequest, SetCTBatchLeverageResult, SetLeverageRequest, SetMMPConfigRequest, SetMmpConfigRequest, SetMMPConfigResult, SetMmpConfigResult, SetQuoteProductsRequest, SetSignalInstrumentsRequest, SetSubAccountLoanAllocationRequest, SpreadCandle, SpreadDetails, SpreadOrder, SpreadOrderBook, SpreadTicker, SpreadTrade, StopGridAlgoOrderRequest, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountMaxWithdrawal, SubAccountTransferRequest, SubAccountTransferResult, SubmitFixedLoanBorrowingOrderRequest, SubpositionsHistory, SystemTime, Ticker, TimestampObject, Trade, UnitConvertData, UnitConvertRequest, UpdateFixedLoanBorrowingOrderRequest, UpdateSpreadOrderRequest, UpdateSpreadOrderResponse, VIPInterest, VIPLoanOrder, VIPLoanOrderDetail, WithdrawalHistoryRequest, WithdrawRequest, WithdrawResponse } from './types';
4
- import { AccruedInterestItem, AccruedInterestRequest, AdjustCollateralRequest, CollateralAssetsResponse, LoanHistoryItem, LoanHistoryRequest, LoanInfo, MaxLoanRequest, MaxLoanResponse } from './types/rest/response/private-flexible-loan';
5
- import BaseRestClient from './util/BaseRestClient';
1
+ import { ASSET_BILL_TYPE } from './constants/funding.js';
2
+ import { ChangePositionMarginRequest, GetBorrowRepayHistoryRequest, GetFixedLoanBorrowingOrdersListRequest, GetFixedLoanBorrowQuoteRequest, GetHistoricPositionParams, GetInstrumentsRequest, GetPositionsParams, GetQuickMarginBorrowRepayHistoryRequest, GetVIPInterestRequest, GetVIPLoanOrderDetailRequest, GetVIPLoanOrderListRequest, PositionBuilderRequest, QuickMarginBorrowRepayRequest, SetLeverageRequest, SetMMPConfigRequest, SubmitFixedLoanBorrowingOrderRequest, UpdateFixedLoanBorrowingOrderRequest, WithdrawalHistoryRequest } from './types/rest/request/account.js';
3
+ import { CancelBlockQuoteRequest, CancelBlockRFQRequest, CancelMultipleBlockQuoteRequest, CancelMultipleBlockRFQRequest, CreateBlockQuoteRequest, CreateBlockRFQRequest, ExecuteBlockQuoteRequest, GetBlockQuoteParams, GetBlockRFQSParams, SetMmpConfigRequest, SetQuoteProductsRequest } from './types/rest/request/block-trading.js';
4
+ import { ConvertQuoteEstimateRequest, ConvertTradeRequest } from './types/rest/request/convert.js';
5
+ import { CloseSubpositionRequest, CopySettingsRequest, GetCopyTradersRequest, GetCTBatchLeverageInfoRequest, GetCTHistoryLeadTradersRequest, GetCTProfitDetailsRequest, GetCurrentSubpositionsRequest, GetLeadTraderPositionsRequest, GetLeadTraderRanksRequest, GetLeadTraderStatsRequest, GetPrivateLeadTraderRanksRequest, GetSubpositionsHistoryRequest, PlaceCTAlgoOrderRequest, SetCTBatchLeverageRequest } from './types/rest/request/copy-trading.js';
6
+ import { FundingRateRequest, FundsTransferRequest, GetDepositWithdrawStatusRequest, WithdrawRequest } from './types/rest/request/funding.js';
7
+ import { CloseContractGridPositionRequest, GetGridAlgoOrdersRequest, GetRSIBackTestingRequest, GridAlgoOrderRequest, GridAlgoOrderType, MaxGridQuantityRequest, StopGridAlgoOrderRequest } from './types/rest/request/grid-trading.js';
8
+ import { CandleRequest, EconomicCalendarRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, GetOptionTradesRequest, GetPremiumHistoryRequest, GetTopTradersContractLongShortRatioRequest, UnitConvertRequest } from './types/rest/request/public.js';
9
+ import { AmendRecurringBuyOrderRequest, GetRecurringBuyOrderListRequest, PlaceRecurringBuyOrderRequest } from './types/rest/request/recurring-buy.js';
10
+ import { PaginatedSymbolRequest } from './types/rest/request/shared.js';
11
+ import { AdjustMarginBalanceRequest, AmendTPSLRequest, CancelSubOrderRequest, CreateSignalBotRequest, CreateSignalRequest, GetSignalBotEventHistoryRequest, GetSignalBotPositionHistoryRequest, GetSignalBotRequest, GetSignalBotSubOrdersRequest, GetSignalsRequest, PlaceSubOrderRequest, SetSignalInstrumentsRequest } from './types/rest/request/signal-bot.js';
12
+ import { GetLendingOrderListRequest, GetLendingSubOrderListRequest, LendingOrder } from './types/rest/request/simple-earn.js';
13
+ import { GetActiveSpreadOrdersRequest, GetSpreadCandlesRequest, GetSpreadOrderHistoryArchiveRequest, GetSpreadOrderHistoryRequest, GetSpreadsRequest, GetSpreadTradesRequest, PlaceSpreadOrderRequest, UpdateSpreadOrderRequest } from './types/rest/request/spread-trading.js';
14
+ import { GetManagedSubAccountTransferHistoryRequest, GetSubAccountMaxWithdrawalsRequest, SetSubAccountLoanAllocationRequest, SubAccountTransferRequest } from './types/rest/request/subaccount.js';
15
+ import { AlgoLongHistoryRequest, AlgoOrderDetailsRequest, AlgoOrderRequest, AlgoRecentHistoryRequest, AmendAlgoOrderRequest, AmendOrderRequest, CancelAlgoOrderRequest, ClosePositionRequest, FillsHistoryRequest, OrderHistoryRequest, OrderIdRequest, OrderPrecheckRequest, OrderRequest } from './types/rest/request/trade.js';
16
+ import { AccountBalance, AccountBill, AccountChangeMarginResult, AccountConfiguration, AccountFeeRate, AccountHistoryBill, AccountInstrument, AccountIsolatedMode, AccountLeverage, AccountLeverageResult, AccountMaxLoan, AccountMaxOrderAmount, AccountMaxTradableAmount, AccountModeResult, AccountPosition, AccountPositionModeResult, AccountPositionRisk, AccountRiskState, AdjustLeverageInfo, AutoLoanResult, BorrowRepayHistoryItem, FixedLoanBorrowingLimit, FixedLoanBorrowQuote, Greeks, HistoricAccountPosition, InterestAccrued, InterestRate, MaxWithdrawal, MMPConfig, QuickMarginBorrowRepayRecord, QuickMarginBorrowRepayResult, SetMMPConfigResult, VIPInterest, VIPLoanOrder, VIPLoanOrderDetail } from './types/rest/response/private-account.js';
17
+ import { BlockCounterParty, BlockMakerInstrumentSettings, BlockMMPConfig, BlockRFQResult, CancelBlockQuoteResult, CancelBlockRFQResult, CreateBlockQuoteResult, CreateRFQResult, ExecuteBlockQuoteResult, GetBlockQuoteResult, PublicBlockTrade, SetMmpConfigResult } from './types/rest/response/private-block-trading.js';
18
+ import { CurrentSubposition, GetAccountConfigurationResult, GetCopySettingsResult, GetCopyTradersResult, GetCopyTradingConfigResult, GetCTBatchLeverageInfoResult, GetCTHistoryLeadTradersResult, GetCTMyLeadTradersResult, GetCTProfitDetailsResult, GetCTTotalProfitResult, GetCTUnrealizedProfitResult, GetLeadTraderRanksResult, GetPrivateLeadTraderRanksResult, LeadTraderCurrentPosition, LeadTraderPnl, LeadTraderPositionHistory, LeadTraderPreference, LeadTraderStats, PlaceCTAlgoOrderResult, SetCTBatchLeverageResult, SubpositionsHistory } from './types/rest/response/private-copy-trading.js';
19
+ import { AccruedInterestItem, AccruedInterestRequest, AdjustCollateralRequest, CollateralAssetsResponse, LoanHistoryItem, LoanHistoryRequest, LoanInfo, MaxLoanRequest, MaxLoanResponse } from './types/rest/response/private-flexible-loan.js';
20
+ import { AccountAssetValuation, AssetBillDetails, FundingBalance, FundingCurrency, FundTransferResult, FundTransferState, NonTradableAsset, WithdrawResponse } from './types/rest/response/private-funding.js';
21
+ import { RecurringBuyOrder, RecurringBuyOrderResult, RecurringBuySubOrder } from './types/rest/response/private-recurring-buy.js';
22
+ import { CancelSignalBotsResult, CreateSignalBotResult, CreateSignalResult, GetSignalsResult } from './types/rest/response/private-signal-bot.js';
23
+ import { CancelSpreadOrderResponse, PlaceSpreadOrderResponse, PublicSpreadTrade, SpreadCandle, SpreadDetails, SpreadOrder, SpreadOrderBook, SpreadTicker, SpreadTrade, UpdateSpreadOrderResponse } from './types/rest/response/private-spread-trading.js';
24
+ import { ManagedSubAccountTransfer, SubAccount, SubAccountAPIReset, SubAccountBalances, SubAccountMaxWithdrawal, SubAccountTransferResult } from './types/rest/response/private-subaccount.js';
25
+ import { AlgoOrderDetailsResult, AlgoOrderListItem, AlgoOrderResult, AmendAlgoOrderResult, AmendedOrder, CancelAllAfterResponse, CancelledOrderResult, ClosedPositions, HistoricAlgoOrder, HistoricOrder, OrderDetails, OrderFill, OrderListItem, OrderResult } from './types/rest/response/private-trade.js';
26
+ import { Announcement, Candle, CandleNoVolume, EconomicCalendarData, IndexTicker, Instrument, OptionTrade, OptionTrades, OrderBook, SystemTime, Ticker, Trade, UnitConvertData } from './types/rest/response/public-data.js';
27
+ import { AccountLevel, APIResponse, ContractGridDirection, GridAlgoSubOrderType, InstrumentType, MarginMode, numberInString, Pagination, PositionSide, PosMode, TimestampObject } from './types/rest/shared.js';
28
+ import BaseRestClient from './util/BaseRestClient.js';
6
29
  export declare class RestClient extends BaseRestClient {
7
- /**
8
- * @public Creates an instance of the REST API client.
9
- *
10
- * @param credentials - Note: This parameter will be removed! Pass `null` here and use the restClientOptions parameter (3rd one) instead!
11
- * @param environment - Note: This parameter will be removed! Pass `prod` here and use the restClientOptions parameter (3rd one) instead!
12
- * @param restClientOptions
13
- * @param requestOptions
14
- * @returns
15
- */
16
- constructor(credentials?: APICredentials | null, environment?: APIMarket, restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig);
17
30
  /**
18
31
  *
19
32
  * Custom SDK functions