@upbit-official/upbit-sdk 0.9.0 → 1.1.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 (406) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +36 -16
  3. package/client.d.mts +13 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +13 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +26 -4
  8. package/client.js.map +1 -1
  9. package/client.mjs +26 -4
  10. package/client.mjs.map +1 -1
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts.map +1 -1
  13. package/core/api-promise.js.map +1 -1
  14. package/core/api-promise.mjs.map +1 -1
  15. package/core/error.d.mts.map +1 -1
  16. package/core/error.d.ts.map +1 -1
  17. package/core/error.js.map +1 -1
  18. package/core/error.mjs.map +1 -1
  19. package/core/pagination.d.mts.map +1 -1
  20. package/core/pagination.d.ts.map +1 -1
  21. package/core/pagination.js.map +1 -1
  22. package/core/pagination.mjs.map +1 -1
  23. package/core/resource.d.mts.map +1 -1
  24. package/core/resource.d.ts.map +1 -1
  25. package/core/resource.js.map +1 -1
  26. package/core/resource.mjs.map +1 -1
  27. package/index.d.mts +3 -1
  28. package/index.d.mts.map +1 -1
  29. package/index.d.ts +3 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.js +2 -1
  32. package/index.js.map +1 -1
  33. package/index.mjs +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/builtin-types.d.mts.map +1 -1
  36. package/internal/builtin-types.d.ts.map +1 -1
  37. package/internal/errors.d.mts.map +1 -1
  38. package/internal/errors.d.ts.map +1 -1
  39. package/internal/errors.js.map +1 -1
  40. package/internal/errors.mjs.map +1 -1
  41. package/internal/headers.d.mts.map +1 -1
  42. package/internal/headers.d.ts.map +1 -1
  43. package/internal/headers.js.map +1 -1
  44. package/internal/headers.mjs.map +1 -1
  45. package/internal/parse.d.mts.map +1 -1
  46. package/internal/parse.d.ts.map +1 -1
  47. package/internal/parse.js.map +1 -1
  48. package/internal/parse.mjs.map +1 -1
  49. package/internal/request-options.d.mts.map +1 -1
  50. package/internal/request-options.d.ts.map +1 -1
  51. package/internal/request-options.js.map +1 -1
  52. package/internal/request-options.mjs.map +1 -1
  53. package/internal/shim-types.d.mts.map +1 -1
  54. package/internal/shim-types.d.ts.map +1 -1
  55. package/internal/shim-types.js.map +1 -1
  56. package/internal/shim-types.mjs.map +1 -1
  57. package/internal/shims.d.mts.map +1 -1
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/shims.js.map +1 -1
  60. package/internal/shims.mjs.map +1 -1
  61. package/internal/types.d.mts.map +1 -1
  62. package/internal/types.d.ts.map +1 -1
  63. package/internal/utils/base64.d.mts.map +1 -1
  64. package/internal/utils/base64.d.ts.map +1 -1
  65. package/internal/utils/base64.js.map +1 -1
  66. package/internal/utils/base64.mjs.map +1 -1
  67. package/internal/utils/env.d.mts.map +1 -1
  68. package/internal/utils/env.d.ts.map +1 -1
  69. package/internal/utils/env.js.map +1 -1
  70. package/internal/utils/env.mjs.map +1 -1
  71. package/internal/utils/log.d.mts.map +1 -1
  72. package/internal/utils/log.d.ts.map +1 -1
  73. package/internal/utils/log.js.map +1 -1
  74. package/internal/utils/log.mjs.map +1 -1
  75. package/internal/utils/query.d.mts.map +1 -1
  76. package/internal/utils/query.d.ts.map +1 -1
  77. package/internal/utils/query.js.map +1 -1
  78. package/internal/utils/query.mjs.map +1 -1
  79. package/internal/utils/sleep.d.mts.map +1 -1
  80. package/internal/utils/sleep.d.ts.map +1 -1
  81. package/internal/utils/sleep.js.map +1 -1
  82. package/internal/utils/sleep.mjs.map +1 -1
  83. package/internal/utils/uuid.d.mts.map +1 -1
  84. package/internal/utils/uuid.d.ts.map +1 -1
  85. package/internal/utils/uuid.js.map +1 -1
  86. package/internal/utils/uuid.mjs.map +1 -1
  87. package/internal/utils/values.d.mts.map +1 -1
  88. package/internal/utils/values.d.ts.map +1 -1
  89. package/internal/utils/values.js.map +1 -1
  90. package/internal/utils/values.mjs.map +1 -1
  91. package/internal/utils.js.map +1 -1
  92. package/internal/ws-parser.d.mts +40 -0
  93. package/internal/ws-parser.d.mts.map +1 -0
  94. package/internal/ws-parser.d.ts +40 -0
  95. package/internal/ws-parser.d.ts.map +1 -0
  96. package/internal/ws-parser.js +125 -0
  97. package/internal/ws-parser.js.map +1 -0
  98. package/internal/ws-parser.mjs +118 -0
  99. package/internal/ws-parser.mjs.map +1 -0
  100. package/internal/ws-simple-types.d.mts +8 -0
  101. package/internal/ws-simple-types.d.mts.map +1 -0
  102. package/internal/ws-simple-types.d.ts +8 -0
  103. package/internal/ws-simple-types.d.ts.map +1 -0
  104. package/internal/ws-simple-types.js +3 -0
  105. package/internal/ws-simple-types.js.map +1 -0
  106. package/internal/ws-simple-types.mjs +2 -0
  107. package/internal/ws-simple-types.mjs.map +1 -0
  108. package/internal/ws.d.mts +1 -0
  109. package/internal/ws.d.mts.map +1 -1
  110. package/internal/ws.d.ts +1 -0
  111. package/internal/ws.d.ts.map +1 -1
  112. package/internal/ws.js.map +1 -1
  113. package/internal/ws.mjs.map +1 -1
  114. package/lib/index.d.mts +4 -2
  115. package/lib/index.d.mts.map +1 -1
  116. package/lib/index.d.ts +4 -2
  117. package/lib/index.d.ts.map +1 -1
  118. package/lib/index.js +2 -1
  119. package/lib/index.js.map +1 -1
  120. package/lib/index.mjs +1 -1
  121. package/lib/index.mjs.map +1 -1
  122. package/lib/jsonParseFloat.d.mts +5 -5
  123. package/lib/jsonParseFloat.d.mts.map +1 -1
  124. package/lib/jsonParseFloat.d.ts +5 -5
  125. package/lib/jsonParseFloat.d.ts.map +1 -1
  126. package/lib/jsonParseFloat.js +31 -12
  127. package/lib/jsonParseFloat.js.map +1 -1
  128. package/lib/jsonParseFloat.mjs +31 -12
  129. package/lib/jsonParseFloat.mjs.map +1 -1
  130. package/lib/ws.d.mts +102 -15
  131. package/lib/ws.d.mts.map +1 -1
  132. package/lib/ws.d.ts +102 -15
  133. package/lib/ws.d.ts.map +1 -1
  134. package/lib/ws.js +208 -34
  135. package/lib/ws.js.map +1 -1
  136. package/lib/ws.mjs +204 -33
  137. package/lib/ws.mjs.map +1 -1
  138. package/package.json +15 -9
  139. package/resources/accounts.d.mts +2 -0
  140. package/resources/accounts.d.mts.map +1 -1
  141. package/resources/accounts.d.ts +2 -0
  142. package/resources/accounts.d.ts.map +1 -1
  143. package/resources/accounts.js +2 -0
  144. package/resources/accounts.js.map +1 -1
  145. package/resources/accounts.mjs +2 -0
  146. package/resources/accounts.mjs.map +1 -1
  147. package/resources/api-keys.d.mts +3 -1
  148. package/resources/api-keys.d.mts.map +1 -1
  149. package/resources/api-keys.d.ts +3 -1
  150. package/resources/api-keys.d.ts.map +1 -1
  151. package/resources/api-keys.js +3 -1
  152. package/resources/api-keys.js.map +1 -1
  153. package/resources/api-keys.mjs +3 -1
  154. package/resources/api-keys.mjs.map +1 -1
  155. package/resources/candles.d.mts +21 -1
  156. package/resources/candles.d.mts.map +1 -1
  157. package/resources/candles.d.ts +21 -1
  158. package/resources/candles.d.ts.map +1 -1
  159. package/resources/candles.js +12 -0
  160. package/resources/candles.js.map +1 -1
  161. package/resources/candles.mjs +12 -0
  162. package/resources/candles.mjs.map +1 -1
  163. package/resources/deposits.d.mts +18 -1
  164. package/resources/deposits.d.mts.map +1 -1
  165. package/resources/deposits.d.ts +18 -1
  166. package/resources/deposits.d.ts.map +1 -1
  167. package/resources/deposits.js +18 -1
  168. package/resources/deposits.js.map +1 -1
  169. package/resources/deposits.mjs +18 -1
  170. package/resources/deposits.mjs.map +1 -1
  171. package/resources/index.d.mts +4 -2
  172. package/resources/index.d.mts.map +1 -1
  173. package/resources/index.d.ts +4 -2
  174. package/resources/index.d.ts.map +1 -1
  175. package/resources/index.js +5 -1
  176. package/resources/index.js.map +1 -1
  177. package/resources/index.mjs +4 -2
  178. package/resources/index.mjs.map +1 -1
  179. package/resources/orderbooks.d.mts +4 -0
  180. package/resources/orderbooks.d.mts.map +1 -1
  181. package/resources/orderbooks.d.ts +4 -0
  182. package/resources/orderbooks.d.ts.map +1 -1
  183. package/resources/orderbooks.js +4 -0
  184. package/resources/orderbooks.js.map +1 -1
  185. package/resources/orderbooks.mjs +4 -0
  186. package/resources/orderbooks.mjs.map +1 -1
  187. package/resources/orders.d.mts +12 -2
  188. package/resources/orders.d.mts.map +1 -1
  189. package/resources/orders.d.ts +12 -2
  190. package/resources/orders.d.ts.map +1 -1
  191. package/resources/orders.js +12 -2
  192. package/resources/orders.js.map +1 -1
  193. package/resources/orders.mjs +12 -2
  194. package/resources/orders.mjs.map +1 -1
  195. package/resources/pockets.d.mts +509 -0
  196. package/resources/pockets.d.mts.map +1 -0
  197. package/resources/pockets.d.ts +509 -0
  198. package/resources/pockets.d.ts.map +1 -0
  199. package/resources/pockets.js +157 -0
  200. package/resources/pockets.js.map +1 -0
  201. package/resources/pockets.mjs +153 -0
  202. package/resources/pockets.mjs.map +1 -0
  203. package/resources/tickers.d.mts +6 -0
  204. package/resources/tickers.d.mts.map +1 -1
  205. package/resources/tickers.d.ts +6 -0
  206. package/resources/tickers.d.ts.map +1 -1
  207. package/resources/tickers.js +6 -0
  208. package/resources/tickers.js.map +1 -1
  209. package/resources/tickers.mjs +6 -0
  210. package/resources/tickers.mjs.map +1 -1
  211. package/resources/trades.d.mts +5 -3
  212. package/resources/trades.d.mts.map +1 -1
  213. package/resources/trades.d.ts +5 -3
  214. package/resources/trades.d.ts.map +1 -1
  215. package/resources/trades.js +5 -3
  216. package/resources/trades.js.map +1 -1
  217. package/resources/trades.mjs +5 -3
  218. package/resources/trades.mjs.map +1 -1
  219. package/resources/trading-pairs.d.mts +2 -0
  220. package/resources/trading-pairs.d.mts.map +1 -1
  221. package/resources/trading-pairs.d.ts +2 -0
  222. package/resources/trading-pairs.d.ts.map +1 -1
  223. package/resources/trading-pairs.js +2 -0
  224. package/resources/trading-pairs.js.map +1 -1
  225. package/resources/trading-pairs.mjs +2 -0
  226. package/resources/trading-pairs.mjs.map +1 -1
  227. package/resources/travel-rule.d.mts +6 -0
  228. package/resources/travel-rule.d.mts.map +1 -1
  229. package/resources/travel-rule.d.ts +6 -0
  230. package/resources/travel-rule.d.ts.map +1 -1
  231. package/resources/travel-rule.js +6 -0
  232. package/resources/travel-rule.js.map +1 -1
  233. package/resources/travel-rule.mjs +6 -0
  234. package/resources/travel-rule.mjs.map +1 -1
  235. package/resources/wallet-status.d.mts +2 -0
  236. package/resources/wallet-status.d.mts.map +1 -1
  237. package/resources/wallet-status.d.ts +2 -0
  238. package/resources/wallet-status.d.ts.map +1 -1
  239. package/resources/wallet-status.js +2 -0
  240. package/resources/wallet-status.js.map +1 -1
  241. package/resources/wallet-status.mjs +2 -0
  242. package/resources/wallet-status.mjs.map +1 -1
  243. package/resources/withdraws.d.mts +18 -1
  244. package/resources/withdraws.d.mts.map +1 -1
  245. package/resources/withdraws.d.ts +18 -1
  246. package/resources/withdraws.d.ts.map +1 -1
  247. package/resources/withdraws.js +18 -1
  248. package/resources/withdraws.js.map +1 -1
  249. package/resources/withdraws.mjs +18 -1
  250. package/resources/withdraws.mjs.map +1 -1
  251. package/resources/ws-info/index.d.mts +6 -0
  252. package/resources/ws-info/index.d.mts.map +1 -0
  253. package/resources/ws-info/index.d.ts +6 -0
  254. package/resources/ws-info/index.d.ts.map +1 -0
  255. package/resources/ws-info/index.js +6 -0
  256. package/resources/ws-info/index.js.map +1 -0
  257. package/resources/ws-info/index.mjs +2 -0
  258. package/resources/ws-info/index.mjs.map +1 -0
  259. package/resources/ws-info/internal-base.d.mts +63 -0
  260. package/resources/ws-info/internal-base.d.mts.map +1 -0
  261. package/resources/ws-info/internal-base.d.ts +63 -0
  262. package/resources/ws-info/internal-base.d.ts.map +1 -0
  263. package/resources/ws-info/internal-base.js +47 -0
  264. package/resources/ws-info/internal-base.js.map +1 -0
  265. package/resources/ws-info/internal-base.mjs +41 -0
  266. package/resources/ws-info/internal-base.mjs.map +1 -0
  267. package/resources/ws-info/ws-info.d.mts +1180 -0
  268. package/resources/ws-info/ws-info.d.mts.map +1 -0
  269. package/resources/ws-info/ws-info.d.ts +1180 -0
  270. package/resources/ws-info/ws-info.d.ts.map +1 -0
  271. package/resources/ws-info/ws-info.js +8 -0
  272. package/resources/ws-info/ws-info.js.map +1 -0
  273. package/resources/ws-info/ws-info.mjs +4 -0
  274. package/resources/ws-info/ws-info.mjs.map +1 -0
  275. package/resources/ws-info/ws.d.mts +91 -0
  276. package/resources/ws-info/ws.d.mts.map +1 -0
  277. package/resources/ws-info/ws.d.ts +91 -0
  278. package/resources/ws-info/ws.d.ts.map +1 -0
  279. package/resources/ws-info/ws.js +463 -0
  280. package/resources/ws-info/ws.js.map +1 -0
  281. package/resources/ws-info/ws.mjs +458 -0
  282. package/resources/ws-info/ws.mjs.map +1 -0
  283. package/resources/ws-info.d.mts +2 -0
  284. package/resources/ws-info.d.mts.map +1 -0
  285. package/resources/ws-info.d.ts +2 -0
  286. package/resources/ws-info.d.ts.map +1 -0
  287. package/resources/ws-info.js +5 -0
  288. package/resources/ws-info.js.map +1 -0
  289. package/resources/ws-info.mjs +2 -0
  290. package/resources/ws-info.mjs.map +1 -0
  291. package/resources/ws-private/index.d.mts +3 -1
  292. package/resources/ws-private/index.d.mts.map +1 -1
  293. package/resources/ws-private/index.d.ts +3 -1
  294. package/resources/ws-private/index.d.ts.map +1 -1
  295. package/resources/ws-private/index.js.map +1 -1
  296. package/resources/ws-private/index.mjs +1 -1
  297. package/resources/ws-private/index.mjs.map +1 -1
  298. package/resources/ws-private/internal-base.d.mts.map +1 -1
  299. package/resources/ws-private/internal-base.d.ts.map +1 -1
  300. package/resources/ws-private/internal-base.js.map +1 -1
  301. package/resources/ws-private/internal-base.mjs.map +1 -1
  302. package/resources/ws-private/ws-private.d.mts +301 -9
  303. package/resources/ws-private/ws-private.d.mts.map +1 -1
  304. package/resources/ws-private/ws-private.d.ts +301 -9
  305. package/resources/ws-private/ws-private.d.ts.map +1 -1
  306. package/resources/ws-private/ws-private.js.map +1 -1
  307. package/resources/ws-private/ws-private.mjs.map +1 -1
  308. package/resources/ws-private/ws.d.mts +2 -2
  309. package/resources/ws-private/ws.d.mts.map +1 -1
  310. package/resources/ws-private/ws.d.ts +2 -2
  311. package/resources/ws-private/ws.d.ts.map +1 -1
  312. package/resources/ws-private/ws.js +15 -20
  313. package/resources/ws-private/ws.js.map +1 -1
  314. package/resources/ws-private/ws.mjs +15 -20
  315. package/resources/ws-private/ws.mjs.map +1 -1
  316. package/resources/ws-private.js.map +1 -1
  317. package/resources/ws-public/index.d.mts +3 -1
  318. package/resources/ws-public/index.d.mts.map +1 -1
  319. package/resources/ws-public/index.d.ts +3 -1
  320. package/resources/ws-public/index.d.ts.map +1 -1
  321. package/resources/ws-public/index.js.map +1 -1
  322. package/resources/ws-public/index.mjs +1 -1
  323. package/resources/ws-public/index.mjs.map +1 -1
  324. package/resources/ws-public/internal-base.d.mts.map +1 -1
  325. package/resources/ws-public/internal-base.d.ts.map +1 -1
  326. package/resources/ws-public/internal-base.js.map +1 -1
  327. package/resources/ws-public/internal-base.mjs.map +1 -1
  328. package/resources/ws-public/ws-public.d.mts +355 -5
  329. package/resources/ws-public/ws-public.d.mts.map +1 -1
  330. package/resources/ws-public/ws-public.d.ts +355 -5
  331. package/resources/ws-public/ws-public.d.ts.map +1 -1
  332. package/resources/ws-public/ws-public.js.map +1 -1
  333. package/resources/ws-public/ws-public.mjs.map +1 -1
  334. package/resources/ws-public/ws.d.mts +2 -2
  335. package/resources/ws-public/ws.d.mts.map +1 -1
  336. package/resources/ws-public/ws.d.ts +2 -2
  337. package/resources/ws-public/ws.d.ts.map +1 -1
  338. package/resources/ws-public/ws.js +15 -20
  339. package/resources/ws-public/ws.js.map +1 -1
  340. package/resources/ws-public/ws.mjs +15 -20
  341. package/resources/ws-public/ws.mjs.map +1 -1
  342. package/resources/ws-public.js.map +1 -1
  343. package/src/client.ts +141 -5
  344. package/src/core/api-promise.ts +0 -1
  345. package/src/core/error.ts +0 -1
  346. package/src/core/pagination.ts +0 -1
  347. package/src/core/resource.ts +0 -1
  348. package/src/index.ts +24 -2
  349. package/src/internal/builtin-types.ts +0 -1
  350. package/src/internal/errors.ts +0 -1
  351. package/src/internal/headers.ts +0 -1
  352. package/src/internal/parse.ts +0 -1
  353. package/src/internal/request-options.ts +0 -1
  354. package/src/internal/shim-types.ts +0 -1
  355. package/src/internal/shims.ts +0 -1
  356. package/src/internal/types.ts +0 -1
  357. package/src/internal/utils/base64.ts +0 -1
  358. package/src/internal/utils/env.ts +0 -1
  359. package/src/internal/utils/log.ts +0 -1
  360. package/src/internal/utils/query.ts +0 -1
  361. package/src/internal/utils/sleep.ts +0 -1
  362. package/src/internal/utils/uuid.ts +0 -1
  363. package/src/internal/utils/values.ts +0 -1
  364. package/src/internal/utils.ts +0 -1
  365. package/src/internal/ws-parser.ts +164 -0
  366. package/src/internal/ws-simple-types.ts +34 -0
  367. package/src/internal/ws.ts +1 -0
  368. package/src/lib/index.ts +17 -2
  369. package/src/lib/jsonParseFloat.ts +38 -12
  370. package/src/lib/ws.ts +367 -55
  371. package/src/resources/accounts.ts +2 -1
  372. package/src/resources/api-keys.ts +3 -2
  373. package/src/resources/candles.ts +22 -2
  374. package/src/resources/deposits.ts +18 -2
  375. package/src/resources/index.ts +65 -3
  376. package/src/resources/orderbooks.ts +4 -1
  377. package/src/resources/orders.ts +12 -3
  378. package/src/resources/pockets.ts +639 -0
  379. package/src/resources/tickers.ts +6 -1
  380. package/src/resources/trades.ts +5 -4
  381. package/src/resources/trading-pairs.ts +2 -1
  382. package/src/resources/travel-rule.ts +6 -1
  383. package/src/resources/wallet-status.ts +2 -1
  384. package/src/resources/withdraws.ts +18 -2
  385. package/src/resources/ws-info/index.ts +44 -0
  386. package/src/resources/ws-info/internal-base.ts +96 -0
  387. package/src/resources/ws-info/ws-info.ts +1855 -0
  388. package/src/resources/ws-info/ws.ts +574 -0
  389. package/src/resources/ws-info.ts +1 -0
  390. package/src/resources/ws-private/index.ts +12 -2
  391. package/src/resources/ws-private/internal-base.ts +0 -2
  392. package/src/resources/ws-private/ws-private.ts +419 -18
  393. package/src/resources/ws-private/ws.ts +16 -24
  394. package/src/resources/ws-private.ts +0 -1
  395. package/src/resources/ws-public/index.ts +16 -2
  396. package/src/resources/ws-public/internal-base.ts +0 -2
  397. package/src/resources/ws-public/ws-public.ts +459 -5
  398. package/src/resources/ws-public/ws.ts +16 -24
  399. package/src/resources/ws-public.ts +0 -1
  400. package/src/version.ts +1 -1
  401. package/version.d.mts +1 -1
  402. package/version.d.ts +1 -1
  403. package/version.js +1 -1
  404. package/version.js.map +1 -1
  405. package/version.mjs +1 -1
  406. package/version.mjs.map +1 -1
@@ -5,6 +5,7 @@
5
5
  */
6
6
  const NUMBER_FIELDS = new Set([
7
7
  'timestamp',
8
+ 'tms',
8
9
  'trade_timestamp',
9
10
  'sequential_id',
10
11
  'trades_count',
@@ -14,57 +15,75 @@ const NUMBER_FIELDS = new Set([
14
15
  'block_elapsed_minutes',
15
16
  'fee_level',
16
17
  'security_level',
18
+ 'unit',
17
19
  ]);
18
20
  /**
19
21
  * Parses a JSON string with type-aware coercion.
20
22
  *
21
- * 1st pass (JSON.parse reviver): float tokens (containing `.`, `e`, `E`) are
22
- * preserved as their original string representation to avoid precision loss.
23
- * Uses the reviver's third argument `context.source` (TypeScript 5.2+ / modern runtimes).
23
+ * 1st pass (JSON.parse reviver): numeric tokens retain their original source
24
+ * alongside the parsed number. Uses the runtime's reviver `context.source`.
24
25
  * Falls back to standard number parsing when `context.source` is unavailable.
25
26
  *
26
27
  * 2nd pass (constructType): coerces values to match SDK declared types.
27
28
  * - `string`-declared fields: `number` → `string` (e.g. balance `0` → `"0"`)
28
29
  * - `number`-declared fields: `string` → `number` (e.g. timestamp `"123.45"` → `123.45`)
29
30
  *
30
- * Mirrors the behavior of Python SDK's `json.loads(parse_float=str)` + `construct_type()`.
31
+ * Integer scalars and integer array elements keep their existing number contract;
32
+ * decimal/exponent scalars and array elements keep their existing source strings.
31
33
  */
32
- export function jsonParseFloat(text) {
34
+ export function jsonParseFloat(text, numberField) {
33
35
  const parsed = JSON.parse(text, (key, value, context) => {
34
36
  if (typeof value !== 'number')
35
37
  return value;
36
38
  const src = context?.source;
37
39
  if (!src)
38
40
  return value;
39
- return /[.eE]/.test(src) ? src : value;
41
+ return new NumericToken(src, value);
40
42
  });
41
- return constructType(parsed);
43
+ return constructType(parsed, numberField);
42
44
  }
43
- function constructType(data) {
45
+ /** Internal only: distinguish numeric wire tokens from JSON string values. */
46
+ class NumericToken {
47
+ constructor(source, value) {
48
+ this.source = source;
49
+ this.value = value;
50
+ }
51
+ }
52
+ function constructType(data, numberField, path = [], root) {
53
+ if (data instanceof NumericToken) {
54
+ return /[.eE]/.test(data.source) ? data.source : data.value;
55
+ }
44
56
  if (Array.isArray(data)) {
45
- return data.map(constructType);
57
+ return data.map((item) => constructType(item, numberField, path, root));
46
58
  }
47
59
  if (data !== null && typeof data === 'object') {
48
60
  const obj = data;
61
+ root ?? (root = obj);
49
62
  const result = {};
50
63
  for (const key of Object.keys(obj)) {
51
64
  const value = obj[key];
52
- if (NUMBER_FIELDS.has(key)) {
65
+ if (NUMBER_FIELDS.has(key) || numberField?.(key, path, root)) {
53
66
  // number-declared field: coerce string → number
54
- if (typeof value === 'string') {
67
+ if (value instanceof NumericToken) {
68
+ result[key] = value.value;
69
+ }
70
+ else if (typeof value === 'string') {
55
71
  result[key] = Number(value);
56
72
  }
57
73
  else {
58
74
  result[key] = value;
59
75
  }
60
76
  }
77
+ else if (value instanceof NumericToken) {
78
+ result[key] = value.source;
79
+ }
61
80
  else if (typeof value === 'number') {
62
81
  // string-declared field: coerce number → string
63
82
  result[key] = String(value);
64
83
  }
65
84
  else {
66
85
  // recurse into nested objects and arrays
67
- result[key] = constructType(value);
86
+ result[key] = constructType(value, numberField, [...path, key], root);
68
87
  }
69
88
  }
70
89
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"jsonParseFloat.mjs","source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,CAAC;gBAC7D,gDAAgD;gBAChD,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;oBAClC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;gBAC5B,CAAC;qBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;oBACrC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACtB,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;gBACzC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;YAC7B,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,gDAAgD;gBAChD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,yCAAyC;gBACzC,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
package/lib/ws.d.mts CHANGED
@@ -1,7 +1,15 @@
1
1
  import type { ConnectPublicServerEvent } from "../resources/ws-public/ws-public.mjs";
2
- import type { ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.mjs";
2
+ import type { ListSubscriptionsResponse, ListSubscriptionsServerResponse, SimpleListSubscriptionsResponse } from "../resources/ws-public/ws-public.mjs";
3
+ import type { AnnouncementCategory, ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.mjs";
4
+ import type { ConnectInfoServerEvent } from "../resources/ws-info/ws-info.mjs";
5
+ import type { ConnectInfoClientEvent } from "../resources/ws-info/ws-info.mjs";
6
+ import { type InfoWebSocketUnknownMessage, type WebSocketMessage } from "../internal/ws-parser.mjs";
7
+ import type { SimpleWebSocketEvent } from "../internal/ws-simple-types.mjs";
8
+ import type { SimpleWebSocketEvent as ExtensibleSimpleEvent } from "../internal/ws-parser.mjs";
3
9
  import type { Upbit } from "../client.mjs";
4
10
  export interface WsStreamOptions {
11
+ /** Response format (default: DEFAULT). Preserved for queries and reconnects. */
12
+ format?: WsStreamFormat;
5
13
  /** Maximum number of reconnection attempts (default: 5) */
6
14
  maxRetries?: number;
7
15
  /** Reconnection delay in ms (default: 1000) */
@@ -11,6 +19,35 @@ export interface WsStreamOptions {
11
19
  /** Callback invoked on successful reconnection */
12
20
  onReconnect?: () => void;
13
21
  }
22
+ export type WsStreamFormat = 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
23
+ export declare enum WsEndpoint {
24
+ Public = "public",
25
+ Private = "private",
26
+ Info = "info"
27
+ }
28
+ export type WsDefaultListSubscriptionsResponse = ListSubscriptionsResponse;
29
+ export type WsSimpleListSubscriptionsResponse = SimpleListSubscriptionsResponse;
30
+ export type WsListSubscriptionsResponse = ListSubscriptionsServerResponse;
31
+ export interface WsAnnouncementOptions extends WsStreamOptions {
32
+ /** Response format (default: DEFAULT). */
33
+ format?: WsStreamFormat;
34
+ /** Announcement categories to receive. Omit to receive all categories. */
35
+ categories?: AnnouncementCategory[];
36
+ /** Whether to include the announcement body in stream messages. */
37
+ includeBody?: boolean;
38
+ }
39
+ export type WsIndicatorSubscription = Omit<Extract<InfoSubscription, {
40
+ type: 'indicator';
41
+ }>, 'type'>;
42
+ export interface WsIndicatorOptions extends Omit<WsIndicatorSubscription, 'codes'>, WsStreamOptions {
43
+ format?: WsStreamFormat;
44
+ }
45
+ export type WsIndicatorSignalSubscription = Omit<Extract<InfoSubscription, {
46
+ type: 'indicator_signal';
47
+ }>, 'type'>;
48
+ export interface WsIndicatorSignalOptions extends Omit<WsIndicatorSignalSubscription, 'codes'>, WsStreamOptions {
49
+ format?: WsStreamFormat;
50
+ }
14
51
  type PublicSubscriptionType = {
15
52
  type: 'ticker';
16
53
  codes: string[];
@@ -24,33 +61,71 @@ type PublicSubscriptionType = {
24
61
  type: string;
25
62
  codes: string[];
26
63
  };
27
- type PrivateSubscriptionType = {
64
+ type AnnouncementSubscriptionType = {
65
+ type: 'announcement';
66
+ categories?: AnnouncementCategory[];
67
+ include_body?: boolean;
68
+ };
69
+ type PrivateSubscriptionType = AnnouncementSubscriptionType | {
28
70
  type: 'myOrder';
29
71
  codes?: string[];
30
72
  } | {
31
73
  type: 'myAsset';
32
74
  };
33
- type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType;
75
+ export type InfoSubscription = Extract<ConnectInfoClientEvent[number], {
76
+ type: 'indicator' | 'indicator_signal';
77
+ }>;
78
+ type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType | InfoSubscription;
79
+ type WsServerEvent = ConnectPublicServerEvent | ConnectPrivateServerEvent | ConnectInfoServerEvent | InfoWebSocketUnknownMessage;
80
+ export type WsSimpleEvent = SimpleWebSocketEvent;
81
+ export type WsStreamEvent = WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse | Array<WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse>;
82
+ type PublicEvent<Type extends ConnectPublicServerEvent['type']> = Extract<ConnectPublicServerEvent, {
83
+ type: Type;
84
+ }>;
85
+ type CandleEvent = Exclude<ConnectPublicServerEvent, PublicEvent<'ticker' | 'trade' | 'orderbook'>>;
86
+ type PrivateEvent<Type extends ConnectPrivateServerEvent['type']> = Extract<ConnectPrivateServerEvent, {
87
+ type: Type;
88
+ }>;
89
+ type InfoEvent<Type extends ConnectInfoServerEvent['type']> = Extract<ConnectInfoServerEvent, {
90
+ type: Type;
91
+ }>;
92
+ export declare function buildSubscriptionMessage(types: AnySubscriptionType[], format?: WsStreamFormat): string;
93
+ export declare function buildListSubscriptionsMessage(format?: WsStreamFormat): string;
94
+ export declare function parseWsMessage(data: string): unknown;
34
95
  /**
35
96
  * Manages a WebSocket stream as an AsyncIterable.
36
97
  *
37
98
  * Use with `for await (const event of manager) { ... }`.
38
99
  */
39
- export declare class WsStreamManager implements AsyncIterable<ConnectPublicServerEvent | ConnectPrivateServerEvent> {
100
+ export declare class WsStreamManager<Event = ConnectPublicServerEvent | ConnectPrivateServerEvent> implements AsyncIterable<Event> {
40
101
  private readonly client;
41
102
  private readonly types;
42
- private readonly isPrivate;
103
+ private readonly endpoint;
104
+ private readonly format;
43
105
  private readonly maxRetries;
44
106
  private readonly retryDelayMs;
45
107
  private readonly onDisconnect;
46
108
  private readonly onReconnect;
47
109
  private _currentWs;
48
- constructor(client: Upbit, types: AnySubscriptionType[], isPrivate: boolean, opts?: WsStreamOptions);
110
+ private _pendingListSubscriptions;
111
+ constructor(client: Upbit, types: AnySubscriptionType[], privateConnection: boolean, opts?: WsStreamOptions & {
112
+ format?: WsStreamFormat;
113
+ });
114
+ constructor(client: Upbit, types: AnySubscriptionType[], endpoint: WsEndpoint, opts?: WsStreamOptions & {
115
+ format?: WsStreamFormat;
116
+ });
117
+ /**
118
+ * Returns subscriptions for this stream's currently open connection.
119
+ * Start consuming the iterator before calling; calls before connection reject.
120
+ * The response format is unchanged. Responses are matched by request ticket.
121
+ */
122
+ listSubscriptions(timeoutMs?: number): Promise<WsListSubscriptionsResponse>;
49
123
  /** Closes the current WebSocket connection. */
50
124
  close(): void;
51
- [Symbol.asyncIterator](): AsyncGenerator<ConnectPublicServerEvent | ConnectPrivateServerEvent>;
125
+ [Symbol.asyncIterator](): AsyncGenerator<Event>;
52
126
  private _iterate;
53
127
  private _connect;
128
+ private _settlePendingListSubscriptions;
54
129
  }
55
130
  /**
56
131
  * Convenience API for WebSocket streams.
@@ -62,19 +137,25 @@ export declare class WsStream {
62
137
  private readonly client;
63
138
  constructor(client: Upbit);
64
139
  /** Subscribe to the ticker (current price) stream. */
65
- ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager;
140
+ ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'ticker'>>;
66
141
  /** Subscribe to the trade (executed order) stream. */
67
- trade(codes: string[], opts?: WsStreamOptions): WsStreamManager;
142
+ trade(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'trade'>>;
68
143
  /** Subscribe to the orderbook stream. */
69
- orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager;
144
+ orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'orderbook'>>;
70
145
  /** Subscribe to the candle stream. */
71
146
  candle(codes: string[], opts?: {
72
147
  interval?: string;
73
- } & WsStreamOptions): WsStreamManager;
148
+ } & WsStreamOptions): WsStreamManager<CandleEvent>;
74
149
  /** Subscribe to the myOrder (my orders) stream. Requires authentication. */
75
- myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager;
150
+ myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myOrder'>>;
76
151
  /** Subscribe to the myAsset (my assets) stream. Requires authentication. */
77
- myAsset(opts?: WsStreamOptions): WsStreamManager;
152
+ myAsset(opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myAsset'>>;
153
+ /** Subscribe to the announcement stream. Requires authentication. */
154
+ announcement(opts?: WsAnnouncementOptions): WsStreamManager<PrivateEvent<'announcement'>>;
155
+ /** Subscribe to calculated indicator values. Requires authentication. */
156
+ indicator(codes: string[], opts: WsIndicatorOptions): WsStreamManager<InfoEvent<'indicator'>>;
157
+ /** Subscribe to technical indicator condition transitions. Requires authentication. */
158
+ indicatorSignal(codes: string[], opts: WsIndicatorSignalOptions): WsStreamManager<InfoEvent<'indicator_signal'>>;
78
159
  /** Subscribe to multiple public streams at once. */
79
160
  subscribe(opts: {
80
161
  ticker?: string[];
@@ -84,12 +165,18 @@ export declare class WsStream {
84
165
  codes: string[];
85
166
  interval?: string;
86
167
  };
87
- } & WsStreamOptions): WsStreamManager;
168
+ } & WsStreamOptions): WsStreamManager<ConnectPublicServerEvent>;
88
169
  /** Subscribe to multiple private streams at once. Requires authentication. */
89
170
  subscribePrivate(opts: {
171
+ announcement?: boolean | Pick<WsAnnouncementOptions, 'categories' | 'includeBody'>;
90
172
  myOrder?: string[];
91
173
  myAsset?: boolean;
92
- } & WsStreamOptions): WsStreamManager;
174
+ } & WsStreamOptions): WsStreamManager<ConnectPrivateServerEvent>;
175
+ /** Subscribe to multiple info streams at once. Requires authentication. */
176
+ subscribeInfo(opts: {
177
+ indicator?: WsIndicatorSubscription | WsIndicatorSubscription[];
178
+ indicatorSignal?: WsIndicatorSignalSubscription | WsIndicatorSignalSubscription[];
179
+ } & WsStreamOptions): WsStreamManager<ConnectInfoServerEvent>;
93
180
  }
94
181
  export {};
95
182
  //# sourceMappingURL=ws.d.mts.map
package/lib/ws.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ws.d.mts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EAAE,yBAAyB,EAAE;OAClC,KAAK,EAAE,KAAK,EAAE;AAErB,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,KAAK,sBAAsB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK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jB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjD,GAAG,eAAe,GAClB,eAAe,CAAC,wBAAwB,CAAC;IAiB5C,8EAA8E;IAC9E,gBAAgB,CACd,IAAI,EAAE;QACJ,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;QACnF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,eAAe,GAClB,eAAe,CAAC,yBAAyB,CAAC;IAuB7C,2EAA2E;IAC3E,aAAa,CACX,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,uBAAuB,GAAG,uBAAuB,EAAE,CAAC;QAChE,eAAe,CAAC,EAAE,6BAA6B,GAAG,6BAA6B,EAAE,CAAC;KACnF,GAAG,eAAe,GAClB,eAAe,CAAC,sBAAsB,CAAC;CA2B3C"}
package/lib/ws.d.ts CHANGED
@@ -1,7 +1,15 @@
1
1
  import type { ConnectPublicServerEvent } from "../resources/ws-public/ws-public.js";
2
- import type { ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.js";
2
+ import type { ListSubscriptionsResponse, ListSubscriptionsServerResponse, SimpleListSubscriptionsResponse } from "../resources/ws-public/ws-public.js";
3
+ import type { AnnouncementCategory, ConnectPrivateServerEvent } from "../resources/ws-private/ws-private.js";
4
+ import type { ConnectInfoServerEvent } from "../resources/ws-info/ws-info.js";
5
+ import type { ConnectInfoClientEvent } from "../resources/ws-info/ws-info.js";
6
+ import { type InfoWebSocketUnknownMessage, type WebSocketMessage } from "../internal/ws-parser.js";
7
+ import type { SimpleWebSocketEvent } from "../internal/ws-simple-types.js";
8
+ import type { SimpleWebSocketEvent as ExtensibleSimpleEvent } from "../internal/ws-parser.js";
3
9
  import type { Upbit } from "../client.js";
4
10
  export interface WsStreamOptions {
11
+ /** Response format (default: DEFAULT). Preserved for queries and reconnects. */
12
+ format?: WsStreamFormat;
5
13
  /** Maximum number of reconnection attempts (default: 5) */
6
14
  maxRetries?: number;
7
15
  /** Reconnection delay in ms (default: 1000) */
@@ -11,6 +19,35 @@ export interface WsStreamOptions {
11
19
  /** Callback invoked on successful reconnection */
12
20
  onReconnect?: () => void;
13
21
  }
22
+ export type WsStreamFormat = 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
23
+ export declare enum WsEndpoint {
24
+ Public = "public",
25
+ Private = "private",
26
+ Info = "info"
27
+ }
28
+ export type WsDefaultListSubscriptionsResponse = ListSubscriptionsResponse;
29
+ export type WsSimpleListSubscriptionsResponse = SimpleListSubscriptionsResponse;
30
+ export type WsListSubscriptionsResponse = ListSubscriptionsServerResponse;
31
+ export interface WsAnnouncementOptions extends WsStreamOptions {
32
+ /** Response format (default: DEFAULT). */
33
+ format?: WsStreamFormat;
34
+ /** Announcement categories to receive. Omit to receive all categories. */
35
+ categories?: AnnouncementCategory[];
36
+ /** Whether to include the announcement body in stream messages. */
37
+ includeBody?: boolean;
38
+ }
39
+ export type WsIndicatorSubscription = Omit<Extract<InfoSubscription, {
40
+ type: 'indicator';
41
+ }>, 'type'>;
42
+ export interface WsIndicatorOptions extends Omit<WsIndicatorSubscription, 'codes'>, WsStreamOptions {
43
+ format?: WsStreamFormat;
44
+ }
45
+ export type WsIndicatorSignalSubscription = Omit<Extract<InfoSubscription, {
46
+ type: 'indicator_signal';
47
+ }>, 'type'>;
48
+ export interface WsIndicatorSignalOptions extends Omit<WsIndicatorSignalSubscription, 'codes'>, WsStreamOptions {
49
+ format?: WsStreamFormat;
50
+ }
14
51
  type PublicSubscriptionType = {
15
52
  type: 'ticker';
16
53
  codes: string[];
@@ -24,33 +61,71 @@ type PublicSubscriptionType = {
24
61
  type: string;
25
62
  codes: string[];
26
63
  };
27
- type PrivateSubscriptionType = {
64
+ type AnnouncementSubscriptionType = {
65
+ type: 'announcement';
66
+ categories?: AnnouncementCategory[];
67
+ include_body?: boolean;
68
+ };
69
+ type PrivateSubscriptionType = AnnouncementSubscriptionType | {
28
70
  type: 'myOrder';
29
71
  codes?: string[];
30
72
  } | {
31
73
  type: 'myAsset';
32
74
  };
33
- type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType;
75
+ export type InfoSubscription = Extract<ConnectInfoClientEvent[number], {
76
+ type: 'indicator' | 'indicator_signal';
77
+ }>;
78
+ type AnySubscriptionType = PublicSubscriptionType | PrivateSubscriptionType | InfoSubscription;
79
+ type WsServerEvent = ConnectPublicServerEvent | ConnectPrivateServerEvent | ConnectInfoServerEvent | InfoWebSocketUnknownMessage;
80
+ export type WsSimpleEvent = SimpleWebSocketEvent;
81
+ export type WsStreamEvent = WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse | Array<WebSocketMessage<WsServerEvent | WsSimpleEvent | ExtensibleSimpleEvent> | WsListSubscriptionsResponse>;
82
+ type PublicEvent<Type extends ConnectPublicServerEvent['type']> = Extract<ConnectPublicServerEvent, {
83
+ type: Type;
84
+ }>;
85
+ type CandleEvent = Exclude<ConnectPublicServerEvent, PublicEvent<'ticker' | 'trade' | 'orderbook'>>;
86
+ type PrivateEvent<Type extends ConnectPrivateServerEvent['type']> = Extract<ConnectPrivateServerEvent, {
87
+ type: Type;
88
+ }>;
89
+ type InfoEvent<Type extends ConnectInfoServerEvent['type']> = Extract<ConnectInfoServerEvent, {
90
+ type: Type;
91
+ }>;
92
+ export declare function buildSubscriptionMessage(types: AnySubscriptionType[], format?: WsStreamFormat): string;
93
+ export declare function buildListSubscriptionsMessage(format?: WsStreamFormat): string;
94
+ export declare function parseWsMessage(data: string): unknown;
34
95
  /**
35
96
  * Manages a WebSocket stream as an AsyncIterable.
36
97
  *
37
98
  * Use with `for await (const event of manager) { ... }`.
38
99
  */
39
- export declare class WsStreamManager implements AsyncIterable<ConnectPublicServerEvent | ConnectPrivateServerEvent> {
100
+ export declare class WsStreamManager<Event = ConnectPublicServerEvent | ConnectPrivateServerEvent> implements AsyncIterable<Event> {
40
101
  private readonly client;
41
102
  private readonly types;
42
- private readonly isPrivate;
103
+ private readonly endpoint;
104
+ private readonly format;
43
105
  private readonly maxRetries;
44
106
  private readonly retryDelayMs;
45
107
  private readonly onDisconnect;
46
108
  private readonly onReconnect;
47
109
  private _currentWs;
48
- constructor(client: Upbit, types: AnySubscriptionType[], isPrivate: boolean, opts?: WsStreamOptions);
110
+ private _pendingListSubscriptions;
111
+ constructor(client: Upbit, types: AnySubscriptionType[], privateConnection: boolean, opts?: WsStreamOptions & {
112
+ format?: WsStreamFormat;
113
+ });
114
+ constructor(client: Upbit, types: AnySubscriptionType[], endpoint: WsEndpoint, opts?: WsStreamOptions & {
115
+ format?: WsStreamFormat;
116
+ });
117
+ /**
118
+ * Returns subscriptions for this stream's currently open connection.
119
+ * Start consuming the iterator before calling; calls before connection reject.
120
+ * The response format is unchanged. Responses are matched by request ticket.
121
+ */
122
+ listSubscriptions(timeoutMs?: number): Promise<WsListSubscriptionsResponse>;
49
123
  /** Closes the current WebSocket connection. */
50
124
  close(): void;
51
- [Symbol.asyncIterator](): AsyncGenerator<ConnectPublicServerEvent | ConnectPrivateServerEvent>;
125
+ [Symbol.asyncIterator](): AsyncGenerator<Event>;
52
126
  private _iterate;
53
127
  private _connect;
128
+ private _settlePendingListSubscriptions;
54
129
  }
55
130
  /**
56
131
  * Convenience API for WebSocket streams.
@@ -62,19 +137,25 @@ export declare class WsStream {
62
137
  private readonly client;
63
138
  constructor(client: Upbit);
64
139
  /** Subscribe to the ticker (current price) stream. */
65
- ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager;
140
+ ticker(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'ticker'>>;
66
141
  /** Subscribe to the trade (executed order) stream. */
67
- trade(codes: string[], opts?: WsStreamOptions): WsStreamManager;
142
+ trade(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'trade'>>;
68
143
  /** Subscribe to the orderbook stream. */
69
- orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager;
144
+ orderbook(codes: string[], opts?: WsStreamOptions): WsStreamManager<PublicEvent<'orderbook'>>;
70
145
  /** Subscribe to the candle stream. */
71
146
  candle(codes: string[], opts?: {
72
147
  interval?: string;
73
- } & WsStreamOptions): WsStreamManager;
148
+ } & WsStreamOptions): WsStreamManager<CandleEvent>;
74
149
  /** Subscribe to the myOrder (my orders) stream. Requires authentication. */
75
- myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager;
150
+ myOrder(codes: string[], opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myOrder'>>;
76
151
  /** Subscribe to the myAsset (my assets) stream. Requires authentication. */
77
- myAsset(opts?: WsStreamOptions): WsStreamManager;
152
+ myAsset(opts?: WsStreamOptions): WsStreamManager<PrivateEvent<'myAsset'>>;
153
+ /** Subscribe to the announcement stream. Requires authentication. */
154
+ announcement(opts?: WsAnnouncementOptions): WsStreamManager<PrivateEvent<'announcement'>>;
155
+ /** Subscribe to calculated indicator values. Requires authentication. */
156
+ indicator(codes: string[], opts: WsIndicatorOptions): WsStreamManager<InfoEvent<'indicator'>>;
157
+ /** Subscribe to technical indicator condition transitions. Requires authentication. */
158
+ indicatorSignal(codes: string[], opts: WsIndicatorSignalOptions): WsStreamManager<InfoEvent<'indicator_signal'>>;
78
159
  /** Subscribe to multiple public streams at once. */
79
160
  subscribe(opts: {
80
161
  ticker?: string[];
@@ -84,12 +165,18 @@ export declare class WsStream {
84
165
  codes: string[];
85
166
  interval?: string;
86
167
  };
87
- } & WsStreamOptions): WsStreamManager;
168
+ } & WsStreamOptions): WsStreamManager<ConnectPublicServerEvent>;
88
169
  /** Subscribe to multiple private streams at once. Requires authentication. */
89
170
  subscribePrivate(opts: {
171
+ announcement?: boolean | Pick<WsAnnouncementOptions, 'categories' | 'includeBody'>;
90
172
  myOrder?: string[];
91
173
  myAsset?: boolean;
92
- } & WsStreamOptions): WsStreamManager;
174
+ } & WsStreamOptions): WsStreamManager<ConnectPrivateServerEvent>;
175
+ /** Subscribe to multiple info streams at once. Requires authentication. */
176
+ subscribeInfo(opts: {
177
+ indicator?: WsIndicatorSubscription | WsIndicatorSubscription[];
178
+ indicatorSignal?: WsIndicatorSignalSubscription | WsIndicatorSignalSubscription[];
179
+ } & WsStreamOptions): WsStreamManager<ConnectInfoServerEvent>;
93
180
  }
94
181
  export {};
95
182
  //# sourceMappingURL=ws.d.ts.map
package/lib/ws.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../src/lib/ws.ts"],"names":[],"mappings":"OAMO,KAAK,EAAE,wBAAwB,EAAE;OACjC,KAAK,EAAE,yBAAyB,EAAE;OAClC,KAAK,EAAE,KAAK,EAAE;AAErB,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,KAAK,sBAAsB,GACvB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEtC,KAAK,u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