@symmio/trading-core 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1666) hide show
  1. package/dist/candles/adapters/tradingview/index.d.ts +4 -0
  2. package/dist/candles/adapters/tradingview/index.d.ts.map +1 -0
  3. package/dist/candles/adapters/tradingview/map-resolution.d.ts +26 -0
  4. package/dist/candles/adapters/tradingview/map-resolution.d.ts.map +1 -0
  5. package/dist/candles/adapters/tradingview/map-resolution.js +51 -0
  6. package/dist/candles/adapters/tradingview/map-resolution.js.map +1 -0
  7. package/dist/candles/adapters/tradingview/to-tradingview-datafeed.d.ts +48 -0
  8. package/dist/candles/adapters/tradingview/to-tradingview-datafeed.d.ts.map +1 -0
  9. package/dist/candles/adapters/tradingview/to-tradingview-datafeed.js +115 -0
  10. package/dist/candles/adapters/tradingview/to-tradingview-datafeed.js.map +1 -0
  11. package/dist/candles/adapters/tradingview/types.d.ts +102 -0
  12. package/dist/candles/adapters/tradingview/types.d.ts.map +1 -0
  13. package/dist/candles/index.d.ts +6 -0
  14. package/dist/candles/index.d.ts.map +1 -0
  15. package/dist/candles/query.d.ts +58 -0
  16. package/dist/candles/query.d.ts.map +1 -0
  17. package/dist/candles/query.js +31 -0
  18. package/dist/candles/query.js.map +1 -0
  19. package/dist/candles/resolution.d.ts +25 -0
  20. package/dist/candles/resolution.d.ts.map +1 -0
  21. package/dist/candles/resolution.js +30 -0
  22. package/dist/candles/resolution.js.map +1 -0
  23. package/dist/candles/sources/binance/constants.d.ts +46 -0
  24. package/dist/candles/sources/binance/constants.d.ts.map +1 -0
  25. package/dist/candles/sources/binance/constants.js +21 -0
  26. package/dist/candles/sources/binance/constants.js.map +1 -0
  27. package/dist/candles/sources/binance/create-binance-candle-source.d.ts +65 -0
  28. package/dist/candles/sources/binance/create-binance-candle-source.d.ts.map +1 -0
  29. package/dist/candles/sources/binance/create-binance-candle-source.js +92 -0
  30. package/dist/candles/sources/binance/create-binance-candle-source.js.map +1 -0
  31. package/dist/candles/sources/binance/fetch-binance-exchange-info.d.ts +40 -0
  32. package/dist/candles/sources/binance/fetch-binance-exchange-info.d.ts.map +1 -0
  33. package/dist/candles/sources/binance/fetch-binance-exchange-info.js +34 -0
  34. package/dist/candles/sources/binance/fetch-binance-exchange-info.js.map +1 -0
  35. package/dist/candles/sources/binance/fetch-binance-klines.d.ts +36 -0
  36. package/dist/candles/sources/binance/fetch-binance-klines.d.ts.map +1 -0
  37. package/dist/candles/sources/binance/fetch-binance-klines.js +31 -0
  38. package/dist/candles/sources/binance/fetch-binance-klines.js.map +1 -0
  39. package/dist/candles/sources/binance/index.d.ts +8 -0
  40. package/dist/candles/sources/binance/index.d.ts.map +1 -0
  41. package/dist/candles/sources/binance/map-resolution.d.ts +25 -0
  42. package/dist/candles/sources/binance/map-resolution.d.ts.map +1 -0
  43. package/dist/candles/sources/binance/map-resolution.js +34 -0
  44. package/dist/candles/sources/binance/map-resolution.js.map +1 -0
  45. package/dist/candles/sources/binance/parse-kline.d.ts +61 -0
  46. package/dist/candles/sources/binance/parse-kline.d.ts.map +1 -0
  47. package/dist/candles/sources/binance/parse-kline.js +32 -0
  48. package/dist/candles/sources/binance/parse-kline.js.map +1 -0
  49. package/dist/candles/sources/binance/watch-binance-klines.d.ts +54 -0
  50. package/dist/candles/sources/binance/watch-binance-klines.d.ts.map +1 -0
  51. package/dist/candles/sources/binance/watch-binance-klines.js +45 -0
  52. package/dist/candles/sources/binance/watch-binance-klines.js.map +1 -0
  53. package/dist/candles/types.d.ts +192 -0
  54. package/dist/candles/types.d.ts.map +1 -0
  55. package/dist/core/chains/actions/get-default-solver.d.ts +22 -0
  56. package/dist/core/chains/actions/get-default-solver.d.ts.map +1 -0
  57. package/dist/core/chains/actions/get-default-solver.js +10 -0
  58. package/dist/core/chains/actions/get-default-solver.js.map +1 -0
  59. package/dist/core/chains/index.d.ts +4 -0
  60. package/dist/core/chains/index.d.ts.map +1 -1
  61. package/dist/core/chains/price-service-support.d.ts +18 -0
  62. package/dist/core/chains/price-service-support.d.ts.map +1 -0
  63. package/dist/core/chains/price-service-support.js +10 -0
  64. package/dist/core/chains/price-service-support.js.map +1 -0
  65. package/dist/core/chains/registry.d.ts.map +1 -1
  66. package/dist/core/chains/registry.js +88 -42
  67. package/dist/core/chains/registry.js.map +1 -1
  68. package/dist/core/chains/resolve-solver.d.ts +14 -0
  69. package/dist/core/chains/resolve-solver.d.ts.map +1 -0
  70. package/dist/core/chains/resolve-solver.js +14 -0
  71. package/dist/core/chains/resolve-solver.js.map +1 -0
  72. package/dist/core/chains/solver-support.d.ts +14 -0
  73. package/dist/core/chains/solver-support.d.ts.map +1 -0
  74. package/dist/core/chains/solver-support.js +10 -0
  75. package/dist/core/chains/solver-support.js.map +1 -0
  76. package/dist/core/chains/supported-chains.d.ts +3 -1
  77. package/dist/core/chains/supported-chains.d.ts.map +1 -1
  78. package/dist/core/chains/supported-chains.js +1 -1
  79. package/dist/core/chains/supported-chains.js.map +1 -1
  80. package/dist/core/chains/types.d.ts +236 -22
  81. package/dist/core/chains/types.d.ts.map +1 -1
  82. package/dist/core/chains/types.js +6 -0
  83. package/dist/core/chains/types.js.map +1 -0
  84. package/dist/core/config/config-key.d.ts +6 -0
  85. package/dist/core/config/config-key.d.ts.map +1 -1
  86. package/dist/core/config/config-key.js.map +1 -1
  87. package/dist/core/config/create-config.d.ts +43 -12
  88. package/dist/core/config/create-config.d.ts.map +1 -1
  89. package/dist/core/config/create-config.js +47 -25
  90. package/dist/core/config/create-config.js.map +1 -1
  91. package/dist/core/config/merge-chain-config.d.ts.map +1 -1
  92. package/dist/core/config/merge-chain-config.js +81 -28
  93. package/dist/core/config/merge-chain-config.js.map +1 -1
  94. package/dist/index.d.ts +281 -34
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +490 -273
  97. package/dist/inventory/index.d.ts +5 -0
  98. package/dist/inventory/index.d.ts.map +1 -0
  99. package/dist/inventory/resolve-inventory.d.ts +25 -0
  100. package/dist/inventory/resolve-inventory.d.ts.map +1 -0
  101. package/dist/inventory/resolve-inventory.js +18 -0
  102. package/dist/inventory/resolve-inventory.js.map +1 -0
  103. package/dist/inventory/tvl/get-inventory-tvl.d.ts +45 -0
  104. package/dist/inventory/tvl/get-inventory-tvl.d.ts.map +1 -0
  105. package/dist/inventory/tvl/get-inventory-tvl.js +27 -0
  106. package/dist/inventory/tvl/get-inventory-tvl.js.map +1 -0
  107. package/dist/inventory/tvl/index.d.ts +3 -0
  108. package/dist/inventory/tvl/index.d.ts.map +1 -0
  109. package/dist/inventory/tvl/query.d.ts +36 -0
  110. package/dist/inventory/tvl/query.d.ts.map +1 -0
  111. package/dist/inventory/tvl/query.js +21 -0
  112. package/dist/inventory/tvl/query.js.map +1 -0
  113. package/dist/inventory/tvl-history/get-inventory-tvl-history.d.ts +44 -0
  114. package/dist/inventory/tvl-history/get-inventory-tvl-history.d.ts.map +1 -0
  115. package/dist/inventory/tvl-history/get-inventory-tvl-history.js +21 -0
  116. package/dist/inventory/tvl-history/get-inventory-tvl-history.js.map +1 -0
  117. package/dist/inventory/tvl-history/index.d.ts +4 -0
  118. package/dist/inventory/tvl-history/index.d.ts.map +1 -0
  119. package/dist/inventory/tvl-history/query.d.ts +36 -0
  120. package/dist/inventory/tvl-history/query.d.ts.map +1 -0
  121. package/dist/inventory/tvl-history/query.js +24 -0
  122. package/dist/inventory/tvl-history/query.js.map +1 -0
  123. package/dist/inventory/tvl-history/to-inventory-tvl-point.d.ts +16 -0
  124. package/dist/inventory/tvl-history/to-inventory-tvl-point.d.ts.map +1 -0
  125. package/dist/inventory/tvl-history/to-inventory-tvl-point.js +12 -0
  126. package/dist/inventory/tvl-history/to-inventory-tvl-point.js.map +1 -0
  127. package/dist/inventory/types/generated/inventory-service.d.ts +769 -0
  128. package/dist/inventory/types/generated/inventory-service.d.ts.map +1 -0
  129. package/dist/inventory/types/generated/inventory-service.js +7 -0
  130. package/dist/inventory/types/generated/inventory-service.js.map +1 -0
  131. package/dist/inventory/types.d.ts +29 -0
  132. package/dist/inventory/types.d.ts.map +1 -0
  133. package/dist/inventory/types.js +6 -0
  134. package/dist/inventory/types.js.map +1 -0
  135. package/dist/margin/calculate-margin-risk.d.ts +108 -0
  136. package/dist/margin/calculate-margin-risk.d.ts.map +1 -0
  137. package/dist/margin/calculate-margin-risk.js +18 -0
  138. package/dist/margin/calculate-margin-risk.js.map +1 -0
  139. package/dist/margin/index.d.ts +2 -0
  140. package/dist/margin/index.d.ts.map +1 -0
  141. package/dist/muon/client.d.ts +29 -0
  142. package/dist/muon/client.d.ts.map +1 -1
  143. package/dist/muon/client.js +20 -6
  144. package/dist/muon/client.js.map +1 -1
  145. package/dist/muon/deallocate-upnl-sig/get-deallocate-upnl-sig.d.ts.map +1 -1
  146. package/dist/muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js +10 -20
  147. package/dist/muon/deallocate-upnl-sig/get-deallocate-upnl-sig.js.map +1 -1
  148. package/dist/muon/force-close-price-sig/get-force-close-price-sig.d.ts +58 -0
  149. package/dist/muon/force-close-price-sig/get-force-close-price-sig.d.ts.map +1 -0
  150. package/dist/muon/force-close-price-sig/get-force-close-price-sig.js +34 -0
  151. package/dist/muon/force-close-price-sig/get-force-close-price-sig.js.map +1 -0
  152. package/dist/muon/force-close-price-sig/index.d.ts +3 -0
  153. package/dist/muon/force-close-price-sig/index.d.ts.map +1 -0
  154. package/dist/muon/force-close-price-sig/query.d.ts +50 -0
  155. package/dist/muon/force-close-price-sig/query.d.ts.map +1 -0
  156. package/dist/muon/force-close-price-sig/query.js +28 -0
  157. package/dist/muon/force-close-price-sig/query.js.map +1 -0
  158. package/dist/muon/index.d.ts +2 -0
  159. package/dist/muon/index.d.ts.map +1 -1
  160. package/dist/muon/party-a-overview/get-muon-party-a-overview.d.ts +1 -1
  161. package/dist/muon/party-a-overview/get-muon-party-a-overview.js.map +1 -1
  162. package/dist/muon/send-quote-upnl-sig/get-send-quote-upnl-sig.d.ts +53 -0
  163. package/dist/muon/send-quote-upnl-sig/get-send-quote-upnl-sig.d.ts.map +1 -0
  164. package/dist/muon/send-quote-upnl-sig/get-send-quote-upnl-sig.js +23 -0
  165. package/dist/muon/send-quote-upnl-sig/get-send-quote-upnl-sig.js.map +1 -0
  166. package/dist/muon/send-quote-upnl-sig/index.d.ts +3 -0
  167. package/dist/muon/send-quote-upnl-sig/index.d.ts.map +1 -0
  168. package/dist/muon/send-quote-upnl-sig/query.d.ts +42 -0
  169. package/dist/muon/send-quote-upnl-sig/query.d.ts.map +1 -0
  170. package/dist/muon/send-quote-upnl-sig/query.js +25 -0
  171. package/dist/muon/send-quote-upnl-sig/query.js.map +1 -0
  172. package/dist/muon/types.d.ts +2 -2
  173. package/dist/muon/types.js.map +1 -1
  174. package/dist/muon/upnl-a/get-muon-upnl-a.d.ts +1 -1
  175. package/dist/muon/upnl-a/get-muon-upnl-a.js.map +1 -1
  176. package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.d.ts +1 -1
  177. package/dist/muon/upnl-a-with-symbol-price/get-muon-upnl-a-with-symbol-price.js.map +1 -1
  178. package/dist/muon/upnl-b/get-muon-upnl-b.d.ts +1 -1
  179. package/dist/muon/upnl-b/get-muon-upnl-b.js.map +1 -1
  180. package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.d.ts +1 -1
  181. package/dist/muon/upnl-with-symbol-price/get-muon-upnl-with-symbol-price.js.map +1 -1
  182. package/dist/notifications/search/adapters/enigma-search.d.ts +14 -0
  183. package/dist/notifications/search/adapters/enigma-search.d.ts.map +1 -0
  184. package/dist/notifications/search/adapters/enigma-search.js +33 -0
  185. package/dist/notifications/search/adapters/enigma-search.js.map +1 -0
  186. package/dist/notifications/search/adapters/rasa-search.d.ts +13 -0
  187. package/dist/notifications/search/adapters/rasa-search.d.ts.map +1 -0
  188. package/dist/notifications/search/adapters/rasa-search.js +28 -0
  189. package/dist/notifications/search/adapters/rasa-search.js.map +1 -0
  190. package/dist/notifications/search/query.d.ts +4 -2
  191. package/dist/notifications/search/query.d.ts.map +1 -1
  192. package/dist/notifications/search/query.js +8 -4
  193. package/dist/notifications/search/query.js.map +1 -1
  194. package/dist/notifications/search/search-notifications.d.ts +23 -43
  195. package/dist/notifications/search/search-notifications.d.ts.map +1 -1
  196. package/dist/notifications/search/search-notifications.js +11 -22
  197. package/dist/notifications/search/search-notifications.js.map +1 -1
  198. package/dist/notifications/search/types.d.ts +80 -0
  199. package/dist/notifications/search/types.d.ts.map +1 -0
  200. package/dist/notifications/types.d.ts +0 -11
  201. package/dist/notifications/types.d.ts.map +1 -1
  202. package/dist/orderbook/aggregate.d.ts +80 -0
  203. package/dist/orderbook/aggregate.d.ts.map +1 -0
  204. package/dist/orderbook/aggregate.js +74 -0
  205. package/dist/orderbook/aggregate.js.map +1 -0
  206. package/dist/orderbook/index.d.ts +7 -0
  207. package/dist/orderbook/index.d.ts.map +1 -0
  208. package/dist/orderbook/query.d.ts +55 -0
  209. package/dist/orderbook/query.d.ts.map +1 -0
  210. package/dist/orderbook/query.js +25 -0
  211. package/dist/orderbook/query.js.map +1 -0
  212. package/dist/orderbook/sources/binance/constants.d.ts +78 -0
  213. package/dist/orderbook/sources/binance/constants.d.ts.map +1 -0
  214. package/dist/orderbook/sources/binance/constants.js +51 -0
  215. package/dist/orderbook/sources/binance/constants.js.map +1 -0
  216. package/dist/orderbook/sources/binance/create-binance-orderbook-source.d.ts +78 -0
  217. package/dist/orderbook/sources/binance/create-binance-orderbook-source.d.ts.map +1 -0
  218. package/dist/orderbook/sources/binance/create-binance-orderbook-source.js +87 -0
  219. package/dist/orderbook/sources/binance/create-binance-orderbook-source.js.map +1 -0
  220. package/dist/orderbook/sources/binance/fetch-binance-depth.d.ts +45 -0
  221. package/dist/orderbook/sources/binance/fetch-binance-depth.d.ts.map +1 -0
  222. package/dist/orderbook/sources/binance/fetch-binance-depth.js +34 -0
  223. package/dist/orderbook/sources/binance/fetch-binance-depth.js.map +1 -0
  224. package/dist/orderbook/sources/binance/fetch-binance-symbol-filters.d.ts +39 -0
  225. package/dist/orderbook/sources/binance/fetch-binance-symbol-filters.d.ts.map +1 -0
  226. package/dist/orderbook/sources/binance/fetch-binance-symbol-filters.js +39 -0
  227. package/dist/orderbook/sources/binance/fetch-binance-symbol-filters.js.map +1 -0
  228. package/dist/orderbook/sources/binance/index.d.ts +7 -0
  229. package/dist/orderbook/sources/binance/index.d.ts.map +1 -0
  230. package/dist/orderbook/sources/binance/parse-depth.d.ts +70 -0
  231. package/dist/orderbook/sources/binance/parse-depth.d.ts.map +1 -0
  232. package/dist/orderbook/sources/binance/parse-depth.js +23 -0
  233. package/dist/orderbook/sources/binance/parse-depth.js.map +1 -0
  234. package/dist/orderbook/sources/binance/watch-binance-depth.d.ts +78 -0
  235. package/dist/orderbook/sources/binance/watch-binance-depth.d.ts.map +1 -0
  236. package/dist/orderbook/sources/binance/watch-binance-depth.js +125 -0
  237. package/dist/orderbook/sources/binance/watch-binance-depth.js.map +1 -0
  238. package/dist/orderbook/tick-size.d.ts +79 -0
  239. package/dist/orderbook/tick-size.d.ts.map +1 -0
  240. package/dist/orderbook/tick-size.js +46 -0
  241. package/dist/orderbook/tick-size.js.map +1 -0
  242. package/dist/orderbook/types.d.ts +299 -0
  243. package/dist/orderbook/types.d.ts.map +1 -0
  244. package/dist/orderbook/walk.d.ts +31 -0
  245. package/dist/orderbook/walk.d.ts.map +1 -0
  246. package/dist/orderbook/walk.js +39 -0
  247. package/dist/orderbook/walk.js.map +1 -0
  248. package/dist/pools/add-market/add-market.d.ts +74 -0
  249. package/dist/pools/add-market/add-market.d.ts.map +1 -0
  250. package/dist/pools/add-market/add-market.js +25 -0
  251. package/dist/pools/add-market/add-market.js.map +1 -0
  252. package/dist/pools/add-market/index.d.ts +6 -0
  253. package/dist/pools/add-market/index.d.ts.map +1 -0
  254. package/dist/pools/add-market/query.d.ts +27 -0
  255. package/dist/pools/add-market/query.d.ts.map +1 -0
  256. package/dist/pools/add-market/query.js +12 -0
  257. package/dist/pools/add-market/query.js.map +1 -0
  258. package/dist/pools/add-market/to-add-market-request.d.ts +16 -0
  259. package/dist/pools/add-market/to-add-market-request.d.ts.map +1 -0
  260. package/dist/pools/add-market/to-add-market-request.js +14 -0
  261. package/dist/pools/add-market/to-add-market-request.js.map +1 -0
  262. package/dist/pools/add-market/to-created-pool.d.ts +16 -0
  263. package/dist/pools/add-market/to-created-pool.d.ts.map +1 -0
  264. package/dist/pools/add-market/to-created-pool.js +20 -0
  265. package/dist/pools/add-market/to-created-pool.js.map +1 -0
  266. package/dist/pools/add-market/types.d.ts +42 -0
  267. package/dist/pools/add-market/types.d.ts.map +1 -0
  268. package/dist/pools/auth/authenticate-listing.d.ts +47 -0
  269. package/dist/pools/auth/authenticate-listing.d.ts.map +1 -0
  270. package/dist/pools/auth/authenticate-listing.js +37 -0
  271. package/dist/pools/auth/authenticate-listing.js.map +1 -0
  272. package/dist/pools/auth/get-sign-in-message.d.ts +45 -0
  273. package/dist/pools/auth/get-sign-in-message.d.ts.map +1 -0
  274. package/dist/pools/auth/get-sign-in-message.js +26 -0
  275. package/dist/pools/auth/get-sign-in-message.js.map +1 -0
  276. package/dist/pools/auth/index.d.ts +6 -0
  277. package/dist/pools/auth/index.d.ts.map +1 -0
  278. package/dist/pools/auth/query.d.ts +21 -0
  279. package/dist/pools/auth/query.d.ts.map +1 -0
  280. package/dist/pools/auth/query.js +12 -0
  281. package/dist/pools/auth/query.js.map +1 -0
  282. package/dist/pools/auth/to-siwe.d.ts +27 -0
  283. package/dist/pools/auth/to-siwe.d.ts.map +1 -0
  284. package/dist/pools/auth/to-siwe.js +38 -0
  285. package/dist/pools/auth/to-siwe.js.map +1 -0
  286. package/dist/pools/auth/types.d.ts +46 -0
  287. package/dist/pools/auth/types.d.ts.map +1 -0
  288. package/dist/pools/cancel-withdraw/cancel-withdraw.d.ts +56 -0
  289. package/dist/pools/cancel-withdraw/cancel-withdraw.d.ts.map +1 -0
  290. package/dist/pools/cancel-withdraw/cancel-withdraw.js +24 -0
  291. package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -0
  292. package/dist/pools/cancel-withdraw/index.d.ts +4 -0
  293. package/dist/pools/cancel-withdraw/index.d.ts.map +1 -0
  294. package/dist/pools/cancel-withdraw/query.d.ts +21 -0
  295. package/dist/pools/cancel-withdraw/query.d.ts.map +1 -0
  296. package/dist/pools/cancel-withdraw/query.js +12 -0
  297. package/dist/pools/cancel-withdraw/query.js.map +1 -0
  298. package/dist/pools/cancel-withdraw/to-cancel-withdraw-result.d.ts +15 -0
  299. package/dist/pools/cancel-withdraw/to-cancel-withdraw-result.d.ts.map +1 -0
  300. package/dist/pools/cancel-withdraw/to-cancel-withdraw-result.js +11 -0
  301. package/dist/pools/cancel-withdraw/to-cancel-withdraw-result.js.map +1 -0
  302. package/dist/pools/claim/claim-profit.d.ts +78 -0
  303. package/dist/pools/claim/claim-profit.d.ts.map +1 -0
  304. package/dist/pools/claim/claim-profit.js +25 -0
  305. package/dist/pools/claim/claim-profit.js.map +1 -0
  306. package/dist/pools/claim/index.d.ts +5 -0
  307. package/dist/pools/claim/index.d.ts.map +1 -0
  308. package/dist/pools/claim/query.d.ts +27 -0
  309. package/dist/pools/claim/query.d.ts.map +1 -0
  310. package/dist/pools/claim/query.js +12 -0
  311. package/dist/pools/claim/query.js.map +1 -0
  312. package/dist/pools/claim/to-claim-request.d.ts +15 -0
  313. package/dist/pools/claim/to-claim-request.d.ts.map +1 -0
  314. package/dist/pools/claim/to-claim-request.js +13 -0
  315. package/dist/pools/claim/to-claim-request.js.map +1 -0
  316. package/dist/pools/claim/to-claim-result.d.ts +17 -0
  317. package/dist/pools/claim/to-claim-result.d.ts.map +1 -0
  318. package/dist/pools/claim/to-claim-result.js +14 -0
  319. package/dist/pools/claim/to-claim-result.js.map +1 -0
  320. package/dist/pools/claim-history/get-claim-history.d.ts +65 -0
  321. package/dist/pools/claim-history/get-claim-history.d.ts.map +1 -0
  322. package/dist/pools/claim-history/get-claim-history.js +27 -0
  323. package/dist/pools/claim-history/get-claim-history.js.map +1 -0
  324. package/dist/pools/claim-history/index.d.ts +4 -0
  325. package/dist/pools/claim-history/index.d.ts.map +1 -0
  326. package/dist/pools/claim-history/query.d.ts +40 -0
  327. package/dist/pools/claim-history/query.d.ts.map +1 -0
  328. package/dist/pools/claim-history/query.js +28 -0
  329. package/dist/pools/claim-history/query.js.map +1 -0
  330. package/dist/pools/claim-history/to-pool-claim.d.ts +23 -0
  331. package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -0
  332. package/dist/pools/claim-history/to-pool-claim.js +21 -0
  333. package/dist/pools/claim-history/to-pool-claim.js.map +1 -0
  334. package/dist/pools/deposit-address/get-deposit-address.d.ts +62 -0
  335. package/dist/pools/deposit-address/get-deposit-address.d.ts.map +1 -0
  336. package/dist/pools/deposit-address/get-deposit-address.js +27 -0
  337. package/dist/pools/deposit-address/get-deposit-address.js.map +1 -0
  338. package/dist/pools/deposit-address/index.d.ts +4 -0
  339. package/dist/pools/deposit-address/index.d.ts.map +1 -0
  340. package/dist/pools/deposit-address/query.d.ts +50 -0
  341. package/dist/pools/deposit-address/query.d.ts.map +1 -0
  342. package/dist/pools/deposit-address/query.js +26 -0
  343. package/dist/pools/deposit-address/query.js.map +1 -0
  344. package/dist/pools/deposit-address/to-market-deposit-address.d.ts +17 -0
  345. package/dist/pools/deposit-address/to-market-deposit-address.d.ts.map +1 -0
  346. package/dist/pools/deposit-address/to-market-deposit-address.js +15 -0
  347. package/dist/pools/deposit-address/to-market-deposit-address.js.map +1 -0
  348. package/dist/pools/index.d.ts +26 -0
  349. package/dist/pools/index.d.ts.map +1 -0
  350. package/dist/pools/listing-config/get-listing-config.d.ts +37 -0
  351. package/dist/pools/listing-config/get-listing-config.d.ts.map +1 -0
  352. package/dist/pools/listing-config/get-listing-config.js +21 -0
  353. package/dist/pools/listing-config/get-listing-config.js.map +1 -0
  354. package/dist/pools/listing-config/index.d.ts +4 -0
  355. package/dist/pools/listing-config/index.d.ts.map +1 -0
  356. package/dist/pools/listing-config/query.d.ts +36 -0
  357. package/dist/pools/listing-config/query.d.ts.map +1 -0
  358. package/dist/pools/listing-config/query.js +21 -0
  359. package/dist/pools/listing-config/query.js.map +1 -0
  360. package/dist/pools/listing-config/to-listing-config.d.ts +16 -0
  361. package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -0
  362. package/dist/pools/listing-config/to-listing-config.js +26 -0
  363. package/dist/pools/listing-config/to-listing-config.js.map +1 -0
  364. package/dist/pools/listing-status/get-listing-status.d.ts +54 -0
  365. package/dist/pools/listing-status/get-listing-status.d.ts.map +1 -0
  366. package/dist/pools/listing-status/get-listing-status.js +24 -0
  367. package/dist/pools/listing-status/get-listing-status.js.map +1 -0
  368. package/dist/pools/listing-status/index.d.ts +4 -0
  369. package/dist/pools/listing-status/index.d.ts.map +1 -0
  370. package/dist/pools/listing-status/query.d.ts +43 -0
  371. package/dist/pools/listing-status/query.d.ts.map +1 -0
  372. package/dist/pools/listing-status/query.js +25 -0
  373. package/dist/pools/listing-status/query.js.map +1 -0
  374. package/dist/pools/listing-status/to-listing-status.d.ts +17 -0
  375. package/dist/pools/listing-status/to-listing-status.d.ts.map +1 -0
  376. package/dist/pools/listing-status/to-listing-status.js +16 -0
  377. package/dist/pools/listing-status/to-listing-status.js.map +1 -0
  378. package/dist/pools/market-config/get-listing-market-config.d.ts +72 -0
  379. package/dist/pools/market-config/get-listing-market-config.d.ts.map +1 -0
  380. package/dist/pools/market-config/get-listing-market-config.js +27 -0
  381. package/dist/pools/market-config/get-listing-market-config.js.map +1 -0
  382. package/dist/pools/market-config/index.d.ts +8 -0
  383. package/dist/pools/market-config/index.d.ts.map +1 -0
  384. package/dist/pools/market-config/project-listing-market-config.d.ts +45 -0
  385. package/dist/pools/market-config/project-listing-market-config.d.ts.map +1 -0
  386. package/dist/pools/market-config/project-listing-market-config.js +20 -0
  387. package/dist/pools/market-config/project-listing-market-config.js.map +1 -0
  388. package/dist/pools/market-config/query.d.ts +73 -0
  389. package/dist/pools/market-config/query.d.ts.map +1 -0
  390. package/dist/pools/market-config/query.js +33 -0
  391. package/dist/pools/market-config/query.js.map +1 -0
  392. package/dist/pools/market-config/to-listing-market-config.d.ts +18 -0
  393. package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -0
  394. package/dist/pools/market-config/to-listing-market-config.js +15 -0
  395. package/dist/pools/market-config/to-listing-market-config.js.map +1 -0
  396. package/dist/pools/market-config/to-update-listing-market-config-request.d.ts +20 -0
  397. package/dist/pools/market-config/to-update-listing-market-config-request.d.ts.map +1 -0
  398. package/dist/pools/market-config/to-update-listing-market-config-request.js +13 -0
  399. package/dist/pools/market-config/to-update-listing-market-config-request.js.map +1 -0
  400. package/dist/pools/market-config/types.d.ts +135 -0
  401. package/dist/pools/market-config/types.d.ts.map +1 -0
  402. package/dist/pools/market-config/types.js +15 -0
  403. package/dist/pools/market-config/types.js.map +1 -0
  404. package/dist/pools/market-config/update-listing-market-config.d.ts +103 -0
  405. package/dist/pools/market-config/update-listing-market-config.d.ts.map +1 -0
  406. package/dist/pools/market-config/update-listing-market-config.js +32 -0
  407. package/dist/pools/market-config/update-listing-market-config.js.map +1 -0
  408. package/dist/pools/market-detail/get-listing-market-detail.d.ts +51 -0
  409. package/dist/pools/market-detail/get-listing-market-detail.d.ts.map +1 -0
  410. package/dist/pools/market-detail/get-listing-market-detail.js +24 -0
  411. package/dist/pools/market-detail/get-listing-market-detail.js.map +1 -0
  412. package/dist/pools/market-detail/index.d.ts +5 -0
  413. package/dist/pools/market-detail/index.d.ts.map +1 -0
  414. package/dist/pools/market-detail/query.d.ts +31 -0
  415. package/dist/pools/market-detail/query.d.ts.map +1 -0
  416. package/dist/pools/market-detail/query.js +25 -0
  417. package/dist/pools/market-detail/query.js.map +1 -0
  418. package/dist/pools/market-detail/to-listing-market-detail.d.ts +11 -0
  419. package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -0
  420. package/dist/pools/market-detail/to-listing-market-detail.js +57 -0
  421. package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -0
  422. package/dist/pools/market-detail/to-pool-positions.d.ts +23 -0
  423. package/dist/pools/market-detail/to-pool-positions.d.ts.map +1 -0
  424. package/dist/pools/market-detail/to-pool-positions.js +8 -0
  425. package/dist/pools/market-detail/to-pool-positions.js.map +1 -0
  426. package/dist/pools/markets/get-listing-markets.d.ts +65 -0
  427. package/dist/pools/markets/get-listing-markets.d.ts.map +1 -0
  428. package/dist/pools/markets/get-listing-markets.js +34 -0
  429. package/dist/pools/markets/get-listing-markets.js.map +1 -0
  430. package/dist/pools/markets/index.d.ts +5 -0
  431. package/dist/pools/markets/index.d.ts.map +1 -0
  432. package/dist/pools/markets/query.d.ts +36 -0
  433. package/dist/pools/markets/query.d.ts.map +1 -0
  434. package/dist/pools/markets/query.js +31 -0
  435. package/dist/pools/markets/query.js.map +1 -0
  436. package/dist/pools/markets/to-listing-market.d.ts +65 -0
  437. package/dist/pools/markets/to-listing-market.d.ts.map +1 -0
  438. package/dist/pools/markets/to-listing-market.js +76 -0
  439. package/dist/pools/markets/to-listing-market.js.map +1 -0
  440. package/dist/pools/markets/to-search-params.d.ts +36 -0
  441. package/dist/pools/markets/to-search-params.d.ts.map +1 -0
  442. package/dist/pools/markets/to-search-params.js +42 -0
  443. package/dist/pools/markets/to-search-params.js.map +1 -0
  444. package/dist/pools/profit/get-user-profit.d.ts +54 -0
  445. package/dist/pools/profit/get-user-profit.d.ts.map +1 -0
  446. package/dist/pools/profit/get-user-profit.js +24 -0
  447. package/dist/pools/profit/get-user-profit.js.map +1 -0
  448. package/dist/pools/profit/index.d.ts +4 -0
  449. package/dist/pools/profit/index.d.ts.map +1 -0
  450. package/dist/pools/profit/query.d.ts +41 -0
  451. package/dist/pools/profit/query.d.ts.map +1 -0
  452. package/dist/pools/profit/query.js +25 -0
  453. package/dist/pools/profit/query.js.map +1 -0
  454. package/dist/pools/profit/to-user-pool-profit.d.ts +27 -0
  455. package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -0
  456. package/dist/pools/profit/to-user-pool-profit.js +19 -0
  457. package/dist/pools/profit/to-user-pool-profit.js.map +1 -0
  458. package/dist/pools/quotes/get-pool-quotes.d.ts +72 -0
  459. package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -0
  460. package/dist/pools/quotes/get-pool-quotes.js +25 -0
  461. package/dist/pools/quotes/get-pool-quotes.js.map +1 -0
  462. package/dist/pools/quotes/index.d.ts +4 -0
  463. package/dist/pools/quotes/index.d.ts.map +1 -0
  464. package/dist/pools/quotes/query-document.d.ts +20 -0
  465. package/dist/pools/quotes/query-document.d.ts.map +1 -0
  466. package/dist/pools/quotes/query-document.js +7 -0
  467. package/dist/pools/quotes/query-document.js.map +1 -0
  468. package/dist/pools/quotes/query.d.ts +34 -0
  469. package/dist/pools/quotes/query.d.ts.map +1 -0
  470. package/dist/pools/quotes/query.js +28 -0
  471. package/dist/pools/quotes/query.js.map +1 -0
  472. package/dist/pools/quotes/to-pool-quote.d.ts +16 -0
  473. package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -0
  474. package/dist/pools/quotes/to-pool-quote.js +42 -0
  475. package/dist/pools/quotes/to-pool-quote.js.map +1 -0
  476. package/dist/pools/refund/index.d.ts +5 -0
  477. package/dist/pools/refund/index.d.ts.map +1 -0
  478. package/dist/pools/refund/query.d.ts +25 -0
  479. package/dist/pools/refund/query.d.ts.map +1 -0
  480. package/dist/pools/refund/query.js +12 -0
  481. package/dist/pools/refund/query.js.map +1 -0
  482. package/dist/pools/refund/refund-market.d.ts +67 -0
  483. package/dist/pools/refund/refund-market.d.ts.map +1 -0
  484. package/dist/pools/refund/refund-market.js +25 -0
  485. package/dist/pools/refund/refund-market.js.map +1 -0
  486. package/dist/pools/refund/to-refund-request.d.ts +13 -0
  487. package/dist/pools/refund/to-refund-request.d.ts.map +1 -0
  488. package/dist/pools/refund/to-refund-request.js +12 -0
  489. package/dist/pools/refund/to-refund-request.js.map +1 -0
  490. package/dist/pools/refund/to-refund-result.d.ts +10 -0
  491. package/dist/pools/refund/to-refund-result.d.ts.map +1 -0
  492. package/dist/pools/refund/to-refund-result.js +8 -0
  493. package/dist/pools/refund/to-refund-result.js.map +1 -0
  494. package/dist/pools/resolve-listing.d.ts +46 -0
  495. package/dist/pools/resolve-listing.d.ts.map +1 -0
  496. package/dist/pools/resolve-listing.js +18 -0
  497. package/dist/pools/resolve-listing.js.map +1 -0
  498. package/dist/pools/resolve-pool-source.d.ts +18 -0
  499. package/dist/pools/resolve-pool-source.d.ts.map +1 -0
  500. package/dist/pools/resolve-pool-source.js +8 -0
  501. package/dist/pools/resolve-pool-source.js.map +1 -0
  502. package/dist/pools/retry-listing/get-retry-listing-info.d.ts +51 -0
  503. package/dist/pools/retry-listing/get-retry-listing-info.d.ts.map +1 -0
  504. package/dist/pools/retry-listing/get-retry-listing-info.js +27 -0
  505. package/dist/pools/retry-listing/get-retry-listing-info.js.map +1 -0
  506. package/dist/pools/retry-listing/index.d.ts +6 -0
  507. package/dist/pools/retry-listing/index.d.ts.map +1 -0
  508. package/dist/pools/retry-listing/query.d.ts +44 -0
  509. package/dist/pools/retry-listing/query.d.ts.map +1 -0
  510. package/dist/pools/retry-listing/query.js +33 -0
  511. package/dist/pools/retry-listing/query.js.map +1 -0
  512. package/dist/pools/retry-listing/retry-listing.d.ts +52 -0
  513. package/dist/pools/retry-listing/retry-listing.d.ts.map +1 -0
  514. package/dist/pools/retry-listing/retry-listing.js +27 -0
  515. package/dist/pools/retry-listing/retry-listing.js.map +1 -0
  516. package/dist/pools/retry-listing/to-retry-listing-info.d.ts +14 -0
  517. package/dist/pools/retry-listing/to-retry-listing-info.d.ts.map +1 -0
  518. package/dist/pools/retry-listing/to-retry-listing-info.js +12 -0
  519. package/dist/pools/retry-listing/to-retry-listing-info.js.map +1 -0
  520. package/dist/pools/retry-listing/to-retry-listing-result.d.ts +11 -0
  521. package/dist/pools/retry-listing/to-retry-listing-result.d.ts.map +1 -0
  522. package/dist/pools/retry-listing/to-retry-listing-result.js +12 -0
  523. package/dist/pools/retry-listing/to-retry-listing-result.js.map +1 -0
  524. package/dist/pools/rewards/get-pool-reward-chart.d.ts +49 -0
  525. package/dist/pools/rewards/get-pool-reward-chart.d.ts.map +1 -0
  526. package/dist/pools/rewards/get-pool-reward-chart.js +24 -0
  527. package/dist/pools/rewards/get-pool-reward-chart.js.map +1 -0
  528. package/dist/pools/rewards/get-pool-total-reward.d.ts +48 -0
  529. package/dist/pools/rewards/get-pool-total-reward.d.ts.map +1 -0
  530. package/dist/pools/rewards/get-pool-total-reward.js +25 -0
  531. package/dist/pools/rewards/get-pool-total-reward.js.map +1 -0
  532. package/dist/pools/rewards/get-user-reward-chart.d.ts +48 -0
  533. package/dist/pools/rewards/get-user-reward-chart.d.ts.map +1 -0
  534. package/dist/pools/rewards/get-user-reward-chart.js +24 -0
  535. package/dist/pools/rewards/get-user-reward-chart.js.map +1 -0
  536. package/dist/pools/rewards/get-user-total-reward.d.ts +54 -0
  537. package/dist/pools/rewards/get-user-total-reward.d.ts.map +1 -0
  538. package/dist/pools/rewards/get-user-total-reward.js +27 -0
  539. package/dist/pools/rewards/get-user-total-reward.js.map +1 -0
  540. package/dist/pools/rewards/index.d.ts +7 -0
  541. package/dist/pools/rewards/index.d.ts.map +1 -0
  542. package/dist/pools/rewards/query.d.ts +150 -0
  543. package/dist/pools/rewards/query.d.ts.map +1 -0
  544. package/dist/pools/rewards/query.js +83 -0
  545. package/dist/pools/rewards/query.js.map +1 -0
  546. package/dist/pools/rewards/to-pool-reward-point.d.ts +28 -0
  547. package/dist/pools/rewards/to-pool-reward-point.d.ts.map +1 -0
  548. package/dist/pools/rewards/to-pool-reward-point.js +19 -0
  549. package/dist/pools/rewards/to-pool-reward-point.js.map +1 -0
  550. package/dist/pools/trade-history/get-pool-trade-history.d.ts +52 -0
  551. package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -0
  552. package/dist/pools/trade-history/get-pool-trade-history.js +27 -0
  553. package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -0
  554. package/dist/pools/trade-history/index.d.ts +3 -0
  555. package/dist/pools/trade-history/index.d.ts.map +1 -0
  556. package/dist/pools/trade-history/query-document.d.ts +20 -0
  557. package/dist/pools/trade-history/query-document.d.ts.map +1 -0
  558. package/dist/pools/trade-history/query-document.js +7 -0
  559. package/dist/pools/trade-history/query-document.js.map +1 -0
  560. package/dist/pools/trade-history/query.d.ts +34 -0
  561. package/dist/pools/trade-history/query.d.ts.map +1 -0
  562. package/dist/pools/trade-history/query.js +28 -0
  563. package/dist/pools/trade-history/query.js.map +1 -0
  564. package/dist/pools/transactions/get-pool-transactions.d.ts +47 -0
  565. package/dist/pools/transactions/get-pool-transactions.d.ts.map +1 -0
  566. package/dist/pools/transactions/get-pool-transactions.js +24 -0
  567. package/dist/pools/transactions/get-pool-transactions.js.map +1 -0
  568. package/dist/pools/transactions/index.d.ts +4 -0
  569. package/dist/pools/transactions/index.d.ts.map +1 -0
  570. package/dist/pools/transactions/query.d.ts +31 -0
  571. package/dist/pools/transactions/query.d.ts.map +1 -0
  572. package/dist/pools/transactions/query.js +27 -0
  573. package/dist/pools/transactions/query.js.map +1 -0
  574. package/dist/pools/transactions/to-pool-transaction.d.ts +18 -0
  575. package/dist/pools/transactions/to-pool-transaction.d.ts.map +1 -0
  576. package/dist/pools/transactions/to-pool-transaction.js +29 -0
  577. package/dist/pools/transactions/to-pool-transaction.js.map +1 -0
  578. package/dist/pools/types/generated/listing-backend.d.ts +1319 -0
  579. package/dist/pools/types/generated/listing-backend.d.ts.map +1 -0
  580. package/dist/pools/types/generated/listing-backend.js +85 -0
  581. package/dist/pools/types/generated/listing-backend.js.map +1 -0
  582. package/dist/pools/types.d.ts +789 -0
  583. package/dist/pools/types.d.ts.map +1 -0
  584. package/dist/pools/types.js +16 -0
  585. package/dist/pools/types.js.map +1 -0
  586. package/dist/pools/user-markets/get-user-listing-markets.d.ts +74 -0
  587. package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -0
  588. package/dist/pools/user-markets/get-user-listing-markets.js +35 -0
  589. package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -0
  590. package/dist/pools/user-markets/index.d.ts +4 -0
  591. package/dist/pools/user-markets/index.d.ts.map +1 -0
  592. package/dist/pools/user-markets/query.d.ts +41 -0
  593. package/dist/pools/user-markets/query.d.ts.map +1 -0
  594. package/dist/pools/user-markets/query.js +32 -0
  595. package/dist/pools/user-markets/query.js.map +1 -0
  596. package/dist/pools/user-markets/to-user-listing-market.d.ts +32 -0
  597. package/dist/pools/user-markets/to-user-listing-market.d.ts.map +1 -0
  598. package/dist/pools/user-markets/to-user-listing-market.js +22 -0
  599. package/dist/pools/user-markets/to-user-listing-market.js.map +1 -0
  600. package/dist/pools/user-transactions/get-user-transactions.d.ts +59 -0
  601. package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -0
  602. package/dist/pools/user-transactions/get-user-transactions.js +28 -0
  603. package/dist/pools/user-transactions/get-user-transactions.js.map +1 -0
  604. package/dist/pools/user-transactions/index.d.ts +4 -0
  605. package/dist/pools/user-transactions/index.d.ts.map +1 -0
  606. package/dist/pools/user-transactions/query.d.ts +40 -0
  607. package/dist/pools/user-transactions/query.d.ts.map +1 -0
  608. package/dist/pools/user-transactions/query.js +29 -0
  609. package/dist/pools/user-transactions/query.js.map +1 -0
  610. package/dist/pools/user-transactions/to-user-transaction.d.ts +25 -0
  611. package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -0
  612. package/dist/pools/user-transactions/to-user-transaction.js +29 -0
  613. package/dist/pools/user-transactions/to-user-transaction.js.map +1 -0
  614. package/dist/pools/weekly-limit/get-weekly-listing-limit.d.ts +36 -0
  615. package/dist/pools/weekly-limit/get-weekly-listing-limit.d.ts.map +1 -0
  616. package/dist/pools/weekly-limit/get-weekly-listing-limit.js +21 -0
  617. package/dist/pools/weekly-limit/get-weekly-listing-limit.js.map +1 -0
  618. package/dist/pools/weekly-limit/index.d.ts +4 -0
  619. package/dist/pools/weekly-limit/index.d.ts.map +1 -0
  620. package/dist/pools/weekly-limit/query.d.ts +36 -0
  621. package/dist/pools/weekly-limit/query.d.ts.map +1 -0
  622. package/dist/pools/weekly-limit/query.js +21 -0
  623. package/dist/pools/weekly-limit/query.js.map +1 -0
  624. package/dist/pools/weekly-limit/to-weekly-limit.d.ts +14 -0
  625. package/dist/pools/weekly-limit/to-weekly-limit.d.ts.map +1 -0
  626. package/dist/pools/weekly-limit/to-weekly-limit.js +12 -0
  627. package/dist/pools/weekly-limit/to-weekly-limit.js.map +1 -0
  628. package/dist/pools/withdraw/index.d.ts +4 -0
  629. package/dist/pools/withdraw/index.d.ts.map +1 -0
  630. package/dist/pools/withdraw/query.d.ts +26 -0
  631. package/dist/pools/withdraw/query.d.ts.map +1 -0
  632. package/dist/pools/withdraw/query.js +12 -0
  633. package/dist/pools/withdraw/query.js.map +1 -0
  634. package/dist/pools/withdraw/to-withdraw-request.d.ts +16 -0
  635. package/dist/pools/withdraw/to-withdraw-request.d.ts.map +1 -0
  636. package/dist/pools/withdraw/to-withdraw-request.js +13 -0
  637. package/dist/pools/withdraw/to-withdraw-request.js.map +1 -0
  638. package/dist/pools/withdraw/withdraw-lp.d.ts +73 -0
  639. package/dist/pools/withdraw/withdraw-lp.d.ts.map +1 -0
  640. package/dist/pools/withdraw/withdraw-lp.js +24 -0
  641. package/dist/pools/withdraw/withdraw-lp.js.map +1 -0
  642. package/dist/price-service/adapters/binance-mark-prices.d.ts +41 -0
  643. package/dist/price-service/adapters/binance-mark-prices.d.ts.map +1 -0
  644. package/dist/price-service/adapters/binance-mark-prices.js +38 -0
  645. package/dist/price-service/adapters/binance-mark-prices.js.map +1 -0
  646. package/dist/price-service/adapters/enigma-mark-prices.d.ts +44 -0
  647. package/dist/price-service/adapters/enigma-mark-prices.d.ts.map +1 -0
  648. package/dist/price-service/adapters/enigma-mark-prices.js +25 -0
  649. package/dist/price-service/adapters/enigma-mark-prices.js.map +1 -0
  650. package/dist/price-service/adapters/index.d.ts +8 -0
  651. package/dist/price-service/adapters/index.d.ts.map +1 -0
  652. package/dist/price-service/assert-price-service-provider.d.ts +19 -0
  653. package/dist/price-service/assert-price-service-provider.d.ts.map +1 -0
  654. package/dist/price-service/assert-price-service-provider.js +9 -0
  655. package/dist/price-service/assert-price-service-provider.js.map +1 -0
  656. package/dist/price-service/binance/client.d.ts +37 -0
  657. package/dist/price-service/binance/client.d.ts.map +1 -0
  658. package/dist/price-service/binance/client.js +30 -0
  659. package/dist/price-service/binance/client.js.map +1 -0
  660. package/dist/price-service/binance/health/get-binance-health.d.ts +25 -0
  661. package/dist/price-service/binance/health/get-binance-health.d.ts.map +1 -0
  662. package/dist/price-service/binance/health/get-binance-health.js +24 -0
  663. package/dist/price-service/binance/health/get-binance-health.js.map +1 -0
  664. package/dist/price-service/binance/health/index.d.ts +3 -0
  665. package/dist/price-service/binance/health/index.d.ts.map +1 -0
  666. package/dist/price-service/binance/health/query.d.ts +17 -0
  667. package/dist/price-service/binance/health/query.d.ts.map +1 -0
  668. package/dist/price-service/binance/health/query.js +24 -0
  669. package/dist/price-service/binance/health/query.js.map +1 -0
  670. package/dist/price-service/binance/index.d.ts +5 -0
  671. package/dist/price-service/binance/index.d.ts.map +1 -0
  672. package/dist/price-service/binance/premium-index/get-binance-premium-index.d.ts +39 -0
  673. package/dist/price-service/binance/premium-index/get-binance-premium-index.d.ts.map +1 -0
  674. package/dist/price-service/binance/premium-index/get-binance-premium-index.js +25 -0
  675. package/dist/price-service/binance/premium-index/get-binance-premium-index.js.map +1 -0
  676. package/dist/price-service/binance/premium-index/index.d.ts +3 -0
  677. package/dist/price-service/binance/premium-index/index.d.ts.map +1 -0
  678. package/dist/price-service/binance/premium-index/query.d.ts +28 -0
  679. package/dist/price-service/binance/premium-index/query.d.ts.map +1 -0
  680. package/dist/price-service/binance/premium-index/query.js +25 -0
  681. package/dist/price-service/binance/premium-index/query.js.map +1 -0
  682. package/dist/price-service/binance/symbols-info/get-binance-symbols-info.d.ts +29 -0
  683. package/dist/price-service/binance/symbols-info/get-binance-symbols-info.d.ts.map +1 -0
  684. package/dist/price-service/binance/symbols-info/get-binance-symbols-info.js +25 -0
  685. package/dist/price-service/binance/symbols-info/get-binance-symbols-info.js.map +1 -0
  686. package/dist/price-service/binance/symbols-info/index.d.ts +3 -0
  687. package/dist/price-service/binance/symbols-info/index.d.ts.map +1 -0
  688. package/dist/price-service/binance/symbols-info/query.d.ts +17 -0
  689. package/dist/price-service/binance/symbols-info/query.d.ts.map +1 -0
  690. package/dist/price-service/binance/symbols-info/query.js +26 -0
  691. package/dist/price-service/binance/symbols-info/query.js.map +1 -0
  692. package/dist/price-service/binance/types.d.ts +104 -0
  693. package/dist/price-service/binance/types.d.ts.map +1 -0
  694. package/dist/price-service/enigma/types/generated/enigma-price-service.js +4 -4
  695. package/dist/price-service/enigma/types/generated/enigma-price-service.js.map +1 -1
  696. package/dist/price-service/get-mark-prices/get-mark-prices.d.ts +45 -0
  697. package/dist/price-service/get-mark-prices/get-mark-prices.d.ts.map +1 -0
  698. package/dist/price-service/get-mark-prices/get-mark-prices.js +37 -0
  699. package/dist/price-service/get-mark-prices/get-mark-prices.js.map +1 -0
  700. package/dist/price-service/get-mark-prices/index.d.ts +3 -0
  701. package/dist/price-service/get-mark-prices/index.d.ts.map +1 -0
  702. package/dist/price-service/get-mark-prices/query.d.ts +36 -0
  703. package/dist/price-service/get-mark-prices/query.d.ts.map +1 -0
  704. package/dist/price-service/get-mark-prices/query.js +25 -0
  705. package/dist/price-service/get-mark-prices/query.js.map +1 -0
  706. package/dist/price-service/index.d.ts +11 -0
  707. package/dist/price-service/index.d.ts.map +1 -1
  708. package/dist/price-service/resolve-price-service.d.ts +33 -0
  709. package/dist/price-service/resolve-price-service.d.ts.map +1 -0
  710. package/dist/price-service/resolve-price-service.js +18 -0
  711. package/dist/price-service/resolve-price-service.js.map +1 -0
  712. package/dist/price-service/types.d.ts +87 -0
  713. package/dist/price-service/types.d.ts.map +1 -0
  714. package/dist/quotes/apply-notification.d.ts +57 -0
  715. package/dist/quotes/apply-notification.d.ts.map +1 -1
  716. package/dist/quotes/apply-notification.js +39 -22
  717. package/dist/quotes/apply-notification.js.map +1 -1
  718. package/dist/quotes/close-planning/index.d.ts +5 -0
  719. package/dist/quotes/close-planning/index.d.ts.map +1 -0
  720. package/dist/quotes/close-planning/min-remaining-quantity.d.ts +26 -0
  721. package/dist/quotes/close-planning/min-remaining-quantity.d.ts.map +1 -0
  722. package/dist/quotes/close-planning/min-remaining-quantity.js +12 -0
  723. package/dist/quotes/close-planning/min-remaining-quantity.js.map +1 -0
  724. package/dist/quotes/close-planning/plan-group-close/index.d.ts +2 -0
  725. package/dist/quotes/close-planning/plan-group-close/index.d.ts.map +1 -0
  726. package/dist/quotes/close-planning/plan-group-close/plan-group-close.d.ts +32 -0
  727. package/dist/quotes/close-planning/plan-group-close/plan-group-close.d.ts.map +1 -0
  728. package/dist/quotes/close-planning/plan-group-close/plan-group-close.js +60 -0
  729. package/dist/quotes/close-planning/plan-group-close/plan-group-close.js.map +1 -0
  730. package/dist/quotes/close-planning/to-close-candidates.d.ts +17 -0
  731. package/dist/quotes/close-planning/to-close-candidates.d.ts.map +1 -0
  732. package/dist/quotes/close-planning/to-close-candidates.js +16 -0
  733. package/dist/quotes/close-planning/to-close-candidates.js.map +1 -0
  734. package/dist/quotes/close-planning/types.d.ts +52 -0
  735. package/dist/quotes/close-planning/types.d.ts.map +1 -0
  736. package/dist/quotes/get-quote-events-by-type/types.d.ts +10 -0
  737. package/dist/quotes/get-quote-events-by-type/types.d.ts.map +1 -1
  738. package/dist/quotes/get-quote-events-by-type/types.js +2 -2
  739. package/dist/quotes/get-quote-events-by-type/types.js.map +1 -1
  740. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +26 -4
  741. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
  742. package/dist/quotes/get-quote-funding/get-quote-funding.js +19 -10
  743. package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
  744. package/dist/quotes/get-quote-funding/query-document.d.ts +1 -0
  745. package/dist/quotes/get-quote-funding/query-document.d.ts.map +1 -1
  746. package/dist/quotes/get-quote-funding/query-document.js +1 -1
  747. package/dist/quotes/get-quote-funding/query-document.js.map +1 -1
  748. package/dist/quotes/get-quote-funding/query.d.ts +2 -2
  749. package/dist/quotes/get-quote-funding/query.d.ts.map +1 -1
  750. package/dist/quotes/get-quote-funding/query.js +12 -11
  751. package/dist/quotes/get-quote-funding/query.js.map +1 -1
  752. package/dist/quotes/get-quote-funding/to-funding-row.d.ts +3 -2
  753. package/dist/quotes/get-quote-funding/to-funding-row.d.ts.map +1 -1
  754. package/dist/quotes/get-quote-funding/to-funding-row.js +1 -1
  755. package/dist/quotes/get-quote-funding/to-funding-row.js.map +1 -1
  756. package/dist/quotes/get-quote-funding/types.d.ts +9 -5
  757. package/dist/quotes/get-quote-funding/types.d.ts.map +1 -1
  758. package/dist/quotes/get-quote-history/get-quote-history.d.ts +11 -3
  759. package/dist/quotes/get-quote-history/get-quote-history.d.ts.map +1 -1
  760. package/dist/quotes/get-quote-history/get-quote-history.js +23 -18
  761. package/dist/quotes/get-quote-history/get-quote-history.js.map +1 -1
  762. package/dist/quotes/get-quote-history/query.d.ts.map +1 -1
  763. package/dist/quotes/get-quote-history/query.js +1 -0
  764. package/dist/quotes/get-quote-history/query.js.map +1 -1
  765. package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
  766. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +76 -0
  767. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -0
  768. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js +31 -0
  769. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -0
  770. package/dist/quotes/get-quotes-events-by-type/index.d.ts +3 -0
  771. package/dist/quotes/get-quotes-events-by-type/index.d.ts.map +1 -0
  772. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts +20 -0
  773. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts.map +1 -0
  774. package/dist/quotes/get-quotes-events-by-type/query-document.js +7 -0
  775. package/dist/quotes/get-quotes-events-by-type/query-document.js.map +1 -0
  776. package/dist/quotes/get-quotes-events-by-type/query.d.ts +46 -0
  777. package/dist/quotes/get-quotes-events-by-type/query.d.ts.map +1 -0
  778. package/dist/quotes/get-quotes-events-by-type/query.js +33 -0
  779. package/dist/quotes/get-quotes-events-by-type/query.js.map +1 -0
  780. package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.d.ts +2 -2
  781. package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.d.ts.map +1 -1
  782. package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.js +22 -20
  783. package/dist/quotes/get-sub-account-quotes/get-sub-account-quotes.js.map +1 -1
  784. package/dist/quotes/get-sub-account-quotes/query.d.ts.map +1 -1
  785. package/dist/quotes/get-sub-account-quotes/query.js +1 -0
  786. package/dist/quotes/get-sub-account-quotes/query.js.map +1 -1
  787. package/dist/quotes/grouping/aggregate-group-funding.d.ts +109 -0
  788. package/dist/quotes/grouping/aggregate-group-funding.d.ts.map +1 -0
  789. package/dist/quotes/grouping/aggregate-group-funding.js +29 -0
  790. package/dist/quotes/grouping/aggregate-group-funding.js.map +1 -0
  791. package/dist/quotes/grouping/aggregate-group-upnl.d.ts +143 -0
  792. package/dist/quotes/grouping/aggregate-group-upnl.d.ts.map +1 -0
  793. package/dist/quotes/grouping/aggregate-group-upnl.js +38 -0
  794. package/dist/quotes/grouping/aggregate-group-upnl.js.map +1 -0
  795. package/dist/quotes/grouping/aggregate-metrics.d.ts +8 -5
  796. package/dist/quotes/grouping/aggregate-metrics.d.ts.map +1 -1
  797. package/dist/quotes/grouping/aggregate-metrics.js +26 -24
  798. package/dist/quotes/grouping/aggregate-metrics.js.map +1 -1
  799. package/dist/quotes/grouping/group-quotes.d.ts +10 -1
  800. package/dist/quotes/grouping/group-quotes.d.ts.map +1 -1
  801. package/dist/quotes/grouping/group-quotes.js.map +1 -1
  802. package/dist/quotes/grouping/group-strategy.d.ts +86 -7
  803. package/dist/quotes/grouping/group-strategy.d.ts.map +1 -1
  804. package/dist/quotes/grouping/group-strategy.js +21 -16
  805. package/dist/quotes/grouping/group-strategy.js.map +1 -1
  806. package/dist/quotes/grouping/index.d.ts +2 -0
  807. package/dist/quotes/grouping/index.d.ts.map +1 -1
  808. package/dist/quotes/grouping/partition-quotes.d.ts +3 -3
  809. package/dist/quotes/grouping/partition-quotes.d.ts.map +1 -1
  810. package/dist/quotes/grouping/partition-quotes.js +1 -2
  811. package/dist/quotes/grouping/partition-quotes.js.map +1 -1
  812. package/dist/quotes/grouping/quote-group.d.ts +35 -21
  813. package/dist/quotes/grouping/quote-group.d.ts.map +1 -1
  814. package/dist/quotes/index.d.ts +4 -0
  815. package/dist/quotes/index.d.ts.map +1 -1
  816. package/dist/quotes/liquidation/calculate-liquidation-price.js +10 -10
  817. package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
  818. package/dist/quotes/open-price.d.ts +51 -0
  819. package/dist/quotes/open-price.d.ts.map +1 -0
  820. package/dist/quotes/open-price.js +17 -0
  821. package/dist/quotes/open-price.js.map +1 -0
  822. package/dist/quotes/open-quantity.d.ts +6 -0
  823. package/dist/quotes/open-quantity.d.ts.map +1 -1
  824. package/dist/quotes/open-quantity.js.map +1 -1
  825. package/dist/quotes/quote-id-key-part.d.ts +19 -0
  826. package/dist/quotes/quote-id-key-part.d.ts.map +1 -0
  827. package/dist/quotes/quote-id-key-part.js +8 -0
  828. package/dist/quotes/quote-id-key-part.js.map +1 -0
  829. package/dist/quotes/reconcile-quotes.d.ts +12 -1
  830. package/dist/quotes/reconcile-quotes.d.ts.map +1 -1
  831. package/dist/quotes/reconcile-quotes.js +50 -42
  832. package/dist/quotes/reconcile-quotes.js.map +1 -1
  833. package/dist/quotes/resolve-quote-accounts.d.ts +1 -1
  834. package/dist/quotes/resolve-quote-accounts.d.ts.map +1 -1
  835. package/dist/quotes/resolve-quote-accounts.js.map +1 -1
  836. package/dist/quotes/should-accelerate.d.ts +10 -7
  837. package/dist/quotes/should-accelerate.d.ts.map +1 -1
  838. package/dist/quotes/should-accelerate.js +2 -7
  839. package/dist/quotes/should-accelerate.js.map +1 -1
  840. package/dist/quotes/to-unified-quote.d.ts +6 -4
  841. package/dist/quotes/to-unified-quote.d.ts.map +1 -1
  842. package/dist/quotes/to-unified-quote.js +1 -3
  843. package/dist/quotes/to-unified-quote.js.map +1 -1
  844. package/dist/quotes/unified-quote.d.ts +26 -11
  845. package/dist/quotes/unified-quote.d.ts.map +1 -1
  846. package/dist/quotes/unified-quote.js +1 -1
  847. package/dist/quotes/unified-quote.js.map +1 -1
  848. package/dist/quotes/upnl/calculate-quote-leverage.d.ts +5 -1
  849. package/dist/quotes/upnl/calculate-quote-leverage.d.ts.map +1 -1
  850. package/dist/quotes/upnl/calculate-quote-leverage.js +9 -8
  851. package/dist/quotes/upnl/calculate-quote-leverage.js.map +1 -1
  852. package/dist/quotes/upnl/calculate-quote-upnl-wei.d.ts +39 -0
  853. package/dist/quotes/upnl/calculate-quote-upnl-wei.d.ts.map +1 -0
  854. package/dist/quotes/upnl/calculate-quote-upnl-wei.js +11 -0
  855. package/dist/quotes/upnl/calculate-quote-upnl-wei.js.map +1 -0
  856. package/dist/quotes/upnl/index.d.ts +1 -0
  857. package/dist/quotes/upnl/index.d.ts.map +1 -1
  858. package/dist/shared/types/properties.d.ts +17 -1
  859. package/dist/shared/types/properties.d.ts.map +1 -1
  860. package/dist/shared/utils/percent.d.ts +17 -0
  861. package/dist/shared/utils/percent.d.ts.map +1 -0
  862. package/dist/shared/utils/percent.js +9 -0
  863. package/dist/shared/utils/percent.js.map +1 -0
  864. package/dist/shared/utils/price.d.ts +22 -0
  865. package/dist/shared/utils/price.d.ts.map +1 -0
  866. package/dist/shared/utils/price.js +15 -0
  867. package/dist/shared/utils/price.js.map +1 -0
  868. package/dist/shared/utils/query.d.ts.map +1 -1
  869. package/dist/shared/utils/query.js +2 -1
  870. package/dist/shared/utils/query.js.map +1 -1
  871. package/dist/shared/utils/wei.d.ts +26 -0
  872. package/dist/shared/utils/wei.d.ts.map +1 -1
  873. package/dist/shared/utils/wei.js +4 -1
  874. package/dist/shared/utils/wei.js.map +1 -1
  875. package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts +27 -0
  876. package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts.map +1 -0
  877. package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js +25 -0
  878. package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js.map +1 -0
  879. package/dist/solvers/add-solver-whitelist/index.d.ts +3 -0
  880. package/dist/solvers/add-solver-whitelist/index.d.ts.map +1 -0
  881. package/dist/solvers/add-solver-whitelist/query.d.ts +19 -0
  882. package/dist/solvers/add-solver-whitelist/query.d.ts.map +1 -0
  883. package/dist/solvers/add-solver-whitelist/query.js +12 -0
  884. package/dist/solvers/add-solver-whitelist/query.js.map +1 -0
  885. package/dist/solvers/assert-solver-kind.d.ts +15 -0
  886. package/dist/solvers/assert-solver-kind.d.ts.map +1 -0
  887. package/dist/solvers/assert-solver-kind.js +9 -0
  888. package/dist/solvers/assert-solver-kind.js.map +1 -0
  889. package/dist/solvers/capabilities.d.ts +56 -0
  890. package/dist/solvers/capabilities.d.ts.map +1 -0
  891. package/dist/solvers/capabilities.js +30 -0
  892. package/dist/solvers/capabilities.js.map +1 -0
  893. package/dist/solvers/error-codes/get-solver-error-codes.d.ts +2 -2
  894. package/dist/solvers/error-codes/get-solver-error-codes.d.ts.map +1 -1
  895. package/dist/solvers/error-codes/get-solver-error-codes.js +4 -2
  896. package/dist/solvers/error-codes/get-solver-error-codes.js.map +1 -1
  897. package/dist/solvers/error-codes/query.d.ts.map +1 -1
  898. package/dist/solvers/error-codes/query.js +4 -1
  899. package/dist/solvers/error-codes/query.js.map +1 -1
  900. package/dist/solvers/estimated-price/get-estimated-price.d.ts +2 -2
  901. package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
  902. package/dist/solvers/estimated-price/get-estimated-price.js +20 -15
  903. package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
  904. package/dist/solvers/estimated-price/index.d.ts +1 -0
  905. package/dist/solvers/estimated-price/index.d.ts.map +1 -1
  906. package/dist/solvers/estimated-price/query.d.ts.map +1 -1
  907. package/dist/solvers/estimated-price/query.js +1 -0
  908. package/dist/solvers/estimated-price/query.js.map +1 -1
  909. package/dist/solvers/estimated-price/supports-estimated-price.d.ts +33 -0
  910. package/dist/solvers/estimated-price/supports-estimated-price.d.ts.map +1 -0
  911. package/dist/solvers/estimated-price/supports-estimated-price.js +13 -0
  912. package/dist/solvers/estimated-price/supports-estimated-price.js.map +1 -0
  913. package/dist/solvers/force-close/force-close-auto.d.ts +53 -0
  914. package/dist/solvers/force-close/force-close-auto.d.ts.map +1 -0
  915. package/dist/solvers/force-close/force-close-auto.js +80 -0
  916. package/dist/solvers/force-close/force-close-auto.js.map +1 -0
  917. package/dist/solvers/force-close/force-close-math.d.ts +93 -0
  918. package/dist/solvers/force-close/force-close-math.d.ts.map +1 -0
  919. package/dist/solvers/force-close/force-close-math.js +58 -0
  920. package/dist/solvers/force-close/force-close-math.js.map +1 -0
  921. package/dist/solvers/force-close/force-close-position.d.ts +45 -0
  922. package/dist/solvers/force-close/force-close-position.d.ts.map +1 -0
  923. package/dist/solvers/force-close/force-close-position.js +22 -0
  924. package/dist/solvers/force-close/force-close-position.js.map +1 -0
  925. package/dist/solvers/force-close/get-force-close-params.d.ts +32 -0
  926. package/dist/solvers/force-close/get-force-close-params.d.ts.map +1 -0
  927. package/dist/solvers/force-close/get-force-close-params.js +41 -0
  928. package/dist/solvers/force-close/get-force-close-params.js.map +1 -0
  929. package/dist/solvers/force-close/index.d.ts +7 -0
  930. package/dist/solvers/force-close/index.d.ts.map +1 -0
  931. package/dist/solvers/force-close/query.d.ts +60 -0
  932. package/dist/solvers/force-close/query.d.ts.map +1 -0
  933. package/dist/solvers/force-close/query.js +38 -0
  934. package/dist/solvers/force-close/query.js.map +1 -0
  935. package/dist/solvers/force-close/types.d.ts +37 -0
  936. package/dist/solvers/force-close/types.d.ts.map +1 -0
  937. package/dist/solvers/funding-info/get-funding-info.d.ts +2 -2
  938. package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -1
  939. package/dist/solvers/funding-info/get-funding-info.js +4 -2
  940. package/dist/solvers/funding-info/get-funding-info.js.map +1 -1
  941. package/dist/solvers/funding-info/query.d.ts.map +1 -1
  942. package/dist/solvers/funding-info/query.js +1 -0
  943. package/dist/solvers/funding-info/query.js.map +1 -1
  944. package/dist/solvers/get-error-message/get-error-message.d.ts +22 -0
  945. package/dist/solvers/get-error-message/get-error-message.d.ts.map +1 -0
  946. package/dist/solvers/get-error-message/get-error-message.js +24 -0
  947. package/dist/solvers/get-error-message/get-error-message.js.map +1 -0
  948. package/dist/solvers/get-error-message/index.d.ts +3 -0
  949. package/dist/solvers/get-error-message/index.d.ts.map +1 -0
  950. package/dist/solvers/get-error-message/query.d.ts +29 -0
  951. package/dist/solvers/get-error-message/query.d.ts.map +1 -0
  952. package/dist/solvers/get-error-message/query.js +25 -0
  953. package/dist/solvers/get-error-message/query.js.map +1 -0
  954. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.d.ts +21 -0
  955. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.d.ts.map +1 -0
  956. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js +24 -0
  957. package/dist/solvers/get-party-a-upnl/get-party-a-upnl.js.map +1 -0
  958. package/dist/solvers/get-party-a-upnl/index.d.ts +3 -0
  959. package/dist/solvers/get-party-a-upnl/index.d.ts.map +1 -0
  960. package/dist/solvers/get-party-a-upnl/query.d.ts +29 -0
  961. package/dist/solvers/get-party-a-upnl/query.d.ts.map +1 -0
  962. package/dist/solvers/get-party-a-upnl/query.js +25 -0
  963. package/dist/solvers/get-party-a-upnl/query.js.map +1 -0
  964. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.d.ts +25 -0
  965. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.d.ts.map +1 -0
  966. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js +25 -0
  967. package/dist/solvers/get-solver-balance-info/get-solver-balance-info.js.map +1 -0
  968. package/dist/solvers/get-solver-balance-info/index.d.ts +3 -0
  969. package/dist/solvers/get-solver-balance-info/index.d.ts.map +1 -0
  970. package/dist/solvers/get-solver-balance-info/query.d.ts +29 -0
  971. package/dist/solvers/get-solver-balance-info/query.d.ts.map +1 -0
  972. package/dist/solvers/get-solver-balance-info/query.js +26 -0
  973. package/dist/solvers/get-solver-balance-info/query.js.map +1 -0
  974. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.d.ts +19 -0
  975. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.d.ts.map +1 -0
  976. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js +24 -0
  977. package/dist/solvers/get-solver-open-interest/get-solver-open-interest.js.map +1 -0
  978. package/dist/solvers/get-solver-open-interest/index.d.ts +3 -0
  979. package/dist/solvers/get-solver-open-interest/index.d.ts.map +1 -0
  980. package/dist/solvers/get-solver-open-interest/query.d.ts +29 -0
  981. package/dist/solvers/get-solver-open-interest/query.d.ts.map +1 -0
  982. package/dist/solvers/get-solver-open-interest/query.js +24 -0
  983. package/dist/solvers/get-solver-open-interest/query.js.map +1 -0
  984. package/dist/solvers/get-solver-price-range/get-solver-price-range.d.ts +22 -0
  985. package/dist/solvers/get-solver-price-range/get-solver-price-range.d.ts.map +1 -0
  986. package/dist/solvers/get-solver-price-range/get-solver-price-range.js +24 -0
  987. package/dist/solvers/get-solver-price-range/get-solver-price-range.js.map +1 -0
  988. package/dist/solvers/get-solver-price-range/index.d.ts +3 -0
  989. package/dist/solvers/get-solver-price-range/index.d.ts.map +1 -0
  990. package/dist/solvers/get-solver-price-range/query.d.ts +29 -0
  991. package/dist/solvers/get-solver-price-range/query.d.ts.map +1 -0
  992. package/dist/solvers/get-solver-price-range/query.js +25 -0
  993. package/dist/solvers/get-solver-price-range/query.js.map +1 -0
  994. package/dist/solvers/get-solver-readiness/get-solver-readiness.d.ts +18 -0
  995. package/dist/solvers/get-solver-readiness/get-solver-readiness.d.ts.map +1 -0
  996. package/dist/solvers/get-solver-readiness/get-solver-readiness.js +24 -0
  997. package/dist/solvers/get-solver-readiness/get-solver-readiness.js.map +1 -0
  998. package/dist/solvers/get-solver-readiness/index.d.ts +3 -0
  999. package/dist/solvers/get-solver-readiness/index.d.ts.map +1 -0
  1000. package/dist/solvers/get-solver-readiness/query.d.ts +29 -0
  1001. package/dist/solvers/get-solver-readiness/query.d.ts.map +1 -0
  1002. package/dist/solvers/get-solver-readiness/query.js +24 -0
  1003. package/dist/solvers/get-solver-readiness/query.js.map +1 -0
  1004. package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.d.ts +2 -2
  1005. package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.d.ts.map +1 -1
  1006. package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.js +4 -1
  1007. package/dist/solvers/instant-close/get-instant-closes/get-instant-closes.js.map +1 -1
  1008. package/dist/solvers/instant-close/get-instant-closes/query.d.ts.map +1 -1
  1009. package/dist/solvers/instant-close/get-instant-closes/query.js +1 -0
  1010. package/dist/solvers/instant-close/get-instant-closes/query.js.map +1 -1
  1011. package/dist/solvers/instant-close/instant-close/instant-close.d.ts +16 -3
  1012. package/dist/solvers/instant-close/instant-close/instant-close.d.ts.map +1 -1
  1013. package/dist/solvers/instant-close/instant-close/instant-close.js +26 -25
  1014. package/dist/solvers/instant-close/instant-close/instant-close.js.map +1 -1
  1015. package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.d.ts +1 -1
  1016. package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.js.map +1 -1
  1017. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.d.ts.map +1 -1
  1018. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.js +1 -0
  1019. package/dist/solvers/instant-close/instant-close-bulk/instant-close-bulk.js.map +1 -1
  1020. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.d.ts +2 -2
  1021. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.d.ts.map +1 -1
  1022. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.js +1 -0
  1023. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.js.map +1 -1
  1024. package/dist/solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.d.ts.map +1 -1
  1025. package/dist/solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.js +3 -0
  1026. package/dist/solvers/instant-close/prepare-instant-close-params/prepare-instant-close-params.js.map +1 -1
  1027. package/dist/solvers/instant-close/shared/adapters/enigma-instant-close.d.ts +14 -0
  1028. package/dist/solvers/instant-close/shared/adapters/enigma-instant-close.d.ts.map +1 -0
  1029. package/dist/solvers/instant-close/shared/adapters/enigma-instant-close.js +14 -0
  1030. package/dist/solvers/instant-close/shared/adapters/enigma-instant-close.js.map +1 -0
  1031. package/dist/solvers/instant-close/shared/adapters/hedger-error.d.ts +10 -0
  1032. package/dist/solvers/instant-close/shared/adapters/hedger-error.d.ts.map +1 -0
  1033. package/dist/solvers/instant-close/shared/adapters/hedger-error.js +13 -0
  1034. package/dist/solvers/instant-close/shared/adapters/hedger-error.js.map +1 -0
  1035. package/dist/solvers/instant-close/shared/adapters/index.d.ts +4 -0
  1036. package/dist/solvers/instant-close/shared/adapters/index.d.ts.map +1 -0
  1037. package/dist/solvers/instant-close/shared/adapters/rasa-instant-close.d.ts +20 -0
  1038. package/dist/solvers/instant-close/shared/adapters/rasa-instant-close.d.ts.map +1 -0
  1039. package/dist/solvers/instant-close/shared/adapters/rasa-instant-close.js +25 -0
  1040. package/dist/solvers/instant-close/shared/adapters/rasa-instant-close.js.map +1 -0
  1041. package/dist/solvers/instant-close/shared/hedger-api.d.ts +17 -14
  1042. package/dist/solvers/instant-close/shared/hedger-api.d.ts.map +1 -1
  1043. package/dist/solvers/instant-close/shared/hedger-api.js +16 -13
  1044. package/dist/solvers/instant-close/shared/hedger-api.js.map +1 -1
  1045. package/dist/solvers/instant-close/shared/index.d.ts +1 -0
  1046. package/dist/solvers/instant-close/shared/index.d.ts.map +1 -1
  1047. package/dist/solvers/instant-close/shared/quote-constraints.d.ts +20 -3
  1048. package/dist/solvers/instant-close/shared/quote-constraints.d.ts.map +1 -1
  1049. package/dist/solvers/instant-close/shared/quote-constraints.js +4 -4
  1050. package/dist/solvers/instant-close/shared/quote-constraints.js.map +1 -1
  1051. package/dist/solvers/instant-close/shared/types.d.ts +3 -3
  1052. package/dist/solvers/instant-close/shared/types.d.ts.map +1 -1
  1053. package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.d.ts +2 -2
  1054. package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.d.ts.map +1 -1
  1055. package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.js +4 -1
  1056. package/dist/solvers/instant-open/get-instant-open-quote-id/get-instant-open-quote-id.js.map +1 -1
  1057. package/dist/solvers/instant-open/get-instant-open-quote-id/query.d.ts.map +1 -1
  1058. package/dist/solvers/instant-open/get-instant-open-quote-id/query.js +1 -0
  1059. package/dist/solvers/instant-open/get-instant-open-quote-id/query.js.map +1 -1
  1060. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.d.ts +18 -0
  1061. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.d.ts.map +1 -0
  1062. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js +28 -0
  1063. package/dist/solvers/instant-open/get-instant-opens/adapters/enigma-instant-opens.js.map +1 -0
  1064. package/dist/solvers/instant-open/get-instant-opens/adapters/index.d.ts +3 -0
  1065. package/dist/solvers/instant-open/get-instant-opens/adapters/index.d.ts.map +1 -0
  1066. package/dist/solvers/instant-open/get-instant-opens/adapters/rasa-instant-opens.d.ts +18 -0
  1067. package/dist/solvers/instant-open/get-instant-opens/adapters/rasa-instant-opens.d.ts.map +1 -0
  1068. package/dist/solvers/instant-open/get-instant-opens/adapters/rasa-instant-opens.js +25 -0
  1069. package/dist/solvers/instant-open/get-instant-opens/adapters/rasa-instant-opens.js.map +1 -0
  1070. package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.d.ts +22 -11
  1071. package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.d.ts.map +1 -1
  1072. package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.js +26 -10
  1073. package/dist/solvers/instant-open/get-instant-opens/get-instant-opens.js.map +1 -1
  1074. package/dist/solvers/instant-open/get-instant-opens/index.d.ts +1 -1
  1075. package/dist/solvers/instant-open/get-instant-opens/index.d.ts.map +1 -1
  1076. package/dist/solvers/instant-open/get-instant-opens/query.d.ts +7 -6
  1077. package/dist/solvers/instant-open/get-instant-opens/query.d.ts.map +1 -1
  1078. package/dist/solvers/instant-open/get-instant-opens/query.js +1 -0
  1079. package/dist/solvers/instant-open/get-instant-opens/query.js.map +1 -1
  1080. package/dist/solvers/instant-open/get-instant-opens/{to-pending-instant-open.d.ts → types.d.ts} +31 -15
  1081. package/dist/solvers/instant-open/get-instant-opens/types.d.ts.map +1 -0
  1082. package/dist/solvers/instant-open/instant-open/adapters/context.d.ts +34 -0
  1083. package/dist/solvers/instant-open/instant-open/adapters/context.d.ts.map +1 -0
  1084. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts +22 -0
  1085. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -0
  1086. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +73 -0
  1087. package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -0
  1088. package/dist/solvers/instant-open/instant-open/adapters/index.d.ts +4 -0
  1089. package/dist/solvers/instant-open/instant-open/adapters/index.d.ts.map +1 -0
  1090. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.d.ts +22 -0
  1091. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.d.ts.map +1 -0
  1092. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js +55 -0
  1093. package/dist/solvers/instant-open/instant-open/adapters/rasa-instant-open.js.map +1 -0
  1094. package/dist/solvers/instant-open/instant-open/index.d.ts +2 -0
  1095. package/dist/solvers/instant-open/instant-open/index.d.ts.map +1 -1
  1096. package/dist/solvers/instant-open/instant-open/instant-open.d.ts +34 -65
  1097. package/dist/solvers/instant-open/instant-open/instant-open.d.ts.map +1 -1
  1098. package/dist/solvers/instant-open/instant-open/instant-open.js +31 -63
  1099. package/dist/solvers/instant-open/instant-open/instant-open.js.map +1 -1
  1100. package/dist/solvers/instant-open/instant-open/query.d.ts +9 -3
  1101. package/dist/solvers/instant-open/instant-open/query.d.ts.map +1 -1
  1102. package/dist/solvers/instant-open/instant-open/query.js.map +1 -1
  1103. package/dist/solvers/instant-open/instant-open/types.d.ts +91 -0
  1104. package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -0
  1105. package/dist/solvers/instant-open/instant-open-auto/instant-open-auto.d.ts +1 -1
  1106. package/dist/solvers/instant-open/instant-open-auto/instant-open-auto.d.ts.map +1 -1
  1107. package/dist/solvers/instant-open/instant-open-auto/instant-open-auto.js.map +1 -1
  1108. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +1 -1
  1109. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts.map +1 -1
  1110. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js +4 -0
  1111. package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js.map +1 -1
  1112. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.d.ts +7 -0
  1113. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.d.ts.map +1 -1
  1114. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.js +1 -0
  1115. package/dist/solvers/instant-open/prepare-instant-open-params/resolvers/resolve-locked-params.js.map +1 -1
  1116. package/dist/solvers/instant-open/shared/calldata.d.ts +45 -0
  1117. package/dist/solvers/instant-open/shared/calldata.d.ts.map +1 -1
  1118. package/dist/solvers/instant-open/shared/calldata.js +40 -17
  1119. package/dist/solvers/instant-open/shared/calldata.js.map +1 -1
  1120. package/dist/solvers/instant-open/shared/hedger-api.d.ts +33 -2
  1121. package/dist/solvers/instant-open/shared/hedger-api.d.ts.map +1 -1
  1122. package/dist/solvers/instant-open/shared/hedger-api.js +25 -7
  1123. package/dist/solvers/instant-open/shared/hedger-api.js.map +1 -1
  1124. package/dist/solvers/instant-open/shared/operations.d.ts +16 -3
  1125. package/dist/solvers/instant-open/shared/operations.d.ts.map +1 -1
  1126. package/dist/solvers/instant-open/shared/operations.js +2 -2
  1127. package/dist/solvers/instant-open/shared/operations.js.map +1 -1
  1128. package/dist/solvers/instant-open/shared/quote-constraints.d.ts +27 -3
  1129. package/dist/solvers/instant-open/shared/quote-constraints.d.ts.map +1 -1
  1130. package/dist/solvers/instant-open/shared/quote-constraints.js +27 -27
  1131. package/dist/solvers/instant-open/shared/quote-constraints.js.map +1 -1
  1132. package/dist/solvers/instant-open/shared/trade-math.d.ts +11 -0
  1133. package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
  1134. package/dist/solvers/instant-open/shared/trade-math.js +10 -6
  1135. package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
  1136. package/dist/solvers/instant-open/shared/types.d.ts +12 -23
  1137. package/dist/solvers/instant-open/shared/types.d.ts.map +1 -1
  1138. package/dist/solvers/instant-open/shared/types.js.map +1 -1
  1139. package/dist/solvers/limit-close/index.d.ts +4 -0
  1140. package/dist/solvers/limit-close/index.d.ts.map +1 -0
  1141. package/dist/solvers/limit-close/limit-close-auto.d.ts +23 -0
  1142. package/dist/solvers/limit-close/limit-close-auto.d.ts.map +1 -0
  1143. package/dist/solvers/limit-close/limit-close-auto.js +10 -0
  1144. package/dist/solvers/limit-close/limit-close-auto.js.map +1 -0
  1145. package/dist/solvers/limit-close/prepare-limit-close-params.d.ts +30 -0
  1146. package/dist/solvers/limit-close/prepare-limit-close-params.d.ts.map +1 -0
  1147. package/dist/solvers/limit-close/prepare-limit-close-params.js +24 -0
  1148. package/dist/solvers/limit-close/prepare-limit-close-params.js.map +1 -0
  1149. package/dist/solvers/limit-close/query.d.ts +15 -0
  1150. package/dist/solvers/limit-close/query.d.ts.map +1 -0
  1151. package/dist/solvers/limit-close/query.js +12 -0
  1152. package/dist/solvers/limit-close/query.js.map +1 -0
  1153. package/dist/solvers/limit-open/index.d.ts +4 -0
  1154. package/dist/solvers/limit-open/index.d.ts.map +1 -0
  1155. package/dist/solvers/limit-open/limit-open-auto.d.ts +23 -0
  1156. package/dist/solvers/limit-open/limit-open-auto.d.ts.map +1 -0
  1157. package/dist/solvers/limit-open/limit-open-auto.js +10 -0
  1158. package/dist/solvers/limit-open/limit-open-auto.js.map +1 -0
  1159. package/dist/solvers/limit-open/prepare-limit-open-params.d.ts +31 -0
  1160. package/dist/solvers/limit-open/prepare-limit-open-params.d.ts.map +1 -0
  1161. package/dist/solvers/limit-open/prepare-limit-open-params.js +24 -0
  1162. package/dist/solvers/limit-open/prepare-limit-open-params.js.map +1 -0
  1163. package/dist/solvers/limit-open/query.d.ts +15 -0
  1164. package/dist/solvers/limit-open/query.d.ts.map +1 -0
  1165. package/dist/solvers/limit-open/query.js +12 -0
  1166. package/dist/solvers/limit-open/query.js.map +1 -0
  1167. package/dist/solvers/locked-params/get-locked-params.d.ts +2 -2
  1168. package/dist/solvers/locked-params/get-locked-params.d.ts.map +1 -1
  1169. package/dist/solvers/locked-params/get-locked-params.js +4 -2
  1170. package/dist/solvers/locked-params/get-locked-params.js.map +1 -1
  1171. package/dist/solvers/locked-params/query.d.ts.map +1 -1
  1172. package/dist/solvers/locked-params/query.js +1 -0
  1173. package/dist/solvers/locked-params/query.js.map +1 -1
  1174. package/dist/solvers/market-info/adapters/enigma-market-info.d.ts +15 -0
  1175. package/dist/solvers/market-info/adapters/enigma-market-info.d.ts.map +1 -0
  1176. package/dist/solvers/market-info/adapters/enigma-market-info.js +33 -0
  1177. package/dist/solvers/market-info/adapters/enigma-market-info.js.map +1 -0
  1178. package/dist/solvers/market-info/adapters/index.d.ts +3 -0
  1179. package/dist/solvers/market-info/adapters/index.d.ts.map +1 -0
  1180. package/dist/solvers/market-info/adapters/rasa-market-info.d.ts +16 -0
  1181. package/dist/solvers/market-info/adapters/rasa-market-info.d.ts.map +1 -0
  1182. package/dist/solvers/market-info/adapters/rasa-market-info.js +22 -0
  1183. package/dist/solvers/market-info/adapters/rasa-market-info.js.map +1 -0
  1184. package/dist/solvers/market-info/get-market-info.d.ts +25 -17
  1185. package/dist/solvers/market-info/get-market-info.d.ts.map +1 -1
  1186. package/dist/solvers/market-info/get-market-info.js +25 -12
  1187. package/dist/solvers/market-info/get-market-info.js.map +1 -1
  1188. package/dist/solvers/market-info/index.d.ts +0 -1
  1189. package/dist/solvers/market-info/index.d.ts.map +1 -1
  1190. package/dist/solvers/market-info/query.d.ts +11 -10
  1191. package/dist/solvers/market-info/query.d.ts.map +1 -1
  1192. package/dist/solvers/market-info/query.js +4 -1
  1193. package/dist/solvers/market-info/query.js.map +1 -1
  1194. package/dist/solvers/market-info/types.d.ts +40 -9
  1195. package/dist/solvers/market-info/types.d.ts.map +1 -1
  1196. package/dist/solvers/markets/adapters/enigma-markets.d.ts +18 -0
  1197. package/dist/solvers/markets/adapters/enigma-markets.d.ts.map +1 -0
  1198. package/dist/solvers/markets/adapters/enigma-markets.js +44 -0
  1199. package/dist/solvers/markets/adapters/enigma-markets.js.map +1 -0
  1200. package/dist/solvers/markets/adapters/index.d.ts +3 -0
  1201. package/dist/solvers/markets/adapters/index.d.ts.map +1 -0
  1202. package/dist/solvers/markets/adapters/rasa-markets.d.ts +18 -0
  1203. package/dist/solvers/markets/adapters/rasa-markets.d.ts.map +1 -0
  1204. package/dist/solvers/markets/adapters/rasa-markets.js +36 -0
  1205. package/dist/solvers/markets/adapters/rasa-markets.js.map +1 -0
  1206. package/dist/solvers/markets/get-markets.d.ts +34 -13
  1207. package/dist/solvers/markets/get-markets.d.ts.map +1 -1
  1208. package/dist/solvers/markets/get-markets.js +28 -14
  1209. package/dist/solvers/markets/get-markets.js.map +1 -1
  1210. package/dist/solvers/markets/index.d.ts +1 -1
  1211. package/dist/solvers/markets/index.d.ts.map +1 -1
  1212. package/dist/solvers/markets/query.d.ts +14 -11
  1213. package/dist/solvers/markets/query.d.ts.map +1 -1
  1214. package/dist/solvers/markets/query.js +4 -1
  1215. package/dist/solvers/markets/query.js.map +1 -1
  1216. package/dist/solvers/markets/types.d.ts +96 -0
  1217. package/dist/solvers/markets/types.d.ts.map +1 -0
  1218. package/dist/solvers/notional-cap/adapters/enigma-notional-cap.d.ts +17 -0
  1219. package/dist/solvers/notional-cap/adapters/enigma-notional-cap.d.ts.map +1 -0
  1220. package/dist/solvers/notional-cap/adapters/enigma-notional-cap.js +27 -0
  1221. package/dist/solvers/notional-cap/adapters/enigma-notional-cap.js.map +1 -0
  1222. package/dist/solvers/notional-cap/adapters/index.d.ts +3 -0
  1223. package/dist/solvers/notional-cap/adapters/index.d.ts.map +1 -0
  1224. package/dist/solvers/notional-cap/adapters/rasa-notional-cap.d.ts +16 -0
  1225. package/dist/solvers/notional-cap/adapters/rasa-notional-cap.d.ts.map +1 -0
  1226. package/dist/solvers/notional-cap/adapters/rasa-notional-cap.js +17 -0
  1227. package/dist/solvers/notional-cap/adapters/rasa-notional-cap.js.map +1 -0
  1228. package/dist/solvers/notional-cap/check-notional-cap.d.ts +4 -2
  1229. package/dist/solvers/notional-cap/check-notional-cap.d.ts.map +1 -1
  1230. package/dist/solvers/notional-cap/check-notional-cap.js +2 -2
  1231. package/dist/solvers/notional-cap/check-notional-cap.js.map +1 -1
  1232. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +5 -5
  1233. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
  1234. package/dist/solvers/notional-cap/get-notional-cap-all.js +5 -2
  1235. package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
  1236. package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.d.ts +23 -14
  1237. package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.d.ts.map +1 -1
  1238. package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.js +26 -10
  1239. package/dist/solvers/notional-cap/get-notional-cap-by-symbol-id.js.map +1 -1
  1240. package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.d.ts +2 -2
  1241. package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.d.ts.map +1 -1
  1242. package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.js +7 -1
  1243. package/dist/solvers/notional-cap/get-open-interest-by-symbol-id.js.map +1 -1
  1244. package/dist/solvers/notional-cap/index.d.ts +0 -1
  1245. package/dist/solvers/notional-cap/index.d.ts.map +1 -1
  1246. package/dist/solvers/notional-cap/query-all.js +4 -1
  1247. package/dist/solvers/notional-cap/query-all.js.map +1 -1
  1248. package/dist/solvers/notional-cap/query-open-interest.d.ts.map +1 -1
  1249. package/dist/solvers/notional-cap/query-open-interest.js +1 -0
  1250. package/dist/solvers/notional-cap/query-open-interest.js.map +1 -1
  1251. package/dist/solvers/notional-cap/query.d.ts +10 -8
  1252. package/dist/solvers/notional-cap/query.d.ts.map +1 -1
  1253. package/dist/solvers/notional-cap/query.js +1 -0
  1254. package/dist/solvers/notional-cap/query.js.map +1 -1
  1255. package/dist/solvers/notional-cap/types.d.ts +38 -15
  1256. package/dist/solvers/notional-cap/types.d.ts.map +1 -1
  1257. package/dist/solvers/revenue/get-solver-revenue.d.ts +48 -0
  1258. package/dist/solvers/revenue/get-solver-revenue.d.ts.map +1 -0
  1259. package/dist/solvers/revenue/get-solver-revenue.js +28 -0
  1260. package/dist/solvers/revenue/get-solver-revenue.js.map +1 -0
  1261. package/dist/solvers/revenue/index.d.ts +5 -0
  1262. package/dist/solvers/revenue/index.d.ts.map +1 -0
  1263. package/dist/solvers/revenue/query.d.ts +36 -0
  1264. package/dist/solvers/revenue/query.d.ts.map +1 -0
  1265. package/dist/solvers/revenue/query.js +26 -0
  1266. package/dist/solvers/revenue/query.js.map +1 -0
  1267. package/dist/solvers/revenue/to-solver-revenue.d.ts +13 -0
  1268. package/dist/solvers/revenue/to-solver-revenue.d.ts.map +1 -0
  1269. package/dist/solvers/revenue/to-solver-revenue.js +14 -0
  1270. package/dist/solvers/revenue/to-solver-revenue.js.map +1 -0
  1271. package/dist/solvers/revenue/types.d.ts +33 -0
  1272. package/dist/solvers/revenue/types.d.ts.map +1 -0
  1273. package/dist/solvers/revenue-records/get-revenue-records.d.ts +36 -0
  1274. package/dist/solvers/revenue-records/get-revenue-records.d.ts.map +1 -0
  1275. package/dist/solvers/revenue-records/get-revenue-records.js +36 -0
  1276. package/dist/solvers/revenue-records/get-revenue-records.js.map +1 -0
  1277. package/dist/solvers/revenue-records/index.d.ts +5 -0
  1278. package/dist/solvers/revenue-records/index.d.ts.map +1 -0
  1279. package/dist/solvers/revenue-records/query.d.ts +29 -0
  1280. package/dist/solvers/revenue-records/query.d.ts.map +1 -0
  1281. package/dist/solvers/revenue-records/query.js +28 -0
  1282. package/dist/solvers/revenue-records/query.js.map +1 -0
  1283. package/dist/solvers/revenue-records/to-revenue-record.d.ts +11 -0
  1284. package/dist/solvers/revenue-records/to-revenue-record.d.ts.map +1 -0
  1285. package/dist/solvers/revenue-records/to-revenue-record.js +13 -0
  1286. package/dist/solvers/revenue-records/to-revenue-record.js.map +1 -0
  1287. package/dist/solvers/revenue-records/types.d.ts +26 -0
  1288. package/dist/solvers/revenue-records/types.d.ts.map +1 -0
  1289. package/dist/solvers/shared/resolvers/resolve-mark-price.d.ts +17 -5
  1290. package/dist/solvers/shared/resolvers/resolve-mark-price.d.ts.map +1 -1
  1291. package/dist/solvers/shared/resolvers/resolve-mark-price.js +17 -10
  1292. package/dist/solvers/shared/resolvers/resolve-mark-price.js.map +1 -1
  1293. package/dist/solvers/shared/resolvers/resolve-market.d.ts +10 -3
  1294. package/dist/solvers/shared/resolvers/resolve-market.d.ts.map +1 -1
  1295. package/dist/solvers/shared/resolvers/resolve-market.js +7 -6
  1296. package/dist/solvers/shared/resolvers/resolve-market.js.map +1 -1
  1297. package/dist/solvers/symbols/get-symbols.d.ts +53 -0
  1298. package/dist/solvers/symbols/get-symbols.d.ts.map +1 -0
  1299. package/dist/solvers/symbols/get-symbols.js +37 -0
  1300. package/dist/solvers/symbols/get-symbols.js.map +1 -0
  1301. package/dist/solvers/symbols/index.d.ts +5 -0
  1302. package/dist/solvers/symbols/index.d.ts.map +1 -0
  1303. package/dist/solvers/symbols/query.d.ts +28 -0
  1304. package/dist/solvers/symbols/query.d.ts.map +1 -0
  1305. package/dist/solvers/symbols/query.js +33 -0
  1306. package/dist/solvers/symbols/query.js.map +1 -0
  1307. package/dist/solvers/symbols/to-solver-symbol.d.ts +11 -0
  1308. package/dist/solvers/symbols/to-solver-symbol.d.ts.map +1 -0
  1309. package/dist/solvers/symbols/to-solver-symbol.js +40 -0
  1310. package/dist/solvers/symbols/to-solver-symbol.js.map +1 -0
  1311. package/dist/solvers/symbols/types.d.ts +71 -0
  1312. package/dist/solvers/symbols/types.d.ts.map +1 -0
  1313. package/dist/solvers/trade-volume/get-trade-volume.d.ts +37 -0
  1314. package/dist/solvers/trade-volume/get-trade-volume.d.ts.map +1 -0
  1315. package/dist/solvers/trade-volume/get-trade-volume.js +27 -0
  1316. package/dist/solvers/trade-volume/get-trade-volume.js.map +1 -0
  1317. package/dist/solvers/trade-volume/index.d.ts +5 -0
  1318. package/dist/solvers/trade-volume/index.d.ts.map +1 -0
  1319. package/dist/solvers/trade-volume/query.d.ts +29 -0
  1320. package/dist/solvers/trade-volume/query.d.ts.map +1 -0
  1321. package/dist/solvers/trade-volume/query.js +25 -0
  1322. package/dist/solvers/trade-volume/query.js.map +1 -0
  1323. package/dist/solvers/trade-volume/to-daily-volume.d.ts +12 -0
  1324. package/dist/solvers/trade-volume/to-daily-volume.d.ts.map +1 -0
  1325. package/dist/solvers/trade-volume/to-daily-volume.js +11 -0
  1326. package/dist/solvers/trade-volume/to-daily-volume.js.map +1 -0
  1327. package/dist/solvers/trade-volume/types.d.ts +20 -0
  1328. package/dist/solvers/trade-volume/types.d.ts.map +1 -0
  1329. package/dist/solvers/types/generated/enigma-solver.d.ts +168 -13
  1330. package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
  1331. package/dist/solvers/types/generated/enigma-solver.js +26 -2
  1332. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  1333. package/dist/solvers/types/generated/rasa-solver.d.ts +471 -0
  1334. package/dist/solvers/types/generated/rasa-solver.d.ts.map +1 -0
  1335. package/dist/solvers/types/generated/rasa-solver.js +7 -0
  1336. package/dist/solvers/types/generated/rasa-solver.js.map +1 -0
  1337. package/dist/symmio-contracts/abi/index.d.ts +9 -2
  1338. package/dist/symmio-contracts/abi/index.d.ts.map +1 -1
  1339. package/dist/symmio-contracts/account-layer/actions/cancel-registration.d.ts +38 -0
  1340. package/dist/symmio-contracts/account-layer/actions/cancel-registration.d.ts.map +1 -0
  1341. package/dist/symmio-contracts/account-layer/actions/cancel-registration.js +26 -0
  1342. package/dist/symmio-contracts/account-layer/actions/cancel-registration.js.map +1 -0
  1343. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +4 -3
  1344. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
  1345. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
  1346. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +4 -3
  1347. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
  1348. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
  1349. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.d.ts +39 -0
  1350. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.d.ts.map +1 -0
  1351. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js +15 -0
  1352. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js.map +1 -0
  1353. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.d.ts +35 -0
  1354. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.d.ts.map +1 -0
  1355. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js +15 -0
  1356. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js.map +1 -0
  1357. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.d.ts +1 -1
  1358. package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js.map +1 -1
  1359. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.d.ts +56 -0
  1360. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.d.ts.map +1 -0
  1361. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js +26 -0
  1362. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js.map +1 -0
  1363. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts +31 -0
  1364. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts.map +1 -0
  1365. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js +16 -0
  1366. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js.map +1 -0
  1367. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts +33 -0
  1368. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts.map +1 -0
  1369. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js +16 -0
  1370. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js.map +1 -0
  1371. package/dist/symmio-contracts/account-layer/calculate-available-for-order.d.ts +39 -0
  1372. package/dist/symmio-contracts/account-layer/calculate-available-for-order.d.ts.map +1 -0
  1373. package/dist/symmio-contracts/account-layer/calculate-available-for-order.js +14 -0
  1374. package/dist/symmio-contracts/account-layer/calculate-available-for-order.js.map +1 -0
  1375. package/dist/symmio-contracts/account-layer/index.d.ts +13 -0
  1376. package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
  1377. package/dist/symmio-contracts/account-layer/query/cancel-registration.d.ts +22 -0
  1378. package/dist/symmio-contracts/account-layer/query/cancel-registration.d.ts.map +1 -0
  1379. package/dist/symmio-contracts/account-layer/query/cancel-registration.js +12 -0
  1380. package/dist/symmio-contracts/account-layer/query/cancel-registration.js.map +1 -0
  1381. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.d.ts +39 -0
  1382. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.d.ts.map +1 -0
  1383. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +30 -0
  1384. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js.map +1 -0
  1385. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.d.ts +38 -0
  1386. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.d.ts.map +1 -0
  1387. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +29 -0
  1388. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js.map +1 -0
  1389. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.d.ts +22 -0
  1390. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.d.ts.map +1 -0
  1391. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.js +12 -0
  1392. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.js.map +1 -0
  1393. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.d.ts +19 -0
  1394. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.d.ts.map +1 -0
  1395. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.js +12 -0
  1396. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.js.map +1 -0
  1397. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.d.ts +19 -0
  1398. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.d.ts.map +1 -0
  1399. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.js +12 -0
  1400. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.js.map +1 -0
  1401. package/dist/symmio-contracts/account-layer/types.d.ts +68 -0
  1402. package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
  1403. package/dist/symmio-contracts/account-layer/types.js +3 -1
  1404. package/dist/symmio-contracts/account-layer/types.js.map +1 -1
  1405. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +95 -0
  1406. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts.map +1 -0
  1407. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +34 -0
  1408. package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -0
  1409. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts +10 -5
  1410. package/dist/symmio-contracts/symmio/actions/deallocate.d.ts.map +1 -1
  1411. package/dist/symmio-contracts/symmio/actions/deallocate.js +15 -11
  1412. package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
  1413. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts +41 -0
  1414. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.d.ts.map +1 -0
  1415. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +22 -0
  1416. package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -0
  1417. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts +41 -0
  1418. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.d.ts.map +1 -0
  1419. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +22 -0
  1420. package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -0
  1421. package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.d.ts +34 -0
  1422. package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.d.ts.map +1 -0
  1423. package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js +14 -0
  1424. package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js.map +1 -0
  1425. package/dist/symmio-contracts/symmio/actions/get-pending-quotes.d.ts +39 -0
  1426. package/dist/symmio-contracts/symmio/actions/get-pending-quotes.d.ts.map +1 -0
  1427. package/dist/symmio-contracts/symmio/actions/get-pending-quotes.js +29 -0
  1428. package/dist/symmio-contracts/symmio/actions/get-pending-quotes.js.map +1 -0
  1429. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts +41 -0
  1430. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.d.ts.map +1 -0
  1431. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +22 -0
  1432. package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -0
  1433. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts +39 -0
  1434. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.d.ts.map +1 -0
  1435. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +22 -0
  1436. package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -0
  1437. package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.d.ts +33 -0
  1438. package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.d.ts.map +1 -0
  1439. package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js +33 -0
  1440. package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js.map +1 -0
  1441. package/dist/symmio-contracts/symmio/actions/simulate-deallocate.d.ts +2 -1
  1442. package/dist/symmio-contracts/symmio/actions/simulate-deallocate.d.ts.map +1 -1
  1443. package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js +13 -9
  1444. package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js.map +1 -1
  1445. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts +96 -0
  1446. package/dist/symmio-contracts/symmio/actions/withdraw-auto.d.ts.map +1 -0
  1447. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js +31 -0
  1448. package/dist/symmio-contracts/symmio/actions/withdraw-auto.js.map +1 -0
  1449. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +109 -0
  1450. package/dist/symmio-contracts/symmio/actions/withdraw.d.ts.map +1 -0
  1451. package/dist/symmio-contracts/symmio/actions/withdraw.js +34 -0
  1452. package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -0
  1453. package/dist/symmio-contracts/symmio/index.d.ts +20 -0
  1454. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  1455. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts +8 -2
  1456. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.d.ts.map +1 -1
  1457. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +7 -7
  1458. package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
  1459. package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts +4 -2
  1460. package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts.map +1 -1
  1461. package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js +3 -3
  1462. package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js.map +1 -1
  1463. package/dist/symmio-contracts/symmio/query/deallocate-and-initiate-withdraw.d.ts +24 -0
  1464. package/dist/symmio-contracts/symmio/query/deallocate-and-initiate-withdraw.d.ts.map +1 -0
  1465. package/dist/symmio-contracts/symmio/query/deallocate-and-initiate-withdraw.js +12 -0
  1466. package/dist/symmio-contracts/symmio/query/deallocate-and-initiate-withdraw.js.map +1 -0
  1467. package/dist/symmio-contracts/symmio/query/force-cancel-close-request.d.ts +21 -0
  1468. package/dist/symmio-contracts/symmio/query/force-cancel-close-request.d.ts.map +1 -0
  1469. package/dist/symmio-contracts/symmio/query/force-cancel-close-request.js +12 -0
  1470. package/dist/symmio-contracts/symmio/query/force-cancel-close-request.js.map +1 -0
  1471. package/dist/symmio-contracts/symmio/query/force-cancel-quote.d.ts +21 -0
  1472. package/dist/symmio-contracts/symmio/query/force-cancel-quote.d.ts.map +1 -0
  1473. package/dist/symmio-contracts/symmio/query/force-cancel-quote.js +12 -0
  1474. package/dist/symmio-contracts/symmio/query/force-cancel-quote.js.map +1 -0
  1475. package/dist/symmio-contracts/symmio/query/get-cool-downs-of-ma.d.ts +35 -0
  1476. package/dist/symmio-contracts/symmio/query/get-cool-downs-of-ma.d.ts.map +1 -0
  1477. package/dist/symmio-contracts/symmio/query/get-cool-downs-of-ma.js +21 -0
  1478. package/dist/symmio-contracts/symmio/query/get-cool-downs-of-ma.js.map +1 -0
  1479. package/dist/symmio-contracts/symmio/query/get-pending-quotes.d.ts +38 -0
  1480. package/dist/symmio-contracts/symmio/query/get-pending-quotes.d.ts.map +1 -0
  1481. package/dist/symmio-contracts/symmio/query/get-pending-quotes.js +30 -0
  1482. package/dist/symmio-contracts/symmio/query/get-pending-quotes.js.map +1 -0
  1483. package/dist/symmio-contracts/symmio/query/request-to-cancel-close-request.d.ts +21 -0
  1484. package/dist/symmio-contracts/symmio/query/request-to-cancel-close-request.d.ts.map +1 -0
  1485. package/dist/symmio-contracts/symmio/query/request-to-cancel-close-request.js +12 -0
  1486. package/dist/symmio-contracts/symmio/query/request-to-cancel-close-request.js.map +1 -0
  1487. package/dist/symmio-contracts/symmio/query/request-to-cancel-quote.d.ts +22 -0
  1488. package/dist/symmio-contracts/symmio/query/request-to-cancel-quote.d.ts.map +1 -0
  1489. package/dist/symmio-contracts/symmio/query/request-to-cancel-quote.js +12 -0
  1490. package/dist/symmio-contracts/symmio/query/request-to-cancel-quote.js.map +1 -0
  1491. package/dist/symmio-contracts/symmio/query/simulate-deallocate-and-initiate-withdraw.d.ts +20 -0
  1492. package/dist/symmio-contracts/symmio/query/simulate-deallocate-and-initiate-withdraw.d.ts.map +1 -0
  1493. package/dist/symmio-contracts/symmio/query/simulate-deallocate-and-initiate-withdraw.js +12 -0
  1494. package/dist/symmio-contracts/symmio/query/simulate-deallocate-and-initiate-withdraw.js.map +1 -0
  1495. package/dist/symmio-contracts/symmio/query/withdraw-auto.d.ts +26 -0
  1496. package/dist/symmio-contracts/symmio/query/withdraw-auto.d.ts.map +1 -0
  1497. package/dist/symmio-contracts/symmio/query/withdraw-auto.js +12 -0
  1498. package/dist/symmio-contracts/symmio/query/withdraw-auto.js.map +1 -0
  1499. package/dist/symmio-contracts/symmio/query/withdraw.d.ts +25 -0
  1500. package/dist/symmio-contracts/symmio/query/withdraw.d.ts.map +1 -0
  1501. package/dist/symmio-contracts/symmio/query/withdraw.js +12 -0
  1502. package/dist/symmio-contracts/symmio/query/withdraw.js.map +1 -0
  1503. package/dist/symmio-contracts/symmio/types.d.ts +84 -1
  1504. package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
  1505. package/dist/symmio-contracts/symmio/types.js.map +1 -1
  1506. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +13 -1
  1507. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
  1508. package/dist/symmio-subgraph/types/generated/analytics/gql.js +11 -8
  1509. package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
  1510. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +96 -0
  1511. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
  1512. package/dist/symmio-subgraph/types/generated/analytics/graphql.js +2 -2
  1513. package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
  1514. package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.d.ts +5 -1
  1515. package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.d.ts.map +1 -1
  1516. package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.js +13 -7
  1517. package/dist/tpsl/get-quote-tpsl/get-quote-tpsl.js.map +1 -1
  1518. package/dist/tpsl/grouping/estimate-group-tpsl-return.d.ts +35 -0
  1519. package/dist/tpsl/grouping/estimate-group-tpsl-return.d.ts.map +1 -0
  1520. package/dist/tpsl/grouping/estimate-group-tpsl-return.js +30 -0
  1521. package/dist/tpsl/grouping/estimate-group-tpsl-return.js.map +1 -0
  1522. package/dist/tpsl/grouping/index.d.ts +10 -0
  1523. package/dist/tpsl/grouping/index.d.ts.map +1 -0
  1524. package/dist/tpsl/grouping/notional.d.ts +22 -0
  1525. package/dist/tpsl/grouping/notional.d.ts.map +1 -0
  1526. package/dist/tpsl/grouping/notional.js +13 -0
  1527. package/dist/tpsl/grouping/notional.js.map +1 -0
  1528. package/dist/tpsl/grouping/plan-group-tpsl/index.d.ts +2 -0
  1529. package/dist/tpsl/grouping/plan-group-tpsl/index.d.ts.map +1 -0
  1530. package/dist/tpsl/grouping/plan-group-tpsl/plan-group-tpsl.d.ts +66 -0
  1531. package/dist/tpsl/grouping/plan-group-tpsl/plan-group-tpsl.d.ts.map +1 -0
  1532. package/dist/tpsl/grouping/plan-group-tpsl/plan-group-tpsl.js +142 -0
  1533. package/dist/tpsl/grouping/plan-group-tpsl/plan-group-tpsl.js.map +1 -0
  1534. package/dist/tpsl/grouping/plan-group-tpsl-delete.d.ts +24 -0
  1535. package/dist/tpsl/grouping/plan-group-tpsl-delete.d.ts.map +1 -0
  1536. package/dist/tpsl/grouping/plan-group-tpsl-delete.js +51 -0
  1537. package/dist/tpsl/grouping/plan-group-tpsl-delete.js.map +1 -0
  1538. package/dist/tpsl/grouping/resolve-child-side.d.ts +44 -0
  1539. package/dist/tpsl/grouping/resolve-child-side.d.ts.map +1 -0
  1540. package/dist/tpsl/grouping/resolve-child-side.js +21 -0
  1541. package/dist/tpsl/grouping/resolve-child-side.js.map +1 -0
  1542. package/dist/tpsl/grouping/summarize-group-tpsl.d.ts +39 -0
  1543. package/dist/tpsl/grouping/summarize-group-tpsl.d.ts.map +1 -0
  1544. package/dist/tpsl/grouping/summarize-group-tpsl.js +42 -0
  1545. package/dist/tpsl/grouping/summarize-group-tpsl.js.map +1 -0
  1546. package/dist/tpsl/grouping/to-group-tpsl-children.d.ts +33 -0
  1547. package/dist/tpsl/grouping/to-group-tpsl-children.d.ts.map +1 -0
  1548. package/dist/tpsl/grouping/to-group-tpsl-children.js +30 -0
  1549. package/dist/tpsl/grouping/to-group-tpsl-children.js.map +1 -0
  1550. package/dist/tpsl/grouping/to-group-tpsl-orders.d.ts +21 -0
  1551. package/dist/tpsl/grouping/to-group-tpsl-orders.d.ts.map +1 -0
  1552. package/dist/tpsl/grouping/to-group-tpsl-orders.js +33 -0
  1553. package/dist/tpsl/grouping/to-group-tpsl-orders.js.map +1 -0
  1554. package/dist/tpsl/grouping/types.d.ts +294 -0
  1555. package/dist/tpsl/grouping/types.d.ts.map +1 -0
  1556. package/dist/tpsl/index.d.ts +3 -0
  1557. package/dist/tpsl/index.d.ts.map +1 -1
  1558. package/dist/tpsl/internal/resolve-tpsl-config.d.ts +2 -2
  1559. package/dist/tpsl/internal/resolve-tpsl-config.d.ts.map +1 -1
  1560. package/dist/tpsl/internal/resolve-tpsl-config.js +7 -4
  1561. package/dist/tpsl/internal/resolve-tpsl-config.js.map +1 -1
  1562. package/dist/tpsl/search-tpsl-orders/index.d.ts +3 -0
  1563. package/dist/tpsl/search-tpsl-orders/index.d.ts.map +1 -0
  1564. package/dist/tpsl/search-tpsl-orders/query.d.ts +19 -0
  1565. package/dist/tpsl/search-tpsl-orders/query.d.ts.map +1 -0
  1566. package/dist/tpsl/search-tpsl-orders/query.js +21 -0
  1567. package/dist/tpsl/search-tpsl-orders/query.js.map +1 -0
  1568. package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.d.ts +102 -0
  1569. package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.d.ts.map +1 -0
  1570. package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.js +47 -0
  1571. package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.js.map +1 -0
  1572. package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.d.ts +1 -1
  1573. package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.js.map +1 -1
  1574. package/dist/tpsl/slippage.d.ts +3 -3
  1575. package/dist/tpsl/slippage.js.map +1 -1
  1576. package/dist/tpsl/supports-tpsl.d.ts +27 -0
  1577. package/dist/tpsl/supports-tpsl.d.ts.map +1 -0
  1578. package/dist/tpsl/supports-tpsl.js +15 -0
  1579. package/dist/tpsl/supports-tpsl.js.map +1 -0
  1580. package/dist/tpsl/types/generated/tpsl-handler.js +6 -4
  1581. package/dist/tpsl/types/generated/tpsl-handler.js.map +1 -1
  1582. package/dist/tpsl/types.d.ts +14 -0
  1583. package/dist/tpsl/types.d.ts.map +1 -1
  1584. package/dist/tpsl/types.js +8 -0
  1585. package/dist/tpsl/types.js.map +1 -0
  1586. package/dist/tpsl/validate-tpsl.d.ts +1 -1
  1587. package/dist/tpsl/validate-tpsl.js.map +1 -1
  1588. package/dist/websocket/notifications/adapters/enigma-notifications.d.ts +42 -0
  1589. package/dist/websocket/notifications/adapters/enigma-notifications.d.ts.map +1 -0
  1590. package/dist/websocket/notifications/adapters/enigma-notifications.js +63 -0
  1591. package/dist/websocket/notifications/adapters/enigma-notifications.js.map +1 -0
  1592. package/dist/websocket/notifications/adapters/index.d.ts +4 -0
  1593. package/dist/websocket/notifications/adapters/index.d.ts.map +1 -0
  1594. package/dist/websocket/notifications/adapters/rasa-notifications-hub.d.ts +36 -0
  1595. package/dist/websocket/notifications/adapters/rasa-notifications-hub.d.ts.map +1 -0
  1596. package/dist/websocket/notifications/adapters/rasa-notifications-hub.js +50 -0
  1597. package/dist/websocket/notifications/adapters/rasa-notifications-hub.js.map +1 -0
  1598. package/dist/websocket/notifications/adapters/rasa-notifications.d.ts +24 -0
  1599. package/dist/websocket/notifications/adapters/rasa-notifications.d.ts.map +1 -0
  1600. package/dist/websocket/notifications/adapters/rasa-notifications.js +43 -0
  1601. package/dist/websocket/notifications/adapters/rasa-notifications.js.map +1 -0
  1602. package/dist/websocket/notifications/index.d.ts +3 -1
  1603. package/dist/websocket/notifications/index.d.ts.map +1 -1
  1604. package/dist/websocket/notifications/normalize-notification.d.ts +6 -3
  1605. package/dist/websocket/notifications/normalize-notification.d.ts.map +1 -1
  1606. package/dist/websocket/notifications/normalize-notification.js +10 -7
  1607. package/dist/websocket/notifications/normalize-notification.js.map +1 -1
  1608. package/dist/websocket/notifications/parse-frame-payload.d.ts +7 -0
  1609. package/dist/websocket/notifications/parse-frame-payload.d.ts.map +1 -0
  1610. package/dist/websocket/notifications/parse-frame-payload.js +14 -0
  1611. package/dist/websocket/notifications/parse-frame-payload.js.map +1 -0
  1612. package/dist/websocket/notifications/parse-notification-frame.d.ts +13 -6
  1613. package/dist/websocket/notifications/parse-notification-frame.d.ts.map +1 -1
  1614. package/dist/websocket/notifications/parse-notification-frame.js +7 -16
  1615. package/dist/websocket/notifications/parse-notification-frame.js.map +1 -1
  1616. package/dist/websocket/notifications/to-notifications-error.d.ts +8 -0
  1617. package/dist/websocket/notifications/to-notifications-error.d.ts.map +1 -0
  1618. package/dist/websocket/notifications/to-notifications-error.js +11 -0
  1619. package/dist/websocket/notifications/to-notifications-error.js.map +1 -0
  1620. package/dist/websocket/notifications/types.d.ts +90 -19
  1621. package/dist/websocket/notifications/types.d.ts.map +1 -1
  1622. package/dist/websocket/notifications/types.js.map +1 -1
  1623. package/dist/websocket/notifications/watch-notifications.d.ts +11 -27
  1624. package/dist/websocket/notifications/watch-notifications.d.ts.map +1 -1
  1625. package/dist/websocket/notifications/watch-notifications.js +11 -42
  1626. package/dist/websocket/notifications/watch-notifications.js.map +1 -1
  1627. package/dist/websocket/prices/index.d.ts +3 -0
  1628. package/dist/websocket/prices/index.d.ts.map +1 -1
  1629. package/dist/websocket/prices/parse-binance-price-frame.d.ts +25 -0
  1630. package/dist/websocket/prices/parse-binance-price-frame.d.ts.map +1 -0
  1631. package/dist/websocket/prices/parse-binance-price-frame.js +55 -0
  1632. package/dist/websocket/prices/parse-binance-price-frame.js.map +1 -0
  1633. package/dist/websocket/prices/watch-binance-prices.d.ts +89 -0
  1634. package/dist/websocket/prices/watch-binance-prices.d.ts.map +1 -0
  1635. package/dist/websocket/prices/watch-binance-prices.js +53 -0
  1636. package/dist/websocket/prices/watch-binance-prices.js.map +1 -0
  1637. package/dist/websocket/prices/watch-enigma-prices.d.ts +6 -1
  1638. package/dist/websocket/prices/watch-enigma-prices.d.ts.map +1 -1
  1639. package/dist/websocket/prices/watch-enigma-prices.js +24 -15
  1640. package/dist/websocket/prices/watch-enigma-prices.js.map +1 -1
  1641. package/dist/websocket/prices/watch-prices.d.ts +66 -0
  1642. package/dist/websocket/prices/watch-prices.d.ts.map +1 -0
  1643. package/dist/websocket/prices/watch-prices.js +40 -0
  1644. package/dist/websocket/prices/watch-prices.js.map +1 -0
  1645. package/dist/websocket/tpsl/parse-tpsl-frame.d.ts +1 -1
  1646. package/dist/websocket/tpsl/parse-tpsl-frame.js.map +1 -1
  1647. package/dist/websocket/tpsl/types.d.ts +1 -1
  1648. package/dist/websocket/tpsl/watch-tpsl-notifications.d.ts +1 -1
  1649. package/dist/websocket/tpsl/watch-tpsl-notifications.js +6 -6
  1650. package/dist/websocket/tpsl/watch-tpsl-notifications.js.map +1 -1
  1651. package/package.json +1 -1
  1652. package/dist/solvers/instant-open/get-instant-opens/to-pending-instant-open.d.ts.map +0 -1
  1653. package/dist/solvers/instant-open/get-instant-opens/to-pending-instant-open.js +0 -22
  1654. package/dist/solvers/instant-open/get-instant-opens/to-pending-instant-open.js.map +0 -1
  1655. package/dist/solvers/market-info/to-market-info.d.ts +0 -13
  1656. package/dist/solvers/market-info/to-market-info.d.ts.map +0 -1
  1657. package/dist/solvers/market-info/to-market-info.js +0 -28
  1658. package/dist/solvers/market-info/to-market-info.js.map +0 -1
  1659. package/dist/solvers/notional-cap/to-market-notional-cap.d.ts +0 -9
  1660. package/dist/solvers/notional-cap/to-market-notional-cap.d.ts.map +0 -1
  1661. package/dist/solvers/notional-cap/to-market-notional-cap.js +0 -22
  1662. package/dist/solvers/notional-cap/to-market-notional-cap.js.map +0 -1
  1663. package/dist/websocket/notifications/build-subscribe-message.d.ts +0 -24
  1664. package/dist/websocket/notifications/build-subscribe-message.d.ts.map +0 -1
  1665. package/dist/websocket/notifications/build-subscribe-message.js +0 -17
  1666. package/dist/websocket/notifications/build-subscribe-message.js.map +0 -1
@@ -23,6 +23,63 @@ export type QuoteNotificationActionKind = "open" | "close" | "other";
23
23
  * ```
24
24
  */
25
25
  export declare function classifyQuoteNotificationAction(action: string | null | undefined): QuoteNotificationActionKind;
26
+ /**
27
+ * Whether a notification's `lastSeenAction` is an open **anchor** — the quote
28
+ * landed on-chain (`SendQuoteTransaction` / `SendQuote` / `FillLimitOrderOpen`),
29
+ * as opposed to the earlier off-chain `InstantRFQ` price fill. This is the
30
+ * "second" notification of a send flow: the temp id now has a real on-chain quote
31
+ * id. Use it to refetch reads that only change once the quote exists on-chain —
32
+ * e.g. the pending-quotes (resting limit orders) list.
33
+ *
34
+ * @param action - The notification's `lastSeenAction` (may be `null`/absent).
35
+ * @returns `true` for an open-anchor action, otherwise `false`.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * if (n.type === NotificationType.SUCCESS && isOpenAnchorAction(n.lastSeenAction)) refetchPending();
40
+ * ```
41
+ */
42
+ export declare function isOpenAnchorAction(action: string | null | undefined): boolean;
43
+ /**
44
+ * Whether a notification's `lastSeenAction` is a close **fill** — the close actually
45
+ * executed (`FillMarketOrderInstantClose` / `FillLimitOrderClose`), as opposed to a
46
+ * close *request*. Narrower than {@link classifyQuoteNotificationAction} `=== "close"`,
47
+ * which also matches the request. Use this to react only once the close has filled —
48
+ * e.g. to start chasing the on-chain settle, which only begins after the fill.
49
+ *
50
+ * @param action - The notification's `lastSeenAction` (may be `null`/absent).
51
+ * @returns `true` for a close-fill action, otherwise `false`.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * if (isCloseFillAction(n.lastSeenAction)) startCloseConfirmChase(n.quoteId);
56
+ * ```
57
+ */
58
+ export declare function isCloseFillAction(action: string | null | undefined): boolean;
59
+ /**
60
+ * Whether a notification's `lastSeenAction` belongs to the **cancel** flow —
61
+ * cancelling a resting order (`RequestToCancelQuote` and the other cancel paths).
62
+ *
63
+ * Broader than {@link classifyQuoteNotificationAction}, which reports every cancel
64
+ * action as `"other"` — deliberately, since a cancel frame must not mutate a row
65
+ * (the chain is the authority on whether the cancel landed).
66
+ *
67
+ * Cancel is the one flow whose **confirming** transaction is sent by someone else:
68
+ * `requestToCancelQuote` on a `LOCKED` quote only moves it to `CANCEL_PENDING` and
69
+ * leaves it in `partyAPendingQuotes`; the solver's later `acceptCancelRequest` is
70
+ * what sets `CANCELED` and removes it — and that transaction is not announced on
71
+ * the notifications stream. A consumer that reacts to frames alone therefore shows
72
+ * a cancelled order forever. Use this to start chasing the on-chain read.
73
+ *
74
+ * @param action - The notification's `lastSeenAction` (may be `null`/absent).
75
+ * @returns `true` for a cancel-flow action, otherwise `false`.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * if (isCancelAction(n.lastSeenAction)) startCancelConfirmChase(n.quoteId);
80
+ * ```
81
+ */
82
+ export declare function isCancelAction(action: string | null | undefined): boolean;
26
83
  /**
27
84
  * Apply a single notification to a list of {@link UnifiedQuote}s, returning a new
28
85
  * list (pure — inputs are never mutated).
@@ -1 +1 @@
1
- {"version":3,"file":"apply-notification.d.ts","sourceRoot":"","sources":["../../src/quotes/apply-notification.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAkDpE;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,2BAA2B,CAK9G;AAiHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAEjG"}
1
+ {"version":3,"file":"apply-notification.d.ts","sourceRoot":"","sources":["../../src/quotes/apply-notification.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiFpE;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,2BAA2B,CAK9G;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEzE;AAmHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAEjG"}
@@ -6,38 +6,55 @@ var r = new Set([
6
6
  "SendQuoteTransaction",
7
7
  "SendQuote",
8
8
  "FillLimitOrderOpen"
9
- ]), i = new Set(["InstantRFQ"]), a = new Set(["InstantRequestToClosePosition", "RequestToClosePosition"]), o = new Set(["FillMarketOrderInstantClose", "FillLimitOrderClose"]), s = new Set([...a, ...o]), c = {
9
+ ]), i = new Set(["InstantRFQ"]), a = new Set(["InstantRequestToClosePosition", "RequestToClosePosition"]), o = new Set(["FillMarketOrderInstantClose", "FillLimitOrderClose"]), s = new Set(["InstantRequestToLimitClose"]), c = new Set([
10
+ ...a,
11
+ ...s,
12
+ ...o
13
+ ]), l = new Set([
14
+ "RequestToCancelQuote",
15
+ "AcceptCancelRequest",
16
+ "ForceCancelQuote",
17
+ "ExpireQuote"
18
+ ]), u = {
10
19
  [n.OPTIMISTIC_CLOSE]: 1,
11
20
  [n.CLOSE_PRICE_FILLED]: 2,
12
- [n.WRITE_ONCHAIN_CLOSE]: 3,
13
- [n.CLOSING]: 4
21
+ [n.WRITE_ONCHAIN_CLOSE]: 3
14
22
  };
15
- function l(e) {
16
- return c[e] ?? 0;
23
+ function d(e) {
24
+ return u[e] ?? 0;
17
25
  }
18
- function u(e) {
19
- return e ? r.has(e) || i.has(e) ? "open" : s.has(e) ? "close" : "other" : "other";
26
+ function f(e) {
27
+ return e ? r.has(e) || i.has(e) ? "open" : c.has(e) ? "close" : "other" : "other";
20
28
  }
21
- function d(e, t) {
29
+ function p(e) {
30
+ return e != null && r.has(e);
31
+ }
32
+ function m(e) {
33
+ return e != null && o.has(e);
34
+ }
35
+ function h(e) {
36
+ return e != null && l.has(e);
37
+ }
38
+ function g(e, t) {
22
39
  return e.quoteId !== void 0 && t.quoteId === `${e.quoteId}` || e.tempQuoteId !== void 0 && e.tempQuoteId === t.tempQuoteId;
23
40
  }
24
- function f(a, c) {
25
- let u = { ...a }, d = c.quoteId && c.quoteId !== `${c.tempQuoteId}` ? BigInt(c.quoteId) : void 0;
26
- d !== void 0 && u.quoteId === void 0 && (u.quoteId = d, u.key = `onchain:${d}`, u.origin = "onchain"), u.tempQuoteId === void 0 && c.tempQuoteId !== 0 && (u.tempQuoteId = c.tempQuoteId), c.vaAddress && (u.vaAddress = c.vaAddress);
27
- let f = c.lastSeenAction ?? "";
28
- if (c.type === e.FAILED) return u.origin === "onchain" && u.raw.onchain === void 0 && (u.lifecycle = n.FAILED), u;
29
- if (c.type !== e.SUCCESS) return u;
30
- if (s.has(f)) {
31
- c.avgPriceClose && (u.avgClosedPrice = u.avgClosedPrice ?? t(c.avgPriceClose));
32
- let e = o.has(f) ? n.WRITE_ONCHAIN_CLOSE : n.CLOSE_PRICE_FILLED;
33
- return (l(u.lifecycle) > 0 || u.origin !== "onchain") && l(e) > l(u.lifecycle) && (u.lifecycle = e), u;
41
+ function _(a, l) {
42
+ let u = { ...a }, f = l.quoteId && l.quoteId !== `${l.tempQuoteId}` ? BigInt(l.quoteId) : void 0;
43
+ f !== void 0 && u.quoteId === void 0 && (u.quoteId = f, u.key = `onchain:${f}`, u.origin = "onchain"), u.tempQuoteId === void 0 && l.tempQuoteId !== 0 && (u.tempQuoteId = l.tempQuoteId), l.vaAddress && (u.vaAddress = l.vaAddress);
44
+ let p = l.lastSeenAction ?? "";
45
+ if (l.type === e.FAILED) return u.origin === "onchain" && u.raw.onchain === void 0 && (u.lifecycle = n.FAILED), u;
46
+ if (l.type !== e.SUCCESS) return u;
47
+ if (c.has(p)) {
48
+ l.avgPriceClose && (u.avgClosedPrice = u.avgClosedPrice ?? t(l.avgPriceClose));
49
+ let e = o.has(p) || s.has(p) ? n.WRITE_ONCHAIN_CLOSE : n.CLOSE_PRICE_FILLED;
50
+ return (d(u.lifecycle) > 0 || u.origin !== "onchain") && d(e) > d(u.lifecycle) && (u.lifecycle = e), u;
34
51
  }
35
- return r.has(f) ? (c.avgPriceOpen && (u.openedPrice = t(c.avgPriceOpen)), u.raw.onchain === void 0 && (u.lifecycle = n.WRITE_ONCHAIN), u) : i.has(f) ? (c.avgPriceOpen && (u.openedPrice = t(c.avgPriceOpen)), u.lifecycle = u.origin === "onchain" ? u.lifecycle : n.PRICE_FILLED, u) : u;
52
+ return r.has(p) ? (l.avgPriceOpen && (u.openedPrice = t(l.avgPriceOpen)), u.raw.onchain === void 0 && (u.lifecycle = n.WRITE_ONCHAIN), u) : i.has(p) ? (l.avgPriceOpen && (u.openedPrice = t(l.avgPriceOpen)), u.lifecycle = u.origin === "onchain" ? u.lifecycle : n.PRICE_FILLED, u) : u;
36
53
  }
37
- function p(e, t) {
38
- return e.map((e) => d(e, t) ? f(e, t) : e);
54
+ function v(e, t) {
55
+ return e.map((e) => g(e, t) ? _(e, t) : e);
39
56
  }
40
57
  //#endregion
41
- export { p as applyNotificationToQuotes, u as classifyQuoteNotificationAction };
58
+ export { v as applyNotificationToQuotes, f as classifyQuoteNotificationAction, h as isCancelAction, m as isCloseFillAction, p as isOpenAnchorAction };
42
59
 
43
60
  //# sourceMappingURL=apply-notification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-notification.js","names":[],"sources":["../../src/quotes/apply-notification.ts"],"sourcesContent":["import { toWeiBigInt } from \"../solvers/instant-open/shared/trade-math\";\nimport { NotificationType, type Notification } from \"../websocket/notifications/types\";\nimport { QuoteLifecycle, type UnifiedQuote } from \"./unified-quote\";\n\n/**\n * Solver `lastSeenAction` values that, on success, anchor a quote on-chain.\n */\nconst OPEN_ANCHOR_ACTIONS = new Set([\"SendQuoteTransaction\", \"SendQuote\", \"FillLimitOrderOpen\"]);\n\n/**\n * Solver `lastSeenAction` values that report a fill price while the trade is\n * still off-chain (the optimistic row gets a price before its on-chain id lands).\n */\nconst PRICE_FILL_ACTIONS = new Set([\"InstantRFQ\"]);\n\n/**\n * Close `lastSeenAction` values that report the close price / fill request — the\n * first close notification, analogous to `InstantRFQ` on the open side. Advances a\n * closing row to {@link QuoteLifecycle.CLOSE_PRICE_FILLED}.\n */\nconst CLOSE_REQUEST_ACTIONS = new Set([\"InstantRequestToClosePosition\", \"RequestToClosePosition\"]);\n\n/**\n * Close `lastSeenAction` values that report the on-chain fill — the second close\n * notification, analogous to the open-anchor actions. Advances a closing row to\n * {@link QuoteLifecycle.WRITE_ONCHAIN_CLOSE}.\n */\nconst CLOSE_FILL_ACTIONS = new Set([\"FillMarketOrderInstantClose\", \"FillLimitOrderClose\"]);\n\n/**\n * All `lastSeenAction` values that belong to the closing flow (request + fill).\n */\nconst CLOSE_ACTIONS = new Set([...CLOSE_REQUEST_ACTIONS, ...CLOSE_FILL_ACTIONS]);\n\n/**\n * Rank of each closing-stage lifecycle, used to advance a close monotonically and\n * to detect that a row is currently \"in a close\" (rank &gt; 0). Higher = further\n * along: the poll-confirmed `CLOSING` (`CLOSE_PENDING`) outranks the\n * notification-driven stages, so a replayed close notification never regresses it.\n */\nconst CLOSE_STAGE_RANK: Partial<Record<QuoteLifecycle, number>> = {\n [QuoteLifecycle.OPTIMISTIC_CLOSE]: 1,\n [QuoteLifecycle.CLOSE_PRICE_FILLED]: 2,\n [QuoteLifecycle.WRITE_ONCHAIN_CLOSE]: 3,\n [QuoteLifecycle.CLOSING]: 4,\n};\n\n/** The closing-stage rank of a lifecycle (0 when it is not a closing stage). */\nfunction closeStageRank(lifecycle: QuoteLifecycle): number {\n return CLOSE_STAGE_RANK[lifecycle] ?? 0;\n}\n\n/**\n * The kind of quote action a notification reports, derived from its\n * `lastSeenAction`. Consumers use this to scope cache invalidation to the reads a\n * notification can actually affect — an open-anchor event never changes the\n * pending-instant-close feed, and vice versa.\n */\nexport type QuoteNotificationActionKind = \"open\" | \"close\" | \"other\";\n\n/**\n * Classify a notification's `lastSeenAction` into the quote flow it belongs to.\n *\n * Open-side actions (anchoring an open, or the `InstantRFQ` price fill) classify\n * as `\"open\"`; close-request/fill actions classify as `\"close\"`; anything else\n * (including failures and unknown actions) is `\"other\"`.\n *\n * @param action - The notification's `lastSeenAction` (may be `null`/absent).\n * @returns The quote flow the action belongs to.\n *\n * @example\n * ```ts\n * if (classifyQuoteNotificationAction(n.lastSeenAction) === \"close\") invalidateCloses();\n * ```\n */\nexport function classifyQuoteNotificationAction(action: string | null | undefined): QuoteNotificationActionKind {\n if (!action) return \"other\";\n if (OPEN_ANCHOR_ACTIONS.has(action) || PRICE_FILL_ACTIONS.has(action)) return \"open\";\n if (CLOSE_ACTIONS.has(action)) return \"close\";\n return \"other\";\n}\n\n/**\n * Decide whether a notification refers to a given unified row, matching first by\n * on-chain quote id and then by the pre-chain temp id.\n */\nfunction notificationMatchesQuote(quote: UnifiedQuote, n: Notification): boolean {\n if (quote.quoteId !== undefined && n.quoteId === `${quote.quoteId}`) return true;\n if (quote.tempQuoteId !== undefined && quote.tempQuoteId === n.tempQuoteId) return true;\n return false;\n}\n\n/**\n * Apply one notification to a single matched {@link UnifiedQuote}, returning a\n * new row with the linked ids, filled prices, and advanced lifecycle.\n */\nfunction applyToMatched(quote: UnifiedQuote, n: Notification): UnifiedQuote {\n const next: UnifiedQuote = { ...quote };\n const onchainId = n.quoteId && n.quoteId !== `${n.tempQuoteId}` ? BigInt(n.quoteId) : undefined;\n\n if (onchainId !== undefined && next.quoteId === undefined) {\n next.quoteId = onchainId;\n next.key = `onchain:${onchainId}`;\n next.origin = \"onchain\";\n }\n if (next.tempQuoteId === undefined && n.tempQuoteId !== 0) {\n next.tempQuoteId = n.tempQuoteId;\n }\n if (n.vaAddress) {\n next.vaAddress = n.vaAddress as UnifiedQuote[\"vaAddress\"];\n }\n\n const action = n.lastSeenAction ?? \"\";\n\n if (n.type === NotificationType.FAILED) {\n /**\n * A failure is an *event*, not a durable state of a quote that exists, so we do\n * not flash `FAILED` in the common cases:\n * - a failed *action* on a confirmed on-chain row (e.g. a rejected partial\n * close) leaves the position `OPENED` — it stays put and defers to the polled\n * status (notifications are replayed every tick, so stamping `FAILED` here\n * would pin a live position and block any retry);\n * - a failed *open* that never anchored simply has no quote — its optimistic row\n * vanishes on its own once the hedger drops the pending open (active-quotes\n * only), with no `FAILED` flicker.\n *\n * The only row we mark `FAILED` is one the chain was told anchored\n * (`origin === \"onchain\"`, `quoteId` set) but the read never returned\n * (`raw.onchain` absent) — a reverted anchor — so it drops out of the retained\n * anchor set instead of hanging at `WRITE_ONCHAIN` forever.\n */\n if (next.origin === \"onchain\" && next.raw.onchain === undefined) {\n next.lifecycle = QuoteLifecycle.FAILED;\n }\n return next;\n }\n if (n.type !== NotificationType.SUCCESS) {\n return next;\n }\n if (CLOSE_ACTIONS.has(action)) {\n if (n.avgPriceClose) {\n next.avgClosedPrice = next.avgClosedPrice ?? toWeiBigInt(n.avgPriceClose);\n }\n /**\n * Advance the close stage from the notification: the request\n * (`InstantRequestToClosePosition`) → `CLOSE_PRICE_FILLED`, the fill\n * (`FillMarketOrderInstantClose`) → `WRITE_ONCHAIN_CLOSE`.\n *\n * This only applies to a row that is **already in a closing stage** — the\n * pending-instant-close overlay (the self-clearing in-flight signal from the\n * hedger feed) puts an anchored row at `OPTIMISTIC_CLOSE` before notifications\n * run — or to a not-yet-anchored off-chain row. Once the close settles, the\n * feed drops, the overlay no longer runs, and the polled row is back at\n * `ONCHAIN` (rank 0): these **replayed** close notifications then match nothing\n * to advance, so a settled close never sticks (the bug the old `origin` guard\n * prevented). The advance is monotonic on {@link closeStageRank}, so neither a\n * replay nor the earlier request notification can regress the poll-confirmed\n * `CLOSING`.\n */\n const stage = CLOSE_FILL_ACTIONS.has(action)\n ? QuoteLifecycle.WRITE_ONCHAIN_CLOSE\n : QuoteLifecycle.CLOSE_PRICE_FILLED;\n const inClosingFlow = closeStageRank(next.lifecycle) > 0 || next.origin !== \"onchain\";\n if (inClosingFlow && closeStageRank(stage) > closeStageRank(next.lifecycle)) {\n next.lifecycle = stage;\n }\n return next;\n }\n if (OPEN_ANCHOR_ACTIONS.has(action)) {\n if (n.avgPriceOpen) {\n next.openedPrice = toWeiBigInt(n.avgPriceOpen);\n }\n /**\n * The notification reports the quote anchored on-chain, but the on-chain read\n * may not have returned its struct yet. Surface `WRITE_ONCHAIN` — \"anchored,\n * awaiting the RPC\" — until the polled struct arrives (`raw.onchain` present),\n * at which point reconciliation collapses this onto the real on-chain row and\n * its polled status wins. An already-anchored row (struct present) keeps its\n * polled lifecycle.\n */\n if (next.raw.onchain === undefined) next.lifecycle = QuoteLifecycle.WRITE_ONCHAIN;\n return next;\n }\n if (PRICE_FILL_ACTIONS.has(action)) {\n if (n.avgPriceOpen) {\n next.openedPrice = toWeiBigInt(n.avgPriceOpen);\n }\n next.lifecycle = next.origin === \"onchain\" ? next.lifecycle : QuoteLifecycle.PRICE_FILLED;\n return next;\n }\n return next;\n}\n\n/**\n * Apply a single notification to a list of {@link UnifiedQuote}s, returning a new\n * list (pure — inputs are never mutated).\n *\n * The notification is matched to a row by on-chain quote id, falling back to the\n * pre-chain temp id, which is how an optimistic row gets linked to its on-chain\n * quote (`temp:<id>` → `onchain:<id>`). On the matched row it:\n *\n * - links `tempQuoteId` ↔ `quoteId` and rekeys it once the on-chain id appears;\n * - fills `openedPrice` and advances to `PRICE_FILLED` on `InstantRFQ` success;\n * - advances to `ONCHAIN` on `SendQuoteTransaction` (open-anchor) success;\n * - advances the close stage on a row already in the closing flow (or an\n * off-chain row): the request → `CLOSE_PRICE_FILLED`, the fill →\n * `WRITE_ONCHAIN_CLOSE`, monotonically. A settled close (polled back to\n * `ONCHAIN`) is no longer in a closing stage, so the replayed close\n * notifications match nothing to advance and never re-stick it;\n * - advances to `FAILED` **only for an anchored-but-unread row whose anchor reverted**\n * (`origin === \"onchain\"`, `raw.onchain` absent). A failed close on a confirmed\n * position stays put (defers to the poll), and a failed open's optimistic row just\n * vanishes when the hedger drops it — failure is an event, not a durable state.\n *\n * @param quotes - The current unified rows.\n * @param n - The normalized notification to apply.\n * @returns A new list with the matched row updated; the same list (by content) when nothing matched.\n *\n * @example\n * ```ts\n * const next = applyNotificationToQuotes(quotes, notification);\n * ```\n */\nexport function applyNotificationToQuotes(quotes: UnifiedQuote[], n: Notification): UnifiedQuote[] {\n return quotes.map((quote) => (notificationMatchesQuote(quote, n) ? applyToMatched(quote, n) : quote));\n}\n"],"mappings":";;;;AAOA,IAAM,IAAsB,IAAI,IAAI;CAAC;CAAwB;CAAa;AAAoB,CAAC,GAMzF,IAAqB,IAAI,IAAI,CAAC,YAAY,CAAC,GAO3C,IAAwB,IAAI,IAAI,CAAC,iCAAiC,wBAAwB,CAAC,GAO3F,IAAqB,IAAI,IAAI,CAAC,+BAA+B,qBAAqB,CAAC,GAKnF,IAAgB,IAAI,IAAI,CAAC,GAAG,GAAuB,GAAG,CAAkB,CAAC,GAQzE,IAA4D;EAC/D,EAAe,mBAAmB;EAClC,EAAe,qBAAqB;EACpC,EAAe,sBAAsB;EACrC,EAAe,UAAU;AAC5B;AAGA,SAAS,EAAe,GAAmC;CACzD,OAAO,EAAiB,MAAc;AACxC;AAyBA,SAAgB,EAAgC,GAAgE;CAI9G,OAHK,IACD,EAAoB,IAAI,CAAM,KAAK,EAAmB,IAAI,CAAM,IAAU,SAC1E,EAAc,IAAI,CAAM,IAAU,UAC/B,UAHa;AAItB;AAMA,SAAS,EAAyB,GAAqB,GAA0B;CAG/E,OAFI,EAAM,YAAY,KAAA,KAAa,EAAE,YAAY,GAAG,EAAM,aACtD,EAAM,gBAAgB,KAAA,KAAa,EAAM,gBAAgB,EAAE;AAEjE;AAMA,SAAS,EAAe,GAAqB,GAA+B;CAC1E,IAAM,IAAqB,EAAE,GAAG,EAAM,GAChC,IAAY,EAAE,WAAW,EAAE,YAAY,GAAG,EAAE,gBAAgB,OAAO,EAAE,OAAO,IAAI,KAAA;CAUtF,AARI,MAAc,KAAA,KAAa,EAAK,YAAY,KAAA,MAC9C,EAAK,UAAU,GACf,EAAK,MAAM,WAAW,KACtB,EAAK,SAAS,YAEZ,EAAK,gBAAgB,KAAA,KAAa,EAAE,gBAAgB,MACtD,EAAK,cAAc,EAAE,cAEnB,EAAE,cACJ,EAAK,YAAY,EAAE;CAGrB,IAAM,IAAS,EAAE,kBAAkB;CAEnC,IAAI,EAAE,SAAS,EAAiB,QAoB9B,OAHI,EAAK,WAAW,aAAa,EAAK,IAAI,YAAY,KAAA,MACpD,EAAK,YAAY,EAAe,SAE3B;CAET,IAAI,EAAE,SAAS,EAAiB,SAC9B,OAAO;CAET,IAAI,EAAc,IAAI,CAAM,GAAG;EAC7B,AAAI,EAAE,kBACJ,EAAK,iBAAiB,EAAK,kBAAkB,EAAY,EAAE,aAAa;EAkB1E,IAAM,IAAQ,EAAmB,IAAI,CAAM,IACvC,EAAe,sBACf,EAAe;EAKnB,QAJsB,EAAe,EAAK,SAAS,IAAI,KAAK,EAAK,WAAW,cACvD,EAAe,CAAK,IAAI,EAAe,EAAK,SAAS,MACxE,EAAK,YAAY,IAEZ;CACT;CAuBA,OAtBI,EAAoB,IAAI,CAAM,KAC5B,EAAE,iBACJ,EAAK,cAAc,EAAY,EAAE,YAAY,IAU3C,EAAK,IAAI,YAAY,KAAA,MAAW,EAAK,YAAY,EAAe,gBAC7D,KAEL,EAAmB,IAAI,CAAM,KAC3B,EAAE,iBACJ,EAAK,cAAc,EAAY,EAAE,YAAY,IAE/C,EAAK,YAAY,EAAK,WAAW,YAAY,EAAK,YAAY,EAAe,cACtE,KAEF;AACT;AAgCA,SAAgB,EAA0B,GAAwB,GAAiC;CACjG,OAAO,EAAO,KAAK,MAAW,EAAyB,GAAO,CAAC,IAAI,EAAe,GAAO,CAAC,IAAI,CAAM;AACtG"}
1
+ {"version":3,"file":"apply-notification.js","names":[],"sources":["../../src/quotes/apply-notification.ts"],"sourcesContent":["import { toWeiBigInt } from \"../solvers/instant-open/shared/trade-math\";\nimport { NotificationType, type Notification } from \"../websocket/notifications/types\";\nimport { QuoteLifecycle, type UnifiedQuote } from \"./unified-quote\";\n\n/**\n * Solver `lastSeenAction` values that, on success, anchor a quote on-chain.\n */\nconst OPEN_ANCHOR_ACTIONS = new Set([\"SendQuoteTransaction\", \"SendQuote\", \"FillLimitOrderOpen\"]);\n\n/**\n * Solver `lastSeenAction` values that report a fill price while the trade is\n * still off-chain (the optimistic row gets a price before its on-chain id lands).\n */\nconst PRICE_FILL_ACTIONS = new Set([\"InstantRFQ\"]);\n\n/**\n * Close `lastSeenAction` values that report the close price / fill request — the\n * solver **accepted** the close (analogous to `InstantRFQ` on the open side).\n * Advances a closing row to {@link QuoteLifecycle.CLOSE_PRICE_FILLED}.\n */\nconst CLOSE_REQUEST_ACTIONS = new Set([\"InstantRequestToClosePosition\", \"RequestToClosePosition\"]);\n\n/**\n * Close `lastSeenAction` values that report the on-chain **fill** — the close\n * executed. Advances a closing row to {@link QuoteLifecycle.WRITE_ONCHAIN_CLOSE}.\n */\nconst CLOSE_FILL_ACTIONS = new Set([\"FillMarketOrderInstantClose\", \"FillLimitOrderClose\"]);\n\n/**\n * Close `lastSeenAction` values that report the close **anchored on-chain** without\n * a fill — a resting **limit** close (`InstantRequestToLimitClose`): the position\n * is being written to `CLOSE_PENDING` at the user's price but nothing filled yet.\n * Like a fill it advances to {@link QuoteLifecycle.WRITE_ONCHAIN_CLOSE} (\"writing\n * on-chain\"), but it is **not** a settle — no balance moves — so it stays out of\n * {@link CLOSE_FILL_ACTIONS} (and the settle-confirm chase).\n */\nconst CLOSE_ANCHOR_ACTIONS = new Set([\"InstantRequestToLimitClose\"]);\n\n/**\n * All `lastSeenAction` values that belong to the closing flow (request + anchor + fill).\n */\nconst CLOSE_ACTIONS = new Set([...CLOSE_REQUEST_ACTIONS, ...CLOSE_ANCHOR_ACTIONS, ...CLOSE_FILL_ACTIONS]);\n\n/**\n * `lastSeenAction` values that belong to the **cancel** flow — cancelling a resting\n * order rather than closing a position.\n *\n * Only `RequestToCancelQuote` is confirmed against a live solver frame. The other\n * three are the contract's remaining cancel paths (`forceCancelQuote`,\n * `expireQuote`, the solver's own `acceptCancelRequest`); it is **not** confirmed\n * that the hedger publishes a frame for any of them — observed history for a\n * cancelled quote contained the request frame only. They are listed so that a\n * vendor that does emit them is handled, and cost nothing when it does not.\n */\nconst CANCEL_ACTIONS = new Set([\n \"RequestToCancelQuote\",\n /** TODO(vendor-verify): unconfirmed — never observed on the Rasa notifications stream. */\n \"AcceptCancelRequest\",\n /** TODO(vendor-verify): unconfirmed — never observed on the Rasa notifications stream. */\n \"ForceCancelQuote\",\n /** TODO(vendor-verify): unconfirmed — never observed on the Rasa notifications stream. */\n \"ExpireQuote\",\n]);\n\n/**\n * Rank of each closing-stage lifecycle, used to advance a close monotonically and\n * to detect that a row is currently \"in a close\" (rank &gt; 0). Higher = further\n * along; `WRITE_ONCHAIN_CLOSE` is the furthest in-flight stage. Once the on-chain\n * read reflects the close the row leaves the closing flow at `ONCHAIN`\n * (`quoteStatus: CLOSE_PENDING`, rank 0), so a replayed close notification then\n * matches nothing to advance.\n */\nconst CLOSE_STAGE_RANK: Partial<Record<QuoteLifecycle, number>> = {\n [QuoteLifecycle.OPTIMISTIC_CLOSE]: 1,\n [QuoteLifecycle.CLOSE_PRICE_FILLED]: 2,\n [QuoteLifecycle.WRITE_ONCHAIN_CLOSE]: 3,\n};\n\n/** The closing-stage rank of a lifecycle (0 when it is not a closing stage). */\nfunction closeStageRank(lifecycle: QuoteLifecycle): number {\n return CLOSE_STAGE_RANK[lifecycle] ?? 0;\n}\n\n/**\n * The kind of quote action a notification reports, derived from its\n * `lastSeenAction`. Consumers use this to scope cache invalidation to the reads a\n * notification can actually affect — an open-anchor event never changes the\n * pending-instant-close feed, and vice versa.\n */\nexport type QuoteNotificationActionKind = \"open\" | \"close\" | \"other\";\n\n/**\n * Classify a notification's `lastSeenAction` into the quote flow it belongs to.\n *\n * Open-side actions (anchoring an open, or the `InstantRFQ` price fill) classify\n * as `\"open\"`; close-request/fill actions classify as `\"close\"`; anything else\n * (including failures and unknown actions) is `\"other\"`.\n *\n * @param action - The notification's `lastSeenAction` (may be `null`/absent).\n * @returns The quote flow the action belongs to.\n *\n * @example\n * ```ts\n * if (classifyQuoteNotificationAction(n.lastSeenAction) === \"close\") invalidateCloses();\n * ```\n */\nexport function classifyQuoteNotificationAction(action: string | null | undefined): QuoteNotificationActionKind {\n if (!action) return \"other\";\n if (OPEN_ANCHOR_ACTIONS.has(action) || PRICE_FILL_ACTIONS.has(action)) return \"open\";\n if (CLOSE_ACTIONS.has(action)) return \"close\";\n return \"other\";\n}\n\n/**\n * Whether a notification's `lastSeenAction` is an open **anchor** — the quote\n * landed on-chain (`SendQuoteTransaction` / `SendQuote` / `FillLimitOrderOpen`),\n * as opposed to the earlier off-chain `InstantRFQ` price fill. This is the\n * \"second\" notification of a send flow: the temp id now has a real on-chain quote\n * id. Use it to refetch reads that only change once the quote exists on-chain —\n * e.g. the pending-quotes (resting limit orders) list.\n *\n * @param action - The notification's `lastSeenAction` (may be `null`/absent).\n * @returns `true` for an open-anchor action, otherwise `false`.\n *\n * @example\n * ```ts\n * if (n.type === NotificationType.SUCCESS && isOpenAnchorAction(n.lastSeenAction)) refetchPending();\n * ```\n */\nexport function isOpenAnchorAction(action: string | null | undefined): boolean {\n return action != null && OPEN_ANCHOR_ACTIONS.has(action);\n}\n\n/**\n * Whether a notification's `lastSeenAction` is a close **fill** — the close actually\n * executed (`FillMarketOrderInstantClose` / `FillLimitOrderClose`), as opposed to a\n * close *request*. Narrower than {@link classifyQuoteNotificationAction} `=== \"close\"`,\n * which also matches the request. Use this to react only once the close has filled —\n * e.g. to start chasing the on-chain settle, which only begins after the fill.\n *\n * @param action - The notification's `lastSeenAction` (may be `null`/absent).\n * @returns `true` for a close-fill action, otherwise `false`.\n *\n * @example\n * ```ts\n * if (isCloseFillAction(n.lastSeenAction)) startCloseConfirmChase(n.quoteId);\n * ```\n */\nexport function isCloseFillAction(action: string | null | undefined): boolean {\n return action != null && CLOSE_FILL_ACTIONS.has(action);\n}\n\n/**\n * Whether a notification's `lastSeenAction` belongs to the **cancel** flow —\n * cancelling a resting order (`RequestToCancelQuote` and the other cancel paths).\n *\n * Broader than {@link classifyQuoteNotificationAction}, which reports every cancel\n * action as `\"other\"` — deliberately, since a cancel frame must not mutate a row\n * (the chain is the authority on whether the cancel landed).\n *\n * Cancel is the one flow whose **confirming** transaction is sent by someone else:\n * `requestToCancelQuote` on a `LOCKED` quote only moves it to `CANCEL_PENDING` and\n * leaves it in `partyAPendingQuotes`; the solver's later `acceptCancelRequest` is\n * what sets `CANCELED` and removes it — and that transaction is not announced on\n * the notifications stream. A consumer that reacts to frames alone therefore shows\n * a cancelled order forever. Use this to start chasing the on-chain read.\n *\n * @param action - The notification's `lastSeenAction` (may be `null`/absent).\n * @returns `true` for a cancel-flow action, otherwise `false`.\n *\n * @example\n * ```ts\n * if (isCancelAction(n.lastSeenAction)) startCancelConfirmChase(n.quoteId);\n * ```\n */\nexport function isCancelAction(action: string | null | undefined): boolean {\n return action != null && CANCEL_ACTIONS.has(action);\n}\n\n/**\n * Decide whether a notification refers to a given unified row, matching first by\n * on-chain quote id and then by the pre-chain temp id.\n */\nfunction notificationMatchesQuote(quote: UnifiedQuote, n: Notification): boolean {\n if (quote.quoteId !== undefined && n.quoteId === `${quote.quoteId}`) return true;\n if (quote.tempQuoteId !== undefined && quote.tempQuoteId === n.tempQuoteId) return true;\n return false;\n}\n\n/**\n * Apply one notification to a single matched {@link UnifiedQuote}, returning a\n * new row with the linked ids, filled prices, and advanced lifecycle.\n */\nfunction applyToMatched(quote: UnifiedQuote, n: Notification): UnifiedQuote {\n const next: UnifiedQuote = { ...quote };\n const onchainId = n.quoteId && n.quoteId !== `${n.tempQuoteId}` ? BigInt(n.quoteId) : undefined;\n\n if (onchainId !== undefined && next.quoteId === undefined) {\n next.quoteId = onchainId;\n next.key = `onchain:${onchainId}`;\n next.origin = \"onchain\";\n }\n if (next.tempQuoteId === undefined && n.tempQuoteId !== 0) {\n next.tempQuoteId = n.tempQuoteId;\n }\n if (n.vaAddress) {\n next.vaAddress = n.vaAddress as UnifiedQuote[\"vaAddress\"];\n }\n\n const action = n.lastSeenAction ?? \"\";\n\n if (n.type === NotificationType.FAILED) {\n /**\n * A failure is an *event*, not a durable state of a quote that exists, so we do\n * not flash `FAILED` in the common cases:\n * - a failed *action* on a confirmed on-chain row (e.g. a rejected partial\n * close) leaves the position `OPENED` — it stays put and defers to the polled\n * status (notifications are replayed every tick, so stamping `FAILED` here\n * would pin a live position and block any retry);\n * - a failed *open* that never anchored simply has no quote — its optimistic row\n * vanishes on its own once the hedger drops the pending open (active-quotes\n * only), with no `FAILED` flicker.\n *\n * The only row we mark `FAILED` is one the chain was told anchored\n * (`origin === \"onchain\"`, `quoteId` set) but the read never returned\n * (`raw.onchain` absent) — a reverted anchor — so it drops out of the retained\n * anchor set instead of hanging at `WRITE_ONCHAIN` forever.\n */\n if (next.origin === \"onchain\" && next.raw.onchain === undefined) {\n next.lifecycle = QuoteLifecycle.FAILED;\n }\n return next;\n }\n if (n.type !== NotificationType.SUCCESS) {\n return next;\n }\n if (CLOSE_ACTIONS.has(action)) {\n if (n.avgPriceClose) {\n next.avgClosedPrice = next.avgClosedPrice ?? toWeiBigInt(n.avgPriceClose);\n }\n /**\n * Advance the close stage from the notification: the request\n * (`InstantRequestToClosePosition`) → `CLOSE_PRICE_FILLED` (solver accepted),\n * the fill (`FillMarketOrderInstantClose`) or the limit-close anchor\n * (`InstantRequestToLimitClose`) → `WRITE_ONCHAIN_CLOSE` (writing on-chain).\n *\n * This only applies to a row that is **already in a closing stage** — the\n * pending-instant-close overlay (the self-clearing in-flight signal from the\n * hedger feed) puts an anchored row at `OPTIMISTIC_CLOSE` before notifications\n * run — or to a not-yet-anchored off-chain row. Once the close settles, the\n * feed drops, the overlay no longer runs, and the polled row is back at\n * `ONCHAIN` (rank 0): these **replayed** close notifications then match nothing\n * to advance, so a settled close never sticks (the bug the old `origin` guard\n * prevented). The advance is monotonic on {@link closeStageRank}, so neither a\n * replay nor the earlier request notification can regress the poll-confirmed\n * `CLOSING`.\n */\n const stage =\n CLOSE_FILL_ACTIONS.has(action) || CLOSE_ANCHOR_ACTIONS.has(action)\n ? QuoteLifecycle.WRITE_ONCHAIN_CLOSE\n : QuoteLifecycle.CLOSE_PRICE_FILLED;\n const inClosingFlow = closeStageRank(next.lifecycle) > 0 || next.origin !== \"onchain\";\n if (inClosingFlow && closeStageRank(stage) > closeStageRank(next.lifecycle)) {\n next.lifecycle = stage;\n }\n return next;\n }\n if (OPEN_ANCHOR_ACTIONS.has(action)) {\n if (n.avgPriceOpen) {\n next.openedPrice = toWeiBigInt(n.avgPriceOpen);\n }\n /**\n * The notification reports the quote anchored on-chain, but the on-chain read\n * may not have returned its struct yet. Surface `WRITE_ONCHAIN` — \"anchored,\n * awaiting the RPC\" — until the polled struct arrives (`raw.onchain` present),\n * at which point reconciliation collapses this onto the real on-chain row and\n * its polled status wins. An already-anchored row (struct present) keeps its\n * polled lifecycle.\n */\n if (next.raw.onchain === undefined) next.lifecycle = QuoteLifecycle.WRITE_ONCHAIN;\n return next;\n }\n if (PRICE_FILL_ACTIONS.has(action)) {\n if (n.avgPriceOpen) {\n next.openedPrice = toWeiBigInt(n.avgPriceOpen);\n }\n next.lifecycle = next.origin === \"onchain\" ? next.lifecycle : QuoteLifecycle.PRICE_FILLED;\n return next;\n }\n return next;\n}\n\n/**\n * Apply a single notification to a list of {@link UnifiedQuote}s, returning a new\n * list (pure — inputs are never mutated).\n *\n * The notification is matched to a row by on-chain quote id, falling back to the\n * pre-chain temp id, which is how an optimistic row gets linked to its on-chain\n * quote (`temp:<id>` → `onchain:<id>`). On the matched row it:\n *\n * - links `tempQuoteId` ↔ `quoteId` and rekeys it once the on-chain id appears;\n * - fills `openedPrice` and advances to `PRICE_FILLED` on `InstantRFQ` success;\n * - advances to `ONCHAIN` on `SendQuoteTransaction` (open-anchor) success;\n * - advances the close stage on a row already in the closing flow (or an\n * off-chain row): the request → `CLOSE_PRICE_FILLED`, the fill →\n * `WRITE_ONCHAIN_CLOSE`, monotonically. A settled close (polled back to\n * `ONCHAIN`) is no longer in a closing stage, so the replayed close\n * notifications match nothing to advance and never re-stick it;\n * - advances to `FAILED` **only for an anchored-but-unread row whose anchor reverted**\n * (`origin === \"onchain\"`, `raw.onchain` absent). A failed close on a confirmed\n * position stays put (defers to the poll), and a failed open's optimistic row just\n * vanishes when the hedger drops it — failure is an event, not a durable state.\n *\n * @param quotes - The current unified rows.\n * @param n - The normalized notification to apply.\n * @returns A new list with the matched row updated; the same list (by content) when nothing matched.\n *\n * @example\n * ```ts\n * const next = applyNotificationToQuotes(quotes, notification);\n * ```\n */\nexport function applyNotificationToQuotes(quotes: UnifiedQuote[], n: Notification): UnifiedQuote[] {\n return quotes.map((quote) => (notificationMatchesQuote(quote, n) ? applyToMatched(quote, n) : quote));\n}\n"],"mappings":";;;;AAOA,IAAM,IAAsB,IAAI,IAAI;CAAC;CAAwB;CAAa;AAAoB,CAAC,GAMzF,IAAqB,IAAI,IAAI,CAAC,YAAY,CAAC,GAO3C,IAAwB,IAAI,IAAI,CAAC,iCAAiC,wBAAwB,CAAC,GAM3F,IAAqB,IAAI,IAAI,CAAC,+BAA+B,qBAAqB,CAAC,GAUnF,IAAuB,IAAI,IAAI,CAAC,4BAA4B,CAAC,GAK7D,IAAgB,IAAI,IAAI;CAAC,GAAG;CAAuB,GAAG;CAAsB,GAAG;AAAkB,CAAC,GAalG,IAAiB,IAAI,IAAI;CAC7B;CAEA;CAEA;CAEA;AACF,CAAC,GAUK,IAA4D;EAC/D,EAAe,mBAAmB;EAClC,EAAe,qBAAqB;EACpC,EAAe,sBAAsB;AACxC;AAGA,SAAS,EAAe,GAAmC;CACzD,OAAO,EAAiB,MAAc;AACxC;AAyBA,SAAgB,EAAgC,GAAgE;CAI9G,OAHK,IACD,EAAoB,IAAI,CAAM,KAAK,EAAmB,IAAI,CAAM,IAAU,SAC1E,EAAc,IAAI,CAAM,IAAU,UAC/B,UAHa;AAItB;AAkBA,SAAgB,EAAmB,GAA4C;CAC7E,OAAO,KAAU,QAAQ,EAAoB,IAAI,CAAM;AACzD;AAiBA,SAAgB,EAAkB,GAA4C;CAC5E,OAAO,KAAU,QAAQ,EAAmB,IAAI,CAAM;AACxD;AAyBA,SAAgB,EAAe,GAA4C;CACzE,OAAO,KAAU,QAAQ,EAAe,IAAI,CAAM;AACpD;AAMA,SAAS,EAAyB,GAAqB,GAA0B;CAG/E,OAFI,EAAM,YAAY,KAAA,KAAa,EAAE,YAAY,GAAG,EAAM,aACtD,EAAM,gBAAgB,KAAA,KAAa,EAAM,gBAAgB,EAAE;AAEjE;AAMA,SAAS,EAAe,GAAqB,GAA+B;CAC1E,IAAM,IAAqB,EAAE,GAAG,EAAM,GAChC,IAAY,EAAE,WAAW,EAAE,YAAY,GAAG,EAAE,gBAAgB,OAAO,EAAE,OAAO,IAAI,KAAA;CAUtF,AARI,MAAc,KAAA,KAAa,EAAK,YAAY,KAAA,MAC9C,EAAK,UAAU,GACf,EAAK,MAAM,WAAW,KACtB,EAAK,SAAS,YAEZ,EAAK,gBAAgB,KAAA,KAAa,EAAE,gBAAgB,MACtD,EAAK,cAAc,EAAE,cAEnB,EAAE,cACJ,EAAK,YAAY,EAAE;CAGrB,IAAM,IAAS,EAAE,kBAAkB;CAEnC,IAAI,EAAE,SAAS,EAAiB,QAoB9B,OAHI,EAAK,WAAW,aAAa,EAAK,IAAI,YAAY,KAAA,MACpD,EAAK,YAAY,EAAe,SAE3B;CAET,IAAI,EAAE,SAAS,EAAiB,SAC9B,OAAO;CAET,IAAI,EAAc,IAAI,CAAM,GAAG;EAC7B,AAAI,EAAE,kBACJ,EAAK,iBAAiB,EAAK,kBAAkB,EAAY,EAAE,aAAa;EAmB1E,IAAM,IACJ,EAAmB,IAAI,CAAM,KAAK,EAAqB,IAAI,CAAM,IAC7D,EAAe,sBACf,EAAe;EAKrB,QAJsB,EAAe,EAAK,SAAS,IAAI,KAAK,EAAK,WAAW,cACvD,EAAe,CAAK,IAAI,EAAe,EAAK,SAAS,MACxE,EAAK,YAAY,IAEZ;CACT;CAuBA,OAtBI,EAAoB,IAAI,CAAM,KAC5B,EAAE,iBACJ,EAAK,cAAc,EAAY,EAAE,YAAY,IAU3C,EAAK,IAAI,YAAY,KAAA,MAAW,EAAK,YAAY,EAAe,gBAC7D,KAEL,EAAmB,IAAI,CAAM,KAC3B,EAAE,iBACJ,EAAK,cAAc,EAAY,EAAE,YAAY,IAE/C,EAAK,YAAY,EAAK,WAAW,YAAY,EAAK,YAAY,EAAe,cACtE,KAEF;AACT;AAgCA,SAAgB,EAA0B,GAAwB,GAAiC;CACjG,OAAO,EAAO,KAAK,MAAW,EAAyB,GAAO,CAAC,IAAI,EAAe,GAAO,CAAC,IAAI,CAAM;AACtG"}
@@ -0,0 +1,5 @@
1
+ export * from './min-remaining-quantity.js';
2
+ export * from './plan-group-close/index.js';
3
+ export * from './to-close-candidates.js';
4
+ export * from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/quotes/close-planning/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { UnifiedQuote } from '../unified-quote.js';
2
+ /**
3
+ * Smallest open quantity a quote may keep after a partial close, wei.
4
+ *
5
+ * The contract accepts a partial close only when the remaining position's
6
+ * partyA-locked value stays above the symbol's minimum (perps-core v0.8.5
7
+ * `LibQuoteClose.closeQuote`: `lockedValues.totalForPartyA() == 0 ||
8
+ * lockedValues.totalForPartyA() >= minAcceptableQuoteValue` — "Remaining quote
9
+ * value is low"). Locked values shrink proportionally with the closed amount,
10
+ * so the size bound is:
11
+ *
12
+ * `remaining ≥ openQuantity × minAcceptableQuoteValue / lockedForPartyA`
13
+ *
14
+ * rounded **up** (a remainder one wei short would revert). `lockedForPartyA` is
15
+ * the current `cva + lf + partyAmm`.
16
+ *
17
+ * Returns `openQuantity` (i.e. "full close only") when the quote has no
18
+ * partyA-locked value on record — without a margin basis no partial remainder
19
+ * can be proven acceptable.
20
+ *
21
+ * @param quote - The quote being partially closed.
22
+ * @param minAcceptableQuoteValue - The symbol's `minAcceptableQuoteValue`, wei.
23
+ * @returns The minimum acceptable remainder, wei.
24
+ */
25
+ export declare function minRemainingQuantityOf(quote: UnifiedQuote, minAcceptableQuoteValue: bigint): bigint;
26
+ //# sourceMappingURL=min-remaining-quantity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min-remaining-quantity.d.ts","sourceRoot":"","sources":["../../../src/quotes/close-planning/min-remaining-quantity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAWrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,GAAG,MAAM,CAKnG"}
@@ -0,0 +1,12 @@
1
+ //#region src/quotes/close-planning/min-remaining-quantity.ts
2
+ function e(e, t) {
3
+ return (e + t - 1n) / t;
4
+ }
5
+ function t(t, n) {
6
+ let r = t.lockedValues.cva + t.lockedValues.lf + t.lockedValues.partyAmm;
7
+ return r <= 0n ? t.openQuantity : e(t.openQuantity * n, r);
8
+ }
9
+ //#endregion
10
+ export { t as minRemainingQuantityOf };
11
+
12
+ //# sourceMappingURL=min-remaining-quantity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"min-remaining-quantity.js","names":[],"sources":["../../../src/quotes/close-planning/min-remaining-quantity.ts"],"sourcesContent":["import type { UnifiedQuote } from \"../unified-quote\";\n\n/**\n * Integer division rounding **up** (toward positive infinity). JavaScript has\n * no built-in ceiling for `bigint` — `/` always truncates, and `Math.ceil`\n * neither accepts `bigint` nor survives the 2^53 precision limit of `number`.\n */\nfunction ceilDiv(numerator: bigint, denominator: bigint): bigint {\n return (numerator + denominator - 1n) / denominator;\n}\n\n/**\n * Smallest open quantity a quote may keep after a partial close, wei.\n *\n * The contract accepts a partial close only when the remaining position's\n * partyA-locked value stays above the symbol's minimum (perps-core v0.8.5\n * `LibQuoteClose.closeQuote`: `lockedValues.totalForPartyA() == 0 ||\n * lockedValues.totalForPartyA() >= minAcceptableQuoteValue` — \"Remaining quote\n * value is low\"). Locked values shrink proportionally with the closed amount,\n * so the size bound is:\n *\n * `remaining ≥ openQuantity × minAcceptableQuoteValue / lockedForPartyA`\n *\n * rounded **up** (a remainder one wei short would revert). `lockedForPartyA` is\n * the current `cva + lf + partyAmm`.\n *\n * Returns `openQuantity` (i.e. \"full close only\") when the quote has no\n * partyA-locked value on record — without a margin basis no partial remainder\n * can be proven acceptable.\n *\n * @param quote - The quote being partially closed.\n * @param minAcceptableQuoteValue - The symbol's `minAcceptableQuoteValue`, wei.\n * @returns The minimum acceptable remainder, wei.\n */\nexport function minRemainingQuantityOf(quote: UnifiedQuote, minAcceptableQuoteValue: bigint): bigint {\n const lockedForPartyA = quote.lockedValues.cva + quote.lockedValues.lf + quote.lockedValues.partyAmm;\n if (lockedForPartyA <= 0n) return quote.openQuantity;\n // Round up — rounding down would allow a remainder that reverts on-chain.\n return ceilDiv(quote.openQuantity * minAcceptableQuoteValue, lockedForPartyA);\n}\n"],"mappings":";AAOA,SAAS,EAAQ,GAAmB,GAA6B;CAC/D,QAAQ,IAAY,IAAc,MAAM;AAC1C;AAyBA,SAAgB,EAAuB,GAAqB,GAAyC;CACnG,IAAM,IAAkB,EAAM,aAAa,MAAM,EAAM,aAAa,KAAK,EAAM,aAAa;CAG5F,OAFI,KAAmB,KAAW,EAAM,eAEjC,EAAQ,EAAM,eAAe,GAAyB,CAAe;AAC9E"}
@@ -0,0 +1,2 @@
1
+ export * from './plan-group-close.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/quotes/close-planning/plan-group-close/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { GroupCloseCandidate, PlanGroupCloseResult } from '../types.js';
2
+ /**
3
+ * Plan an **exact** partial close of `targetQuantity` across a group's child
4
+ * quotes, touching as few quotes as reasonably possible.
5
+ *
6
+ * Greedy single pass over candidates ordered by {@link compareCandidates}
7
+ * (largest first). Per candidate:
8
+ *
9
+ * - amount left ≥ its open size → close it **fully**;
10
+ * - otherwise close the largest **partial** that leaves no dust
11
+ * (`openQuantity − minRemainingQuantity`), and spill any excess to the next
12
+ * candidate.
13
+ *
14
+ * The plan either sums to the target exactly or fails — it never closes more
15
+ * or less than asked. Failure reasons: `exceeds-open` (target above the
16
+ * group's open size), `nothing-to-close` (no candidates / non-positive
17
+ * target), `dust-locked` (every remaining child is at its dust cap; the
18
+ * failure carries `closeableQuantity`, the largest amount that would have
19
+ * worked). Pure and deterministic; input order does not matter.
20
+ *
21
+ * @param candidates - Closable children (see `toGroupCloseCandidates`).
22
+ * @param targetQuantity - Exact amount to close, wei.
23
+ * @returns The allocation plan, or a typed failure.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const plan = planGroupClose(candidates, 2_800000000000000000n);
28
+ * if (plan.feasible) await executeAllocations(plan.allocations);
29
+ * ```
30
+ */
31
+ export declare function planGroupClose(candidates: readonly GroupCloseCandidate[], targetQuantity: bigint): PlanGroupCloseResult;
32
+ //# sourceMappingURL=plan-group-close.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-group-close.d.ts","sourceRoot":"","sources":["../../../../src/quotes/close-planning/plan-group-close/plan-group-close.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAYhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,mBAAmB,EAAE,EAC1C,cAAc,EAAE,MAAM,GACrB,oBAAoB,CAiDtB"}
@@ -0,0 +1,60 @@
1
+ //#region src/quotes/close-planning/plan-group-close/plan-group-close.ts
2
+ function e(e, t) {
3
+ return e.openQuantity === t.openQuantity ? e.key < t.key ? -1 : +(e.key > t.key) : e.openQuantity > t.openQuantity ? -1 : 1;
4
+ }
5
+ function t(t, n) {
6
+ let r = t.filter((e) => e.openQuantity > 0n), i = r.reduce((e, t) => e + t.openQuantity, 0n);
7
+ if (n <= 0n || r.length === 0) return {
8
+ feasible: !1,
9
+ reason: "nothing-to-close",
10
+ totalOpen: i,
11
+ closeableQuantity: 0n
12
+ };
13
+ if (n > i) return {
14
+ feasible: !1,
15
+ reason: "exceeds-open",
16
+ totalOpen: i,
17
+ closeableQuantity: i
18
+ };
19
+ if (n === i) return {
20
+ feasible: !0,
21
+ allocations: r.map((e) => ({
22
+ key: e.key,
23
+ closeQuantity: e.openQuantity,
24
+ kind: "full"
25
+ }))
26
+ };
27
+ let a = [...r].sort(e), o = [], s = n;
28
+ for (let e of a) {
29
+ if (s === 0n) break;
30
+ if (s >= e.openQuantity) {
31
+ o.push({
32
+ key: e.key,
33
+ closeQuantity: e.openQuantity,
34
+ kind: "full"
35
+ }), s -= e.openQuantity;
36
+ continue;
37
+ }
38
+ let t = e.openQuantity - e.minRemainingQuantity;
39
+ if (t <= 0n) continue;
40
+ let n = s < t ? s : t;
41
+ o.push({
42
+ key: e.key,
43
+ closeQuantity: n,
44
+ kind: "partial"
45
+ }), s -= n;
46
+ }
47
+ return s > 0n ? {
48
+ feasible: !1,
49
+ reason: "dust-locked",
50
+ totalOpen: i,
51
+ closeableQuantity: n - s
52
+ } : {
53
+ feasible: !0,
54
+ allocations: o
55
+ };
56
+ }
57
+ //#endregion
58
+ export { t as planGroupClose };
59
+
60
+ //# sourceMappingURL=plan-group-close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-group-close.js","names":[],"sources":["../../../../src/quotes/close-planning/plan-group-close/plan-group-close.ts"],"sourcesContent":["import type { GroupCloseAllocation, GroupCloseCandidate, PlanGroupCloseResult } from \"../types\";\n\n/**\n * Execution order for the greedy pass: largest open size first — consuming the\n * biggest quotes reaches the target with the fewest quotes touched. Equal sizes\n * tie-break on `key` for determinism.\n */\nfunction compareCandidates(a: GroupCloseCandidate, b: GroupCloseCandidate): number {\n if (a.openQuantity === b.openQuantity) return a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\n return a.openQuantity > b.openQuantity ? -1 : 1;\n}\n\n/**\n * Plan an **exact** partial close of `targetQuantity` across a group's child\n * quotes, touching as few quotes as reasonably possible.\n *\n * Greedy single pass over candidates ordered by {@link compareCandidates}\n * (largest first). Per candidate:\n *\n * - amount left ≥ its open size → close it **fully**;\n * - otherwise close the largest **partial** that leaves no dust\n * (`openQuantity − minRemainingQuantity`), and spill any excess to the next\n * candidate.\n *\n * The plan either sums to the target exactly or fails — it never closes more\n * or less than asked. Failure reasons: `exceeds-open` (target above the\n * group's open size), `nothing-to-close` (no candidates / non-positive\n * target), `dust-locked` (every remaining child is at its dust cap; the\n * failure carries `closeableQuantity`, the largest amount that would have\n * worked). Pure and deterministic; input order does not matter.\n *\n * @param candidates - Closable children (see `toGroupCloseCandidates`).\n * @param targetQuantity - Exact amount to close, wei.\n * @returns The allocation plan, or a typed failure.\n *\n * @example\n * ```ts\n * const plan = planGroupClose(candidates, 2_800000000000000000n);\n * if (plan.feasible) await executeAllocations(plan.allocations);\n * ```\n */\nexport function planGroupClose(\n candidates: readonly GroupCloseCandidate[],\n targetQuantity: bigint,\n): PlanGroupCloseResult {\n const open = candidates.filter((candidate) => candidate.openQuantity > 0n);\n const totalOpen = open.reduce((sum, candidate) => sum + candidate.openQuantity, 0n);\n\n if (targetQuantity <= 0n || open.length === 0) {\n return { feasible: false, reason: \"nothing-to-close\", totalOpen, closeableQuantity: 0n };\n }\n if (targetQuantity > totalOpen) {\n return { feasible: false, reason: \"exceeds-open\", totalOpen, closeableQuantity: totalOpen };\n }\n if (targetQuantity === totalOpen) {\n return {\n feasible: true,\n allocations: open.map((candidate) => ({\n key: candidate.key,\n closeQuantity: candidate.openQuantity,\n kind: \"full\",\n })),\n };\n }\n\n const sorted = [...open].sort(compareCandidates);\n const allocations: GroupCloseAllocation[] = [];\n let remaining = targetQuantity;\n\n for (const candidate of sorted) {\n if (remaining === 0n) break;\n if (remaining >= candidate.openQuantity) {\n allocations.push({ key: candidate.key, closeQuantity: candidate.openQuantity, kind: \"full\" });\n remaining -= candidate.openQuantity;\n continue;\n }\n // Largest partial that leaves an acceptable remainder; ≤ 0 ⇒ full-close-only child, skip.\n const cap = candidate.openQuantity - candidate.minRemainingQuantity;\n if (cap <= 0n) continue;\n const take = remaining < cap ? remaining : cap;\n allocations.push({ key: candidate.key, closeQuantity: take, kind: \"partial\" });\n remaining -= take;\n }\n\n if (remaining > 0n) {\n return {\n feasible: false,\n reason: \"dust-locked\",\n totalOpen,\n closeableQuantity: targetQuantity - remaining,\n };\n }\n return { feasible: true, allocations };\n}\n"],"mappings":";AAOA,SAAS,EAAkB,GAAwB,GAAgC;CAEjF,OADI,EAAE,iBAAiB,EAAE,eAAqB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAE,MAAM,EAAE,OACtE,EAAE,eAAe,EAAE,eAAe,KAAK;AAChD;AA+BA,SAAgB,EACd,GACA,GACsB;CACtB,IAAM,IAAO,EAAW,QAAQ,MAAc,EAAU,eAAe,EAAE,GACnE,IAAY,EAAK,QAAQ,GAAK,MAAc,IAAM,EAAU,cAAc,EAAE;CAElF,IAAI,KAAkB,MAAM,EAAK,WAAW,GAC1C,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAoB;EAAW,mBAAmB;CAAG;CAEzF,IAAI,IAAiB,GACnB,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAgB;EAAW,mBAAmB;CAAU;CAE5F,IAAI,MAAmB,GACrB,OAAO;EACL,UAAU;EACV,aAAa,EAAK,KAAK,OAAe;GACpC,KAAK,EAAU;GACf,eAAe,EAAU;GACzB,MAAM;EACR,EAAE;CACJ;CAGF,IAAM,IAAS,CAAC,GAAG,CAAI,EAAE,KAAK,CAAiB,GACzC,IAAsC,CAAC,GACzC,IAAY;CAEhB,KAAK,IAAM,KAAa,GAAQ;EAC9B,IAAI,MAAc,IAAI;EACtB,IAAI,KAAa,EAAU,cAAc;GAEvC,AADA,EAAY,KAAK;IAAE,KAAK,EAAU;IAAK,eAAe,EAAU;IAAc,MAAM;GAAO,CAAC,GAC5F,KAAa,EAAU;GACvB;EACF;EAEA,IAAM,IAAM,EAAU,eAAe,EAAU;EAC/C,IAAI,KAAO,IAAI;EACf,IAAM,IAAO,IAAY,IAAM,IAAY;EAE3C,AADA,EAAY,KAAK;GAAE,KAAK,EAAU;GAAK,eAAe;GAAM,MAAM;EAAU,CAAC,GAC7E,KAAa;CACf;CAUA,OARI,IAAY,KACP;EACL,UAAU;EACV,QAAQ;EACR;EACA,mBAAmB,IAAiB;CACtC,IAEK;EAAE,UAAU;EAAM;CAAY;AACvC"}
@@ -0,0 +1,17 @@
1
+ import { UnifiedQuote } from '../unified-quote.js';
2
+ import { GroupCloseCandidate } from './types.js';
3
+ /**
4
+ * Build {@link GroupCloseCandidate}s for {@link planGroupClose} from a group's
5
+ * child quotes.
6
+ *
7
+ * Only children that can actually receive a close order qualify: anchored
8
+ * on-chain (`quoteId` known), status `OPENED` (a `CLOSE_PENDING` child already
9
+ * has a close in flight), and open size left. Each candidate carries its
10
+ * contract min-remainder (see {@link minRemainingQuantityOf}).
11
+ *
12
+ * @param quotes - The group's child quotes.
13
+ * @param minAcceptableQuoteValue - The symbol's `minAcceptableQuoteValue`, wei.
14
+ * @returns Candidates for the planner, in the input order.
15
+ */
16
+ export declare function toGroupCloseCandidates(quotes: readonly UnifiedQuote[], minAcceptableQuoteValue: bigint): GroupCloseCandidate[];
17
+ //# sourceMappingURL=to-close-candidates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-close-candidates.d.ts","sourceRoot":"","sources":["../../../src/quotes/close-planning/to-close-candidates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,uBAAuB,EAAE,MAAM,GAC9B,mBAAmB,EAAE,CAavB"}
@@ -0,0 +1,16 @@
1
+ import { QuoteStatus as e } from "../../symmio-contracts/symmio/types.js";
2
+ import { minRemainingQuantityOf as t } from "./min-remaining-quantity.js";
3
+ //#region src/quotes/close-planning/to-close-candidates.ts
4
+ function n(n, r) {
5
+ let i = [];
6
+ for (let a of n) a.quoteId !== void 0 && a.quoteStatus === e.OPENED && (a.openQuantity <= 0n || i.push({
7
+ key: a.key,
8
+ openQuantity: a.openQuantity,
9
+ minRemainingQuantity: t(a, r)
10
+ }));
11
+ return i;
12
+ }
13
+ //#endregion
14
+ export { n as toGroupCloseCandidates };
15
+
16
+ //# sourceMappingURL=to-close-candidates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-close-candidates.js","names":[],"sources":["../../../src/quotes/close-planning/to-close-candidates.ts"],"sourcesContent":["import { QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport type { UnifiedQuote } from \"../unified-quote\";\nimport { minRemainingQuantityOf } from \"./min-remaining-quantity\";\nimport type { GroupCloseCandidate } from \"./types\";\n\n/**\n * Build {@link GroupCloseCandidate}s for {@link planGroupClose} from a group's\n * child quotes.\n *\n * Only children that can actually receive a close order qualify: anchored\n * on-chain (`quoteId` known), status `OPENED` (a `CLOSE_PENDING` child already\n * has a close in flight), and open size left. Each candidate carries its\n * contract min-remainder (see {@link minRemainingQuantityOf}).\n *\n * @param quotes - The group's child quotes.\n * @param minAcceptableQuoteValue - The symbol's `minAcceptableQuoteValue`, wei.\n * @returns Candidates for the planner, in the input order.\n */\nexport function toGroupCloseCandidates(\n quotes: readonly UnifiedQuote[],\n minAcceptableQuoteValue: bigint,\n): GroupCloseCandidate[] {\n const candidates: GroupCloseCandidate[] = [];\n for (const quote of quotes) {\n if (quote.quoteId === undefined) continue;\n if (quote.quoteStatus !== QuoteStatus.OPENED) continue;\n if (quote.openQuantity <= 0n) continue;\n candidates.push({\n key: quote.key,\n openQuantity: quote.openQuantity,\n minRemainingQuantity: minRemainingQuantityOf(quote, minAcceptableQuoteValue),\n });\n }\n return candidates;\n}\n"],"mappings":";;;AAkBA,SAAgB,EACd,GACA,GACuB;CACvB,IAAM,IAAoC,CAAC;CAC3C,KAAK,IAAM,KAAS,GACd,EAAM,YAAY,KAAA,KAClB,EAAM,gBAAgB,EAAY,WAClC,EAAM,gBAAgB,MAC1B,EAAW,KAAK;EACd,KAAK,EAAM;EACX,cAAc,EAAM;EACpB,sBAAsB,EAAuB,GAAO,CAAuB;CAC7E,CAAC;CAEH,OAAO;AACT"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * One closable child position offered to {@link planGroupClose}. All amounts
3
+ * are 18-decimal wei `bigint`.
4
+ */
5
+ export interface GroupCloseCandidate {
6
+ /** Stable child identity (`UnifiedQuote.key`). */
7
+ key: string;
8
+ /** Remaining open size (`quantity − closedAmount`), wei. */
9
+ openQuantity: bigint;
10
+ /**
11
+ * Smallest remainder this child may keep after a partial close, wei — derived
12
+ * from the symbol's `minAcceptableQuoteValue` (see `minRemainingQuantityOf`).
13
+ * `0` means any remainder is acceptable; a value ≥ `openQuantity` means the
14
+ * child can only be closed in full.
15
+ */
16
+ minRemainingQuantity: bigint;
17
+ }
18
+ /** Close amount {@link planGroupClose} assigned to one child. */
19
+ export interface GroupCloseAllocation {
20
+ /** Stable child identity (`UnifiedQuote.key`). */
21
+ key: string;
22
+ /** Amount to close, wei. */
23
+ closeQuantity: bigint;
24
+ /** `full` when `closeQuantity` equals the child's `openQuantity`. */
25
+ kind: "full" | "partial";
26
+ }
27
+ /** Why {@link planGroupClose} could not produce an exact plan. */
28
+ export type PlanGroupCloseFailureReason =
29
+ /** The target exceeds the group's total open quantity. */
30
+ "exceeds-open"
31
+ /** No candidate has open size (or the target is not positive). */
32
+ | "nothing-to-close"
33
+ /** Every remaining child sits at its dust cap — the exact target is unreachable. */
34
+ | "dust-locked";
35
+ /** Failure result of {@link planGroupClose}. Nothing should be closed. */
36
+ export interface PlanGroupCloseFailure {
37
+ feasible: false;
38
+ reason: PlanGroupCloseFailureReason;
39
+ /** Σ open quantity across candidates, wei. */
40
+ totalOpen: bigint;
41
+ /** Largest amount ≤ target the group could actually close, wei — for error messages / UI caps. */
42
+ closeableQuantity: bigint;
43
+ }
44
+ /** Success result of {@link planGroupClose}: Σ `closeQuantity` equals the target exactly. */
45
+ export interface PlanGroupCloseSuccess {
46
+ feasible: true;
47
+ /** Per-child close amounts, in execution order (largest first). */
48
+ allocations: GroupCloseAllocation[];
49
+ }
50
+ /** Result of {@link planGroupClose}. */
51
+ export type PlanGroupCloseResult = PlanGroupCloseSuccess | PlanGroupCloseFailure;
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/close-planning/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED,kEAAkE;AAClE,MAAM,MAAM,2BAA2B;AACrC,0DAA0D;AACxD,cAAc;AAChB,kEAAkE;GAChE,kBAAkB;AACpB,oFAAoF;GAClF,aAAa,CAAC;AAElB,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,EAAE,2BAA2B,CAAC;IACpC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,kGAAkG;IAClG,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,6FAA6F;AAC7F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,IAAI,CAAC;IACf,mEAAmE;IACnE,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AAED,wCAAwC;AACxC,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC"}
@@ -22,6 +22,16 @@ export declare enum QuoteEventType {
22
22
  * can label and lay it out per type.
23
23
  */
24
24
  export declare const PRICE_HISTORY_EVENT_TYPES: readonly QuoteEventType[];
25
+ /**
26
+ * Every event type that settles funding on a quote — the per-tick rows behind a
27
+ * position's funding history.
28
+ *
29
+ * A subset of {@link PRICE_HISTORY_EVENT_TYPES}: it drops `SETTLE_UPNL` (an
30
+ * open-price recompute that moves no funding) and keeps only the two charge
31
+ * events, each of which carries `fundingPaid` / `fundingReceived` / `rate` in its
32
+ * metadata. Pair with `getQuotesEventsByType` for a whole {@link QuoteGroup}.
33
+ */
34
+ export declare const FUNDING_HISTORY_EVENT_TYPES: readonly QuoteEventType[];
25
35
  /**
26
36
  * One decoded `QuoteEvent` row. `type` identifies which event family this row
27
37
  * belongs to (price update vs funding charge); the decoded metadata fields are
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,oBAAY,cAAc;IACxB,uEAAuE;IACvE,UAAU,gBAAgB;IAC1B,qFAAqF;IACrF,iBAAiB,wBAAwB;IACzC,2EAA2E;IAC3E,2BAA2B,mCAAmC;CAC/D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,cAAc,EAI9D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,IAAI,EAAE,cAAc,CAAC;IACrB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,oBAAY,cAAc;IACxB,uEAAuE;IACvE,UAAU,gBAAgB;IAC1B,qFAAqF;IACrF,iBAAiB,wBAAwB;IACzC,2EAA2E;IAC3E,2BAA2B,mCAAmC;CAC/D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,cAAc,EAI9D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,cAAc,EAGhE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,IAAI,EAAE,cAAc,CAAC;IACrB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
@@ -5,8 +5,8 @@ var e = /* @__PURE__ */ function(e) {
5
5
  "SETTLE_UPNL",
6
6
  "CHARGE_FUNDING_RATE",
7
7
  "CHARGE_ACCUMULATED_FUNDING_FEE"
8
- ];
8
+ ], n = ["CHARGE_FUNDING_RATE", "CHARGE_ACCUMULATED_FUNDING_FEE"];
9
9
  //#endregion
10
- export { t as PRICE_HISTORY_EVENT_TYPES, e as QuoteEventType };
10
+ export { n as FUNDING_HISTORY_EVENT_TYPES, t as PRICE_HISTORY_EVENT_TYPES, e as QuoteEventType };
11
11
 
12
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/quotes/get-quote-events-by-type/types.ts"],"sourcesContent":["import type { Hex } from \"viem\";\n\n/**\n * Subgraph `QuoteEvent.type` values for non-terminal events that touch a quote's\n * open price or funding. Terminal close/liquidation events live on\n * {@link \"QuoteCloseEventType\"} (see `getQuoteHistory`).\n */\nexport enum QuoteEventType {\n /** Open-price recompute on a partial close (settle unrealized PnL). */\n SettleUpnl = \"SETTLE_UPNL\",\n /** Periodic funding-rate tick (carries a `rate` and the resulting paid/received). */\n ChargeFundingRate = \"CHARGE_FUNDING_RATE\",\n /** Catch-up charge of accumulated funding that was previously deferred. */\n ChargeAccumulatedFundingFee = \"CHARGE_ACCUMULATED_FUNDING_FEE\",\n}\n\n/**\n * Every event type that contributes to a quote's open-price history.\n *\n * Includes both explicit price-recompute events (`SETTLE_UPNL`) and funding-rate\n * charges (`CHARGE_FUNDING_RATE`, `CHARGE_ACCUMULATED_FUNDING_FEE`) — funding\n * ticks also adjust the open price as a side effect, so they belong in the same\n * timeline. Each row carries the {@link QuoteEventType} discriminant so the UI\n * can label and lay it out per type.\n */\nexport const PRICE_HISTORY_EVENT_TYPES: readonly QuoteEventType[] = [\n QuoteEventType.SettleUpnl,\n QuoteEventType.ChargeFundingRate,\n QuoteEventType.ChargeAccumulatedFundingFee,\n];\n\n/**\n * One decoded `QuoteEvent` row. `type` identifies which event family this row\n * belongs to (price update vs funding charge); the decoded metadata fields are\n * present whenever the underlying JSON carried them.\n *\n * All amount and price fields are 18-decimal-wei `bigint`.\n */\nexport interface QuoteEventRow {\n /** Subgraph `QuoteEvent.id` (stable; use as the React key). */\n eventId: string;\n /** On-chain quote id this row belongs to. */\n quoteId: bigint;\n /** Event-type discriminant — tells the UI which fields it cares about. */\n type: QuoteEventType;\n /** Event block timestamp in seconds. */\n timestamp: number;\n /** Block number, when available. */\n blockNumber?: bigint;\n /** Transaction hash, when available. */\n transaction?: Hex;\n /** New open price after the event (wei), when present in metadata. */\n newPrice?: bigint;\n /** Open price before the event (wei), when present in metadata. */\n prevPrice?: bigint;\n /** Remaining open quantity at the event (wei), when present in metadata. */\n openQuantity?: bigint;\n /** Funding partyA paid in this event (wei), when present in metadata. */\n fundingPaid?: bigint;\n /** Funding partyA received in this event (wei), when present in metadata. */\n fundingReceived?: bigint;\n /** Funding rate applied for the tick (signed `int256` as wei), when present in metadata. */\n rate?: bigint;\n /** Raw metadata JSON string from the subgraph, preserved for power users. */\n rawMetadata: string | null;\n}\n"],"mappings":";AAOA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,aAAA,eAEA,EAAA,oBAAA,uBAEA,EAAA,8BAAA;AACF,EAAA,CAAA,CAAA,GAWa,IAAuD;;;;AAIpE"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/quotes/get-quote-events-by-type/types.ts"],"sourcesContent":["import type { Hex } from \"viem\";\n\n/**\n * Subgraph `QuoteEvent.type` values for non-terminal events that touch a quote's\n * open price or funding. Terminal close/liquidation events live on\n * {@link \"QuoteCloseEventType\"} (see `getQuoteHistory`).\n */\nexport enum QuoteEventType {\n /** Open-price recompute on a partial close (settle unrealized PnL). */\n SettleUpnl = \"SETTLE_UPNL\",\n /** Periodic funding-rate tick (carries a `rate` and the resulting paid/received). */\n ChargeFundingRate = \"CHARGE_FUNDING_RATE\",\n /** Catch-up charge of accumulated funding that was previously deferred. */\n ChargeAccumulatedFundingFee = \"CHARGE_ACCUMULATED_FUNDING_FEE\",\n}\n\n/**\n * Every event type that contributes to a quote's open-price history.\n *\n * Includes both explicit price-recompute events (`SETTLE_UPNL`) and funding-rate\n * charges (`CHARGE_FUNDING_RATE`, `CHARGE_ACCUMULATED_FUNDING_FEE`) — funding\n * ticks also adjust the open price as a side effect, so they belong in the same\n * timeline. Each row carries the {@link QuoteEventType} discriminant so the UI\n * can label and lay it out per type.\n */\nexport const PRICE_HISTORY_EVENT_TYPES: readonly QuoteEventType[] = [\n QuoteEventType.SettleUpnl,\n QuoteEventType.ChargeFundingRate,\n QuoteEventType.ChargeAccumulatedFundingFee,\n];\n\n/**\n * Every event type that settles funding on a quote — the per-tick rows behind a\n * position's funding history.\n *\n * A subset of {@link PRICE_HISTORY_EVENT_TYPES}: it drops `SETTLE_UPNL` (an\n * open-price recompute that moves no funding) and keeps only the two charge\n * events, each of which carries `fundingPaid` / `fundingReceived` / `rate` in its\n * metadata. Pair with `getQuotesEventsByType` for a whole {@link QuoteGroup}.\n */\nexport const FUNDING_HISTORY_EVENT_TYPES: readonly QuoteEventType[] = [\n QuoteEventType.ChargeFundingRate,\n QuoteEventType.ChargeAccumulatedFundingFee,\n];\n\n/**\n * One decoded `QuoteEvent` row. `type` identifies which event family this row\n * belongs to (price update vs funding charge); the decoded metadata fields are\n * present whenever the underlying JSON carried them.\n *\n * All amount and price fields are 18-decimal-wei `bigint`.\n */\nexport interface QuoteEventRow {\n /** Subgraph `QuoteEvent.id` (stable; use as the React key). */\n eventId: string;\n /** On-chain quote id this row belongs to. */\n quoteId: bigint;\n /** Event-type discriminant — tells the UI which fields it cares about. */\n type: QuoteEventType;\n /** Event block timestamp in seconds. */\n timestamp: number;\n /** Block number, when available. */\n blockNumber?: bigint;\n /** Transaction hash, when available. */\n transaction?: Hex;\n /** New open price after the event (wei), when present in metadata. */\n newPrice?: bigint;\n /** Open price before the event (wei), when present in metadata. */\n prevPrice?: bigint;\n /** Remaining open quantity at the event (wei), when present in metadata. */\n openQuantity?: bigint;\n /** Funding partyA paid in this event (wei), when present in metadata. */\n fundingPaid?: bigint;\n /** Funding partyA received in this event (wei), when present in metadata. */\n fundingReceived?: bigint;\n /** Funding rate applied for the tick (signed `int256` as wei), when present in metadata. */\n rate?: bigint;\n /** Raw metadata JSON string from the subgraph, preserved for power users. */\n rawMetadata: string | null;\n}\n"],"mappings":";AAOA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,aAAA,eAEA,EAAA,oBAAA,uBAEA,EAAA,8BAAA;AACF,EAAA,CAAA,CAAA,GAWa,IAAuD;;;;AAIpE,GAWa,IAAyD,CAAA,uBAAA,gCAGtE"}
@@ -1,6 +1,15 @@
1
1
  import { Config } from '../../core/config/index.js';
2
2
  import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
3
3
  import { QuoteFundingData } from './types.js';
4
+ /**
5
+ * Maximum number of quote ids sent in one `QuotesFunding` request.
6
+ *
7
+ * The Graph caps a `first` argument at 1000 entities per query (and silently
8
+ * defaults to 100 when `first` is omitted), so {@link getQuoteFunding} chunks
9
+ * its input at this size and merges the responses. Exported so callers that
10
+ * size their own batches (and tests) can reuse the exact ceiling.
11
+ */
12
+ export declare const QUOTES_FUNDING_MAX_IDS_PER_REQUEST = 1000;
4
13
  /**
5
14
  * Parameters for {@link getQuoteFunding}.
6
15
  */
@@ -17,8 +26,20 @@ export interface GetQuoteFundingReturnType {
17
26
  }
18
27
  /**
19
28
  * Read funding totals (`userPaidFunding`, `userReceivedFunding`) for a batch of
20
- * quotes from the analytics subgraph, in a single round-trip. Filters by the
21
- * protocol-level `quoteId` scalar so callers never need the diamond address.
29
+ * quotes from the analytics subgraph. Filters by the protocol-level `quoteId`
30
+ * scalar so callers never need the diamond address.
31
+ *
32
+ * The action **pages internally**: `quoteIds` is chunked into requests of at
33
+ * most {@link QUOTES_FUNDING_MAX_IDS_PER_REQUEST} ids, issued concurrently, and
34
+ * the responses are merged. Callers pass the full id list — however long — and
35
+ * never need to chunk it themselves. (Without an explicit `first`, The Graph
36
+ * caps a query at 100 entities, which silently truncated large batches; the
37
+ * extras then surfaced as `missingQuoteIds` and any caller that ignored
38
+ * completeness rendered a wrong total.)
39
+ *
40
+ * The returned funding is what the analytics subgraph has **settled to date**:
41
+ * funding accrued since the quote's last funding charge is not indexed and is
42
+ * therefore not included.
22
43
  *
23
44
  * Returns both the resolved rows and any input ids the subgraph did not yet
24
45
  * surface — callers (typically the React layer) decide whether to refetch on
@@ -26,9 +47,10 @@ export interface GetQuoteFundingReturnType {
26
47
  *
27
48
  * @param config - The SDK config.
28
49
  * @param parameters - Quote ids and optional chain id.
29
- * @returns Funding rows plus the input ids the subgraph did not return.
50
+ * @returns Funding rows (merged across all internal requests) plus the input ids
51
+ * the subgraph did not return, computed across the full input set.
30
52
  * @throws {SymmError} when the chain has no analytics subgraph.
31
- * @throws {SymmApiError} when the subgraph request fails.
53
+ * @throws {SymmApiError} when any subgraph request fails.
32
54
  *
33
55
  * @example
34
56
  * ```ts