@symmio/trading-core 3.6.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/balance-history/get-balance-history/types.d.ts +3 -1
  2. package/dist/balance-history/get-balance-history/types.d.ts.map +1 -1
  3. package/dist/balance-history/get-balance-history/types.js +1 -1
  4. package/dist/balance-history/get-balance-history/types.js.map +1 -1
  5. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts +50 -0
  6. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts.map +1 -0
  7. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js +30 -0
  8. package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js.map +1 -0
  9. package/dist/funding/get-funding-index-checkpoints/index.d.ts +5 -0
  10. package/dist/funding/get-funding-index-checkpoints/index.d.ts.map +1 -0
  11. package/dist/funding/get-funding-index-checkpoints/query-document.d.ts +16 -0
  12. package/dist/funding/get-funding-index-checkpoints/query-document.d.ts.map +1 -0
  13. package/dist/funding/get-funding-index-checkpoints/query-document.js +7 -0
  14. package/dist/funding/get-funding-index-checkpoints/query-document.js.map +1 -0
  15. package/dist/funding/get-funding-index-checkpoints/query.d.ts +37 -0
  16. package/dist/funding/get-funding-index-checkpoints/query.d.ts.map +1 -0
  17. package/dist/funding/get-funding-index-checkpoints/query.js +23 -0
  18. package/dist/funding/get-funding-index-checkpoints/query.js.map +1 -0
  19. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts +12 -0
  20. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts.map +1 -0
  21. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js +31 -0
  22. package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js.map +1 -0
  23. package/dist/funding/get-funding-index-checkpoints/types.d.ts +51 -0
  24. package/dist/funding/get-funding-index-checkpoints/types.d.ts.map +1 -0
  25. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts +47 -0
  26. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts.map +1 -0
  27. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js +30 -0
  28. package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js.map +1 -0
  29. package/dist/funding/get-quote-funding-settlements/index.d.ts +5 -0
  30. package/dist/funding/get-quote-funding-settlements/index.d.ts.map +1 -0
  31. package/dist/funding/get-quote-funding-settlements/query-document.d.ts +16 -0
  32. package/dist/funding/get-quote-funding-settlements/query-document.d.ts.map +1 -0
  33. package/dist/funding/get-quote-funding-settlements/query-document.js +7 -0
  34. package/dist/funding/get-quote-funding-settlements/query-document.js.map +1 -0
  35. package/dist/funding/get-quote-funding-settlements/query.d.ts +37 -0
  36. package/dist/funding/get-quote-funding-settlements/query.d.ts.map +1 -0
  37. package/dist/funding/get-quote-funding-settlements/query.js +23 -0
  38. package/dist/funding/get-quote-funding-settlements/query.js.map +1 -0
  39. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts +12 -0
  40. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts.map +1 -0
  41. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js +33 -0
  42. package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js.map +1 -0
  43. package/dist/funding/get-quote-funding-settlements/types.d.ts +56 -0
  44. package/dist/funding/get-quote-funding-settlements/types.d.ts.map +1 -0
  45. package/dist/funding/index.d.ts +3 -0
  46. package/dist/funding/index.d.ts.map +1 -0
  47. package/dist/index.d.ts +48 -5
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +408 -386
  50. package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts +44 -0
  51. package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts.map +1 -0
  52. package/dist/liquidation/get-liquidation-details/get-liquidation-details.js +30 -0
  53. package/dist/liquidation/get-liquidation-details/get-liquidation-details.js.map +1 -0
  54. package/dist/liquidation/get-liquidation-details/index.d.ts +5 -0
  55. package/dist/liquidation/get-liquidation-details/index.d.ts.map +1 -0
  56. package/dist/liquidation/get-liquidation-details/query-document.d.ts +16 -0
  57. package/dist/liquidation/get-liquidation-details/query-document.d.ts.map +1 -0
  58. package/dist/liquidation/get-liquidation-details/query-document.js +7 -0
  59. package/dist/liquidation/get-liquidation-details/query-document.js.map +1 -0
  60. package/dist/liquidation/get-liquidation-details/query.d.ts +37 -0
  61. package/dist/liquidation/get-liquidation-details/query.d.ts.map +1 -0
  62. package/dist/liquidation/get-liquidation-details/query.js +23 -0
  63. package/dist/liquidation/get-liquidation-details/query.js.map +1 -0
  64. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts +12 -0
  65. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts.map +1 -0
  66. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js +32 -0
  67. package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js.map +1 -0
  68. package/dist/liquidation/get-liquidation-details/types.d.ts +47 -0
  69. package/dist/liquidation/get-liquidation-details/types.d.ts.map +1 -0
  70. package/dist/liquidation/index.d.ts +2 -0
  71. package/dist/liquidation/index.d.ts.map +1 -0
  72. package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts +51 -0
  73. package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts.map +1 -0
  74. package/dist/margin/get-margin-transfers/get-margin-transfers.js +32 -0
  75. package/dist/margin/get-margin-transfers/get-margin-transfers.js.map +1 -0
  76. package/dist/margin/get-margin-transfers/index.d.ts +5 -0
  77. package/dist/margin/get-margin-transfers/index.d.ts.map +1 -0
  78. package/dist/margin/get-margin-transfers/query-document.d.ts +17 -0
  79. package/dist/margin/get-margin-transfers/query-document.d.ts.map +1 -0
  80. package/dist/margin/get-margin-transfers/query-document.js +7 -0
  81. package/dist/margin/get-margin-transfers/query-document.js.map +1 -0
  82. package/dist/margin/get-margin-transfers/query.d.ts +37 -0
  83. package/dist/margin/get-margin-transfers/query.d.ts.map +1 -0
  84. package/dist/margin/get-margin-transfers/query.js +23 -0
  85. package/dist/margin/get-margin-transfers/query.js.map +1 -0
  86. package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts +12 -0
  87. package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts.map +1 -0
  88. package/dist/margin/get-margin-transfers/to-margin-transfer-row.js +19 -0
  89. package/dist/margin/get-margin-transfers/to-margin-transfer-row.js.map +1 -0
  90. package/dist/margin/get-margin-transfers/types.d.ts +27 -0
  91. package/dist/margin/get-margin-transfers/types.d.ts.map +1 -0
  92. package/dist/margin/index.d.ts +1 -0
  93. package/dist/margin/index.d.ts.map +1 -1
  94. package/dist/pools/markets/get-listing-markets.d.ts +2 -0
  95. package/dist/pools/markets/get-listing-markets.d.ts.map +1 -1
  96. package/dist/pools/markets/get-listing-markets.js +1 -0
  97. package/dist/pools/markets/get-listing-markets.js.map +1 -1
  98. package/dist/pools/markets/query.d.ts.map +1 -1
  99. package/dist/pools/markets/query.js +1 -0
  100. package/dist/pools/markets/query.js.map +1 -1
  101. package/dist/pools/markets/to-search-params.d.ts +1 -0
  102. package/dist/pools/markets/to-search-params.d.ts.map +1 -1
  103. package/dist/pools/markets/to-search-params.js +1 -1
  104. package/dist/pools/markets/to-search-params.js.map +1 -1
  105. package/dist/pools/trade-history/query-document.d.ts +3 -0
  106. package/dist/pools/trade-history/query-document.d.ts.map +1 -1
  107. package/dist/pools/trade-history/query-document.js +1 -1
  108. package/dist/pools/trade-history/query-document.js.map +1 -1
  109. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +22 -12
  110. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts.map +1 -1
  111. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js +20 -21
  112. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js.map +1 -1
  113. package/dist/quotes/get-quote-events-by-type/query-document.d.ts +5 -5
  114. package/dist/quotes/get-quote-events-by-type/query-document.d.ts.map +1 -1
  115. package/dist/quotes/get-quote-events-by-type/query-document.js +1 -1
  116. package/dist/quotes/get-quote-events-by-type/query-document.js.map +1 -1
  117. package/dist/quotes/get-quote-events-by-type/query.d.ts +7 -6
  118. package/dist/quotes/get-quote-events-by-type/query.d.ts.map +1 -1
  119. package/dist/quotes/get-quote-events-by-type/query.js +19 -17
  120. package/dist/quotes/get-quote-events-by-type/query.js.map +1 -1
  121. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
  122. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts.map +1 -1
  123. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js +1 -3
  124. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js.map +1 -1
  125. package/dist/quotes/get-quote-events-by-type/types.d.ts +14 -3
  126. package/dist/quotes/get-quote-events-by-type/types.d.ts.map +1 -1
  127. package/dist/quotes/get-quote-events-by-type/types.js.map +1 -1
  128. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +12 -2
  129. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
  130. package/dist/quotes/get-quote-funding/get-quote-funding.js +21 -17
  131. package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
  132. package/dist/quotes/get-quote-funding/query-document.d.ts +3 -2
  133. package/dist/quotes/get-quote-funding/query-document.d.ts.map +1 -1
  134. package/dist/quotes/get-quote-funding/query-document.js +1 -1
  135. package/dist/quotes/get-quote-funding/query-document.js.map +1 -1
  136. package/dist/quotes/get-quote-funding/query.d.ts.map +1 -1
  137. package/dist/quotes/get-quote-funding/query.js +2 -1
  138. package/dist/quotes/get-quote-funding/query.js.map +1 -1
  139. package/dist/quotes/get-quote-funding/to-funding-row.d.ts.map +1 -1
  140. package/dist/quotes/get-quote-funding/to-funding-row.js +1 -3
  141. package/dist/quotes/get-quote-funding/to-funding-row.js.map +1 -1
  142. package/dist/quotes/get-quote-history/get-quote-history.d.ts +18 -7
  143. package/dist/quotes/get-quote-history/get-quote-history.d.ts.map +1 -1
  144. package/dist/quotes/get-quote-history/get-quote-history.js +32 -22
  145. package/dist/quotes/get-quote-history/get-quote-history.js.map +1 -1
  146. package/dist/quotes/get-quote-history/query-document.d.ts +12 -7
  147. package/dist/quotes/get-quote-history/query-document.d.ts.map +1 -1
  148. package/dist/quotes/get-quote-history/query-document.js +1 -1
  149. package/dist/quotes/get-quote-history/query-document.js.map +1 -1
  150. package/dist/quotes/get-quote-history/query.d.ts +3 -2
  151. package/dist/quotes/get-quote-history/query.d.ts.map +1 -1
  152. package/dist/quotes/get-quote-history/query.js +22 -19
  153. package/dist/quotes/get-quote-history/query.js.map +1 -1
  154. package/dist/quotes/get-quote-history/to-history-row.d.ts.map +1 -1
  155. package/dist/quotes/get-quote-history/to-history-row.js +52 -37
  156. package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
  157. package/dist/quotes/get-quote-history/types.d.ts +41 -0
  158. package/dist/quotes/get-quote-history/types.d.ts.map +1 -1
  159. package/dist/quotes/get-quote-history/types.js.map +1 -1
  160. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +21 -11
  161. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
  162. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js +19 -21
  163. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
  164. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts +7 -7
  165. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts.map +1 -1
  166. package/dist/quotes/get-quotes-events-by-type/query-document.js +1 -1
  167. package/dist/quotes/get-quotes-events-by-type/query-document.js.map +1 -1
  168. package/dist/quotes/get-quotes-events-by-type/query.d.ts +8 -6
  169. package/dist/quotes/get-quotes-events-by-type/query.d.ts.map +1 -1
  170. package/dist/quotes/get-quotes-events-by-type/query.js +22 -20
  171. package/dist/quotes/get-quotes-events-by-type/query.js.map +1 -1
  172. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts +38 -0
  173. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts.map +1 -0
  174. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js +28 -0
  175. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js.map +1 -0
  176. package/dist/quotes/get-subgraph-quotes/index.d.ts +5 -0
  177. package/dist/quotes/get-subgraph-quotes/index.d.ts.map +1 -0
  178. package/dist/quotes/get-subgraph-quotes/query-document.d.ts +15 -0
  179. package/dist/quotes/get-subgraph-quotes/query-document.d.ts.map +1 -0
  180. package/dist/quotes/get-subgraph-quotes/query-document.js +7 -0
  181. package/dist/quotes/get-subgraph-quotes/query-document.js.map +1 -0
  182. package/dist/quotes/get-subgraph-quotes/query.d.ts +37 -0
  183. package/dist/quotes/get-subgraph-quotes/query.d.ts.map +1 -0
  184. package/dist/quotes/get-subgraph-quotes/query.js +23 -0
  185. package/dist/quotes/get-subgraph-quotes/query.js.map +1 -0
  186. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts +12 -0
  187. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts.map +1 -0
  188. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js +32 -0
  189. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js.map +1 -0
  190. package/dist/quotes/get-subgraph-quotes/types.d.ts +54 -0
  191. package/dist/quotes/get-subgraph-quotes/types.d.ts.map +1 -0
  192. package/dist/quotes/index.d.ts +1 -0
  193. package/dist/quotes/index.d.ts.map +1 -1
  194. package/dist/solvers/estimated-price/get-estimated-price.d.ts +2 -0
  195. package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
  196. package/dist/solvers/estimated-price/get-estimated-price.js +4 -1
  197. package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
  198. package/dist/solvers/estimated-price/query.d.ts +6 -2
  199. package/dist/solvers/estimated-price/query.d.ts.map +1 -1
  200. package/dist/solvers/estimated-price/query.js +3 -2
  201. package/dist/solvers/estimated-price/query.js.map +1 -1
  202. package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts +4 -0
  203. package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts.map +1 -0
  204. package/dist/solvers/funding-info/adapters/enigma-funding-info.js +17 -0
  205. package/dist/solvers/funding-info/adapters/enigma-funding-info.js.map +1 -0
  206. package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts +4 -0
  207. package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts.map +1 -0
  208. package/dist/solvers/funding-info/adapters/rasa-funding-info.js +21 -0
  209. package/dist/solvers/funding-info/adapters/rasa-funding-info.js.map +1 -0
  210. package/dist/solvers/funding-info/get-funding-info.d.ts +22 -13
  211. package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -1
  212. package/dist/solvers/funding-info/get-funding-info.js +24 -12
  213. package/dist/solvers/funding-info/get-funding-info.js.map +1 -1
  214. package/dist/solvers/funding-info/query.d.ts +14 -6
  215. package/dist/solvers/funding-info/query.d.ts.map +1 -1
  216. package/dist/solvers/funding-info/query.js +1 -0
  217. package/dist/solvers/funding-info/query.js.map +1 -1
  218. package/dist/solvers/funding-info/to-funding-info.d.ts +8 -4
  219. package/dist/solvers/funding-info/to-funding-info.d.ts.map +1 -1
  220. package/dist/solvers/funding-info/to-funding-info.js +2 -1
  221. package/dist/solvers/funding-info/to-funding-info.js.map +1 -1
  222. package/dist/solvers/funding-info/types.d.ts +26 -4
  223. package/dist/solvers/funding-info/types.d.ts.map +1 -1
  224. package/dist/solvers/market-info/adapters/enigma-market-info.d.ts +3 -3
  225. package/dist/solvers/market-info/adapters/enigma-market-info.d.ts.map +1 -1
  226. package/dist/solvers/market-info/adapters/enigma-market-info.js +7 -5
  227. package/dist/solvers/market-info/adapters/enigma-market-info.js.map +1 -1
  228. package/dist/solvers/market-info/get-market-info.d.ts +3 -2
  229. package/dist/solvers/market-info/get-market-info.d.ts.map +1 -1
  230. package/dist/solvers/market-info/get-market-info.js.map +1 -1
  231. package/dist/solvers/market-info/types.d.ts +4 -3
  232. package/dist/solvers/market-info/types.d.ts.map +1 -1
  233. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +10 -10
  234. package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
  235. package/dist/solvers/notional-cap/get-notional-cap-all.js +26 -23
  236. package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
  237. package/dist/solvers/notional-cap/get-notional-cap-page.d.ts +49 -0
  238. package/dist/solvers/notional-cap/get-notional-cap-page.d.ts.map +1 -0
  239. package/dist/solvers/notional-cap/get-notional-cap-page.js +37 -0
  240. package/dist/solvers/notional-cap/get-notional-cap-page.js.map +1 -0
  241. package/dist/solvers/notional-cap/index.d.ts +2 -0
  242. package/dist/solvers/notional-cap/index.d.ts.map +1 -1
  243. package/dist/solvers/notional-cap/query-page.d.ts +45 -0
  244. package/dist/solvers/notional-cap/query-page.d.ts.map +1 -0
  245. package/dist/solvers/notional-cap/query-page.js +26 -0
  246. package/dist/solvers/notional-cap/query-page.js.map +1 -0
  247. package/dist/solvers/symbols/get-symbols.d.ts +3 -2
  248. package/dist/solvers/symbols/get-symbols.d.ts.map +1 -1
  249. package/dist/solvers/symbols/get-symbols.js +17 -3
  250. package/dist/solvers/symbols/get-symbols.js.map +1 -1
  251. package/dist/solvers/trade-volume/get-trade-volume.d.ts +2 -1
  252. package/dist/solvers/trade-volume/get-trade-volume.d.ts.map +1 -1
  253. package/dist/solvers/trade-volume/get-trade-volume.js +6 -1
  254. package/dist/solvers/trade-volume/get-trade-volume.js.map +1 -1
  255. package/dist/solvers/trade-volume/to-daily-volume.d.ts +6 -6
  256. package/dist/solvers/trade-volume/to-daily-volume.js.map +1 -1
  257. package/dist/solvers/trade-volume/types.d.ts +4 -3
  258. package/dist/solvers/trade-volume/types.d.ts.map +1 -1
  259. package/dist/solvers/types/generated/enigma-solver.js +3 -3
  260. package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
  261. package/dist/solvers/types/generated/rasa-solver.js +8 -2
  262. package/dist/solvers/types/generated/rasa-solver.js.map +1 -1
  263. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts +122 -0
  264. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts.map +1 -0
  265. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js +80 -0
  266. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js.map +1 -0
  267. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts +3 -0
  268. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts.map +1 -0
  269. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts +37 -0
  270. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts.map +1 -0
  271. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js +27 -0
  272. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js.map +1 -0
  273. package/dist/symmio-contracts/symmio/index.d.ts +2 -0
  274. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  275. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts +3 -0
  276. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts.map +1 -0
  277. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts +37 -0
  278. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts.map +1 -0
  279. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js +15 -0
  280. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js.map +1 -0
  281. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts +38 -0
  282. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts.map +1 -0
  283. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js +29 -0
  284. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js.map +1 -0
  285. package/dist/symmio-subgraph/index.d.ts +1 -0
  286. package/dist/symmio-subgraph/index.d.ts.map +1 -1
  287. package/dist/symmio-subgraph/subgraph-decode.d.ts +51 -0
  288. package/dist/symmio-subgraph/subgraph-decode.d.ts.map +1 -0
  289. package/dist/symmio-subgraph/subgraph-decode.js +24 -0
  290. package/dist/symmio-subgraph/subgraph-decode.js.map +1 -0
  291. package/dist/symmio-subgraph/subgraph-filters.d.ts +97 -0
  292. package/dist/symmio-subgraph/subgraph-filters.d.ts.map +1 -0
  293. package/dist/symmio-subgraph/subgraph-filters.js +39 -0
  294. package/dist/symmio-subgraph/subgraph-filters.js.map +1 -0
  295. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +25 -5
  296. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
  297. package/dist/symmio-subgraph/types/generated/analytics/gql.js +16 -11
  298. package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
  299. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +3640 -9
  300. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
  301. package/dist/symmio-subgraph/types/generated/analytics/graphql.js +2 -2
  302. package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
  303. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rasa-funding-info.d.ts","sourceRoot":"","sources":["../../../../src/solvers/funding-info/adapters/rasa-funding-info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,qEAAqE;AACrE,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAalC"}
@@ -0,0 +1,21 @@
1
+ import { getFundingInfoGetFundingInfoGet as e } from "../../types/generated/rasa-solver.js";
2
+ import { toFiniteNumber as t } from "@symmio/utils/number";
3
+ //#region src/solvers/funding-info/adapters/rasa-funding-info.ts
4
+ async function n(n, r) {
5
+ let i = await e(r ? { symbols: [...r] } : void 0, {
6
+ baseURL: n,
7
+ paramsSerializer: { indexes: null }
8
+ });
9
+ return Object.entries(i.data).map(([e, n]) => ({
10
+ kind: "rasa",
11
+ symbol: e,
12
+ nextFundingRateLong: t(n.next_funding_rate_long),
13
+ nextFundingRateShort: t(n.next_funding_rate_short),
14
+ nextFundingTime: t(n.next_funding_time),
15
+ epochDurationSeconds: t(n.funding_rate_epoch_duration)
16
+ }));
17
+ }
18
+ //#endregion
19
+ export { n as fetchRasaFundingInfo };
20
+
21
+ //# sourceMappingURL=rasa-funding-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rasa-funding-info.js","names":[],"sources":["../../../../src/solvers/funding-info/adapters/rasa-funding-info.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport { getFundingInfoGetFundingInfoGet } from \"../../types/generated/rasa-solver\";\nimport type { RasaMarketFundingInfo } from \"../types\";\n/** Fetch Rasa's existing ticker-based funding response. @internal */\nexport async function fetchRasaFundingInfo(\n baseURL: string,\n symbols?: readonly string[],\n): Promise<RasaMarketFundingInfo[]> {\n const response = await getFundingInfoGetFundingInfoGet(symbols ? { symbols: [...symbols] } : undefined, {\n baseURL,\n paramsSerializer: { indexes: null },\n });\n return Object.entries(response.data).map(([symbol, raw]) => ({\n kind: \"rasa\",\n symbol,\n nextFundingRateLong: toFiniteNumber(raw.next_funding_rate_long),\n nextFundingRateShort: toFiniteNumber(raw.next_funding_rate_short),\n nextFundingTime: toFiniteNumber(raw.next_funding_time),\n epochDurationSeconds: toFiniteNumber(raw.funding_rate_epoch_duration),\n }));\n}\n"],"mappings":";;;AAIA,eAAsB,EACpB,GACA,GACkC;CAClC,IAAM,IAAW,MAAM,EAAgC,IAAU,EAAE,SAAS,CAAC,GAAG,CAAO,EAAE,IAAI,KAAA,GAAW;EACtG;EACA,kBAAkB,EAAE,SAAS,KAAK;CACpC,CAAC;CACD,OAAO,OAAO,QAAQ,EAAS,IAAI,EAAE,KAAK,CAAC,GAAQ,QAAU;EAC3D,MAAM;EACN;EACA,qBAAqB,EAAe,EAAI,sBAAsB;EAC9D,sBAAsB,EAAe,EAAI,uBAAuB;EAChE,iBAAiB,EAAe,EAAI,iBAAiB;EACrD,sBAAsB,EAAe,EAAI,2BAA2B;CACtE,EAAE;AACJ"}
@@ -1,19 +1,28 @@
1
+ import { SymmioSolverKind } from '../../core/chains/types.js';
1
2
  import { Config } from '../../core/config/index.js';
2
- import { Compute, ReadSolverParameter } from '../../shared/types/properties.js';
3
- import { MarketFundingInfo } from './types.js';
3
+ import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
4
+ import { NormalizedFundingInfoByKind } from './types.js';
4
5
  /**
5
6
  * Parameters for {@link getFundingInfo}.
7
+ * @example const parameters: GetFundingInfoParameters = { chainId: 42161, symbolIds: [117, 185] };
6
8
  */
7
- export type GetFundingInfoParameters = Compute<ReadSolverParameter & {
8
- /** Restrict the result to these market names. Omit to fetch every market (the endpoint default). */
9
+ export type GetFundingInfoParameters<K extends SymmioSolverKind = SymmioSolverKind> = Compute<ChainIdParameter & {
10
+ /** Select a solver; a literal narrows the returned rows. */
11
+ solverId?: K;
12
+ /** Enigma only: restrict the result to these symbol IDs. Omit to fetch every market (the endpoint default). */
13
+ symbolIds?: readonly number[];
14
+ /** Rasa ticker filter. Only valid for a Rasa solver. */
9
15
  symbols?: readonly string[];
10
16
  }>;
11
- /** Return type of {@link getFundingInfo}: one entry per market. */
12
- export type GetFundingInfoReturnType = MarketFundingInfo[];
13
17
  /**
14
- * Fetch per-market funding rates from the chain's solver `/get_funding_info`
18
+ * Funding observations keyed by Enigma symbol ID or Rasa ticker, with per-epoch fractional rates.
19
+ * @example const rows: GetFundingInfoReturnType = await getFundingInfo(config, { symbolIds: [117] });
20
+ */
21
+ export type GetFundingInfoReturnType<K extends SymmioSolverKind = SymmioSolverKind> = NormalizedFundingInfoByKind[K][];
22
+ /**
23
+ * Fetch per-market funding rates from Enigma `/funding-info` or Rasa `/get_funding_info`
15
24
  * endpoint. Returns the next-epoch long/short funding rate, next funding time,
16
- * and epoch length for every market (or only the requested `symbols`). The
25
+ * and epoch length for every market (or only the requested Enigma `symbolIds` or Rasa `symbols`). The
17
26
  * solver base URL is resolved from `config` per call, so multiple chains never
18
27
  * clobber each other.
19
28
  *
@@ -21,17 +30,17 @@ export type GetFundingInfoReturnType = MarketFundingInfo[];
21
30
  * reports them (multiply by `100` for a percentage); no scaling is applied.
22
31
  *
23
32
  * @param config - The SDK config.
24
- * @param parameters - Optional chain id and `symbols` filter.
33
+ * @param parameters - Optional chain, solver and solver-specific filter.
25
34
  * @returns Normalized funding info, one {@link MarketFundingInfo} per market.
26
35
  * @throws {SymmApiError} when the API request fails.
27
- * @throws {SymmError} when the chain is unsupported.
36
+ * @throws {SymmError} when the chain is unsupported or a filter targets the wrong solver (INVALID_FUNDING_FILTER).
28
37
  *
29
38
  * @example
30
39
  * ```ts
31
- * const funding = await getFundingInfo(config);
32
- * const btc = funding.find((f) => f.symbol === "BTCUSDT");
40
+ * const funding = await getFundingInfo(config, { solverId: "enigma" });
41
+ * const btc = funding.find((f) => f.symbolId === 1);
33
42
  * console.log(btc?.nextFundingRateLong); // 0.0001 → 0.01%
34
43
  * ```
35
44
  */
36
- export declare function getFundingInfo(config: Config, parameters?: GetFundingInfoParameters): Promise<GetFundingInfoReturnType>;
45
+ export declare function getFundingInfo<K extends SymmioSolverKind = SymmioSolverKind>(config: Config, parameters?: GetFundingInfoParameters<K>): Promise<GetFundingInfoReturnType<K>>;
37
46
  //# sourceMappingURL=get-funding-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/get-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,mBAAmB,GAAG;IACpB,oGAAoG;IACpG,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,wBAA6B,GACxC,OAAO,CAAC,wBAAwB,CAAC,CAGnC"}
1
+ {"version":3,"file":"get-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/get-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EAAqB,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,OAAO,CAC3F,gBAAgB,GAAG;IACjB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,+GAA+G;IAC/G,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,2BAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;AAEvH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAChF,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,wBAAwB,CAAC,CAAC,CAAM,GAC3C,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CA4CtC"}
@@ -1,22 +1,34 @@
1
1
  import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
- import { getGetFundingInfo as n } from "../types/generated/enigma-solver.js";
3
- import { toMarketFundingInfo as r } from "./to-funding-info.js";
2
+ import { fetchEnigmaFundingInfo as n } from "./adapters/enigma-funding-info.js";
3
+ import { fetchRasaFundingInfo as r } from "./adapters/rasa-funding-info.js";
4
4
  import { isAxiosError as i } from "axios";
5
5
  //#region src/solvers/funding-info/get-funding-info.ts
6
- async function a(e, t = {}) {
7
- return o(e.getSolver({
8
- chainId: t.chainId,
9
- solverId: t.solverId
10
- }).url, t.symbols);
11
- }
12
- async function o(a, o) {
6
+ async function a(a, o = {}) {
7
+ let s = a.getSolver({
8
+ chainId: o.chainId,
9
+ solverId: o.solverId
10
+ });
13
11
  try {
14
- let e = await n(o ? { symbols: [...o] } : void 0, { baseURL: a });
15
- return Object.entries(e.data).map(([e, t]) => r(e, t));
12
+ let e;
13
+ switch (s.id) {
14
+ case "enigma":
15
+ if (o.symbols !== void 0) throw new t("validation", "INVALID_FUNDING_FILTER", "Enigma funding accepts symbolIds, not ticker symbols.");
16
+ e = await n(s.url, o.symbolIds);
17
+ break;
18
+ case "rasa":
19
+ if (o.symbolIds !== void 0) throw new t("validation", "INVALID_FUNDING_FILTER", "Rasa funding accepts ticker symbols, not symbolIds.");
20
+ e = await r(s.url, o.symbols);
21
+ break;
22
+ default: {
23
+ let e = s.id;
24
+ throw new t("api", "UNSUPPORTED_BY_SOLVER", `Funding info is not supported by solver kind "${e}".`);
25
+ }
26
+ }
27
+ return e;
16
28
  } catch (n) {
17
29
  throw n instanceof t ? n : i(n) ? e.fromAxios(n, {
18
30
  code: "FETCH_FUNDING_INFO_FAILED",
19
- baseURL: a
31
+ baseURL: s.url
20
32
  }) : new t("api", "FETCH_FUNDING_INFO_FAILED", `Failed to fetch funding info: ${n instanceof Error ? n.message : String(n)}`, { cause: n instanceof Error ? n : void 0 });
21
33
  }
22
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/get-funding-info.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, ReadSolverParameter } from \"../../shared/types/properties\";\nimport { getGetFundingInfo } from \"../types/generated/enigma-solver\";\nimport { toMarketFundingInfo } from \"./to-funding-info\";\nimport type { MarketFundingInfo } from \"./types\";\n\n/**\n * Parameters for {@link getFundingInfo}.\n */\nexport type GetFundingInfoParameters = Compute<\n ReadSolverParameter & {\n /** Restrict the result to these market names. Omit to fetch every market (the endpoint default). */\n symbols?: readonly string[];\n }\n>;\n\n/** Return type of {@link getFundingInfo}: one entry per market. */\nexport type GetFundingInfoReturnType = MarketFundingInfo[];\n\n/**\n * Fetch per-market funding rates from the chain's solver `/get_funding_info`\n * endpoint. Returns the next-epoch long/short funding rate, next funding time,\n * and epoch length for every market (or only the requested `symbols`). The\n * solver base URL is resolved from `config` per call, so multiple chains never\n * clobber each other.\n *\n * Rates are surfaced as plain per-epoch decimal fractions exactly as the solver\n * reports them (multiply by `100` for a percentage); no scaling is applied.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain id and `symbols` filter.\n * @returns Normalized funding info, one {@link MarketFundingInfo} per market.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const funding = await getFundingInfo(config);\n * const btc = funding.find((f) => f.symbol === \"BTCUSDT\");\n * console.log(btc?.nextFundingRateLong); // 0.0001 → 0.01%\n * ```\n */\nexport async function getFundingInfo(\n config: Config,\n parameters: GetFundingInfoParameters = {},\n): Promise<GetFundingInfoReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n return fetchFundingInfo(solver.url, parameters.symbols);\n}\n\n/**\n * Call the solver's `/get_funding_info` endpoint with a per-call base URL and\n * map the market-keyed response into the SDK's normalized array.\n *\n * @internal\n */\nasync function fetchFundingInfo(baseURL: string, symbols?: readonly string[]): Promise<MarketFundingInfo[]> {\n try {\n const response = await getGetFundingInfo(symbols ? { symbols: [...symbols] } : undefined, { baseURL });\n return Object.entries(response.data).map(([symbol, raw]) => toMarketFundingInfo(symbol, raw));\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_FUNDING_INFO_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_FUNDING_INFO_FAILED\",\n `Failed to fetch funding info: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;AA4CA,eAAsB,EACpB,GACA,IAAuC,CAAC,GACL;CAEnC,OAAO,EADQ,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CACrE,EAAO,KAAK,EAAW,OAAO;AACxD;AAQA,eAAe,EAAiB,GAAiB,GAA2D;CAC1G,IAAI;EACF,IAAM,IAAW,MAAM,EAAkB,IAAU,EAAE,SAAS,CAAC,GAAG,CAAO,EAAE,IAAI,KAAA,GAAW,EAAE,WAAQ,CAAC;EACrG,OAAO,OAAO,QAAQ,EAAS,IAAI,EAAE,KAAK,CAAC,GAAQ,OAAS,EAAoB,GAAQ,CAAG,CAAC;CAC9F,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA6B;EAAQ,CAAC,IAG5E,IAAI,EACR,OACA,6BACA,iCAAiC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAChF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
1
+ {"version":3,"file":"get-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/get-funding-info.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { SymmioSolverKind } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchEnigmaFundingInfo } from \"./adapters/enigma-funding-info\";\nimport { fetchRasaFundingInfo } from \"./adapters/rasa-funding-info\";\nimport type { MarketFundingInfo, NormalizedFundingInfoByKind } from \"./types\";\n\n/**\n * Parameters for {@link getFundingInfo}.\n * @example const parameters: GetFundingInfoParameters = { chainId: 42161, symbolIds: [117, 185] };\n */\nexport type GetFundingInfoParameters<K extends SymmioSolverKind = SymmioSolverKind> = Compute<\n ChainIdParameter & {\n /** Select a solver; a literal narrows the returned rows. */\n solverId?: K;\n /** Enigma only: restrict the result to these symbol IDs. Omit to fetch every market (the endpoint default). */\n symbolIds?: readonly number[];\n /** Rasa ticker filter. Only valid for a Rasa solver. */\n symbols?: readonly string[];\n }\n>;\n\n/**\n * Funding observations keyed by Enigma symbol ID or Rasa ticker, with per-epoch fractional rates.\n * @example const rows: GetFundingInfoReturnType = await getFundingInfo(config, { symbolIds: [117] });\n */\nexport type GetFundingInfoReturnType<K extends SymmioSolverKind = SymmioSolverKind> = NormalizedFundingInfoByKind[K][];\n\n/**\n * Fetch per-market funding rates from Enigma `/funding-info` or Rasa `/get_funding_info`\n * endpoint. Returns the next-epoch long/short funding rate, next funding time,\n * and epoch length for every market (or only the requested Enigma `symbolIds` or Rasa `symbols`). The\n * solver base URL is resolved from `config` per call, so multiple chains never\n * clobber each other.\n *\n * Rates are surfaced as plain per-epoch decimal fractions exactly as the solver\n * reports them (multiply by `100` for a percentage); no scaling is applied.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain, solver and solver-specific filter.\n * @returns Normalized funding info, one {@link MarketFundingInfo} per market.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} when the chain is unsupported or a filter targets the wrong solver (INVALID_FUNDING_FILTER).\n *\n * @example\n * ```ts\n * const funding = await getFundingInfo(config, { solverId: \"enigma\" });\n * const btc = funding.find((f) => f.symbolId === 1);\n * console.log(btc?.nextFundingRateLong); // 0.0001 → 0.01%\n * ```\n */\nexport async function getFundingInfo<K extends SymmioSolverKind = SymmioSolverKind>(\n config: Config,\n parameters: GetFundingInfoParameters<K> = {},\n): Promise<GetFundingInfoReturnType<K>> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n try {\n let rows: MarketFundingInfo[];\n switch (solver.id) {\n case \"enigma\":\n if (parameters.symbols !== undefined)\n throw new SymmError(\n \"validation\",\n \"INVALID_FUNDING_FILTER\",\n \"Enigma funding accepts symbolIds, not ticker symbols.\",\n );\n rows = await fetchEnigmaFundingInfo(solver.url, parameters.symbolIds);\n break;\n case \"rasa\":\n if (parameters.symbolIds !== undefined)\n throw new SymmError(\n \"validation\",\n \"INVALID_FUNDING_FILTER\",\n \"Rasa funding accepts ticker symbols, not symbolIds.\",\n );\n rows = await fetchRasaFundingInfo(solver.url, parameters.symbols);\n break;\n default: {\n const unreachable: never = solver.id;\n throw new SymmError(\n \"api\",\n \"UNSUPPORTED_BY_SOLVER\",\n `Funding info is not supported by solver kind \"${unreachable}\".`,\n );\n }\n }\n return rows as GetFundingInfoReturnType<K>;\n } catch (err) {\n if (err instanceof SymmError) throw err;\n if (isAxiosError(err))\n throw SymmApiError.fromAxios(err, { code: \"FETCH_FUNDING_INFO_FAILED\", baseURL: solver.url });\n throw new SymmError(\n \"api\",\n \"FETCH_FUNDING_INFO_FAILED\",\n `Failed to fetch funding info: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;AAqDA,eAAsB,EACpB,GACA,IAA0C,CAAC,GACL;CACtC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAC9F,IAAI;EACF,IAAI;EACJ,QAAQ,EAAO,IAAf;GACE,KAAK;IACH,IAAI,EAAW,YAAY,KAAA,GACzB,MAAM,IAAI,EACR,cACA,0BACA,uDACF;IACF,IAAO,MAAM,EAAuB,EAAO,KAAK,EAAW,SAAS;IACpE;GACF,KAAK;IACH,IAAI,EAAW,cAAc,KAAA,GAC3B,MAAM,IAAI,EACR,cACA,0BACA,qDACF;IACF,IAAO,MAAM,EAAqB,EAAO,KAAK,EAAW,OAAO;IAChE;GACF,SAAS;IACP,IAAM,IAAqB,EAAO;IAClC,MAAM,IAAI,EACR,OACA,yBACA,iDAAiD,EAAY,GAC/D;GACF;EACF;EACA,OAAO;CACT,SAAS,GAAK;EAIZ,MAHI,aAAe,IAAiB,IAChC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA6B,SAAS,EAAO;EAAI,CAAC,IACxF,IAAI,EACR,OACA,6BACA,iCAAiC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAChF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
@@ -1,22 +1,30 @@
1
+ import { SymmioSolverKind } from '../../core/chains/types.js';
1
2
  import { Config } from '../../core/config/index.js';
2
3
  import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
3
4
  import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
4
5
  import { GetFundingInfoParameters, GetFundingInfoReturnType } from './get-funding-info.js';
5
6
  /** Data resolved by the {@link getFundingInfoQueryOptions} query. */
6
- export type GetFundingInfoData = GetFundingInfoReturnType;
7
- /** Build the TanStack Query key for {@link getFundingInfoQueryOptions}. */
7
+ export type GetFundingInfoData<K extends SymmioSolverKind = SymmioSolverKind> = GetFundingInfoReturnType<K>;
8
+ /**
9
+ * Build a funding cache key including the solver-specific filter and deployment identity.
10
+ * @param options - Optional deployment, solver and symbol IDs/tickers; query overrides are excluded.
11
+ * @returns A stable query-key tuple.
12
+ * @throws Does not throw for valid options.
13
+ * @example getFundingInfoQueryKey({ symbolIds: [117, 185] });
14
+ */
8
15
  export declare function getFundingInfoQueryKey(options?: Compute<GetFundingInfoParameters & ConfigKeyParameter>): readonly ["getFundingInfo", Record<string, unknown>];
9
16
  /** Query-key type produced by {@link getFundingInfoQueryKey}. */
10
17
  export type GetFundingInfoQueryKey = ReturnType<typeof getFundingInfoQueryKey>;
11
18
  /** Options accepted by {@link getFundingInfoQueryOptions}. */
12
- export type GetFundingInfoOptions = Compute<GetFundingInfoParameters & QueryParameter<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>>;
19
+ export type GetFundingInfoOptions<K extends SymmioSolverKind = SymmioSolverKind> = Compute<GetFundingInfoParameters<K> & QueryParameter<GetFundingInfoData<K>, Error, GetFundingInfoData<K>, GetFundingInfoQueryKey>>;
13
20
  /** TanStack Query options returned by {@link getFundingInfoQueryOptions}. */
14
- export type GetFundingInfoQueryOptions = SymmioQueryOptions<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>;
21
+ export type GetFundingInfoQueryOptions<K extends SymmioSolverKind = SymmioSolverKind> = SymmioQueryOptions<GetFundingInfoData<K>, Error, GetFundingInfoData<K>, GetFundingInfoQueryKey>;
15
22
  /**
16
23
  * Build TanStack Query options for {@link getFundingInfo}.
17
24
  *
18
25
  * @param config - The SDK config.
19
- * @param options - Query parameters (optional `chainId` / `symbols`) and TanStack overrides.
26
+ * @param options - Query parameters (optional `chainId`, `solverId`, `symbolIds` / `symbols`) and TanStack overrides.
27
+ * @throws {SymmError} When configuration cannot be resolved; the query function propagates action errors.
20
28
  * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
21
29
  *
22
30
  * @example
@@ -24,5 +32,5 @@ export type GetFundingInfoQueryOptions = SymmioQueryOptions<GetFundingInfoData,
24
32
  * useQuery(getFundingInfoQueryOptions(config, {}));
25
33
  * ```
26
34
  */
27
- export declare function getFundingInfoQueryOptions(config: Config, options?: GetFundingInfoOptions): GetFundingInfoQueryOptions;
35
+ export declare function getFundingInfoQueryOptions<K extends SymmioSolverKind = SymmioSolverKind>(config: Config, options?: GetFundingInfoOptions<K>): GetFundingInfoQueryOptions<K>;
28
36
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAElH,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE1D,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,CAAC,wBAAwB,GAAG,kBAAkB,CAAM,wDAE1G;AAED,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE/E,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,wBAAwB,GAAG,cAAc,CAAC,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CACjH,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,CACzD,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,0BAA0B,CAW5B"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAElH,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,CAAC,wBAAwB,GAAG,kBAAkB,CAAM,wDAE1G;AAED,iEAAiE;AACjE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE/E,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,OAAO,CACxF,wBAAwB,CAAC,CAAC,CAAC,GACzB,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAC9F,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,kBAAkB,CACxG,kBAAkB,CAAC,CAAC,CAAC,EACrB,KAAK,EACL,kBAAkB,CAAC,CAAC,CAAC,EACrB,sBAAsB,CACvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EACtF,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAAqB,CAAC,CAAC,CAAM,GACrC,0BAA0B,CAAC,CAAC,CAAC,CAgB/B"}
@@ -15,6 +15,7 @@ function r(e, r = {}) {
15
15
  queryFn: () => t(e, {
16
16
  chainId: r.chainId,
17
17
  solverId: r.solverId,
18
+ symbolIds: r.symbolIds,
18
19
  symbols: r.symbols
19
20
  })
20
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/funding-info/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { getFundingInfo, type GetFundingInfoParameters, type GetFundingInfoReturnType } from \"./get-funding-info\";\n\n/** Data resolved by the {@link getFundingInfoQueryOptions} query. */\nexport type GetFundingInfoData = GetFundingInfoReturnType;\n\n/** Build the TanStack Query key for {@link getFundingInfoQueryOptions}. */\nexport function getFundingInfoQueryKey(options: Compute<GetFundingInfoParameters & ConfigKeyParameter> = {}) {\n return [\"getFundingInfo\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getFundingInfoQueryKey}. */\nexport type GetFundingInfoQueryKey = ReturnType<typeof getFundingInfoQueryKey>;\n\n/** Options accepted by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoOptions = Compute<\n GetFundingInfoParameters & QueryParameter<GetFundingInfoData, Error, GetFundingInfoData, GetFundingInfoQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoQueryOptions = SymmioQueryOptions<\n GetFundingInfoData,\n Error,\n GetFundingInfoData,\n GetFundingInfoQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getFundingInfo}.\n *\n * @param config - The SDK config.\n * @param options - Query parameters (optional `chainId` / `symbols`) and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getFundingInfoQueryOptions(config, {}));\n * ```\n */\nexport function getFundingInfoQueryOptions(\n config: Config,\n options: GetFundingInfoOptions = {},\n): GetFundingInfoQueryOptions {\n return {\n ...options.query,\n queryKey: getFundingInfoQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: options.query?.enabled ?? true,\n queryFn: () =>\n getFundingInfo(config, { chainId: options.chainId, solverId: options.solverId, symbols: options.symbols }),\n };\n}\n"],"mappings":";;;AAUA,SAAgB,EAAuB,IAAkE,CAAC,GAAG;CAC3G,OAAO,CAAC,kBAAkB,EAAmB,CAAO,CAAC;AACvD;AA8BA,SAAgB,EACd,GACA,IAAiC,CAAC,GACN;CAC5B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAuB;GAC/B,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,SAAS,EAAQ,OAAO,WAAW;EACnC,eACE,EAAe,GAAQ;GAAE,SAAS,EAAQ;GAAS,UAAU,EAAQ;GAAU,SAAS,EAAQ;EAAQ,CAAC;CAC7G;AACF"}
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/funding-info/query.ts"],"sourcesContent":["import type { SymmioSolverKind } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { getFundingInfo, type GetFundingInfoParameters, type GetFundingInfoReturnType } from \"./get-funding-info\";\n\n/** Data resolved by the {@link getFundingInfoQueryOptions} query. */\nexport type GetFundingInfoData<K extends SymmioSolverKind = SymmioSolverKind> = GetFundingInfoReturnType<K>;\n\n/**\n * Build a funding cache key including the solver-specific filter and deployment identity.\n * @param options - Optional deployment, solver and symbol IDs/tickers; query overrides are excluded.\n * @returns A stable query-key tuple.\n * @throws Does not throw for valid options.\n * @example getFundingInfoQueryKey({ symbolIds: [117, 185] });\n */\nexport function getFundingInfoQueryKey(options: Compute<GetFundingInfoParameters & ConfigKeyParameter> = {}) {\n return [\"getFundingInfo\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getFundingInfoQueryKey}. */\nexport type GetFundingInfoQueryKey = ReturnType<typeof getFundingInfoQueryKey>;\n\n/** Options accepted by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoOptions<K extends SymmioSolverKind = SymmioSolverKind> = Compute<\n GetFundingInfoParameters<K> &\n QueryParameter<GetFundingInfoData<K>, Error, GetFundingInfoData<K>, GetFundingInfoQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getFundingInfoQueryOptions}. */\nexport type GetFundingInfoQueryOptions<K extends SymmioSolverKind = SymmioSolverKind> = SymmioQueryOptions<\n GetFundingInfoData<K>,\n Error,\n GetFundingInfoData<K>,\n GetFundingInfoQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getFundingInfo}.\n *\n * @param config - The SDK config.\n * @param options - Query parameters (optional `chainId`, `solverId`, `symbolIds` / `symbols`) and TanStack overrides.\n * @throws {SymmError} When configuration cannot be resolved; the query function propagates action errors.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getFundingInfoQueryOptions(config, {}));\n * ```\n */\nexport function getFundingInfoQueryOptions<K extends SymmioSolverKind = SymmioSolverKind>(\n config: Config,\n options: GetFundingInfoOptions<K> = {},\n): GetFundingInfoQueryOptions<K> {\n return {\n ...options.query,\n queryKey: getFundingInfoQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: options.query?.enabled ?? true,\n queryFn: () =>\n getFundingInfo<K>(config, {\n chainId: options.chainId,\n solverId: options.solverId,\n symbolIds: options.symbolIds,\n symbols: options.symbols,\n }),\n };\n}\n"],"mappings":";;;AAiBA,SAAgB,EAAuB,IAAkE,CAAC,GAAG;CAC3G,OAAO,CAAC,kBAAkB,EAAmB,CAAO,CAAC;AACvD;AAgCA,SAAgB,EACd,GACA,IAAoC,CAAC,GACN;CAC/B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAuB;GAC/B,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,SAAS,EAAQ,OAAO,WAAW;EACnC,eACE,EAAkB,GAAQ;GACxB,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,WAAW,EAAQ;GACnB,SAAS,EAAQ;EACnB,CAAC;CACL;AACF"}
@@ -1,14 +1,18 @@
1
1
  import { ApiFundingInfoResponse } from '../types/generated/enigma-solver.js';
2
- import { MarketFundingInfo } from './types.js';
2
+ import { EnigmaMarketFundingInfo } from './types.js';
3
3
  /** One market's raw entry from `ApiFundingInfoResponse` (the map value). */
4
4
  type RawFundingInfo = ApiFundingInfoResponse[string];
5
5
  /**
6
- * Map one `ApiFundingInfoResponse` entry (keyed by market name) into the SDK's
6
+ * Map one `ApiFundingInfoResponse` entry (keyed by symbol ID) into the SDK's
7
7
  * {@link MarketFundingInfo}. Missing numeric fields default to `0`.
8
8
  *
9
- * @param symbol - The market name (the response map key).
9
+ * @param symbolId - The market ID (the response map key).
10
10
  * @param raw - The raw funding entry for that market.
11
+ * @returns Funding figures identified by symbol ID, with unchanged rate/time units.
12
+ * @throws Does not throw for a valid funding entry.
13
+ * @example
14
+ * toMarketFundingInfo(12, { next_funding_rate_long: "0.001", next_funding_time: 1783209600000 });
11
15
  */
12
- export declare function toMarketFundingInfo(symbol: string, raw: RawFundingInfo): MarketFundingInfo;
16
+ export declare function toMarketFundingInfo(symbolId: number, raw: RawFundingInfo): EnigmaMarketFundingInfo;
13
17
  export {};
14
18
  //# sourceMappingURL=to-funding-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,4EAA4E;AAC5E,KAAK,cAAc,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAQ1F"}
1
+ {"version":3,"file":"to-funding-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,4EAA4E;AAC5E,KAAK,cAAc,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,uBAAuB,CASlG"}
@@ -2,7 +2,8 @@ import { toFiniteNumber as e } from "@symmio/utils/number";
2
2
  //#region src/solvers/funding-info/to-funding-info.ts
3
3
  function t(t, n) {
4
4
  return {
5
- symbol: t,
5
+ kind: "enigma",
6
+ symbolId: t,
6
7
  nextFundingRateLong: e(n.next_funding_rate_long),
7
8
  nextFundingRateShort: e(n.next_funding_rate_short),
8
9
  nextFundingTime: e(n.next_funding_time),
@@ -1 +1 @@
1
- {"version":3,"file":"to-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport type { ApiFundingInfoResponse } from \"../types/generated/enigma-solver\";\nimport type { MarketFundingInfo } from \"./types\";\n\n/** One market's raw entry from `ApiFundingInfoResponse` (the map value). */\ntype RawFundingInfo = ApiFundingInfoResponse[string];\n\n/**\n * Map one `ApiFundingInfoResponse` entry (keyed by market name) into the SDK's\n * {@link MarketFundingInfo}. Missing numeric fields default to `0`.\n *\n * @param symbol - The market name (the response map key).\n * @param raw - The raw funding entry for that market.\n */\nexport function toMarketFundingInfo(symbol: string, raw: RawFundingInfo): MarketFundingInfo {\n return {\n symbol,\n nextFundingRateLong: toFiniteNumber(raw.next_funding_rate_long),\n nextFundingRateShort: toFiniteNumber(raw.next_funding_rate_short),\n nextFundingTime: toFiniteNumber(raw.next_funding_time),\n epochDurationSeconds: toFiniteNumber(raw.funding_rate_epoch_duration),\n };\n}\n"],"mappings":";;AAcA,SAAgB,EAAoB,GAAgB,GAAwC;CAC1F,OAAO;EACL;EACA,qBAAqB,EAAe,EAAI,sBAAsB;EAC9D,sBAAsB,EAAe,EAAI,uBAAuB;EAChE,iBAAiB,EAAe,EAAI,iBAAiB;EACrD,sBAAsB,EAAe,EAAI,2BAA2B;CACtE;AACF"}
1
+ {"version":3,"file":"to-funding-info.js","names":[],"sources":["../../../src/solvers/funding-info/to-funding-info.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport type { ApiFundingInfoResponse } from \"../types/generated/enigma-solver\";\nimport type { EnigmaMarketFundingInfo } from \"./types\";\n\n/** One market's raw entry from `ApiFundingInfoResponse` (the map value). */\ntype RawFundingInfo = ApiFundingInfoResponse[string];\n\n/**\n * Map one `ApiFundingInfoResponse` entry (keyed by symbol ID) into the SDK's\n * {@link MarketFundingInfo}. Missing numeric fields default to `0`.\n *\n * @param symbolId - The market ID (the response map key).\n * @param raw - The raw funding entry for that market.\n * @returns Funding figures identified by symbol ID, with unchanged rate/time units.\n * @throws Does not throw for a valid funding entry.\n * @example\n * toMarketFundingInfo(12, { next_funding_rate_long: \"0.001\", next_funding_time: 1783209600000 });\n */\nexport function toMarketFundingInfo(symbolId: number, raw: RawFundingInfo): EnigmaMarketFundingInfo {\n return {\n kind: \"enigma\",\n symbolId,\n nextFundingRateLong: toFiniteNumber(raw.next_funding_rate_long),\n nextFundingRateShort: toFiniteNumber(raw.next_funding_rate_short),\n nextFundingTime: toFiniteNumber(raw.next_funding_time),\n epochDurationSeconds: toFiniteNumber(raw.funding_rate_epoch_duration),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAoB,GAAkB,GAA8C;CAClG,OAAO;EACL,MAAM;EACN;EACA,qBAAqB,EAAe,EAAI,sBAAsB;EAC9D,sBAAsB,EAAe,EAAI,uBAAuB;EAChE,iBAAiB,EAAe,EAAI,iBAAiB;EACrD,sBAAsB,EAAe,EAAI,2BAA2B;CACtE;AACF"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Next-epoch funding figures for one solver market, normalized from the
3
- * generated `/get_funding_info` response.
3
+ * generated `/funding-info` response.
4
4
  *
5
5
  * Funding is charged per epoch: the long side pays (or receives) at
6
6
  * {@link MarketFundingInfo.nextFundingRateLong} and the short side at
@@ -8,10 +8,10 @@
8
8
  * per-epoch decimal fractions the solver reports — multiply by `100` for a
9
9
  * percentage. A **positive** rate means that side *receives* funding; a
10
10
  * **negative** rate means it *pays*.
11
+ * @example
12
+ * const row: MarketFundingInfo = { kind: "enigma", symbolId: 117, nextFundingRateLong: 0.0001, nextFundingRateShort: -0.0001, nextFundingTime: 1783209600000, epochDurationSeconds: 43200 };
11
13
  */
12
- export interface MarketFundingInfo {
13
- /** Market ticker and solver map key (e.g. `"BTCUSDT"`). */
14
- symbol: string;
14
+ interface BaseMarketFundingInfo {
15
15
  /**
16
16
  * Next funding rate for the long side, as a per-epoch decimal fraction
17
17
  * (`0.0001` = `0.01%`). Positive receives, negative pays.
@@ -32,4 +32,26 @@ export interface MarketFundingInfo {
32
32
  /** Length of one funding epoch, in seconds (e.g. `43200` = 12h). `0` when absent. */
33
33
  epochDurationSeconds: number;
34
34
  }
35
+ /** Funding from Enigma's symbol-ID endpoint. */
36
+ export interface EnigmaMarketFundingInfo extends BaseMarketFundingInfo {
37
+ /** Discriminant identifying the solver response. */
38
+ kind: "enigma";
39
+ /** Stable solver symbol ID; join with getSymbols for names. */
40
+ symbolId: number;
41
+ }
42
+ /** Funding from Rasa's existing ticker endpoint. */
43
+ export interface RasaMarketFundingInfo extends BaseMarketFundingInfo {
44
+ /** Discriminant identifying the solver response. */
45
+ kind: "rasa";
46
+ /** Market ticker from the response map key. */
47
+ symbol: string;
48
+ }
49
+ /** Solver funding row. Narrow on kind before reading symbolId or symbol. */
50
+ export type MarketFundingInfo = EnigmaMarketFundingInfo | RasaMarketFundingInfo;
51
+ /** Maps each solver kind to its funding row, used to narrow actions and hooks. */
52
+ export interface NormalizedFundingInfoByKind {
53
+ enigma: EnigmaMarketFundingInfo;
54
+ rasa: RasaMarketFundingInfo;
55
+ }
56
+ export {};
35
57
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/funding-info/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,UAAU,qBAAqB;IAC7B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,gDAAgD;AAChD,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,oDAAoD;IACpD,IAAI,EAAE,QAAQ,CAAC;IACf,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,oDAAoD;AACpD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AAChF,kFAAkF;AAClF,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,uBAAuB,CAAC;IAChC,IAAI,EAAE,qBAAqB,CAAC;CAC7B"}
@@ -1,10 +1,10 @@
1
- import { GetGetMarketInfo200 } from '../../types/generated/enigma-solver.js';
1
+ import { GetMarketInfo200 } from '../../types/generated/enigma-solver.js';
2
2
  import { EnigmaMarketInfo } from '../types.js';
3
3
  /**
4
- * Map Enigma's flat `/get_market_info` bag into {@link EnigmaMarketInfo},
4
+ * Map Enigma's flat `/market-info` bag into {@link EnigmaMarketInfo},
5
5
  * splitting the top-level aggregate totals from the per-market volume rows.
6
6
  */
7
- export declare function toEnigmaMarketInfo(raw: GetGetMarketInfo200): EnigmaMarketInfo;
7
+ export declare function toEnigmaMarketInfo(raw: GetMarketInfo200): EnigmaMarketInfo;
8
8
  /**
9
9
  * Fetch and normalize market info from an **Enigma** solver — the generated
10
10
  * client call plus mapping to {@link EnigmaMarketInfo}.
@@ -1 +1 @@
1
- {"version":3,"file":"enigma-market-info.d.ts","sourceRoot":"","sources":["../../../../src/solvers/market-info/adapters/enigma-market-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AACjG,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,UAAU,CAAC;AAmB/D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,gBAAgB,CAkB7E;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAGtF"}
1
+ {"version":3,"file":"enigma-market-info.d.ts","sourceRoot":"","sources":["../../../../src/solvers/market-info/adapters/enigma-market-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAChH,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,UAAU,CAAC;AAmB/D;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,CAoB1E;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAGtF"}
@@ -1,4 +1,4 @@
1
- import { getGetMarketInfo as e } from "../../types/generated/enigma-solver.js";
1
+ import { getMarketInfo as e } from "../../types/generated/enigma-solver.js";
2
2
  //#region src/solvers/market-info/adapters/enigma-market-info.ts
3
3
  var t = new Set(["total_value_24h", "total_lifetime_value"]);
4
4
  function n(e) {
@@ -10,11 +10,13 @@ function r(e) {
10
10
  let r = [];
11
11
  for (let [i, a] of Object.entries(e)) {
12
12
  if (t.has(i) || typeof a != "object" || !a) continue;
13
- let e = a;
13
+ let e = Number(i);
14
+ if (!Number.isSafeInteger(e) || e <= 0) continue;
15
+ let o = a;
14
16
  r.push({
15
- symbol: i,
16
- tradingVolume: n(e.trading_volume),
17
- lifetimeValue: n(e.lifetime_value)
17
+ symbolId: e,
18
+ tradingVolume: n(o.trading_volume),
19
+ lifetimeValue: n(o.lifetime_value)
18
20
  });
19
21
  }
20
22
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"enigma-market-info.js","names":[],"sources":["../../../../src/solvers/market-info/adapters/enigma-market-info.ts"],"sourcesContent":["import { getGetMarketInfo, type GetGetMarketInfo200 } from \"../../types/generated/enigma-solver\";\nimport type { EnigmaMarketInfo, MarketVolume } from \"../types\";\n\n/**\n * Top-level aggregate keys in Enigma's `/get_market_info` bag. Every other key is\n * a market name whose value is a `{ trading_volume, lifetime_value }` object.\n */\nconst AGGREGATE_KEYS = new Set<string>([\"total_value_24h\", \"total_lifetime_value\"]);\n\n/**\n * Coerce an optional numeric solver field to a finite `number`, defaulting to\n * `0`. Enigma's volume bag is untyped in the OpenAPI spec but the running solver\n * may serve numbers or decimal strings, so accept both.\n */\nfunction toNumber(value: unknown): number {\n if (value === undefined || value === null) return 0;\n const parsed = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\n/**\n * Map Enigma's flat `/get_market_info` bag into {@link EnigmaMarketInfo},\n * splitting the top-level aggregate totals from the per-market volume rows.\n */\nexport function toEnigmaMarketInfo(raw: GetGetMarketInfo200): EnigmaMarketInfo {\n const markets: MarketVolume[] = [];\n for (const [key, value] of Object.entries(raw)) {\n if (AGGREGATE_KEYS.has(key)) continue;\n if (typeof value !== \"object\" || value === null) continue;\n const entry = value as Record<string, unknown>;\n markets.push({\n symbol: key,\n tradingVolume: toNumber(entry.trading_volume),\n lifetimeValue: toNumber(entry.lifetime_value),\n });\n }\n return {\n kind: \"enigma\",\n markets,\n totalValue24h: toNumber(raw.total_value_24h),\n totalLifetimeValue: toNumber(raw.total_lifetime_value),\n };\n}\n\n/**\n * Fetch and normalize market info from an **Enigma** solver — the generated\n * client call plus mapping to {@link EnigmaMarketInfo}.\n *\n * @internal\n */\nexport async function fetchEnigmaMarketInfo(baseURL: string): Promise<EnigmaMarketInfo> {\n const response = await getGetMarketInfo({ baseURL });\n return toEnigmaMarketInfo(response.data);\n}\n"],"mappings":";;AAOA,IAAM,IAAiB,IAAI,IAAY,CAAC,mBAAmB,sBAAsB,CAAC;AAOlF,SAAS,EAAS,GAAwB;CACxC,IAAI,KAAiC,MAAM,OAAO;CAClD,IAAM,IAAS,OAAO,KAAU,WAAW,IAAQ,OAAO,CAAK;CAC/D,OAAO,OAAO,SAAS,CAAM,IAAI,IAAS;AAC5C;AAMA,SAAgB,EAAmB,GAA4C;CAC7E,IAAM,IAA0B,CAAC;CACjC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAG,GAAG;EAE9C,IADI,EAAe,IAAI,CAAG,KACtB,OAAO,KAAU,aAAY,GAAgB;EACjD,IAAM,IAAQ;EACd,EAAQ,KAAK;GACX,QAAQ;GACR,eAAe,EAAS,EAAM,cAAc;GAC5C,eAAe,EAAS,EAAM,cAAc;EAC9C,CAAC;CACH;CACA,OAAO;EACL,MAAM;EACN;EACA,eAAe,EAAS,EAAI,eAAe;EAC3C,oBAAoB,EAAS,EAAI,oBAAoB;CACvD;AACF;AAQA,eAAsB,EAAsB,GAA4C;CAEtF,OAAO,GAAmB,MADH,EAAiB,EAAE,WAAQ,CAAC,GAChB,IAAI;AACzC"}
1
+ {"version":3,"file":"enigma-market-info.js","names":[],"sources":["../../../../src/solvers/market-info/adapters/enigma-market-info.ts"],"sourcesContent":["import { getMarketInfo as requestMarketInfo, type GetMarketInfo200 } from \"../../types/generated/enigma-solver\";\nimport type { EnigmaMarketInfo, MarketVolume } from \"../types\";\n\n/**\n * Top-level aggregate keys in Enigma's `/market-info` bag. Every other key is\n * a symbol ID whose value is a `{ trading_volume, lifetime_value }` object.\n */\nconst AGGREGATE_KEYS = new Set<string>([\"total_value_24h\", \"total_lifetime_value\"]);\n\n/**\n * Coerce an optional numeric solver field to a finite `number`, defaulting to\n * `0`. Enigma's volume bag is untyped in the OpenAPI spec but the running solver\n * may serve numbers or decimal strings, so accept both.\n */\nfunction toNumber(value: unknown): number {\n if (value === undefined || value === null) return 0;\n const parsed = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n\n/**\n * Map Enigma's flat `/market-info` bag into {@link EnigmaMarketInfo},\n * splitting the top-level aggregate totals from the per-market volume rows.\n */\nexport function toEnigmaMarketInfo(raw: GetMarketInfo200): EnigmaMarketInfo {\n const markets: MarketVolume[] = [];\n for (const [key, value] of Object.entries(raw)) {\n if (AGGREGATE_KEYS.has(key)) continue;\n if (typeof value !== \"object\" || value === null) continue;\n const symbolId = Number(key);\n if (!Number.isSafeInteger(symbolId) || symbolId <= 0) continue;\n const entry = value as Record<string, unknown>;\n markets.push({\n symbolId,\n tradingVolume: toNumber(entry.trading_volume),\n lifetimeValue: toNumber(entry.lifetime_value),\n });\n }\n return {\n kind: \"enigma\",\n markets,\n totalValue24h: toNumber(raw.total_value_24h),\n totalLifetimeValue: toNumber(raw.total_lifetime_value),\n };\n}\n\n/**\n * Fetch and normalize market info from an **Enigma** solver — the generated\n * client call plus mapping to {@link EnigmaMarketInfo}.\n *\n * @internal\n */\nexport async function fetchEnigmaMarketInfo(baseURL: string): Promise<EnigmaMarketInfo> {\n const response = await requestMarketInfo({ baseURL });\n return toEnigmaMarketInfo(response.data);\n}\n"],"mappings":";;AAOA,IAAM,IAAiB,IAAI,IAAY,CAAC,mBAAmB,sBAAsB,CAAC;AAOlF,SAAS,EAAS,GAAwB;CACxC,IAAI,KAAiC,MAAM,OAAO;CAClD,IAAM,IAAS,OAAO,KAAU,WAAW,IAAQ,OAAO,CAAK;CAC/D,OAAO,OAAO,SAAS,CAAM,IAAI,IAAS;AAC5C;AAMA,SAAgB,EAAmB,GAAyC;CAC1E,IAAM,IAA0B,CAAC;CACjC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAG,GAAG;EAE9C,IADI,EAAe,IAAI,CAAG,KACtB,OAAO,KAAU,aAAY,GAAgB;EACjD,IAAM,IAAW,OAAO,CAAG;EAC3B,IAAI,CAAC,OAAO,cAAc,CAAQ,KAAK,KAAY,GAAG;EACtD,IAAM,IAAQ;EACd,EAAQ,KAAK;GACX;GACA,eAAe,EAAS,EAAM,cAAc;GAC5C,eAAe,EAAS,EAAM,cAAc;EAC9C,CAAC;CACH;CACA,OAAO;EACL,MAAM;EACN;EACA,eAAe,EAAS,EAAI,eAAe;EAC3C,oBAAoB,EAAS,EAAI,oBAAoB;CACvD;AACF;AAQA,eAAsB,EAAsB,GAA4C;CAEtF,OAAO,GAAmB,MADH,EAAkB,EAAE,WAAQ,CAAC,GACjB,IAAI;AACzC"}
@@ -14,11 +14,12 @@ export type GetMarketInfoParameters<K extends SymmioSolverKind = SymmioSolverKin
14
14
  /** Return type of {@link getMarketInfo}: the market-info type for kind `K` (the {@link MarketInfo} union when unspecified). */
15
15
  export type GetMarketInfoReturnType<K extends SymmioSolverKind = SymmioSolverKind> = NormalizedMarketInfoByKind[K];
16
16
  /**
17
- * Fetch per-market info from the chain's solver `/get_market_info` endpoint,
17
+ * Fetch market info from Enigma `/market-info` or Rasa `/get_market_info`,
18
18
  * normalized to the {@link MarketInfo} union. The response diverges by solver
19
19
  * kind — **Enigma** returns per-market 24h volume + lifetime value plus aggregate
20
- * totals; **Rasa** returns per-market price / 24h change / volume / notional cap.
20
+ * totals keyed by symbol ID; **Rasa** returns per-market price / 24h change / volume / notional cap.
21
21
  * So **narrow on `kind`** before reading either side's rows.
22
+ * Enigma has no per-market route: select a symbol ID from this shared response.
22
23
  *
23
24
  * Pass a **literal** `solverId` to narrow the return to that solver's type; omit
24
25
  * it (default solver) to get the union.
@@ -1 +1 @@
1
- {"version":3,"file":"get-market-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/market-info/get-market-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAc,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,OAAO,CAC1F,gBAAgB,GAAG;IACjB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd,CACF,CAAC;AAEF,+HAA+H;AAC/H,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAEnH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC/E,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,uBAAuB,CAAC,CAAC,CAAM,GAC1C,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAQrC"}
1
+ {"version":3,"file":"get-market-info.d.ts","sourceRoot":"","sources":["../../../src/solvers/market-info/get-market-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAc,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,OAAO,CAC1F,gBAAgB,GAAG;IACjB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd,CACF,CAAC;AAEF,+HAA+H;AAC/H,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAEnH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC/E,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,uBAAuB,CAAC,CAAC,CAAM,GAC1C,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAQrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-market-info.js","names":[],"sources":["../../../src/solvers/market-info/get-market-info.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { SymmioResolvedSolver, SymmioSolverKind } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchEnigmaMarketInfo, fetchRasaMarketInfo } from \"./adapters\";\nimport type { MarketInfo, NormalizedMarketInfoByKind } from \"./types\";\n\n/**\n * Parameters for {@link getMarketInfo}, generic over the solver kind `K`. A\n * **literal** `solverId` narrows the return to that solver's market-info type; a\n * variable or omitted `solverId` yields the {@link MarketInfo} union.\n */\nexport type GetMarketInfoParameters<K extends SymmioSolverKind = SymmioSolverKind> = Compute<\n ChainIdParameter & {\n /** Which solver kind to read. A literal narrows the return; omit for the chain's default. */\n solverId?: K;\n }\n>;\n\n/** Return type of {@link getMarketInfo}: the market-info type for kind `K` (the {@link MarketInfo} union when unspecified). */\nexport type GetMarketInfoReturnType<K extends SymmioSolverKind = SymmioSolverKind> = NormalizedMarketInfoByKind[K];\n\n/**\n * Fetch per-market info from the chain's solver `/get_market_info` endpoint,\n * normalized to the {@link MarketInfo} union. The response diverges by solver\n * kind — **Enigma** returns per-market 24h volume + lifetime value plus aggregate\n * totals; **Rasa** returns per-market price / 24h change / volume / notional cap.\n * So **narrow on `kind`** before reading either side's rows.\n *\n * Pass a **literal** `solverId` to narrow the return to that solver's type; omit\n * it (default solver) to get the union.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain id and solver kind.\n * @returns Normalized market info for the resolved solver.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} when the chain or solver is unsupported.\n *\n * @example\n * ```ts\n * const info = await getMarketInfo(config, {});\n * if (info.kind === \"enigma\") console.log(info.totalValue24h);\n * else console.log(info.markets[0]?.price); // Rasa\n * ```\n */\nexport async function getMarketInfo<K extends SymmioSolverKind = SymmioSolverKind>(\n config: Config,\n parameters: GetMarketInfoParameters<K> = {},\n): Promise<GetMarketInfoReturnType<K>> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n try {\n const info = await fetchMarketInfoBySolverKind(solver);\n return info as GetMarketInfoReturnType<K>;\n } catch (err) {\n throw toMarketInfoError(err, solver.url);\n }\n}\n\n/**\n * Dispatch to the resolved solver's per-kind market-info adapter (each owns its\n * client call + normalization). Exhaustive over the solver kinds — a new kind\n * fails to compile at the `never` guard until its adapter is wired in.\n *\n * @internal\n */\nasync function fetchMarketInfoBySolverKind(solver: SymmioResolvedSolver): Promise<MarketInfo> {\n switch (solver.id) {\n case \"enigma\":\n return fetchEnigmaMarketInfo(solver.url);\n case \"rasa\":\n return fetchRasaMarketInfo(solver.url);\n default: {\n const unreachable: never = solver.id;\n throw new SymmError(\n \"api\",\n \"UNSUPPORTED_BY_SOLVER\",\n `Market info is not supported by solver kind \"${unreachable}\".`,\n );\n }\n }\n}\n\n/**\n * Map a fetch failure to a typed {@link SymmError}.\n *\n * @internal\n */\nfunction toMarketInfoError(err: unknown, baseURL: string): SymmError {\n if (err instanceof SymmError) return err;\n if (isAxiosError(err)) {\n return SymmApiError.fromAxios(err, { code: \"FETCH_MARKET_INFO_FAILED\", baseURL });\n }\n return new SymmError(\n \"api\",\n \"FETCH_MARKET_INFO_FAILED\",\n `Failed to fetch market info: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n}\n"],"mappings":";;;;;AA8CA,eAAsB,EACpB,GACA,IAAyC,CAAC,GACL;CACrC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAC9F,IAAI;EAEF,OAAO,MADY,EAA4B,CAAM;CAEvD,SAAS,GAAK;EACZ,MAAM,EAAkB,GAAK,EAAO,GAAG;CACzC;AACF;AASA,eAAe,EAA4B,GAAmD;CAC5F,QAAQ,EAAO,IAAf;EACE,KAAK,UACH,OAAO,EAAsB,EAAO,GAAG;EACzC,KAAK,QACH,OAAO,EAAoB,EAAO,GAAG;EACvC,SAAS;GACP,IAAM,IAAqB,EAAO;GAClC,MAAM,IAAI,EACR,OACA,yBACA,gDAAgD,EAAY,GAC9D;EACF;CACF;AACF;AAOA,SAAS,EAAkB,GAAc,GAA4B;CAKnE,OAJI,aAAe,IAAkB,IACjC,EAAa,CAAG,IACX,EAAa,UAAU,GAAK;EAAE,MAAM;EAA4B;CAAQ,CAAC,IAE3E,IAAI,EACT,OACA,4BACA,gCAAgC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC/E,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;AACF"}
1
+ {"version":3,"file":"get-market-info.js","names":[],"sources":["../../../src/solvers/market-info/get-market-info.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { SymmioResolvedSolver, SymmioSolverKind } from \"../../core/chains/types\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { fetchEnigmaMarketInfo, fetchRasaMarketInfo } from \"./adapters\";\nimport type { MarketInfo, NormalizedMarketInfoByKind } from \"./types\";\n\n/**\n * Parameters for {@link getMarketInfo}, generic over the solver kind `K`. A\n * **literal** `solverId` narrows the return to that solver's market-info type; a\n * variable or omitted `solverId` yields the {@link MarketInfo} union.\n */\nexport type GetMarketInfoParameters<K extends SymmioSolverKind = SymmioSolverKind> = Compute<\n ChainIdParameter & {\n /** Which solver kind to read. A literal narrows the return; omit for the chain's default. */\n solverId?: K;\n }\n>;\n\n/** Return type of {@link getMarketInfo}: the market-info type for kind `K` (the {@link MarketInfo} union when unspecified). */\nexport type GetMarketInfoReturnType<K extends SymmioSolverKind = SymmioSolverKind> = NormalizedMarketInfoByKind[K];\n\n/**\n * Fetch market info from Enigma `/market-info` or Rasa `/get_market_info`,\n * normalized to the {@link MarketInfo} union. The response diverges by solver\n * kind — **Enigma** returns per-market 24h volume + lifetime value plus aggregate\n * totals keyed by symbol ID; **Rasa** returns per-market price / 24h change / volume / notional cap.\n * So **narrow on `kind`** before reading either side's rows.\n * Enigma has no per-market route: select a symbol ID from this shared response.\n *\n * Pass a **literal** `solverId` to narrow the return to that solver's type; omit\n * it (default solver) to get the union.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain id and solver kind.\n * @returns Normalized market info for the resolved solver.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} when the chain or solver is unsupported.\n *\n * @example\n * ```ts\n * const info = await getMarketInfo(config, {});\n * if (info.kind === \"enigma\") console.log(info.totalValue24h);\n * else console.log(info.markets[0]?.price); // Rasa\n * ```\n */\nexport async function getMarketInfo<K extends SymmioSolverKind = SymmioSolverKind>(\n config: Config,\n parameters: GetMarketInfoParameters<K> = {},\n): Promise<GetMarketInfoReturnType<K>> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n try {\n const info = await fetchMarketInfoBySolverKind(solver);\n return info as GetMarketInfoReturnType<K>;\n } catch (err) {\n throw toMarketInfoError(err, solver.url);\n }\n}\n\n/**\n * Dispatch to the resolved solver's per-kind market-info adapter (each owns its\n * client call + normalization). Exhaustive over the solver kinds — a new kind\n * fails to compile at the `never` guard until its adapter is wired in.\n *\n * @internal\n */\nasync function fetchMarketInfoBySolverKind(solver: SymmioResolvedSolver): Promise<MarketInfo> {\n switch (solver.id) {\n case \"enigma\":\n return fetchEnigmaMarketInfo(solver.url);\n case \"rasa\":\n return fetchRasaMarketInfo(solver.url);\n default: {\n const unreachable: never = solver.id;\n throw new SymmError(\n \"api\",\n \"UNSUPPORTED_BY_SOLVER\",\n `Market info is not supported by solver kind \"${unreachable}\".`,\n );\n }\n }\n}\n\n/**\n * Map a fetch failure to a typed {@link SymmError}.\n *\n * @internal\n */\nfunction toMarketInfoError(err: unknown, baseURL: string): SymmError {\n if (err instanceof SymmError) return err;\n if (isAxiosError(err)) {\n return SymmApiError.fromAxios(err, { code: \"FETCH_MARKET_INFO_FAILED\", baseURL });\n }\n return new SymmError(\n \"api\",\n \"FETCH_MARKET_INFO_FAILED\",\n `Failed to fetch market info: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n}\n"],"mappings":";;;;;AA+CA,eAAsB,EACpB,GACA,IAAyC,CAAC,GACL;CACrC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAC9F,IAAI;EAEF,OAAO,MADY,EAA4B,CAAM;CAEvD,SAAS,GAAK;EACZ,MAAM,EAAkB,GAAK,EAAO,GAAG;CACzC;AACF;AASA,eAAe,EAA4B,GAAmD;CAC5F,QAAQ,EAAO,IAAf;EACE,KAAK,UACH,OAAO,EAAsB,EAAO,GAAG;EACzC,KAAK,QACH,OAAO,EAAoB,EAAO,GAAG;EACvC,SAAS;GACP,IAAM,IAAqB,EAAO;GAClC,MAAM,IAAI,EACR,OACA,yBACA,gDAAgD,EAAY,GAC9D;EACF;CACF;AACF;AAOA,SAAS,EAAkB,GAAc,GAA4B;CAKnE,OAJI,aAAe,IAAkB,IACjC,EAAa,CAAG,IACX,EAAa,UAAU,GAAK;EAAE,MAAM;EAA4B;CAAQ,CAAC,IAE3E,IAAI,EACT,OACA,4BACA,gCAAgC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC/E,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;AACF"}
@@ -1,12 +1,13 @@
1
1
  /**
2
- * 24h volume figures for one **Enigma** market, normalized from `/get_market_info`.
2
+ * 24h volume figures for one **Enigma** market, normalized from `/market-info`.
3
3
  *
4
4
  * Every numeric field is a plain JavaScript `number` in the **dollar units the
5
5
  * solver already reports** — no decimal scaling. `1234` here means $1,234.
6
+ * @example const row: MarketVolume = { symbolId: 117, tradingVolume: 1234, lifetimeValue: 5678 };
6
7
  */
7
8
  export interface MarketVolume {
8
- /** Market ticker and solver map key (e.g. `"BTCUSDT"`). */
9
- symbol: string;
9
+ /** Stable solver symbol ID; join with getSymbols for names and tickers. */
10
+ symbolId: number;
10
11
  /** Rolling 24-hour trading volume for the market (dollars). */
11
12
  tradingVolume: number;
12
13
  /** Cumulative lifetime traded value for the market (dollars). */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/market-info/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE3D,gEAAgE;AAChE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,cAAc,CAAC;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/market-info/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,IAAI,EAAE,QAAQ,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE3D,gEAAgE;AAChE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,cAAc,CAAC;CACtB"}
@@ -17,18 +17,18 @@ export interface GetNotionalCapAllReturnType {
17
17
  symbols: EnigmaNotionalCap[];
18
18
  }
19
19
  /**
20
- * Fetch every market's notional cap in one call (`/notional_cap`). Surfaces the
21
- * aggregate `totalOpenInterest` / `totalUsed` and the per-symbol rows decoded
22
- * via {@link toMarketNotionalCap} — the same mapper the single-symbol read uses.
23
- *
24
- * Dollar amounts are returned as plain `number` values exactly as the solver
25
- * reports them; no decimal scaling. HTTP / transport failures throw
26
- * {@link SymmApiError}.
27
- *
20
+ * Fetch every Enigma notional-cap page in server order and sum page totals.
21
+ * Dollar amounts remain plain numbers, with the existing zero fallback for
22
+ * missing fields. A failed later page rejects the whole read.
23
+ * @param config - SDK configuration selecting the deployment.
24
+ * @param parameters - Optional chain and solver selection.
25
+ * @returns All rows, their count and aggregate totals in float dollars.
26
+ * @throws {SymmError} For an unsupported solver or chain.
27
+ * @throws {SymmApiError} When any page request fails.
28
28
  * @example
29
29
  * ```ts
30
- * const all = await getNotionalCapAll(config, {});
31
- * console.log(all.totalOpenInterest, all.symbols.length);
30
+ * const caps = await getNotionalCapAll(config, {});
31
+ * console.log(caps.count, caps.totalUsed);
32
32
  * ```
33
33
  */
34
34
  export declare function getNotionalCapAll(config: Config, parameters?: GetNotionalCapAllParameters): Promise<GetNotionalCapAllReturnType>;
@@ -1 +1 @@
1
- {"version":3,"file":"get-notional-cap-all.d.ts","sourceRoot":"","sources":["../../../src/solvers/notional-cap/get-notional-cap-all.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEvE,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC1C,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,2BAAgC,GAC3C,OAAO,CAAC,2BAA2B,CAAC,CAwBtC"}
1
+ {"version":3,"file":"get-notional-cap-all.d.ts","sourceRoot":"","sources":["../../../src/solvers/notional-cap/get-notional-cap-all.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEvE,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC1C,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,2BAAgC,GAC3C,OAAO,CAAC,2BAA2B,CAAC,CA4BtC"}