@symmio/trading-react 1.1.0 → 3.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 (543) hide show
  1. package/dist/account-layer/index.d.ts +1 -0
  2. package/dist/account-layer/index.d.ts.map +1 -1
  3. package/dist/account-layer/index.js +26 -25
  4. package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts +53 -0
  5. package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts.map +1 -0
  6. package/dist/account-layer/use-deallocate-and-initiate-withdraw.js +49 -0
  7. package/dist/account-layer/use-deallocate-and-initiate-withdraw.js.map +1 -0
  8. package/dist/account-layer/use-deposit-and-allocate.d.ts +4 -2
  9. package/dist/account-layer/use-deposit-and-allocate.d.ts.map +1 -1
  10. package/dist/account-layer/use-deposit-and-allocate.js +17 -15
  11. package/dist/account-layer/use-deposit-and-allocate.js.map +1 -1
  12. package/dist/account-layer/use-edit-account-name.d.ts.map +1 -1
  13. package/dist/account-layer/use-edit-account-name.js +14 -14
  14. package/dist/account-layer/use-edit-account-name.js.map +1 -1
  15. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +1 -1
  16. package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js.map +1 -1
  17. package/dist/candles/index.d.ts +5 -0
  18. package/dist/candles/index.d.ts.map +1 -0
  19. package/dist/candles/index.js +5 -0
  20. package/dist/candles/use-binance-candle-source.d.ts +27 -0
  21. package/dist/candles/use-binance-candle-source.d.ts.map +1 -0
  22. package/dist/candles/use-binance-candle-source.js +24 -0
  23. package/dist/candles/use-binance-candle-source.js.map +1 -0
  24. package/dist/candles/use-candle-stream.d.ts +65 -0
  25. package/dist/candles/use-candle-stream.d.ts.map +1 -0
  26. package/dist/candles/use-candle-stream.js +44 -0
  27. package/dist/candles/use-candle-stream.js.map +1 -0
  28. package/dist/candles/use-candles.d.ts +40 -0
  29. package/dist/candles/use-candles.d.ts.map +1 -0
  30. package/dist/candles/use-candles.js +22 -0
  31. package/dist/candles/use-candles.js.map +1 -0
  32. package/dist/candles/use-tradingview-datafeed.d.ts +31 -0
  33. package/dist/candles/use-tradingview-datafeed.d.ts.map +1 -0
  34. package/dist/candles/use-tradingview-datafeed.js +21 -0
  35. package/dist/candles/use-tradingview-datafeed.js.map +1 -0
  36. package/dist/index.d.ts +125 -21
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +201 -113
  39. package/dist/instant-layer/index.d.ts +4 -0
  40. package/dist/instant-layer/index.d.ts.map +1 -1
  41. package/dist/instant-layer/index.js +10 -6
  42. package/dist/instant-layer/use-instant-close-auto.d.ts.map +1 -1
  43. package/dist/instant-layer/use-instant-close-auto.js +12 -11
  44. package/dist/instant-layer/use-instant-close-auto.js.map +1 -1
  45. package/dist/instant-layer/use-instant-close-bulk-auto.d.ts.map +1 -1
  46. package/dist/instant-layer/use-instant-close-bulk-auto.js +12 -11
  47. package/dist/instant-layer/use-instant-close-bulk-auto.js.map +1 -1
  48. package/dist/instant-layer/use-instant-close-bulk.d.ts.map +1 -1
  49. package/dist/instant-layer/use-instant-close-bulk.js +12 -11
  50. package/dist/instant-layer/use-instant-close-bulk.js.map +1 -1
  51. package/dist/instant-layer/use-instant-close.d.ts.map +1 -1
  52. package/dist/instant-layer/use-instant-close.js +12 -11
  53. package/dist/instant-layer/use-instant-close.js.map +1 -1
  54. package/dist/instant-layer/use-instant-open-auto.d.ts.map +1 -1
  55. package/dist/instant-layer/use-instant-open-auto.js +12 -11
  56. package/dist/instant-layer/use-instant-open-auto.js.map +1 -1
  57. package/dist/instant-layer/use-instant-open-fees.d.ts +43 -0
  58. package/dist/instant-layer/use-instant-open-fees.d.ts.map +1 -0
  59. package/dist/instant-layer/use-instant-open-fees.js +111 -0
  60. package/dist/instant-layer/use-instant-open-fees.js.map +1 -0
  61. package/dist/instant-layer/use-instant-open-with-tpsl.d.ts.map +1 -1
  62. package/dist/instant-layer/use-instant-open-with-tpsl.js +34 -31
  63. package/dist/instant-layer/use-instant-open-with-tpsl.js.map +1 -1
  64. package/dist/instant-layer/use-instant-open.d.ts +23 -18
  65. package/dist/instant-layer/use-instant-open.d.ts.map +1 -1
  66. package/dist/instant-layer/use-instant-open.js +12 -11
  67. package/dist/instant-layer/use-instant-open.js.map +1 -1
  68. package/dist/instant-layer/use-instant-opens.d.ts +6 -6
  69. package/dist/instant-layer/use-instant-opens.d.ts.map +1 -1
  70. package/dist/instant-layer/use-instant-opens.js.map +1 -1
  71. package/dist/instant-layer/use-instant-trade-required-selectors.d.ts +25 -0
  72. package/dist/instant-layer/use-instant-trade-required-selectors.d.ts.map +1 -0
  73. package/dist/instant-layer/use-instant-trade-required-selectors.js +13 -0
  74. package/dist/instant-layer/use-instant-trade-required-selectors.js.map +1 -0
  75. package/dist/instant-layer/use-limit-close-auto.d.ts +30 -0
  76. package/dist/instant-layer/use-limit-close-auto.d.ts.map +1 -0
  77. package/dist/instant-layer/use-limit-close-auto.js +33 -0
  78. package/dist/instant-layer/use-limit-close-auto.js.map +1 -0
  79. package/dist/instant-layer/use-limit-open-auto.d.ts +30 -0
  80. package/dist/instant-layer/use-limit-open-auto.d.ts.map +1 -0
  81. package/dist/instant-layer/use-limit-open-auto.js +33 -0
  82. package/dist/instant-layer/use-limit-open-auto.js.map +1 -0
  83. package/dist/inventory/index.d.ts +3 -0
  84. package/dist/inventory/index.d.ts.map +1 -0
  85. package/dist/inventory/index.js +3 -0
  86. package/dist/inventory/use-inventory-tvl-history.d.ts +27 -0
  87. package/dist/inventory/use-inventory-tvl-history.d.ts.map +1 -0
  88. package/dist/inventory/use-inventory-tvl-history.js +28 -0
  89. package/dist/inventory/use-inventory-tvl-history.js.map +1 -0
  90. package/dist/inventory/use-inventory-tvl.d.ts +23 -0
  91. package/dist/inventory/use-inventory-tvl.d.ts.map +1 -0
  92. package/dist/inventory/use-inventory-tvl.js +27 -0
  93. package/dist/inventory/use-inventory-tvl.js.map +1 -0
  94. package/dist/margin/index.d.ts +1 -0
  95. package/dist/margin/index.d.ts.map +1 -1
  96. package/dist/margin/use-account-margin-risk.d.ts +68 -0
  97. package/dist/margin/use-account-margin-risk.d.ts.map +1 -0
  98. package/dist/margin/use-account-margin-risk.js +31 -0
  99. package/dist/margin/use-account-margin-risk.js.map +1 -0
  100. package/dist/margin/use-available-instant-open-margin.d.ts +27 -7
  101. package/dist/margin/use-available-instant-open-margin.d.ts.map +1 -1
  102. package/dist/margin/use-available-instant-open-margin.js +117 -46
  103. package/dist/margin/use-available-instant-open-margin.js.map +1 -1
  104. package/dist/market-info/use-market-info.d.ts +13 -13
  105. package/dist/market-info/use-market-info.d.ts.map +1 -1
  106. package/dist/market-info/use-market-info.js.map +1 -1
  107. package/dist/markets/use-markets.d.ts +14 -8
  108. package/dist/markets/use-markets.d.ts.map +1 -1
  109. package/dist/markets/use-markets.js.map +1 -1
  110. package/dist/muon/index.d.ts +2 -0
  111. package/dist/muon/index.d.ts.map +1 -1
  112. package/dist/muon/use-force-close-price-sig.d.ts +34 -0
  113. package/dist/muon/use-force-close-price-sig.d.ts.map +1 -0
  114. package/dist/muon/use-force-close-price-sig.js +31 -0
  115. package/dist/muon/use-force-close-price-sig.js.map +1 -0
  116. package/dist/muon/use-send-quote-upnl-sig.d.ts +30 -0
  117. package/dist/muon/use-send-quote-upnl-sig.d.ts.map +1 -0
  118. package/dist/muon/use-send-quote-upnl-sig.js +28 -0
  119. package/dist/muon/use-send-quote-upnl-sig.js.map +1 -0
  120. package/dist/notifications/use-search-notifications.d.ts +12 -12
  121. package/dist/notifications/use-search-notifications.d.ts.map +1 -1
  122. package/dist/notifications/use-search-notifications.js.map +1 -1
  123. package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +7 -7
  124. package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts.map +1 -1
  125. package/dist/notional-cap/use-notional-cap-by-symbol-id.js.map +1 -1
  126. package/dist/orderbook/index.d.ts +5 -0
  127. package/dist/orderbook/index.d.ts.map +1 -0
  128. package/dist/orderbook/index.js +5 -0
  129. package/dist/orderbook/use-binance-orderbook-source.d.ts +28 -0
  130. package/dist/orderbook/use-binance-orderbook-source.d.ts.map +1 -0
  131. package/dist/orderbook/use-binance-orderbook-source.js +26 -0
  132. package/dist/orderbook/use-binance-orderbook-source.js.map +1 -0
  133. package/dist/orderbook/use-live-orderbook.d.ts +104 -0
  134. package/dist/orderbook/use-live-orderbook.d.ts.map +1 -0
  135. package/dist/orderbook/use-live-orderbook.js +77 -0
  136. package/dist/orderbook/use-live-orderbook.js.map +1 -0
  137. package/dist/orderbook/use-orderbook-stream.d.ts +73 -0
  138. package/dist/orderbook/use-orderbook-stream.d.ts.map +1 -0
  139. package/dist/orderbook/use-orderbook-stream.js +49 -0
  140. package/dist/orderbook/use-orderbook-stream.js.map +1 -0
  141. package/dist/orderbook/use-orderbook.d.ts +35 -0
  142. package/dist/orderbook/use-orderbook.d.ts.map +1 -0
  143. package/dist/orderbook/use-orderbook.js +22 -0
  144. package/dist/orderbook/use-orderbook.js.map +1 -0
  145. package/dist/pools/index.d.ts +30 -0
  146. package/dist/pools/index.d.ts.map +1 -0
  147. package/dist/pools/index.js +30 -0
  148. package/dist/pools/use-add-market.d.ts +57 -0
  149. package/dist/pools/use-add-market.d.ts.map +1 -0
  150. package/dist/pools/use-add-market.js +30 -0
  151. package/dist/pools/use-add-market.js.map +1 -0
  152. package/dist/pools/use-authenticate-listing.d.ts +45 -0
  153. package/dist/pools/use-authenticate-listing.d.ts.map +1 -0
  154. package/dist/pools/use-authenticate-listing.js +30 -0
  155. package/dist/pools/use-authenticate-listing.js.map +1 -0
  156. package/dist/pools/use-cancel-withdraw.d.ts +47 -0
  157. package/dist/pools/use-cancel-withdraw.d.ts.map +1 -0
  158. package/dist/pools/use-cancel-withdraw.js +30 -0
  159. package/dist/pools/use-cancel-withdraw.js.map +1 -0
  160. package/dist/pools/use-claim-history.d.ts +25 -0
  161. package/dist/pools/use-claim-history.d.ts.map +1 -0
  162. package/dist/pools/use-claim-history.js +27 -0
  163. package/dist/pools/use-claim-history.js.map +1 -0
  164. package/dist/pools/use-claim-profit.d.ts +53 -0
  165. package/dist/pools/use-claim-profit.d.ts.map +1 -0
  166. package/dist/pools/use-claim-profit.js +30 -0
  167. package/dist/pools/use-claim-profit.js.map +1 -0
  168. package/dist/pools/use-deposit-address.d.ts +43 -0
  169. package/dist/pools/use-deposit-address.d.ts.map +1 -0
  170. package/dist/pools/use-deposit-address.js +28 -0
  171. package/dist/pools/use-deposit-address.js.map +1 -0
  172. package/dist/pools/use-listing-config.d.ts +28 -0
  173. package/dist/pools/use-listing-config.d.ts.map +1 -0
  174. package/dist/pools/use-listing-config.js +27 -0
  175. package/dist/pools/use-listing-config.js.map +1 -0
  176. package/dist/pools/use-listing-market-config-projection.d.ts +66 -0
  177. package/dist/pools/use-listing-market-config-projection.d.ts.map +1 -0
  178. package/dist/pools/use-listing-market-config-projection.js +57 -0
  179. package/dist/pools/use-listing-market-config-projection.js.map +1 -0
  180. package/dist/pools/use-listing-market-config.d.ts +49 -0
  181. package/dist/pools/use-listing-market-config.d.ts.map +1 -0
  182. package/dist/pools/use-listing-market-config.js +28 -0
  183. package/dist/pools/use-listing-market-config.js.map +1 -0
  184. package/dist/pools/use-listing-market-detail.d.ts +29 -0
  185. package/dist/pools/use-listing-market-detail.d.ts.map +1 -0
  186. package/dist/pools/use-listing-market-detail.js +27 -0
  187. package/dist/pools/use-listing-market-detail.js.map +1 -0
  188. package/dist/pools/use-listing-markets.d.ts +32 -0
  189. package/dist/pools/use-listing-markets.d.ts.map +1 -0
  190. package/dist/pools/use-listing-markets.js +27 -0
  191. package/dist/pools/use-listing-markets.js.map +1 -0
  192. package/dist/pools/use-listing-status.d.ts +29 -0
  193. package/dist/pools/use-listing-status.d.ts.map +1 -0
  194. package/dist/pools/use-listing-status.js +28 -0
  195. package/dist/pools/use-listing-status.js.map +1 -0
  196. package/dist/pools/use-pool-quotes.d.ts +26 -0
  197. package/dist/pools/use-pool-quotes.d.ts.map +1 -0
  198. package/dist/pools/use-pool-quotes.js +27 -0
  199. package/dist/pools/use-pool-quotes.js.map +1 -0
  200. package/dist/pools/use-pool-reward-chart.d.ts +32 -0
  201. package/dist/pools/use-pool-reward-chart.d.ts.map +1 -0
  202. package/dist/pools/use-pool-reward-chart.js +28 -0
  203. package/dist/pools/use-pool-reward-chart.js.map +1 -0
  204. package/dist/pools/use-pool-total-reward.d.ts +27 -0
  205. package/dist/pools/use-pool-total-reward.d.ts.map +1 -0
  206. package/dist/pools/use-pool-total-reward.js +28 -0
  207. package/dist/pools/use-pool-total-reward.js.map +1 -0
  208. package/dist/pools/use-pool-trade-history.d.ts +26 -0
  209. package/dist/pools/use-pool-trade-history.d.ts.map +1 -0
  210. package/dist/pools/use-pool-trade-history.js +27 -0
  211. package/dist/pools/use-pool-trade-history.js.map +1 -0
  212. package/dist/pools/use-pool-transactions.d.ts +23 -0
  213. package/dist/pools/use-pool-transactions.d.ts.map +1 -0
  214. package/dist/pools/use-pool-transactions.js +27 -0
  215. package/dist/pools/use-pool-transactions.js.map +1 -0
  216. package/dist/pools/use-refund-market.d.ts +51 -0
  217. package/dist/pools/use-refund-market.d.ts.map +1 -0
  218. package/dist/pools/use-refund-market.js +30 -0
  219. package/dist/pools/use-refund-market.js.map +1 -0
  220. package/dist/pools/use-retry-listing-info.d.ts +23 -0
  221. package/dist/pools/use-retry-listing-info.d.ts.map +1 -0
  222. package/dist/pools/use-retry-listing-info.js +27 -0
  223. package/dist/pools/use-retry-listing-info.js.map +1 -0
  224. package/dist/pools/use-retry-listing.d.ts +46 -0
  225. package/dist/pools/use-retry-listing.d.ts.map +1 -0
  226. package/dist/pools/use-retry-listing.js +30 -0
  227. package/dist/pools/use-retry-listing.js.map +1 -0
  228. package/dist/pools/use-supports-listing-service.d.ts +21 -0
  229. package/dist/pools/use-supports-listing-service.d.ts.map +1 -0
  230. package/dist/pools/use-supports-listing-service.js +13 -0
  231. package/dist/pools/use-supports-listing-service.js.map +1 -0
  232. package/dist/pools/use-update-listing-market-config.d.ts +60 -0
  233. package/dist/pools/use-update-listing-market-config.d.ts.map +1 -0
  234. package/dist/pools/use-update-listing-market-config.js +30 -0
  235. package/dist/pools/use-update-listing-market-config.js.map +1 -0
  236. package/dist/pools/use-user-listing-markets.d.ts +40 -0
  237. package/dist/pools/use-user-listing-markets.d.ts.map +1 -0
  238. package/dist/pools/use-user-listing-markets.js +28 -0
  239. package/dist/pools/use-user-listing-markets.js.map +1 -0
  240. package/dist/pools/use-user-profit.d.ts +39 -0
  241. package/dist/pools/use-user-profit.d.ts.map +1 -0
  242. package/dist/pools/use-user-profit.js +28 -0
  243. package/dist/pools/use-user-profit.js.map +1 -0
  244. package/dist/pools/use-user-reward-chart.d.ts +28 -0
  245. package/dist/pools/use-user-reward-chart.d.ts.map +1 -0
  246. package/dist/pools/use-user-reward-chart.js +28 -0
  247. package/dist/pools/use-user-reward-chart.js.map +1 -0
  248. package/dist/pools/use-user-total-reward.d.ts +30 -0
  249. package/dist/pools/use-user-total-reward.d.ts.map +1 -0
  250. package/dist/pools/use-user-total-reward.js +28 -0
  251. package/dist/pools/use-user-total-reward.js.map +1 -0
  252. package/dist/pools/use-user-transactions.d.ts +24 -0
  253. package/dist/pools/use-user-transactions.d.ts.map +1 -0
  254. package/dist/pools/use-user-transactions.js +27 -0
  255. package/dist/pools/use-user-transactions.js.map +1 -0
  256. package/dist/pools/use-weekly-listing-limit.d.ts +28 -0
  257. package/dist/pools/use-weekly-listing-limit.d.ts.map +1 -0
  258. package/dist/pools/use-weekly-listing-limit.js +28 -0
  259. package/dist/pools/use-weekly-listing-limit.js.map +1 -0
  260. package/dist/pools/use-withdraw-lp.d.ts +52 -0
  261. package/dist/pools/use-withdraw-lp.d.ts.map +1 -0
  262. package/dist/pools/use-withdraw-lp.js +30 -0
  263. package/dist/pools/use-withdraw-lp.js.map +1 -0
  264. package/dist/price-service/index.d.ts +8 -0
  265. package/dist/price-service/index.d.ts.map +1 -1
  266. package/dist/price-service/index.js +17 -9
  267. package/dist/price-service/use-binance-health.d.ts +16 -0
  268. package/dist/price-service/use-binance-health.d.ts.map +1 -0
  269. package/dist/price-service/use-binance-health.js +27 -0
  270. package/dist/price-service/use-binance-health.js.map +1 -0
  271. package/dist/price-service/use-binance-premium-index.d.ts +24 -0
  272. package/dist/price-service/use-binance-premium-index.d.ts.map +1 -0
  273. package/dist/price-service/use-binance-premium-index.js +27 -0
  274. package/dist/price-service/use-binance-premium-index.js.map +1 -0
  275. package/dist/price-service/use-binance-prices.d.ts +54 -0
  276. package/dist/price-service/use-binance-prices.d.ts.map +1 -0
  277. package/dist/price-service/use-binance-prices.js +57 -0
  278. package/dist/price-service/use-binance-prices.js.map +1 -0
  279. package/dist/price-service/use-binance-symbols-info.d.ts +18 -0
  280. package/dist/price-service/use-binance-symbols-info.d.ts.map +1 -0
  281. package/dist/price-service/use-binance-symbols-info.js +27 -0
  282. package/dist/price-service/use-binance-symbols-info.js.map +1 -0
  283. package/dist/price-service/use-enigma-price-by-market-id.d.ts +7 -1
  284. package/dist/price-service/use-enigma-price-by-market-id.d.ts.map +1 -1
  285. package/dist/price-service/use-enigma-price-by-market-id.js +1 -1
  286. package/dist/price-service/use-enigma-price-by-market-id.js.map +1 -1
  287. package/dist/price-service/use-mark-prices.d.ts +25 -0
  288. package/dist/price-service/use-mark-prices.d.ts.map +1 -0
  289. package/dist/price-service/use-mark-prices.js +27 -0
  290. package/dist/price-service/use-mark-prices.js.map +1 -0
  291. package/dist/price-service/use-price-by-market-id.d.ts +53 -0
  292. package/dist/price-service/use-price-by-market-id.d.ts.map +1 -0
  293. package/dist/price-service/use-price-by-market-id.js +33 -0
  294. package/dist/price-service/use-price-by-market-id.js.map +1 -0
  295. package/dist/price-service/use-price-by-name.d.ts +48 -0
  296. package/dist/price-service/use-price-by-name.d.ts.map +1 -0
  297. package/dist/price-service/use-price-by-name.js +23 -0
  298. package/dist/price-service/use-price-by-name.js.map +1 -0
  299. package/dist/price-service/use-prices.d.ts +87 -0
  300. package/dist/price-service/use-prices.d.ts.map +1 -0
  301. package/dist/price-service/use-prices.js +77 -0
  302. package/dist/price-service/use-prices.js.map +1 -0
  303. package/dist/provider/symmio-provider.d.ts +8 -2
  304. package/dist/provider/symmio-provider.d.ts.map +1 -1
  305. package/dist/provider/symmio-provider.js +19 -19
  306. package/dist/provider/symmio-provider.js.map +1 -1
  307. package/dist/quotes/confirm-hold.d.ts +121 -0
  308. package/dist/quotes/confirm-hold.d.ts.map +1 -0
  309. package/dist/quotes/confirm-hold.js +59 -0
  310. package/dist/quotes/confirm-hold.js.map +1 -0
  311. package/dist/quotes/index.d.ts +14 -0
  312. package/dist/quotes/index.d.ts.map +1 -1
  313. package/dist/quotes/use-account-upnl.d.ts +66 -0
  314. package/dist/quotes/use-account-upnl.d.ts.map +1 -0
  315. package/dist/quotes/use-account-upnl.js +73 -0
  316. package/dist/quotes/use-account-upnl.js.map +1 -0
  317. package/dist/quotes/use-close-quote-group.d.ts +126 -0
  318. package/dist/quotes/use-close-quote-group.d.ts.map +1 -0
  319. package/dist/quotes/use-close-quote-group.js +172 -0
  320. package/dist/quotes/use-close-quote-group.js.map +1 -0
  321. package/dist/quotes/use-cool-downs-of-ma.d.ts +26 -0
  322. package/dist/quotes/use-cool-downs-of-ma.d.ts.map +1 -0
  323. package/dist/quotes/use-cool-downs-of-ma.js +27 -0
  324. package/dist/quotes/use-cool-downs-of-ma.js.map +1 -0
  325. package/dist/quotes/use-force-cancel-close-request.d.ts +27 -0
  326. package/dist/quotes/use-force-cancel-close-request.d.ts.map +1 -0
  327. package/dist/quotes/use-force-cancel-close-request.js +41 -0
  328. package/dist/quotes/use-force-cancel-close-request.js.map +1 -0
  329. package/dist/quotes/use-force-cancel-quote.d.ts +26 -0
  330. package/dist/quotes/use-force-cancel-quote.d.ts.map +1 -0
  331. package/dist/quotes/use-force-cancel-quote.js +42 -0
  332. package/dist/quotes/use-force-cancel-quote.js.map +1 -0
  333. package/dist/quotes/use-force-close-eligibility.d.ts +30 -0
  334. package/dist/quotes/use-force-close-eligibility.d.ts.map +1 -0
  335. package/dist/quotes/use-force-close-eligibility.js +39 -0
  336. package/dist/quotes/use-force-close-eligibility.js.map +1 -0
  337. package/dist/quotes/use-force-close-params.d.ts +22 -0
  338. package/dist/quotes/use-force-close-params.d.ts.map +1 -0
  339. package/dist/quotes/use-force-close-params.js +27 -0
  340. package/dist/quotes/use-force-close-params.js.map +1 -0
  341. package/dist/quotes/use-force-close.d.ts +30 -0
  342. package/dist/quotes/use-force-close.d.ts.map +1 -0
  343. package/dist/quotes/use-force-close.js +38 -0
  344. package/dist/quotes/use-force-close.js.map +1 -0
  345. package/dist/quotes/use-grouped-quotes.d.ts +50 -10
  346. package/dist/quotes/use-grouped-quotes.d.ts.map +1 -1
  347. package/dist/quotes/use-grouped-quotes.js +40 -14
  348. package/dist/quotes/use-grouped-quotes.js.map +1 -1
  349. package/dist/quotes/use-grouping-isolation.d.ts +35 -0
  350. package/dist/quotes/use-grouping-isolation.d.ts.map +1 -0
  351. package/dist/quotes/use-grouping-isolation.js +39 -0
  352. package/dist/quotes/use-grouping-isolation.js.map +1 -0
  353. package/dist/quotes/use-limit-orders.d.ts +62 -0
  354. package/dist/quotes/use-limit-orders.d.ts.map +1 -0
  355. package/dist/quotes/use-limit-orders.js +82 -0
  356. package/dist/quotes/use-limit-orders.js.map +1 -0
  357. package/dist/quotes/use-managed-quotes.d.ts.map +1 -1
  358. package/dist/quotes/use-managed-quotes.js +198 -166
  359. package/dist/quotes/use-managed-quotes.js.map +1 -1
  360. package/dist/quotes/use-party-a-open-positions.d.ts +26 -6
  361. package/dist/quotes/use-party-a-open-positions.d.ts.map +1 -1
  362. package/dist/quotes/use-party-a-open-positions.js +32 -12
  363. package/dist/quotes/use-party-a-open-positions.js.map +1 -1
  364. package/dist/quotes/use-quote-funding.d.ts +2 -2
  365. package/dist/quotes/use-quote-funding.js.map +1 -1
  366. package/dist/quotes/use-quote-group-funding-history.d.ts +70 -0
  367. package/dist/quotes/use-quote-group-funding-history.d.ts.map +1 -0
  368. package/dist/quotes/use-quote-group-funding-history.js +38 -0
  369. package/dist/quotes/use-quote-group-funding-history.js.map +1 -0
  370. package/dist/quotes/use-quote-group-funding.d.ts +67 -0
  371. package/dist/quotes/use-quote-group-funding.d.ts.map +1 -0
  372. package/dist/quotes/use-quote-group-funding.js +26 -0
  373. package/dist/quotes/use-quote-group-funding.js.map +1 -0
  374. package/dist/quotes/use-quote-group-margin-risk.d.ts +111 -0
  375. package/dist/quotes/use-quote-group-margin-risk.d.ts.map +1 -0
  376. package/dist/quotes/use-quote-group-margin-risk.js +63 -0
  377. package/dist/quotes/use-quote-group-margin-risk.js.map +1 -0
  378. package/dist/quotes/use-quote-upnl-and-pnl.d.ts +4 -3
  379. package/dist/quotes/use-quote-upnl-and-pnl.d.ts.map +1 -1
  380. package/dist/quotes/use-quote-upnl-and-pnl.js +2 -1
  381. package/dist/quotes/use-quote-upnl-and-pnl.js.map +1 -1
  382. package/dist/quotes/use-quotes-funding.d.ts +46 -10
  383. package/dist/quotes/use-quotes-funding.d.ts.map +1 -1
  384. package/dist/quotes/use-quotes-funding.js +44 -42
  385. package/dist/quotes/use-quotes-funding.js.map +1 -1
  386. package/dist/quotes/use-request-to-cancel-close-request.d.ts +27 -0
  387. package/dist/quotes/use-request-to-cancel-close-request.d.ts.map +1 -0
  388. package/dist/quotes/use-request-to-cancel-close-request.js +41 -0
  389. package/dist/quotes/use-request-to-cancel-close-request.js.map +1 -0
  390. package/dist/quotes/use-request-to-cancel-quote.d.ts +32 -0
  391. package/dist/quotes/use-request-to-cancel-quote.d.ts.map +1 -0
  392. package/dist/quotes/use-request-to-cancel-quote.js +42 -0
  393. package/dist/quotes/use-request-to-cancel-quote.js.map +1 -0
  394. package/dist/rasa-solver/index.d.ts +7 -0
  395. package/dist/rasa-solver/index.d.ts.map +1 -0
  396. package/dist/rasa-solver/use-error-message.d.ts +14 -0
  397. package/dist/rasa-solver/use-error-message.d.ts.map +1 -0
  398. package/dist/rasa-solver/use-error-message.js +27 -0
  399. package/dist/rasa-solver/use-error-message.js.map +1 -0
  400. package/dist/rasa-solver/use-party-a-upnl.d.ts +14 -0
  401. package/dist/rasa-solver/use-party-a-upnl.d.ts.map +1 -0
  402. package/dist/rasa-solver/use-party-a-upnl.js +27 -0
  403. package/dist/rasa-solver/use-party-a-upnl.js.map +1 -0
  404. package/dist/rasa-solver/use-solver-balance-info.d.ts +14 -0
  405. package/dist/rasa-solver/use-solver-balance-info.d.ts.map +1 -0
  406. package/dist/rasa-solver/use-solver-balance-info.js +27 -0
  407. package/dist/rasa-solver/use-solver-balance-info.js.map +1 -0
  408. package/dist/rasa-solver/use-solver-open-interest.d.ts +14 -0
  409. package/dist/rasa-solver/use-solver-open-interest.d.ts.map +1 -0
  410. package/dist/rasa-solver/use-solver-open-interest.js +27 -0
  411. package/dist/rasa-solver/use-solver-open-interest.js.map +1 -0
  412. package/dist/rasa-solver/use-solver-price-range.d.ts +14 -0
  413. package/dist/rasa-solver/use-solver-price-range.d.ts.map +1 -0
  414. package/dist/rasa-solver/use-solver-price-range.js +27 -0
  415. package/dist/rasa-solver/use-solver-price-range.js.map +1 -0
  416. package/dist/rasa-solver/use-solver-readiness.d.ts +13 -0
  417. package/dist/rasa-solver/use-solver-readiness.d.ts.map +1 -0
  418. package/dist/rasa-solver/use-solver-readiness.js +27 -0
  419. package/dist/rasa-solver/use-solver-readiness.js.map +1 -0
  420. package/dist/revenue-records/index.d.ts +2 -0
  421. package/dist/revenue-records/index.d.ts.map +1 -0
  422. package/dist/revenue-records/use-revenue-records.d.ts +25 -0
  423. package/dist/revenue-records/use-revenue-records.d.ts.map +1 -0
  424. package/dist/revenue-records/use-revenue-records.js +27 -0
  425. package/dist/revenue-records/use-revenue-records.js.map +1 -0
  426. package/dist/solvers/index.d.ts +3 -0
  427. package/dist/solvers/index.d.ts.map +1 -0
  428. package/dist/solvers/use-solver-capabilities.d.ts +31 -0
  429. package/dist/solvers/use-solver-capabilities.d.ts.map +1 -0
  430. package/dist/solvers/use-solver-capabilities.js +30 -0
  431. package/dist/solvers/use-solver-capabilities.js.map +1 -0
  432. package/dist/solvers/use-solver-revenue.d.ts +28 -0
  433. package/dist/solvers/use-solver-revenue.d.ts.map +1 -0
  434. package/dist/solvers/use-solver-revenue.js +27 -0
  435. package/dist/solvers/use-solver-revenue.js.map +1 -0
  436. package/dist/symbols/index.d.ts +2 -0
  437. package/dist/symbols/index.d.ts.map +1 -0
  438. package/dist/symbols/use-symbols.d.ts +25 -0
  439. package/dist/symbols/use-symbols.d.ts.map +1 -0
  440. package/dist/symbols/use-symbols.js +27 -0
  441. package/dist/symbols/use-symbols.js.map +1 -0
  442. package/dist/tpsl/apply-tpsl-search-snapshot.d.ts +33 -0
  443. package/dist/tpsl/apply-tpsl-search-snapshot.d.ts.map +1 -0
  444. package/dist/tpsl/apply-tpsl-search-snapshot.js +51 -0
  445. package/dist/tpsl/apply-tpsl-search-snapshot.js.map +1 -0
  446. package/dist/tpsl/await-tpsl-confirmation.d.ts +77 -0
  447. package/dist/tpsl/await-tpsl-confirmation.d.ts.map +1 -0
  448. package/dist/tpsl/await-tpsl-confirmation.js +42 -0
  449. package/dist/tpsl/await-tpsl-confirmation.js.map +1 -0
  450. package/dist/tpsl/index.d.ts +11 -0
  451. package/dist/tpsl/index.d.ts.map +1 -1
  452. package/dist/tpsl/invalidate-tpsl.d.ts +23 -0
  453. package/dist/tpsl/invalidate-tpsl.d.ts.map +1 -0
  454. package/dist/tpsl/invalidate-tpsl.js +14 -0
  455. package/dist/tpsl/invalidate-tpsl.js.map +1 -0
  456. package/dist/tpsl/match-tpsl-notification.d.ts +27 -0
  457. package/dist/tpsl/match-tpsl-notification.d.ts.map +1 -0
  458. package/dist/tpsl/match-tpsl-notification.js +22 -0
  459. package/dist/tpsl/match-tpsl-notification.js.map +1 -0
  460. package/dist/tpsl/run-with-concurrency.d.ts +20 -0
  461. package/dist/tpsl/run-with-concurrency.d.ts.map +1 -0
  462. package/dist/tpsl/run-with-concurrency.js +15 -0
  463. package/dist/tpsl/run-with-concurrency.js.map +1 -0
  464. package/dist/tpsl/settled-side.d.ts +31 -0
  465. package/dist/tpsl/settled-side.d.ts.map +1 -0
  466. package/dist/tpsl/settled-side.js +21 -0
  467. package/dist/tpsl/settled-side.js.map +1 -0
  468. package/dist/tpsl/tpsl-fallback-poll.d.ts +74 -0
  469. package/dist/tpsl/tpsl-fallback-poll.d.ts.map +1 -0
  470. package/dist/tpsl/tpsl-fallback-poll.js +101 -0
  471. package/dist/tpsl/tpsl-fallback-poll.js.map +1 -0
  472. package/dist/tpsl/tpsl-store.d.ts +98 -2
  473. package/dist/tpsl/tpsl-store.d.ts.map +1 -1
  474. package/dist/tpsl/tpsl-store.js +111 -63
  475. package/dist/tpsl/tpsl-store.js.map +1 -1
  476. package/dist/tpsl/use-delete-quote-group-tpsl.d.ts +165 -0
  477. package/dist/tpsl/use-delete-quote-group-tpsl.d.ts.map +1 -0
  478. package/dist/tpsl/use-delete-quote-group-tpsl.js +247 -0
  479. package/dist/tpsl/use-delete-quote-group-tpsl.js.map +1 -0
  480. package/dist/tpsl/use-delete-quote-tpsl.d.ts.map +1 -1
  481. package/dist/tpsl/use-delete-quote-tpsl.js +11 -10
  482. package/dist/tpsl/use-delete-quote-tpsl.js.map +1 -1
  483. package/dist/tpsl/use-quote-group-tpsl-editor.d.ts +66 -0
  484. package/dist/tpsl/use-quote-group-tpsl-editor.d.ts.map +1 -0
  485. package/dist/tpsl/use-quote-group-tpsl-editor.js +78 -0
  486. package/dist/tpsl/use-quote-group-tpsl-editor.js.map +1 -0
  487. package/dist/tpsl/use-quote-group-tpsl.d.ts +74 -0
  488. package/dist/tpsl/use-quote-group-tpsl.d.ts.map +1 -0
  489. package/dist/tpsl/use-quote-group-tpsl.js +67 -0
  490. package/dist/tpsl/use-quote-group-tpsl.js.map +1 -0
  491. package/dist/tpsl/use-quote-tpsl.d.ts +18 -2
  492. package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -1
  493. package/dist/tpsl/use-quote-tpsl.js +32 -24
  494. package/dist/tpsl/use-quote-tpsl.js.map +1 -1
  495. package/dist/tpsl/use-search-tpsl-orders.d.ts +30 -0
  496. package/dist/tpsl/use-search-tpsl-orders.d.ts.map +1 -0
  497. package/dist/tpsl/use-search-tpsl-orders.js +27 -0
  498. package/dist/tpsl/use-search-tpsl-orders.js.map +1 -0
  499. package/dist/tpsl/use-set-quote-group-tpsl.d.ts +234 -0
  500. package/dist/tpsl/use-set-quote-group-tpsl.d.ts.map +1 -0
  501. package/dist/tpsl/use-set-quote-group-tpsl.js +358 -0
  502. package/dist/tpsl/use-set-quote-group-tpsl.js.map +1 -0
  503. package/dist/tpsl/use-set-quote-tpsl.d.ts +4 -4
  504. package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -1
  505. package/dist/tpsl/use-set-quote-tpsl.js +15 -12
  506. package/dist/tpsl/use-set-quote-tpsl.js.map +1 -1
  507. package/dist/tpsl/use-tpsl-supported.d.ts +22 -0
  508. package/dist/tpsl/use-tpsl-supported.d.ts.map +1 -0
  509. package/dist/tpsl/use-tpsl-supported.js +16 -0
  510. package/dist/tpsl/use-tpsl-supported.js.map +1 -0
  511. package/dist/tpsl/use-watch-tpsl-accounts.d.ts +33 -0
  512. package/dist/tpsl/use-watch-tpsl-accounts.d.ts.map +1 -0
  513. package/dist/tpsl/use-watch-tpsl-accounts.js +44 -0
  514. package/dist/tpsl/use-watch-tpsl-accounts.js.map +1 -0
  515. package/dist/trade-volume/index.d.ts +2 -0
  516. package/dist/trade-volume/index.d.ts.map +1 -0
  517. package/dist/trade-volume/use-trade-volume.d.ts +26 -0
  518. package/dist/trade-volume/use-trade-volume.d.ts.map +1 -0
  519. package/dist/trade-volume/use-trade-volume.js +27 -0
  520. package/dist/trade-volume/use-trade-volume.js.map +1 -0
  521. package/dist/utils/index.d.ts +1 -0
  522. package/dist/utils/index.d.ts.map +1 -1
  523. package/dist/utils/invalidate-account-balances.d.ts +36 -0
  524. package/dist/utils/invalidate-account-balances.d.ts.map +1 -0
  525. package/dist/utils/invalidate-account-balances.js +10 -0
  526. package/dist/utils/invalidate-account-balances.js.map +1 -0
  527. package/dist/websocket/use-notifications.d.ts +3 -1
  528. package/dist/websocket/use-notifications.d.ts.map +1 -1
  529. package/dist/websocket/use-notifications.js +22 -20
  530. package/dist/websocket/use-notifications.js.map +1 -1
  531. package/dist/withdraw/index.d.ts +1 -0
  532. package/dist/withdraw/index.d.ts.map +1 -1
  533. package/dist/withdraw/use-initiate-withdraw.d.ts +1 -1
  534. package/dist/withdraw/use-initiate-withdraw.js.map +1 -1
  535. package/dist/withdraw/use-request-cancel-withdraw.d.ts +4 -2
  536. package/dist/withdraw/use-request-cancel-withdraw.d.ts.map +1 -1
  537. package/dist/withdraw/use-request-cancel-withdraw.js +15 -13
  538. package/dist/withdraw/use-request-cancel-withdraw.js.map +1 -1
  539. package/dist/withdraw/use-withdraw.d.ts +67 -0
  540. package/dist/withdraw/use-withdraw.d.ts.map +1 -0
  541. package/dist/withdraw/use-withdraw.js +49 -0
  542. package/dist/withdraw/use-withdraw.js.map +1 -0
  543. package/package.json +18 -2
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { normalizeSymmError as e } from "../errors/normalize-symm-error.js";
3
+ import { getOrderbookQueryOptions as t } from "@symmio/trading-core";
4
+ import { useQuery as n } from "@tanstack/react-query";
5
+ //#region src/orderbook/use-orderbook.ts
6
+ function r(r) {
7
+ let { source: i, ...a } = r, o = t(i, a);
8
+ return n({
9
+ ...o,
10
+ queryFn: async () => {
11
+ try {
12
+ return await o.queryFn();
13
+ } catch (t) {
14
+ throw e(t);
15
+ }
16
+ }
17
+ });
18
+ }
19
+ //#endregion
20
+ export { r as useOrderbook };
21
+
22
+ //# sourceMappingURL=use-orderbook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-orderbook.js","names":[],"sources":["../../src/orderbook/use-orderbook.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getOrderbookQueryOptions,\n type GetOrderbookOptions,\n type Orderbook,\n type OrderbookSource,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\n\n/**\n * Parameters for {@link useOrderbook}: the source to read from, the book to\n * fetch, and TanStack `query` overrides.\n */\nexport type UseOrderbookParameters = GetOrderbookOptions & {\n /** The order-book source to read from, e.g. from {@link useBinanceOrderbookSource}. */\n source: OrderbookSource;\n};\n\n/** Return type of {@link useOrderbook}. */\nexport type UseOrderbookReturnType = UseQueryResult<Orderbook, SymmioRequestError>;\n\n/**\n * Fetch a point-in-time order-book snapshot from an {@link OrderbookSource}.\n *\n * The source's `id` is part of the query key, so switching venues does not read\n * another venue's cached book.\n *\n * A snapshot is stale the moment it lands. Use this for a one-off read — sizing\n * a single order, an impact estimate, a server-rendered summary. For anything a\n * user watches, use `useLiveOrderbook`: a synchronized diff stream is fresher\n * than any poll interval and costs a fraction of the venue's rate-limit weight.\n *\n * @param parameters - Source, market, depth, and query overrides.\n * @returns A TanStack query result carrying the book.\n *\n * @example\n * ```tsx\n * const source = useBinanceOrderbookSource();\n * const { data, isLoading } = useOrderbook({ source, marketName: \"BTCUSDT\", limit: 20 });\n * ```\n */\nexport function useOrderbook(parameters: UseOrderbookParameters): UseOrderbookReturnType {\n const { source, ...options } = parameters;\n const queryOptions = getOrderbookQueryOptions(source, options);\n\n return useQuery({\n ...queryOptions,\n queryFn: async () => {\n try {\n return await queryOptions.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseOrderbookReturnType;\n}\n"],"mappings":";;;;;AA4CA,SAAgB,EAAa,GAA4D;CACvF,IAAM,EAAE,WAAQ,GAAG,MAAY,GACzB,IAAe,EAAyB,GAAQ,CAAO;CAE7D,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAa,QAAQ;GACpC,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,30 @@
1
+ export * from './use-add-market.js';
2
+ export * from './use-authenticate-listing.js';
3
+ export * from './use-cancel-withdraw.js';
4
+ export * from './use-claim-history.js';
5
+ export * from './use-claim-profit.js';
6
+ export * from './use-deposit-address.js';
7
+ export * from './use-listing-config.js';
8
+ export * from './use-listing-market-config.js';
9
+ export * from './use-listing-market-config-projection.js';
10
+ export * from './use-listing-market-detail.js';
11
+ export * from './use-listing-markets.js';
12
+ export * from './use-listing-status.js';
13
+ export * from './use-pool-quotes.js';
14
+ export * from './use-pool-reward-chart.js';
15
+ export * from './use-pool-total-reward.js';
16
+ export * from './use-pool-trade-history.js';
17
+ export * from './use-pool-transactions.js';
18
+ export * from './use-refund-market.js';
19
+ export * from './use-retry-listing.js';
20
+ export * from './use-retry-listing-info.js';
21
+ export * from './use-supports-listing-service.js';
22
+ export * from './use-update-listing-market-config.js';
23
+ export * from './use-user-listing-markets.js';
24
+ export * from './use-user-profit.js';
25
+ export * from './use-user-reward-chart.js';
26
+ export * from './use-user-total-reward.js';
27
+ export * from './use-user-transactions.js';
28
+ export * from './use-weekly-listing-limit.js';
29
+ export * from './use-withdraw-lp.js';
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pools/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { useAddMarket as e } from "./use-add-market.js";
2
+ import { useAuthenticateListing as t } from "./use-authenticate-listing.js";
3
+ import { useCancelWithdraw as n } from "./use-cancel-withdraw.js";
4
+ import { useClaimHistory as r } from "./use-claim-history.js";
5
+ import { useClaimProfit as i } from "./use-claim-profit.js";
6
+ import { useDepositAddress as a } from "./use-deposit-address.js";
7
+ import { useListingConfig as o } from "./use-listing-config.js";
8
+ import { useListingMarketConfig as s } from "./use-listing-market-config.js";
9
+ import { useListingMarketDetail as c } from "./use-listing-market-detail.js";
10
+ import { useUserProfit as l } from "./use-user-profit.js";
11
+ import { useListingMarketConfigProjection as u } from "./use-listing-market-config-projection.js";
12
+ import { useListingMarkets as d } from "./use-listing-markets.js";
13
+ import { useListingStatus as f } from "./use-listing-status.js";
14
+ import { usePoolQuotes as p } from "./use-pool-quotes.js";
15
+ import { usePoolRewardChart as m } from "./use-pool-reward-chart.js";
16
+ import { usePoolTotalReward as h } from "./use-pool-total-reward.js";
17
+ import { usePoolTradeHistory as g } from "./use-pool-trade-history.js";
18
+ import { usePoolTransactions as _ } from "./use-pool-transactions.js";
19
+ import { useRefundMarket as v } from "./use-refund-market.js";
20
+ import { useRetryListing as y } from "./use-retry-listing.js";
21
+ import { useRetryListingInfo as b } from "./use-retry-listing-info.js";
22
+ import { useSupportsListingService as x } from "./use-supports-listing-service.js";
23
+ import { useUpdateListingMarketConfig as S } from "./use-update-listing-market-config.js";
24
+ import { useUserListingMarkets as C } from "./use-user-listing-markets.js";
25
+ import { useUserRewardChart as w } from "./use-user-reward-chart.js";
26
+ import { useUserTotalReward as T } from "./use-user-total-reward.js";
27
+ import { useUserTransactions as E } from "./use-user-transactions.js";
28
+ import { useWeeklyListingLimit as D } from "./use-weekly-listing-limit.js";
29
+ import { useWithdrawLp as O } from "./use-withdraw-lp.js";
30
+ export { e as useAddMarket, t as useAuthenticateListing, n as useCancelWithdraw, r as useClaimHistory, i as useClaimProfit, a as useDepositAddress, o as useListingConfig, s as useListingMarketConfig, u as useListingMarketConfigProjection, c as useListingMarketDetail, d as useListingMarkets, f as useListingStatus, p as usePoolQuotes, m as usePoolRewardChart, h as usePoolTotalReward, g as usePoolTradeHistory, _ as usePoolTransactions, v as useRefundMarket, y as useRetryListing, b as useRetryListingInfo, x as useSupportsListingService, S as useUpdateListingMarketConfig, C as useUserListingMarkets, l as useUserProfit, w as useUserRewardChart, T as useUserTotalReward, E as useUserTransactions, D as useWeeklyListingLimit, O as useWithdrawLp };
@@ -0,0 +1,57 @@
1
+ import { AddMarketParameters, ConfigParameter, CreatedPool } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useAddMarket}: just an optional `config`. */
5
+ export type UseAddMarketParameters = ConfigParameter;
6
+ /**
7
+ * Variables for the {@link useAddMarket} mutation — the same shape as core's
8
+ * {@link AddMarketParameters}.
9
+ *
10
+ * `accessToken`, `tokenContractAddress`, `buyBackRatio`, `maxLeverage`, and
11
+ * `depositChain` are required; every other field is an optional listing extra
12
+ * (`isTax`, `userWhitelistTax`, `additionalChains`, `poolAddress`, `cexList`),
13
+ * sent only when set. `chainId` defaults to the connected chain when omitted.
14
+ */
15
+ export type AddMarketVariables = AddMarketParameters;
16
+ /**
17
+ * Return type of {@link useAddMarket}: the created pool on success (including the
18
+ * deposit wallet to seed it) or a normalized error.
19
+ */
20
+ export type UseAddMarketReturnType = UseMutationResult<CreatedPool, SymmioRequestError, AddMarketVariables>;
21
+ /**
22
+ * Create a pool — list a new token with the listing backend in one call.
23
+ *
24
+ * The mutation POSTs the token and its pool economics to the listing service
25
+ * with the caller's Bearer `accessToken` (mint it with {@link useAuthenticateListing}),
26
+ * and resolves to the accepted {@link CreatedPool}. That result carries the
27
+ * custodial `walletPublicKey` the service provisioned — send the listing deposit
28
+ * there to seed the pool, which stays at `WAITING_FOR_DEPOSIT` until it lands.
29
+ *
30
+ * On success it invalidates the catalog ({@link useListingMarkets}) and Your Pools
31
+ * ({@link useUserListingMarkets}) queries, so every mounted list — the search
32
+ * pickers, the catalogue console, and Your Pools — refetches and surfaces the new
33
+ * pool without a manual refresh.
34
+ *
35
+ * Required variables: `accessToken`, `tokenContractAddress`, `buyBackRatio`
36
+ * (`0`–`100`), `maxLeverage` (`1`–`100`), and `depositChain`. The optional extras
37
+ * are the caller's to default. Pools is **chain-level** — `mutate` /
38
+ * `mutateAsync` reject with a normalized {@link SymmioRequestError}
39
+ * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend, and a bad or
40
+ * expired token comes back as an `ADD_MARKET_FAILED` `401`. Failures are
41
+ * normalized to {@link SymmioRequestError}.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * const create = useAddMarket();
46
+ * create.mutate({
47
+ * accessToken, // from useAuthenticateListing
48
+ * tokenContractAddress: "0xToken…",
49
+ * buyBackRatio: 5,
50
+ * maxLeverage: 20,
51
+ * depositChain: ListingDepositChainId.HYPER_EVM,
52
+ * });
53
+ * // …later: send the listing deposit to `create.data?.walletPublicKey`.
54
+ * ```
55
+ */
56
+ export declare function useAddMarket(parameters?: UseAddMarketParameters): UseAddMarketReturnType;
57
+ //# sourceMappingURL=use-add-market.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-add-market.d.ts","sourceRoot":"","sources":["../../src/pools/use-add-market.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,sEAAsE;AACtE,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,YAAY,CAAC,UAAU,GAAE,sBAA2B,GAAG,sBAAsB,CAuB5F"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { addMarketMutationOptions as r } from "@symmio/trading-core";
6
+ import { useMutation as i, useQueryClient as a } from "@tanstack/react-query";
7
+ //#region src/pools/use-add-market.ts
8
+ function o(o = {}) {
9
+ let s = t(o), c = e(), l = a(), u = r(s);
10
+ return i({
11
+ ...u,
12
+ mutationFn: async (e) => {
13
+ try {
14
+ return await u.mutationFn({
15
+ ...e,
16
+ chainId: e.chainId ?? c
17
+ });
18
+ } catch (e) {
19
+ throw n(e);
20
+ }
21
+ },
22
+ onSuccess: () => {
23
+ l.invalidateQueries({ queryKey: ["getListingMarkets"] }), l.invalidateQueries({ queryKey: ["getUserListingMarkets"] });
24
+ }
25
+ });
26
+ }
27
+ //#endregion
28
+ export { o as useAddMarket };
29
+
30
+ //# sourceMappingURL=use-add-market.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-add-market.js","names":[],"sources":["../../src/pools/use-add-market.ts"],"sourcesContent":["\"use client\";\n\nimport {\n addMarketMutationOptions,\n type AddMarketParameters,\n type AddMarketReturnType,\n type ConfigParameter,\n type CreatedPool,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useAddMarket}: just an optional `config`. */\nexport type UseAddMarketParameters = ConfigParameter;\n\n/**\n * Variables for the {@link useAddMarket} mutation — the same shape as core's\n * {@link AddMarketParameters}.\n *\n * `accessToken`, `tokenContractAddress`, `buyBackRatio`, `maxLeverage`, and\n * `depositChain` are required; every other field is an optional listing extra\n * (`isTax`, `userWhitelistTax`, `additionalChains`, `poolAddress`, `cexList`),\n * sent only when set. `chainId` defaults to the connected chain when omitted.\n */\nexport type AddMarketVariables = AddMarketParameters;\n\n/**\n * Return type of {@link useAddMarket}: the created pool on success (including the\n * deposit wallet to seed it) or a normalized error.\n */\nexport type UseAddMarketReturnType = UseMutationResult<CreatedPool, SymmioRequestError, AddMarketVariables>;\n\n/**\n * Create a pool — list a new token with the listing backend in one call.\n *\n * The mutation POSTs the token and its pool economics to the listing service\n * with the caller's Bearer `accessToken` (mint it with {@link useAuthenticateListing}),\n * and resolves to the accepted {@link CreatedPool}. That result carries the\n * custodial `walletPublicKey` the service provisioned — send the listing deposit\n * there to seed the pool, which stays at `WAITING_FOR_DEPOSIT` until it lands.\n *\n * On success it invalidates the catalog ({@link useListingMarkets}) and Your Pools\n * ({@link useUserListingMarkets}) queries, so every mounted list — the search\n * pickers, the catalogue console, and Your Pools — refetches and surfaces the new\n * pool without a manual refresh.\n *\n * Required variables: `accessToken`, `tokenContractAddress`, `buyBackRatio`\n * (`0`–`100`), `maxLeverage` (`1`–`100`), and `depositChain`. The optional extras\n * are the caller's to default. Pools is **chain-level** — `mutate` /\n * `mutateAsync` reject with a normalized {@link SymmioRequestError}\n * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend, and a bad or\n * expired token comes back as an `ADD_MARKET_FAILED` `401`. Failures are\n * normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const create = useAddMarket();\n * create.mutate({\n * accessToken, // from useAuthenticateListing\n * tokenContractAddress: \"0xToken…\",\n * buyBackRatio: 5,\n * maxLeverage: 20,\n * depositChain: ListingDepositChainId.HYPER_EVM,\n * });\n * // …later: send the listing deposit to `create.data?.walletPublicKey`.\n * ```\n */\nexport function useAddMarket(parameters: UseAddMarketParameters = {}): UseAddMarketReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const options = addMarketMutationOptions(config);\n\n return useMutation({\n ...options,\n mutationFn: async (variables: AddMarketVariables): Promise<AddMarketReturnType> => {\n try {\n return await options.mutationFn({ ...variables, chainId: variables.chainId ?? chainId });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n // A new listing joins the catalog and the caller's \"Your Pools\", so refetch\n // both — every mounted `useListingMarkets` (the search pickers and the\n // console) and `useUserListingMarkets`, whatever their search, filters or page.\n void queryClient.invalidateQueries({ queryKey: [\"getListingMarkets\"] });\n void queryClient.invalidateQueries({ queryKey: [\"getUserListingMarkets\"] });\n },\n }) as UseAddMarketReturnType;\n}\n"],"mappings":";;;;;;;AAsEA,SAAgB,EAAa,IAAqC,CAAC,GAA2B;CAC5F,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAU,EAAyB,CAAM;CAE/C,OAAO,EAAY;EACjB,GAAG;EACH,YAAY,OAAO,MAAgE;GACjF,IAAI;IACF,OAAO,MAAM,EAAQ,WAAW;KAAE,GAAG;KAAW,SAAS,EAAU,WAAW;IAAQ,CAAC;GACzF,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GAKf,AADA,EAAiB,kBAAkB,EAAE,UAAU,CAAC,mBAAmB,EAAE,CAAC,GACtE,EAAiB,kBAAkB,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;EAC5E;CACF,CAAC;AACH"}
@@ -0,0 +1,45 @@
1
+ import { AuthenticateListingParameters, ConfigParameter, ListingAuthToken } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useAuthenticateListing}: just an optional `config`. */
5
+ export type UseAuthenticateListingParameters = ConfigParameter;
6
+ /**
7
+ * Variables for the {@link useAuthenticateListing} mutation.
8
+ *
9
+ * `domain` and `uri` are optional here — omit them and the hook fills them from
10
+ * the current `window.location` (`host` / `origin`). Pass them explicitly to
11
+ * override (e.g. to bind the SIWE message to a canonical domain).
12
+ */
13
+ export type AuthenticateListingVariables = Omit<AuthenticateListingParameters, "domain" | "uri"> & {
14
+ /** RFC 4501 DNS authority requesting the sign-in. Defaults to `window.location.host`. */
15
+ domain?: string;
16
+ /** RFC 3986 URI of the dApp. Defaults to `window.location.origin`. */
17
+ uri?: string;
18
+ };
19
+ /** Return type of {@link useAuthenticateListing}: the issued bearer token or a normalized error. */
20
+ export type UseAuthenticateListingReturnType = UseMutationResult<ListingAuthToken, SymmioRequestError, AuthenticateListingVariables>;
21
+ /**
22
+ * Sign in to the listing backend with SIWE (EIP-4361) in one call.
23
+ *
24
+ * The mutation runs the whole flow — fetch the sign-in message, sign it with the
25
+ * connected wallet, and POST the login — and resolves to the issued bearer token
26
+ * `{ accessToken, tokenType }`. Present it as an `Authorization: Bearer
27
+ * <accessToken>` header on subsequent authenticated Pools requests.
28
+ *
29
+ * `domain` and `uri` default to the current origin (`window.location.host` /
30
+ * `window.location.origin`); pass them to override. Pools is **chain-level**
31
+ * — `mutate` / `mutateAsync` reject with a normalized {@link SymmioRequestError}
32
+ * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend. Failures are
33
+ * normalized to {@link SymmioRequestError}.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * const { mutate, data, isPending } = useAuthenticateListing();
38
+ * // domain / uri auto-fill from the current origin:
39
+ * mutate({});
40
+ * // …later:
41
+ * if (data) headers.Authorization = `${data.tokenType} ${data.accessToken}`;
42
+ * ```
43
+ */
44
+ export declare function useAuthenticateListing(parameters?: UseAuthenticateListingParameters): UseAuthenticateListingReturnType;
45
+ //# sourceMappingURL=use-authenticate-listing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-authenticate-listing.d.ts","sourceRoot":"","sources":["../../src/pools/use-authenticate-listing.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,gFAAgF;AAChF,MAAM,MAAM,gCAAgC,GAAG,eAAe,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,6BAA6B,EAAE,QAAQ,GAAG,KAAK,CAAC,GAAG;IACjG,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oGAAoG;AACpG,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAC9D,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,GAAE,gCAAqC,GAChD,gCAAgC,CAsBlC"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { authenticateListingMutationOptions as r } from "@symmio/trading-core";
6
+ import { useMutation as i } from "@tanstack/react-query";
7
+ //#region src/pools/use-authenticate-listing.ts
8
+ function a(a = {}) {
9
+ let o = t(a), s = e(), c = r(o);
10
+ return i({
11
+ ...c,
12
+ mutationFn: async (e) => {
13
+ let t = e.domain ?? window.location.host, r = e.uri ?? window.location.origin;
14
+ try {
15
+ return await c.mutationFn({
16
+ ...e,
17
+ domain: t,
18
+ uri: r,
19
+ chainId: e.chainId ?? s
20
+ });
21
+ } catch (e) {
22
+ throw n(e);
23
+ }
24
+ }
25
+ });
26
+ }
27
+ //#endregion
28
+ export { a as useAuthenticateListing };
29
+
30
+ //# sourceMappingURL=use-authenticate-listing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-authenticate-listing.js","names":[],"sources":["../../src/pools/use-authenticate-listing.ts"],"sourcesContent":["\"use client\";\n\nimport {\n authenticateListingMutationOptions,\n type AuthenticateListingParameters,\n type ConfigParameter,\n type ListingAuthToken,\n} from \"@symmio/trading-core\";\nimport { useMutation, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useAuthenticateListing}: just an optional `config`. */\nexport type UseAuthenticateListingParameters = ConfigParameter;\n\n/**\n * Variables for the {@link useAuthenticateListing} mutation.\n *\n * `domain` and `uri` are optional here — omit them and the hook fills them from\n * the current `window.location` (`host` / `origin`). Pass them explicitly to\n * override (e.g. to bind the SIWE message to a canonical domain).\n */\nexport type AuthenticateListingVariables = Omit<AuthenticateListingParameters, \"domain\" | \"uri\"> & {\n /** RFC 4501 DNS authority requesting the sign-in. Defaults to `window.location.host`. */\n domain?: string;\n /** RFC 3986 URI of the dApp. Defaults to `window.location.origin`. */\n uri?: string;\n};\n\n/** Return type of {@link useAuthenticateListing}: the issued bearer token or a normalized error. */\nexport type UseAuthenticateListingReturnType = UseMutationResult<\n ListingAuthToken,\n SymmioRequestError,\n AuthenticateListingVariables\n>;\n\n/**\n * Sign in to the listing backend with SIWE (EIP-4361) in one call.\n *\n * The mutation runs the whole flow — fetch the sign-in message, sign it with the\n * connected wallet, and POST the login — and resolves to the issued bearer token\n * `{ accessToken, tokenType }`. Present it as an `Authorization: Bearer\n * <accessToken>` header on subsequent authenticated Pools requests.\n *\n * `domain` and `uri` default to the current origin (`window.location.host` /\n * `window.location.origin`); pass them to override. Pools is **chain-level**\n * — `mutate` / `mutateAsync` reject with a normalized {@link SymmioRequestError}\n * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend. Failures are\n * normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { mutate, data, isPending } = useAuthenticateListing();\n * // domain / uri auto-fill from the current origin:\n * mutate({});\n * // …later:\n * if (data) headers.Authorization = `${data.tokenType} ${data.accessToken}`;\n * ```\n */\nexport function useAuthenticateListing(\n parameters: UseAuthenticateListingParameters = {},\n): UseAuthenticateListingReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = authenticateListingMutationOptions(config);\n\n return useMutation({\n ...options,\n mutationFn: async (variables: AuthenticateListingVariables) => {\n const domain = variables.domain ?? window.location.host;\n const uri = variables.uri ?? window.location.origin;\n try {\n return await options.mutationFn({\n ...variables,\n domain,\n uri,\n chainId: variables.chainId ?? chainId,\n });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseAuthenticateListingReturnType;\n}\n"],"mappings":";;;;;;;AA6DA,SAAgB,EACd,IAA+C,CAAC,GACd;CAClC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAmC,CAAM;CAEzD,OAAO,EAAY;EACjB,GAAG;EACH,YAAY,OAAO,MAA4C;GAC7D,IAAM,IAAS,EAAU,UAAU,OAAO,SAAS,MAC7C,IAAM,EAAU,OAAO,OAAO,SAAS;GAC7C,IAAI;IACF,OAAO,MAAM,EAAQ,WAAW;KAC9B,GAAG;KACH;KACA;KACA,SAAS,EAAU,WAAW;IAChC,CAAC;GACH,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,47 @@
1
+ import { CancelWithdrawParameters, CancelWithdrawReturnType, ConfigParameter } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useCancelWithdraw}: just an optional `config`. */
5
+ export type UseCancelWithdrawParameters = ConfigParameter;
6
+ /**
7
+ * Variables for the {@link useCancelWithdraw} mutation — the same shape as core's
8
+ * {@link CancelWithdrawParameters}.
9
+ *
10
+ * `accessToken` and `withdrawId` are required; `chainId` defaults to the
11
+ * connected chain when omitted.
12
+ */
13
+ export type CancelWithdrawVariables = CancelWithdrawParameters;
14
+ /**
15
+ * Return type of {@link useCancelWithdraw}: resolves to a
16
+ * `PoolCancelWithdrawResult` receipt on success, or a normalized error.
17
+ */
18
+ export type UseCancelWithdrawReturnType = UseMutationResult<CancelWithdrawReturnType, SymmioRequestError, CancelWithdrawVariables>;
19
+ /**
20
+ * Cancel a queued LP withdrawal — remove a pending withdrawal from a pool's
21
+ * withdrawal queue before it settles.
22
+ *
23
+ * The mutation `DELETE`s the withdrawal by its `withdrawId` — the `transactionId`
24
+ * of a still-`PENDING` `withdraw` row from {@link usePoolTransactions} — authed
25
+ * with the caller's Bearer `accessToken` (mint it with
26
+ * {@link useAuthenticateListing}).
27
+ *
28
+ * On success the hook **invalidates every `getPoolTransactions` query**, so any
29
+ * mounted transaction list refetches and drops the canceled withdrawal — the
30
+ * caller does not need to refetch it by hand. The shares also return to the
31
+ * user's available balance, so separately refetch {@link useUserProfit} to see
32
+ * `availableLpAmount` rise and `pendingWithdrawLpAmount` fall.
33
+ *
34
+ * Pools is **chain-level** — `mutate` / `mutateAsync` reject with a normalized
35
+ * {@link SymmioRequestError} (`LISTING_NOT_CONFIGURED`) on a chain with no listing
36
+ * backend, and a bad or expired token comes back as a `CANCEL_WITHDRAW_FAILED`
37
+ * `401`. A withdrawal that has already settled is rejected by the service.
38
+ * Failures are normalized to {@link SymmioRequestError}.
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * const cancel = useCancelWithdraw();
43
+ * cancel.mutate({ accessToken, withdrawId: pending.transactionId });
44
+ * ```
45
+ */
46
+ export declare function useCancelWithdraw(parameters?: UseCancelWithdrawParameters): UseCancelWithdrawReturnType;
47
+ //# sourceMappingURL=use-cancel-withdraw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cancel-withdraw.d.ts","sourceRoot":"","sources":["../../src/pools/use-cancel-withdraw.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,2EAA2E;AAC3E,MAAM,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CACzD,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,GAAE,2BAAgC,GAAG,2BAA2B,CAyB3G"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { cancelWithdrawMutationOptions as r } from "@symmio/trading-core";
6
+ import { useMutation as i, useQueryClient as a } from "@tanstack/react-query";
7
+ //#region src/pools/use-cancel-withdraw.ts
8
+ function o(o = {}) {
9
+ let s = t(o), c = e(), l = a(), u = r(s);
10
+ return i({
11
+ ...u,
12
+ mutationFn: async (e) => {
13
+ try {
14
+ return await u.mutationFn({
15
+ ...e,
16
+ chainId: e.chainId ?? c
17
+ });
18
+ } catch (e) {
19
+ throw n(e);
20
+ }
21
+ },
22
+ onSuccess: () => {
23
+ l.invalidateQueries({ queryKey: ["getPoolTransactions"] }), l.invalidateQueries({ queryKey: ["getUserTransactions"] }), l.invalidateQueries({ queryKey: ["getUserProfit"] });
24
+ }
25
+ });
26
+ }
27
+ //#endregion
28
+ export { o as useCancelWithdraw };
29
+
30
+ //# sourceMappingURL=use-cancel-withdraw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cancel-withdraw.js","names":[],"sources":["../../src/pools/use-cancel-withdraw.ts"],"sourcesContent":["\"use client\";\n\nimport {\n cancelWithdrawMutationOptions,\n type CancelWithdrawParameters,\n type CancelWithdrawReturnType,\n type ConfigParameter,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useCancelWithdraw}: just an optional `config`. */\nexport type UseCancelWithdrawParameters = ConfigParameter;\n\n/**\n * Variables for the {@link useCancelWithdraw} mutation — the same shape as core's\n * {@link CancelWithdrawParameters}.\n *\n * `accessToken` and `withdrawId` are required; `chainId` defaults to the\n * connected chain when omitted.\n */\nexport type CancelWithdrawVariables = CancelWithdrawParameters;\n\n/**\n * Return type of {@link useCancelWithdraw}: resolves to a\n * `PoolCancelWithdrawResult` receipt on success, or a normalized error.\n */\nexport type UseCancelWithdrawReturnType = UseMutationResult<\n CancelWithdrawReturnType,\n SymmioRequestError,\n CancelWithdrawVariables\n>;\n\n/**\n * Cancel a queued LP withdrawal — remove a pending withdrawal from a pool's\n * withdrawal queue before it settles.\n *\n * The mutation `DELETE`s the withdrawal by its `withdrawId` — the `transactionId`\n * of a still-`PENDING` `withdraw` row from {@link usePoolTransactions} — authed\n * with the caller's Bearer `accessToken` (mint it with\n * {@link useAuthenticateListing}).\n *\n * On success the hook **invalidates every `getPoolTransactions` query**, so any\n * mounted transaction list refetches and drops the canceled withdrawal — the\n * caller does not need to refetch it by hand. The shares also return to the\n * user's available balance, so separately refetch {@link useUserProfit} to see\n * `availableLpAmount` rise and `pendingWithdrawLpAmount` fall.\n *\n * Pools is **chain-level** — `mutate` / `mutateAsync` reject with a normalized\n * {@link SymmioRequestError} (`LISTING_NOT_CONFIGURED`) on a chain with no listing\n * backend, and a bad or expired token comes back as a `CANCEL_WITHDRAW_FAILED`\n * `401`. A withdrawal that has already settled is rejected by the service.\n * Failures are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const cancel = useCancelWithdraw();\n * cancel.mutate({ accessToken, withdrawId: pending.transactionId });\n * ```\n */\nexport function useCancelWithdraw(parameters: UseCancelWithdrawParameters = {}): UseCancelWithdrawReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const options = cancelWithdrawMutationOptions(config);\n\n return useMutation({\n ...options,\n mutationFn: async (variables: CancelWithdrawVariables): Promise<CancelWithdrawReturnType> => {\n try {\n return await options.mutationFn({ ...variables, chainId: variables.chainId ?? chainId });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n // Canceling changes the withdrawal's status in both the pool-wide\n // (`getPoolTransactions`) and per-user (`getUserTransactions`) lists, and\n // returns the shares to the user's balance. The variables carry no\n // market/wallet to scope by, so invalidate each by key tag.\n void queryClient.invalidateQueries({ queryKey: [\"getPoolTransactions\"] });\n void queryClient.invalidateQueries({ queryKey: [\"getUserTransactions\"] });\n void queryClient.invalidateQueries({ queryKey: [\"getUserProfit\"] });\n },\n }) as UseCancelWithdrawReturnType;\n}\n"],"mappings":";;;;;;;AA+DA,SAAgB,EAAkB,IAA0C,CAAC,GAAgC;CAC3G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAU,EAA8B,CAAM;CAEpD,OAAO,EAAY;EACjB,GAAG;EACH,YAAY,OAAO,MAA0E;GAC3F,IAAI;IACF,OAAO,MAAM,EAAQ,WAAW;KAAE,GAAG;KAAW,SAAS,EAAU,WAAW;IAAQ,CAAC;GACzF,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GAOf,AAFA,EAAiB,kBAAkB,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAC,GACxE,EAAiB,kBAAkB,EAAE,UAAU,CAAC,qBAAqB,EAAE,CAAC,GACxE,EAAiB,kBAAkB,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC;EACpE;CACF,CAAC;AACH"}
@@ -0,0 +1,25 @@
1
+ import { ConfigParameter, GetClaimHistoryOptions, GetClaimHistoryReturnType } from '@symmio/trading-core';
2
+ import { UseQueryResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useClaimHistory}: the core query options plus an optional `config`. */
5
+ export type UseClaimHistoryParameters = GetClaimHistoryOptions & ConfigParameter;
6
+ /** Return type of {@link useClaimHistory}: one page of the user's past claims. */
7
+ export type UseClaimHistoryReturnType = UseQueryResult<GetClaimHistoryReturnType, SymmioRequestError>;
8
+ /**
9
+ * Read the signed-in user's claim history — their past pool-reward claims,
10
+ * newest first.
11
+ *
12
+ * Authed and scoped to the caller: it only ever returns claims the user owns, so
13
+ * pass the Bearer `accessToken` from {@link useAuthenticateListing}. Optionally
14
+ * narrow to one pool (`tokenContractAddress`) or one receiving sub-account
15
+ * (`accountAddress`). `count` is the total across all pages, so it is what a
16
+ * pager should divide — not `items.length`. Errors are normalized to
17
+ * {@link SymmioRequestError}.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * const { data } = useClaimHistory({ accessToken, tokenContractAddress, size: 25 });
22
+ * ```
23
+ */
24
+ export declare function useClaimHistory(parameters: UseClaimHistoryParameters): UseClaimHistoryReturnType;
25
+ //# sourceMappingURL=use-claim-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claim-history.d.ts","sourceRoot":"","sources":["../../src/pools/use-claim-history.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,gGAAgG;AAChG,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAAG,eAAe,CAAC;AAEjF,kFAAkF;AAClF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAAC;AAEtG;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,yBAAyB,GAAG,yBAAyB,CAkBhG"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { getClaimHistoryQueryOptions as r } from "@symmio/trading-core";
6
+ import { useQuery as i } from "@tanstack/react-query";
7
+ //#region src/pools/use-claim-history.ts
8
+ function a(a) {
9
+ let o = t(a), s = e(), c = r(o, {
10
+ ...a,
11
+ chainId: a.chainId ?? s
12
+ });
13
+ return i({
14
+ ...c,
15
+ queryFn: async () => {
16
+ try {
17
+ return await c.queryFn();
18
+ } catch (e) {
19
+ throw n(e);
20
+ }
21
+ }
22
+ });
23
+ }
24
+ //#endregion
25
+ export { a as useClaimHistory };
26
+
27
+ //# sourceMappingURL=use-claim-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claim-history.js","names":[],"sources":["../../src/pools/use-claim-history.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getClaimHistoryQueryOptions,\n type ConfigParameter,\n type GetClaimHistoryOptions,\n type GetClaimHistoryReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useClaimHistory}: the core query options plus an optional `config`. */\nexport type UseClaimHistoryParameters = GetClaimHistoryOptions & ConfigParameter;\n\n/** Return type of {@link useClaimHistory}: one page of the user's past claims. */\nexport type UseClaimHistoryReturnType = UseQueryResult<GetClaimHistoryReturnType, SymmioRequestError>;\n\n/**\n * Read the signed-in user's claim history — their past pool-reward claims,\n * newest first.\n *\n * Authed and scoped to the caller: it only ever returns claims the user owns, so\n * pass the Bearer `accessToken` from {@link useAuthenticateListing}. Optionally\n * narrow to one pool (`tokenContractAddress`) or one receiving sub-account\n * (`accountAddress`). `count` is the total across all pages, so it is what a\n * pager should divide — not `items.length`. Errors are normalized to\n * {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data } = useClaimHistory({ accessToken, tokenContractAddress, size: 25 });\n * ```\n */\nexport function useClaimHistory(parameters: UseClaimHistoryParameters): UseClaimHistoryReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getClaimHistoryQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseClaimHistoryReturnType;\n}\n"],"mappings":";;;;;;;AAoCA,SAAgB,EAAgB,GAAkE;CAChG,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA4B,GAAQ;EAClD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,53 @@
1
+ import { ClaimProfitParameters, ClaimProfitReturnType, ConfigParameter } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useClaimProfit}: just an optional `config`. */
5
+ export type UseClaimProfitParameters = ConfigParameter;
6
+ /**
7
+ * Variables for the {@link useClaimProfit} mutation — the same shape as core's
8
+ * {@link ClaimProfitParameters}.
9
+ *
10
+ * `accessToken`, `tokenContractAddress`, `depositChain`, `accountAddress`, and
11
+ * `amount` are required; `chainId` defaults to the connected chain when omitted.
12
+ */
13
+ export type ClaimProfitVariables = ClaimProfitParameters;
14
+ /**
15
+ * Return type of {@link useClaimProfit}: resolves to a `PoolClaimResult` receipt
16
+ * on success, or a normalized error.
17
+ */
18
+ export type UseClaimProfitReturnType = UseMutationResult<ClaimProfitReturnType, SymmioRequestError, ClaimProfitVariables>;
19
+ /**
20
+ * Claim a pool's accrued LP rewards as USDC — POST the claim to the listing
21
+ * backend in one call.
22
+ *
23
+ * The mutation POSTs the USDC `amount`, the pool's `tokenContractAddress`, the
24
+ * `depositChain` (the pool's `chainId`), and the `accountAddress` sub-account to
25
+ * credit, authed with the caller's Bearer `accessToken` (mint it with
26
+ * {@link useAuthenticateListing}). The claim is synchronous: it resolves to a
27
+ * `PoolClaimResult` receipt once the USDC has moved, so refetch
28
+ * {@link useUserProfit} afterwards to see `claimableReward` fall and
29
+ * `claimedReward` rise.
30
+ *
31
+ * Cap `amount` at the pool's `claimableReward` from {@link useUserProfit} — the
32
+ * service rejects an over-claim. Pools is **chain-level** — `mutate` /
33
+ * `mutateAsync` reject with a normalized {@link SymmioRequestError}
34
+ * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend, and a bad or
35
+ * expired token comes back as a `CLAIM_PROFIT_FAILED` `401`. Failures are
36
+ * normalized to {@link SymmioRequestError}.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * const claim = useClaimProfit();
41
+ * const { data: profit } = useUserProfit({ accessToken, tokenContractAddress });
42
+ *
43
+ * claim.mutate({
44
+ * accessToken, // from useAuthenticateListing
45
+ * tokenContractAddress,
46
+ * depositChain: market.chainId,
47
+ * accountAddress: "0xSubAccount…",
48
+ * amount: profit?.claimableReward ?? 0n,
49
+ * });
50
+ * ```
51
+ */
52
+ export declare function useClaimProfit(parameters?: UseClaimProfitParameters): UseClaimProfitReturnType;
53
+ //# sourceMappingURL=use-claim-profit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claim-profit.d.ts","sourceRoot":"","sources":["../../src/pools/use-claim-profit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,wEAAwE;AACxE,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CACtD,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAAC,UAAU,GAAE,wBAA6B,GAAG,wBAAwB,CAuBlG"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { claimProfitMutationOptions as r } from "@symmio/trading-core";
6
+ import { useMutation as i, useQueryClient as a } from "@tanstack/react-query";
7
+ //#region src/pools/use-claim-profit.ts
8
+ function o(o = {}) {
9
+ let s = t(o), c = e(), l = a(), u = r(s);
10
+ return i({
11
+ ...u,
12
+ mutationFn: async (e) => {
13
+ try {
14
+ return await u.mutationFn({
15
+ ...e,
16
+ chainId: e.chainId ?? c
17
+ });
18
+ } catch (e) {
19
+ throw n(e);
20
+ }
21
+ },
22
+ onSuccess: () => {
23
+ l.invalidateQueries({ queryKey: ["getUserProfit"] }), l.invalidateQueries({ queryKey: ["getClaimHistory"] });
24
+ }
25
+ });
26
+ }
27
+ //#endregion
28
+ export { o as useClaimProfit };
29
+
30
+ //# sourceMappingURL=use-claim-profit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-claim-profit.js","names":[],"sources":["../../src/pools/use-claim-profit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n claimProfitMutationOptions,\n type ClaimProfitParameters,\n type ClaimProfitReturnType,\n type ConfigParameter,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useClaimProfit}: just an optional `config`. */\nexport type UseClaimProfitParameters = ConfigParameter;\n\n/**\n * Variables for the {@link useClaimProfit} mutation — the same shape as core's\n * {@link ClaimProfitParameters}.\n *\n * `accessToken`, `tokenContractAddress`, `depositChain`, `accountAddress`, and\n * `amount` are required; `chainId` defaults to the connected chain when omitted.\n */\nexport type ClaimProfitVariables = ClaimProfitParameters;\n\n/**\n * Return type of {@link useClaimProfit}: resolves to a `PoolClaimResult` receipt\n * on success, or a normalized error.\n */\nexport type UseClaimProfitReturnType = UseMutationResult<\n ClaimProfitReturnType,\n SymmioRequestError,\n ClaimProfitVariables\n>;\n\n/**\n * Claim a pool's accrued LP rewards as USDC — POST the claim to the listing\n * backend in one call.\n *\n * The mutation POSTs the USDC `amount`, the pool's `tokenContractAddress`, the\n * `depositChain` (the pool's `chainId`), and the `accountAddress` sub-account to\n * credit, authed with the caller's Bearer `accessToken` (mint it with\n * {@link useAuthenticateListing}). The claim is synchronous: it resolves to a\n * `PoolClaimResult` receipt once the USDC has moved, so refetch\n * {@link useUserProfit} afterwards to see `claimableReward` fall and\n * `claimedReward` rise.\n *\n * Cap `amount` at the pool's `claimableReward` from {@link useUserProfit} — the\n * service rejects an over-claim. Pools is **chain-level** — `mutate` /\n * `mutateAsync` reject with a normalized {@link SymmioRequestError}\n * (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend, and a bad or\n * expired token comes back as a `CLAIM_PROFIT_FAILED` `401`. Failures are\n * normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const claim = useClaimProfit();\n * const { data: profit } = useUserProfit({ accessToken, tokenContractAddress });\n *\n * claim.mutate({\n * accessToken, // from useAuthenticateListing\n * tokenContractAddress,\n * depositChain: market.chainId,\n * accountAddress: \"0xSubAccount…\",\n * amount: profit?.claimableReward ?? 0n,\n * });\n * ```\n */\nexport function useClaimProfit(parameters: UseClaimProfitParameters = {}): UseClaimProfitReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const options = claimProfitMutationOptions(config);\n\n return useMutation({\n ...options,\n mutationFn: async (variables: ClaimProfitVariables): Promise<ClaimProfitReturnType> => {\n try {\n return await options.mutationFn({ ...variables, chainId: variables.chainId ?? chainId });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n // A claim moves the balances and adds a history row. Invalidate both by key\n // tag so mounted `getUserProfit` (claimable/claimed) and `getClaimHistory`\n // views refetch — the caller does not invalidate these by hand.\n void queryClient.invalidateQueries({ queryKey: [\"getUserProfit\"] });\n void queryClient.invalidateQueries({ queryKey: [\"getClaimHistory\"] });\n },\n }) as UseClaimProfitReturnType;\n}\n"],"mappings":";;;;;;;AAqEA,SAAgB,EAAe,IAAuC,CAAC,GAA6B;CAClG,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAU,EAA2B,CAAM;CAEjD,OAAO,EAAY;EACjB,GAAG;EACH,YAAY,OAAO,MAAoE;GACrF,IAAI;IACF,OAAO,MAAM,EAAQ,WAAW;KAAE,GAAG;KAAW,SAAS,EAAU,WAAW;IAAQ,CAAC;GACzF,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GAKf,AADA,EAAiB,kBAAkB,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,GAClE,EAAiB,kBAAkB,EAAE,UAAU,CAAC,iBAAiB,EAAE,CAAC;EACtE;CACF,CAAC;AACH"}
@@ -0,0 +1,43 @@
1
+ import { ConfigParameter, GetDepositAddressOptions, GetDepositAddressReturnType } from '@symmio/trading-core';
2
+ import { UseQueryResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ /** Parameters for {@link useDepositAddress}: the core query options plus an optional `config`. */
5
+ export type UseDepositAddressParameters = GetDepositAddressOptions & ConfigParameter;
6
+ /** Return type of {@link useDepositAddress}: the signed-in user's deposit wallet for one market. */
7
+ export type UseDepositAddressReturnType = UseQueryResult<GetDepositAddressReturnType, SymmioRequestError>;
8
+ /**
9
+ * Return (or create) the signed-in user's deposit wallet for a single market —
10
+ * the address the user sends funds to in order to deposit into the market's pool.
11
+ *
12
+ * This is an authed, per-market read: it takes a Bearer `accessToken` from
13
+ * {@link useAuthenticateListing}, the market's `tokenContractAddress`, and the
14
+ * market's `depositChain` — the last two together identify the market. The token
15
+ * and the address both gate the query: until the `accessToken` **and** the
16
+ * `tokenContractAddress` are non-empty strings the hook stays idle
17
+ * (`enabled: false`) rather than firing an incomplete or unauthenticated
18
+ * request, so it can be mounted before sign-in or before a market is selected.
19
+ *
20
+ * The endpoint is an idempotent get-or-create: it returns the user's existing
21
+ * wallet for the market, or provisions a new one on the first call. Enigma-only;
22
+ * errors are normalized to {@link SymmioRequestError}.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const login = useAuthenticateListing();
27
+ * const [token, setToken] = useState("");
28
+ *
29
+ * const { data, isPending } = useDepositAddress({
30
+ * accessToken: token,
31
+ * tokenContractAddress: "0x1234…",
32
+ * depositChain: ListingDepositChainId.HYPER_EVM,
33
+ * });
34
+ *
35
+ * // sign in first, then feed the token to the hook:
36
+ * login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });
37
+ *
38
+ * // the address to deposit into the market:
39
+ * data?.depositAddress;
40
+ * ```
41
+ */
42
+ export declare function useDepositAddress(parameters: UseDepositAddressParameters): UseDepositAddressReturnType;
43
+ //# sourceMappingURL=use-deposit-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-deposit-address.d.ts","sourceRoot":"","sources":["../../src/pools/use-deposit-address.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,kGAAkG;AAClG,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG,eAAe,CAAC;AAErF,oGAAoG;AACpG,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAE1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,2BAA2B,GAAG,2BAA2B,CAsBtG"}