@symmio/trading-core 4.0.0 → 4.2.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 (447) 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 +63 -4
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +427 -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/add-market/to-created-pool.d.ts.map +1 -1
  95. package/dist/pools/add-market/to-created-pool.js +4 -0
  96. package/dist/pools/add-market/to-created-pool.js.map +1 -1
  97. package/dist/pools/add-market/types.d.ts +8 -0
  98. package/dist/pools/add-market/types.d.ts.map +1 -1
  99. package/dist/pools/auth/authenticate-listing.d.ts +3 -1
  100. package/dist/pools/auth/authenticate-listing.d.ts.map +1 -1
  101. package/dist/pools/auth/authenticate-listing.js +28 -23
  102. package/dist/pools/auth/authenticate-listing.js.map +1 -1
  103. package/dist/pools/auth/can-reuse-listing-challenge.d.ts +5 -0
  104. package/dist/pools/auth/can-reuse-listing-challenge.d.ts.map +1 -0
  105. package/dist/pools/auth/can-reuse-listing-challenge.js +9 -0
  106. package/dist/pools/auth/can-reuse-listing-challenge.js.map +1 -0
  107. package/dist/pools/auth/query.d.ts +15 -0
  108. package/dist/pools/auth/query.d.ts.map +1 -1
  109. package/dist/pools/auth/query.js +28 -4
  110. package/dist/pools/auth/query.js.map +1 -1
  111. package/dist/pools/auth/to-siwe.d.ts +5 -1
  112. package/dist/pools/auth/to-siwe.d.ts.map +1 -1
  113. package/dist/pools/auth/to-siwe.js +4 -2
  114. package/dist/pools/auth/to-siwe.js.map +1 -1
  115. package/dist/pools/auth/types.d.ts +2 -0
  116. package/dist/pools/auth/types.d.ts.map +1 -1
  117. package/dist/pools/cancel-withdraw/cancel-withdraw.js +1 -1
  118. package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -1
  119. package/dist/pools/claim-history/get-pool-claim.d.ts +11 -0
  120. package/dist/pools/claim-history/get-pool-claim.d.ts.map +1 -0
  121. package/dist/pools/claim-history/get-pool-claim.js +25 -0
  122. package/dist/pools/claim-history/get-pool-claim.js.map +1 -0
  123. package/dist/pools/claim-history/index.d.ts +1 -0
  124. package/dist/pools/claim-history/index.d.ts.map +1 -1
  125. package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -1
  126. package/dist/pools/claim-history/to-pool-claim.js +2 -0
  127. package/dist/pools/claim-history/to-pool-claim.js.map +1 -1
  128. package/dist/pools/composition.d.ts +16 -0
  129. package/dist/pools/composition.d.ts.map +1 -0
  130. package/dist/pools/composition.js +39 -0
  131. package/dist/pools/composition.js.map +1 -0
  132. package/dist/pools/empty-pool-profit.d.ts +4 -0
  133. package/dist/pools/empty-pool-profit.d.ts.map +1 -0
  134. package/dist/pools/empty-pool-profit.js +17 -0
  135. package/dist/pools/empty-pool-profit.js.map +1 -0
  136. package/dist/pools/index.d.ts +8 -0
  137. package/dist/pools/index.d.ts.map +1 -1
  138. package/dist/pools/listing-config/to-listing-config.d.ts +5 -1
  139. package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
  140. package/dist/pools/listing-config/to-listing-config.js +19 -8
  141. package/dist/pools/listing-config/to-listing-config.js.map +1 -1
  142. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts +37 -0
  143. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts.map +1 -0
  144. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js +35 -0
  145. package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js.map +1 -0
  146. package/dist/pools/maintenance-fees/index.d.ts +3 -0
  147. package/dist/pools/maintenance-fees/index.d.ts.map +1 -0
  148. package/dist/pools/maintenance-fees/query.d.ts +11 -0
  149. package/dist/pools/maintenance-fees/query.d.ts.map +1 -0
  150. package/dist/pools/maintenance-fees/query.js +21 -0
  151. package/dist/pools/maintenance-fees/query.js.map +1 -0
  152. package/dist/pools/market-config/to-listing-market-config.d.ts +6 -1
  153. package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -1
  154. package/dist/pools/market-config/to-listing-market-config.js +1 -0
  155. package/dist/pools/market-config/to-listing-market-config.js.map +1 -1
  156. package/dist/pools/market-config/types.d.ts +5 -0
  157. package/dist/pools/market-config/types.d.ts.map +1 -1
  158. package/dist/pools/market-config/types.js.map +1 -1
  159. package/dist/pools/market-data/get-pool-market-data.d.ts +14 -0
  160. package/dist/pools/market-data/get-pool-market-data.d.ts.map +1 -0
  161. package/dist/pools/market-data/get-pool-market-data.js +25 -0
  162. package/dist/pools/market-data/get-pool-market-data.js.map +1 -0
  163. package/dist/pools/market-data/index.d.ts +2 -0
  164. package/dist/pools/market-data/index.d.ts.map +1 -0
  165. package/dist/pools/market-detail/to-listing-market-detail.d.ts +5 -1
  166. package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
  167. package/dist/pools/market-detail/to-listing-market-detail.js +45 -33
  168. package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
  169. package/dist/pools/markets/to-listing-market.d.ts +13 -1
  170. package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
  171. package/dist/pools/markets/to-listing-market.js +24 -12
  172. package/dist/pools/markets/to-listing-market.js.map +1 -1
  173. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts +39 -0
  174. package/dist/pools/open-positions/calculate-pool-open-positions.d.ts.map +1 -0
  175. package/dist/pools/open-positions/calculate-pool-open-positions.js +83 -0
  176. package/dist/pools/open-positions/calculate-pool-open-positions.js.map +1 -0
  177. package/dist/pools/open-positions/get-pool-open-positions.d.ts +17 -0
  178. package/dist/pools/open-positions/get-pool-open-positions.d.ts.map +1 -0
  179. package/dist/pools/open-positions/get-pool-open-positions.js +39 -0
  180. package/dist/pools/open-positions/get-pool-open-positions.js.map +1 -0
  181. package/dist/pools/open-positions/index.d.ts +4 -0
  182. package/dist/pools/open-positions/index.d.ts.map +1 -0
  183. package/dist/pools/open-positions/query.d.ts +17 -0
  184. package/dist/pools/open-positions/query.d.ts.map +1 -0
  185. package/dist/pools/open-positions/query.js +21 -0
  186. package/dist/pools/open-positions/query.js.map +1 -0
  187. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts +66 -0
  188. package/dist/pools/portfolio/calculate-pool-portfolio.d.ts.map +1 -0
  189. package/dist/pools/portfolio/calculate-pool-portfolio.js +96 -0
  190. package/dist/pools/portfolio/calculate-pool-portfolio.js.map +1 -0
  191. package/dist/pools/portfolio/get-pool-portfolio.d.ts +19 -0
  192. package/dist/pools/portfolio/get-pool-portfolio.d.ts.map +1 -0
  193. package/dist/pools/portfolio/get-pool-portfolio.js +88 -0
  194. package/dist/pools/portfolio/get-pool-portfolio.js.map +1 -0
  195. package/dist/pools/portfolio/index.d.ts +4 -0
  196. package/dist/pools/portfolio/index.d.ts.map +1 -0
  197. package/dist/pools/portfolio/query.d.ts +17 -0
  198. package/dist/pools/portfolio/query.d.ts.map +1 -0
  199. package/dist/pools/portfolio/query.js +21 -0
  200. package/dist/pools/portfolio/query.js.map +1 -0
  201. package/dist/pools/portfolio/read-positions.d.ts +4 -0
  202. package/dist/pools/portfolio/read-positions.d.ts.map +1 -0
  203. package/dist/pools/portfolio/read-positions.js +31 -0
  204. package/dist/pools/portfolio/read-positions.js.map +1 -0
  205. package/dist/pools/position/calculate-pool-position.d.ts +85 -0
  206. package/dist/pools/position/calculate-pool-position.d.ts.map +1 -0
  207. package/dist/pools/position/calculate-pool-position.js +59 -0
  208. package/dist/pools/position/calculate-pool-position.js.map +1 -0
  209. package/dist/pools/position/get-pool-position.d.ts +22 -0
  210. package/dist/pools/position/get-pool-position.d.ts.map +1 -0
  211. package/dist/pools/position/get-pool-position.js +47 -0
  212. package/dist/pools/position/get-pool-position.js.map +1 -0
  213. package/dist/pools/position/index.d.ts +4 -0
  214. package/dist/pools/position/index.d.ts.map +1 -0
  215. package/dist/pools/position/query.d.ts +17 -0
  216. package/dist/pools/position/query.d.ts.map +1 -0
  217. package/dist/pools/position/query.js +21 -0
  218. package/dist/pools/position/query.js.map +1 -0
  219. package/dist/pools/position/sum-deposits.d.ts +10 -0
  220. package/dist/pools/position/sum-deposits.d.ts.map +1 -0
  221. package/dist/pools/position/sum-deposits.js +35 -0
  222. package/dist/pools/position/sum-deposits.js.map +1 -0
  223. package/dist/pools/profit/get-user-profit.d.ts +4 -0
  224. package/dist/pools/profit/get-user-profit.d.ts.map +1 -1
  225. package/dist/pools/profit/get-user-profit.js +18 -12
  226. package/dist/pools/profit/get-user-profit.js.map +1 -1
  227. package/dist/pools/profit/to-user-pool-profit.d.ts +22 -4
  228. package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -1
  229. package/dist/pools/profit/to-user-pool-profit.js +28 -12
  230. package/dist/pools/profit/to-user-pool-profit.js.map +1 -1
  231. package/dist/pools/quotes/get-pool-quotes.d.ts +8 -1
  232. package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -1
  233. package/dist/pools/quotes/get-pool-quotes.js +8 -1
  234. package/dist/pools/quotes/get-pool-quotes.js.map +1 -1
  235. package/dist/pools/quotes/query-document.d.ts.map +1 -1
  236. package/dist/pools/quotes/query-document.js +1 -1
  237. package/dist/pools/quotes/query-document.js.map +1 -1
  238. package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -1
  239. package/dist/pools/quotes/to-pool-quote.js +13 -0
  240. package/dist/pools/quotes/to-pool-quote.js.map +1 -1
  241. package/dist/pools/rewards/query.js +25 -25
  242. package/dist/pools/statistics/calculate-pool-statistics.d.ts +69 -0
  243. package/dist/pools/statistics/calculate-pool-statistics.d.ts.map +1 -0
  244. package/dist/pools/statistics/calculate-pool-statistics.js +42 -0
  245. package/dist/pools/statistics/calculate-pool-statistics.js.map +1 -0
  246. package/dist/pools/statistics/get-pool-statistics.d.ts +29 -0
  247. package/dist/pools/statistics/get-pool-statistics.d.ts.map +1 -0
  248. package/dist/pools/statistics/get-pool-statistics.js +61 -0
  249. package/dist/pools/statistics/get-pool-statistics.js.map +1 -0
  250. package/dist/pools/statistics/index.d.ts +4 -0
  251. package/dist/pools/statistics/index.d.ts.map +1 -0
  252. package/dist/pools/statistics/query.d.ts +17 -0
  253. package/dist/pools/statistics/query.d.ts.map +1 -0
  254. package/dist/pools/statistics/query.js +21 -0
  255. package/dist/pools/statistics/query.js.map +1 -0
  256. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts +32 -0
  257. package/dist/pools/token-metadata/get-listing-token-metadata.d.ts.map +1 -0
  258. package/dist/pools/token-metadata/get-listing-token-metadata.js +43 -0
  259. package/dist/pools/token-metadata/get-listing-token-metadata.js.map +1 -0
  260. package/dist/pools/token-metadata/index.d.ts +3 -0
  261. package/dist/pools/token-metadata/index.d.ts.map +1 -0
  262. package/dist/pools/token-metadata/query.d.ts +11 -0
  263. package/dist/pools/token-metadata/query.d.ts.map +1 -0
  264. package/dist/pools/token-metadata/query.js +21 -0
  265. package/dist/pools/token-metadata/query.js.map +1 -0
  266. package/dist/pools/token-support/check-listing-token-support.d.ts +23 -0
  267. package/dist/pools/token-support/check-listing-token-support.d.ts.map +1 -0
  268. package/dist/pools/token-support/check-listing-token-support.js +36 -0
  269. package/dist/pools/token-support/check-listing-token-support.js.map +1 -0
  270. package/dist/pools/token-support/index.d.ts +3 -0
  271. package/dist/pools/token-support/index.d.ts.map +1 -0
  272. package/dist/pools/token-support/query.d.ts +11 -0
  273. package/dist/pools/token-support/query.d.ts.map +1 -0
  274. package/dist/pools/token-support/query.js +21 -0
  275. package/dist/pools/token-support/query.js.map +1 -0
  276. package/dist/pools/trade-history/calculate-history-metrics.d.ts +12 -0
  277. package/dist/pools/trade-history/calculate-history-metrics.d.ts.map +1 -0
  278. package/dist/pools/trade-history/calculate-history-metrics.js +36 -0
  279. package/dist/pools/trade-history/calculate-history-metrics.js.map +1 -0
  280. package/dist/pools/trade-history/get-pool-trade-history.d.ts +21 -1
  281. package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -1
  282. package/dist/pools/trade-history/get-pool-trade-history.js +57 -18
  283. package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -1
  284. package/dist/pools/trade-history/query-document.d.ts +3 -0
  285. package/dist/pools/trade-history/query-document.d.ts.map +1 -1
  286. package/dist/pools/trade-history/query-document.js +1 -1
  287. package/dist/pools/trade-history/query-document.js.map +1 -1
  288. package/dist/pools/transactions/get-pool-transaction-range.d.ts +6 -0
  289. package/dist/pools/transactions/get-pool-transaction-range.d.ts.map +1 -0
  290. package/dist/pools/transactions/get-pool-transaction-range.js +26 -0
  291. package/dist/pools/transactions/get-pool-transaction-range.js.map +1 -0
  292. package/dist/pools/transactions/index.d.ts +1 -0
  293. package/dist/pools/transactions/index.d.ts.map +1 -1
  294. package/dist/pools/types/generated/listing-backend.js +34 -10
  295. package/dist/pools/types/generated/listing-backend.js.map +1 -1
  296. package/dist/pools/types.d.ts +129 -6
  297. package/dist/pools/types.d.ts.map +1 -1
  298. package/dist/pools/types.js.map +1 -1
  299. package/dist/pools/user-markets/get-user-listing-markets.d.ts +2 -0
  300. package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -1
  301. package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -1
  302. package/dist/pools/user-markets/to-user-listing-market.js +1 -1
  303. package/dist/pools/user-markets/to-user-listing-market.js.map +1 -1
  304. package/dist/pools/user-transactions/get-user-transactions.d.ts +2 -0
  305. package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -1
  306. package/dist/pools/user-transactions/get-user-transactions.js.map +1 -1
  307. package/dist/pools/user-transactions/to-user-transaction.d.ts +5 -1
  308. package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -1
  309. package/dist/pools/user-transactions/to-user-transaction.js +3 -0
  310. package/dist/pools/user-transactions/to-user-transaction.js.map +1 -1
  311. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +22 -12
  312. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts.map +1 -1
  313. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js +20 -21
  314. package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js.map +1 -1
  315. package/dist/quotes/get-quote-events-by-type/query-document.d.ts +5 -5
  316. package/dist/quotes/get-quote-events-by-type/query-document.d.ts.map +1 -1
  317. package/dist/quotes/get-quote-events-by-type/query-document.js +1 -1
  318. package/dist/quotes/get-quote-events-by-type/query-document.js.map +1 -1
  319. package/dist/quotes/get-quote-events-by-type/query.d.ts +7 -6
  320. package/dist/quotes/get-quote-events-by-type/query.d.ts.map +1 -1
  321. package/dist/quotes/get-quote-events-by-type/query.js +19 -17
  322. package/dist/quotes/get-quote-events-by-type/query.js.map +1 -1
  323. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
  324. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts.map +1 -1
  325. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js +1 -3
  326. package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js.map +1 -1
  327. package/dist/quotes/get-quote-events-by-type/types.d.ts +14 -3
  328. package/dist/quotes/get-quote-events-by-type/types.d.ts.map +1 -1
  329. package/dist/quotes/get-quote-events-by-type/types.js.map +1 -1
  330. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +12 -2
  331. package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
  332. package/dist/quotes/get-quote-funding/get-quote-funding.js +21 -17
  333. package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
  334. package/dist/quotes/get-quote-funding/query-document.d.ts +3 -2
  335. package/dist/quotes/get-quote-funding/query-document.d.ts.map +1 -1
  336. package/dist/quotes/get-quote-funding/query-document.js +1 -1
  337. package/dist/quotes/get-quote-funding/query-document.js.map +1 -1
  338. package/dist/quotes/get-quote-funding/query.d.ts.map +1 -1
  339. package/dist/quotes/get-quote-funding/query.js +2 -1
  340. package/dist/quotes/get-quote-funding/query.js.map +1 -1
  341. package/dist/quotes/get-quote-funding/to-funding-row.d.ts.map +1 -1
  342. package/dist/quotes/get-quote-funding/to-funding-row.js +1 -3
  343. package/dist/quotes/get-quote-funding/to-funding-row.js.map +1 -1
  344. package/dist/quotes/get-quote-history/get-quote-history.d.ts +18 -7
  345. package/dist/quotes/get-quote-history/get-quote-history.d.ts.map +1 -1
  346. package/dist/quotes/get-quote-history/get-quote-history.js +32 -22
  347. package/dist/quotes/get-quote-history/get-quote-history.js.map +1 -1
  348. package/dist/quotes/get-quote-history/query-document.d.ts +12 -7
  349. package/dist/quotes/get-quote-history/query-document.d.ts.map +1 -1
  350. package/dist/quotes/get-quote-history/query-document.js +1 -1
  351. package/dist/quotes/get-quote-history/query-document.js.map +1 -1
  352. package/dist/quotes/get-quote-history/query.d.ts +3 -2
  353. package/dist/quotes/get-quote-history/query.d.ts.map +1 -1
  354. package/dist/quotes/get-quote-history/query.js +22 -19
  355. package/dist/quotes/get-quote-history/query.js.map +1 -1
  356. package/dist/quotes/get-quote-history/to-history-row.d.ts.map +1 -1
  357. package/dist/quotes/get-quote-history/to-history-row.js +52 -37
  358. package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
  359. package/dist/quotes/get-quote-history/types.d.ts +41 -0
  360. package/dist/quotes/get-quote-history/types.d.ts.map +1 -1
  361. package/dist/quotes/get-quote-history/types.js.map +1 -1
  362. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +21 -11
  363. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
  364. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js +19 -21
  365. package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
  366. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts +7 -7
  367. package/dist/quotes/get-quotes-events-by-type/query-document.d.ts.map +1 -1
  368. package/dist/quotes/get-quotes-events-by-type/query-document.js +1 -1
  369. package/dist/quotes/get-quotes-events-by-type/query-document.js.map +1 -1
  370. package/dist/quotes/get-quotes-events-by-type/query.d.ts +8 -6
  371. package/dist/quotes/get-quotes-events-by-type/query.d.ts.map +1 -1
  372. package/dist/quotes/get-quotes-events-by-type/query.js +22 -20
  373. package/dist/quotes/get-quotes-events-by-type/query.js.map +1 -1
  374. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts +38 -0
  375. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts.map +1 -0
  376. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js +28 -0
  377. package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js.map +1 -0
  378. package/dist/quotes/get-subgraph-quotes/index.d.ts +5 -0
  379. package/dist/quotes/get-subgraph-quotes/index.d.ts.map +1 -0
  380. package/dist/quotes/get-subgraph-quotes/query-document.d.ts +15 -0
  381. package/dist/quotes/get-subgraph-quotes/query-document.d.ts.map +1 -0
  382. package/dist/quotes/get-subgraph-quotes/query-document.js +7 -0
  383. package/dist/quotes/get-subgraph-quotes/query-document.js.map +1 -0
  384. package/dist/quotes/get-subgraph-quotes/query.d.ts +37 -0
  385. package/dist/quotes/get-subgraph-quotes/query.d.ts.map +1 -0
  386. package/dist/quotes/get-subgraph-quotes/query.js +23 -0
  387. package/dist/quotes/get-subgraph-quotes/query.js.map +1 -0
  388. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts +12 -0
  389. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts.map +1 -0
  390. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js +32 -0
  391. package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js.map +1 -0
  392. package/dist/quotes/get-subgraph-quotes/types.d.ts +54 -0
  393. package/dist/quotes/get-subgraph-quotes/types.d.ts.map +1 -0
  394. package/dist/quotes/index.d.ts +1 -0
  395. package/dist/quotes/index.d.ts.map +1 -1
  396. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +5 -1
  397. package/dist/quotes/liquidation/calculate-liquidation-price.d.ts.map +1 -1
  398. package/dist/quotes/liquidation/calculate-liquidation-price.js +1 -1
  399. package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
  400. package/dist/quotes/upnl/calculate-quote-pnl.d.ts.map +1 -1
  401. package/dist/quotes/upnl/calculate-quote-pnl.js +8 -8
  402. package/dist/quotes/upnl/calculate-quote-pnl.js.map +1 -1
  403. package/dist/quotes/upnl/calculate-quote-upnl.d.ts +2 -2
  404. package/dist/quotes/upnl/calculate-quote-upnl.d.ts.map +1 -1
  405. package/dist/quotes/upnl/calculate-quote-upnl.js +16 -15
  406. package/dist/quotes/upnl/calculate-quote-upnl.js.map +1 -1
  407. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts +122 -0
  408. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts.map +1 -0
  409. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js +80 -0
  410. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js.map +1 -0
  411. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts +3 -0
  412. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts.map +1 -0
  413. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts +37 -0
  414. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts.map +1 -0
  415. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js +27 -0
  416. package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js.map +1 -0
  417. package/dist/symmio-contracts/symmio/index.d.ts +2 -0
  418. package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
  419. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts +3 -0
  420. package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts.map +1 -0
  421. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts +37 -0
  422. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts.map +1 -0
  423. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js +15 -0
  424. package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js.map +1 -0
  425. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts +38 -0
  426. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts.map +1 -0
  427. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js +29 -0
  428. package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js.map +1 -0
  429. package/dist/symmio-subgraph/index.d.ts +1 -0
  430. package/dist/symmio-subgraph/index.d.ts.map +1 -1
  431. package/dist/symmio-subgraph/subgraph-decode.d.ts +51 -0
  432. package/dist/symmio-subgraph/subgraph-decode.d.ts.map +1 -0
  433. package/dist/symmio-subgraph/subgraph-decode.js +24 -0
  434. package/dist/symmio-subgraph/subgraph-decode.js.map +1 -0
  435. package/dist/symmio-subgraph/subgraph-filters.d.ts +97 -0
  436. package/dist/symmio-subgraph/subgraph-filters.d.ts.map +1 -0
  437. package/dist/symmio-subgraph/subgraph-filters.js +39 -0
  438. package/dist/symmio-subgraph/subgraph-filters.js.map +1 -0
  439. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +26 -6
  440. package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
  441. package/dist/symmio-subgraph/types/generated/analytics/gql.js +16 -11
  442. package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
  443. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +3661 -9
  444. package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
  445. package/dist/symmio-subgraph/types/generated/analytics/graphql.js +2 -2
  446. package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
  447. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ import { Address, Hex } from 'viem';
2
+ import { MarginTransferType } from '../../balance-history/get-balance-history/types.js';
3
+ /**
4
+ * One `MarginTransfer` entity: margin moved between a SubAccount and one of its
5
+ * Virtual Accounts. Amounts are 18-decimal wei `bigint`.
6
+ */
7
+ export interface MarginTransferRow {
8
+ /** Subgraph entity id (stable; use as a row key or `idGt` cursor). */
9
+ id: string;
10
+ /** Transfer direction — see {@link MarginTransferType}. */
11
+ type: MarginTransferType | (string & {});
12
+ /** The Virtual Account the margin moved into or out of. */
13
+ virtualAccount: Address;
14
+ /** The SubAccount that owns the Virtual Account. */
15
+ subAccount: Address;
16
+ /** Amount moved (wei). */
17
+ amount: bigint;
18
+ /** Diamond address the transfer was indexed from (the subgraph's `source`). */
19
+ source: Address;
20
+ /** Block timestamp (unix seconds). */
21
+ timestamp: number;
22
+ /** Block number. */
23
+ blockNumber: bigint;
24
+ /** Transaction hash. */
25
+ transaction: Hex;
26
+ }
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/margin/get-margin-transfers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,IAAI,EAAE,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACzC,2DAA2D;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,WAAW,EAAE,GAAG,CAAC;CAClB"}
@@ -1,2 +1,3 @@
1
1
  export * from './calculate-margin-risk.js';
2
+ export * from './get-margin-transfers/index.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/margin/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/margin/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-created-pool.d.ts","sourceRoot":"","sources":["../../../src/pools/add-market/to-created-pool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,gCAAgC,GAAG,WAAW,CAchF"}
1
+ {"version":3,"file":"to-created-pool.d.ts","sourceRoot":"","sources":["../../../src/pools/add-market/to-created-pool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,gCAAgC,GAAG,WAAW,CAkBhF"}
@@ -1,6 +1,10 @@
1
1
  //#region src/pools/add-market/to-created-pool.ts
2
2
  function e(e) {
3
3
  return {
4
+ isTax: e.is_tax ?? null,
5
+ userWhitelistTax: e.user_whitelist_tax ?? null,
6
+ additionalChains: e.additional_chains ?? null,
7
+ cexList: e.cex_list ?? null,
4
8
  tokenContractAddress: e.token_contract_address,
5
9
  userAddress: e.user_address,
6
10
  tokenName: e.token_name,
@@ -1 +1 @@
1
- {"version":3,"file":"to-created-pool.js","names":[],"sources":["../../../src/pools/add-market/to-created-pool.ts"],"sourcesContent":["import type { ListingDepositChainId, ListingMarketStatus } from \"../types\";\nimport type { AddMarketDepositResponseSchemaV2 } from \"../types/generated/listing-backend\";\nimport type { CreatedPool } from \"./types\";\n\n/**\n * Map the raw `/v2/market/add-market` response into the SDK's {@link CreatedPool}.\n *\n * Renames snake_case wire fields to camelCase and normalizes the two nullable\n * addresses to `null` when absent. `deposit_chain` is a numeric chain id that\n * matches {@link ListingDepositChainId}, and the generated `MarketStatus` carries\n * the same string values as {@link ListingMarketStatus}, so both casts are\n * value-preserving.\n *\n * @param raw - The endpoint's `/v2/market/add-market` response body.\n * @returns The normalized created pool.\n */\nexport function toCreatedPool(raw: AddMarketDepositResponseSchemaV2): CreatedPool {\n return {\n tokenContractAddress: raw.token_contract_address,\n userAddress: raw.user_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n tokenDecimal: raw.token_decimal,\n buyBackRatio: raw.buy_back_ratio,\n maxLeverage: raw.max_leverage,\n depositChain: raw.deposit_chain as ListingDepositChainId,\n marketStatus: raw.market_status as unknown as ListingMarketStatus,\n walletPublicKey: raw.wallet_public_key ?? null,\n mainPool: raw.main_pool ?? null,\n };\n}\n"],"mappings":";AAgBA,SAAgB,EAAc,GAAoD;CAChF,OAAO;EACL,sBAAsB,EAAI;EAC1B,aAAa,EAAI;EACjB,WAAW,EAAI;EACf,aAAa,EAAI;EACjB,cAAc,EAAI;EAClB,cAAc,EAAI;EAClB,aAAa,EAAI;EACjB,cAAc,EAAI;EAClB,cAAc,EAAI;EAClB,iBAAiB,EAAI,qBAAqB;EAC1C,UAAU,EAAI,aAAa;CAC7B;AACF"}
1
+ {"version":3,"file":"to-created-pool.js","names":[],"sources":["../../../src/pools/add-market/to-created-pool.ts"],"sourcesContent":["import type { ListingDepositChainId, ListingMarketStatus } from \"../types\";\nimport type { AddMarketDepositResponseSchemaV2 } from \"../types/generated/listing-backend\";\nimport type { CreatedPool } from \"./types\";\n\n/**\n * Map the raw `/v2/market/add-market` response into the SDK's {@link CreatedPool}.\n *\n * Renames snake_case wire fields to camelCase and normalizes the two nullable\n * addresses to `null` when absent. `deposit_chain` is a numeric chain id that\n * matches {@link ListingDepositChainId}, and the generated `MarketStatus` carries\n * the same string values as {@link ListingMarketStatus}, so both casts are\n * value-preserving.\n *\n * @param raw - The endpoint's `/v2/market/add-market` response body.\n * @returns The normalized created pool.\n */\nexport function toCreatedPool(raw: AddMarketDepositResponseSchemaV2): CreatedPool {\n return {\n isTax: raw.is_tax ?? null,\n userWhitelistTax: raw.user_whitelist_tax ?? null,\n additionalChains: raw.additional_chains ?? null,\n cexList: raw.cex_list ?? null,\n tokenContractAddress: raw.token_contract_address,\n userAddress: raw.user_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n tokenDecimal: raw.token_decimal,\n buyBackRatio: raw.buy_back_ratio,\n maxLeverage: raw.max_leverage,\n depositChain: raw.deposit_chain as ListingDepositChainId,\n marketStatus: raw.market_status as unknown as ListingMarketStatus,\n walletPublicKey: raw.wallet_public_key ?? null,\n mainPool: raw.main_pool ?? null,\n };\n}\n"],"mappings":";AAgBA,SAAgB,EAAc,GAAoD;CAChF,OAAO;EACL,OAAO,EAAI,UAAU;EACrB,kBAAkB,EAAI,sBAAsB;EAC5C,kBAAkB,EAAI,qBAAqB;EAC3C,SAAS,EAAI,YAAY;EACzB,sBAAsB,EAAI;EAC1B,aAAa,EAAI;EACjB,WAAW,EAAI;EACf,aAAa,EAAI;EACjB,cAAc,EAAI;EAClB,cAAc,EAAI;EAClB,aAAa,EAAI;EACjB,cAAc,EAAI;EAClB,cAAc,EAAI;EAClB,iBAAiB,EAAI,qBAAqB;EAC1C,UAAU,EAAI,aAAa;CAC7B;AACF"}
@@ -10,6 +10,14 @@ import { ListingDepositChainId, ListingMarketStatus } from '../types.js';
10
10
  * `addMarket` returns the accepted application, not live pool metrics.
11
11
  */
12
12
  export interface CreatedPool {
13
+ /** Token transfer-tax flag, when reported. */
14
+ isTax?: boolean | null;
15
+ /** Whitelist status, when reported. */
16
+ userWhitelistTax?: boolean | null;
17
+ /** Other supported deposit chains. */
18
+ additionalChains?: number[] | null;
19
+ /** Exchange listings, when reported. */
20
+ cexList?: string[] | null;
13
21
  /**
14
22
  * The submitted token's contract address on {@link CreatedPool.depositChain}.
15
23
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/add-market/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4GAA4G;IAC5G,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,gGAAgG;IAChG,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,YAAY,EAAE,qBAAqB,CAAC;IACpC,0IAA0I;IAC1I,YAAY,EAAE,mBAAmB,CAAC;IAClC,uHAAuH;IACvH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/add-market/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACnC,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4GAA4G;IAC5G,WAAW,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,gGAAgG;IAChG,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,YAAY,EAAE,qBAAqB,CAAC;IACpC,0IAA0I;IAC1I,YAAY,EAAE,mBAAmB,CAAC;IAClC,uHAAuH;IACvH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
@@ -1,6 +1,6 @@
1
1
  import { Config } from '../../core/config/index.js';
2
2
  import { ChainIdParameter, Compute, FromParameter } from '../../shared/types/properties.js';
3
- import { ListingAuthToken } from './types.js';
3
+ import { ListingAuthToken, ListingSignInMessage } from './types.js';
4
4
  /**
5
5
  * Parameters for {@link authenticateListing}.
6
6
  *
@@ -14,6 +14,8 @@ export type AuthenticateListingParameters = Compute<ChainIdParameter & FromParam
14
14
  uri: string;
15
15
  /** Optional human-readable statement to embed in the message. */
16
16
  statement?: string;
17
+ /** SDK-issued challenge fetched before the user's signing gesture. Must match the wallet and origin. */
18
+ signInMessage?: ListingSignInMessage;
17
19
  }>;
18
20
  /** Return type of {@link authenticateListing}: the issued bearer token. */
19
21
  export type AuthenticateListingReturnType = ListingAuthToken;
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate-listing.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/authenticate-listing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAK9F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gBAAgB,GACd,aAAa,GAAG;IACd,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CACJ,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CAwCxC"}
1
+ {"version":3,"file":"authenticate-listing.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/authenticate-listing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM9F,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gBAAgB,GACd,aAAa,GAAG;IACd,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,CACJ,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CA6CxC"}
@@ -1,37 +1,42 @@
1
1
  import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
2
2
  import { resolveListingService as n } from "../resolve-listing.js";
3
3
  import { loginV2AuthLoginPost as r } from "../types/generated/listing-backend.js";
4
- import { toCustomSiweMessage as i, toListingAuthToken as a } from "./to-siwe.js";
5
- import { getListingSignInMessage as o } from "./get-sign-in-message.js";
6
- import { isAxiosError as s } from "axios";
4
+ import { canReuseListingChallenge as i } from "./can-reuse-listing-challenge.js";
5
+ import { toCustomSiweMessage as a, toListingAuthToken as o } from "./to-siwe.js";
6
+ import { getListingSignInMessage as s } from "./get-sign-in-message.js";
7
+ import { isAxiosError as c } from "axios";
7
8
  //#region src/pools/auth/authenticate-listing.ts
8
- async function c(c, l) {
9
- let { url: u } = n(c, { chainId: l.chainId }), d = await c.getWalletClient({
10
- chainId: l.chainId,
11
- from: l.from
12
- }), f = d.account.address, p = await o(c, {
13
- chainId: l.chainId,
14
- address: f,
15
- domain: l.domain,
16
- uri: l.uri,
17
- statement: l.statement
18
- }), m = await d.signMessage({
19
- account: d.account,
20
- message: p.message
9
+ async function l(l, u) {
10
+ let { url: d } = n(l, { chainId: u.chainId }), f = await l.getWalletClient({
11
+ chainId: u.chainId,
12
+ from: u.from
13
+ }), p = f.account.address, m = l.getChainConfig(u.chainId).chainId, h = (u.signInMessage && i(u.signInMessage, {
14
+ ...u,
15
+ address: p,
16
+ chainId: m
17
+ }) ? u.signInMessage : void 0) ?? await s(l, {
18
+ chainId: u.chainId,
19
+ address: p,
20
+ domain: u.domain,
21
+ uri: u.uri,
22
+ statement: u.statement
23
+ }), g = await f.signMessage({
24
+ account: f.account,
25
+ message: h.message
21
26
  });
22
27
  try {
23
- return a((await r({
24
- message: i(p.params),
25
- signature: m
26
- }, { baseURL: u })).data);
28
+ return o((await r({
29
+ message: a(h.params),
30
+ signature: g
31
+ }, { baseURL: d })).data);
27
32
  } catch (n) {
28
- throw n instanceof t ? n : s(n) ? e.fromAxios(n, {
33
+ throw n instanceof t ? n : c(n) ? e.fromAxios(n, {
29
34
  code: "LISTING_LOGIN_FAILED",
30
- baseURL: u
35
+ baseURL: d
31
36
  }) : new t("api", "LISTING_LOGIN_FAILED", `Failed to log in to the listing service: ${n instanceof Error ? n.message : String(n)}`, { cause: n instanceof Error ? n : void 0 });
32
37
  }
33
38
  }
34
39
  //#endregion
35
- export { c as authenticateListing };
40
+ export { l as authenticateListing };
36
41
 
37
42
  //# sourceMappingURL=authenticate-listing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authenticate-listing.js","names":[],"sources":["../../../src/pools/auth/authenticate-listing.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute, FromParameter } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { loginV2AuthLoginPost } from \"../types/generated/listing-backend\";\nimport { getListingSignInMessage } from \"./get-sign-in-message\";\nimport { toCustomSiweMessage, toListingAuthToken } from \"./to-siwe\";\nimport type { ListingAuthToken } from \"./types\";\n\n/**\n * Parameters for {@link authenticateListing}.\n *\n * The signing address is taken from the resolved wallet account, so it is not a\n * parameter.\n */\nexport type AuthenticateListingParameters = Compute<\n ChainIdParameter &\n FromParameter & {\n /** RFC 4501 DNS authority requesting the sign-in. */\n domain: string;\n /** RFC 3986 URI of the dApp. */\n uri: string;\n /** Optional human-readable statement to embed in the message. */\n statement?: string;\n }\n>;\n\n/** Return type of {@link authenticateListing}: the issued bearer token. */\nexport type AuthenticateListingReturnType = ListingAuthToken;\n\n/**\n * Authenticate against the listing backend with the full SIWE (EIP-4361) flow:\n * fetch the sign-in challenge, sign it with the connected wallet, and exchange\n * the signature for a bearer token.\n *\n * The signing address comes from the resolved wallet account. Wallet or viem\n * rejection errors from signing pass through unwrapped.\n *\n * Enigma-only: the listing backend is an Enigma capability.\n *\n * @param config - The SDK config.\n * @param parameters - Domain, uri, and optional statement.\n * @returns The issued bearer token.\n * @throws {SymmApiError} when the sign-in or login request fails.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend.\n *\n * @example\n * ```ts\n * const token = await authenticateListing(config, {\n * domain: \"app.example.com\",\n * uri: \"https://app.example.com\",\n * });\n * // Authorization: `Bearer ${token.accessToken}`\n * ```\n */\nexport async function authenticateListing(\n config: Config,\n parameters: AuthenticateListingParameters,\n): Promise<AuthenticateListingReturnType> {\n const { url } = resolveListingService(config, { chainId: parameters.chainId });\n\n const walletClient = await config.getWalletClient({ chainId: parameters.chainId, from: parameters.from });\n const address = walletClient.account.address;\n\n const signIn = await getListingSignInMessage(config, {\n chainId: parameters.chainId,\n address,\n domain: parameters.domain,\n uri: parameters.uri,\n statement: parameters.statement,\n });\n\n const signature = await walletClient.signMessage({\n account: walletClient.account,\n message: signIn.message,\n });\n\n try {\n const response = await loginV2AuthLoginPost(\n { message: toCustomSiweMessage(signIn.params), signature },\n { baseURL: url },\n );\n\n return toListingAuthToken(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"LISTING_LOGIN_FAILED\", baseURL: url });\n }\n\n throw new SymmError(\n \"api\",\n \"LISTING_LOGIN_FAILED\",\n `Failed to log in to the listing service: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;AAyDA,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EAAE,WAAQ,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC,GAEvE,IAAe,MAAM,EAAO,gBAAgB;EAAE,SAAS,EAAW;EAAS,MAAM,EAAW;CAAK,CAAC,GAClG,IAAU,EAAa,QAAQ,SAE/B,IAAS,MAAM,EAAwB,GAAQ;EACnD,SAAS,EAAW;EACpB;EACA,QAAQ,EAAW;EACnB,KAAK,EAAW;EAChB,WAAW,EAAW;CACxB,CAAC,GAEK,IAAY,MAAM,EAAa,YAAY;EAC/C,SAAS,EAAa;EACtB,SAAS,EAAO;CAClB,CAAC;CAED,IAAI;EAMF,OAAO,GAAmB,MALH,EACrB;GAAE,SAAS,EAAoB,EAAO,MAAM;GAAG;EAAU,GACzD,EAAE,SAAS,EAAI,CACjB,GAEmC,IAAI;CACzC,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAwB,SAAS;EAAI,CAAC,IAG5E,IAAI,EACR,OACA,wBACA,4CAA4C,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC3F,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
1
+ {"version":3,"file":"authenticate-listing.js","names":[],"sources":["../../../src/pools/auth/authenticate-listing.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute, FromParameter } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { loginV2AuthLoginPost } from \"../types/generated/listing-backend\";\nimport { canReuseListingChallenge } from \"./can-reuse-listing-challenge\";\nimport { getListingSignInMessage } from \"./get-sign-in-message\";\nimport { toCustomSiweMessage, toListingAuthToken } from \"./to-siwe\";\nimport type { ListingAuthToken, ListingSignInMessage } from \"./types\";\n\n/**\n * Parameters for {@link authenticateListing}.\n *\n * The signing address is taken from the resolved wallet account, so it is not a\n * parameter.\n */\nexport type AuthenticateListingParameters = Compute<\n ChainIdParameter &\n FromParameter & {\n /** RFC 4501 DNS authority requesting the sign-in. */\n domain: string;\n /** RFC 3986 URI of the dApp. */\n uri: string;\n /** Optional human-readable statement to embed in the message. */\n statement?: string;\n /** SDK-issued challenge fetched before the user's signing gesture. Must match the wallet and origin. */\n signInMessage?: ListingSignInMessage;\n }\n>;\n\n/** Return type of {@link authenticateListing}: the issued bearer token. */\nexport type AuthenticateListingReturnType = ListingAuthToken;\n\n/**\n * Authenticate against the listing backend with the full SIWE (EIP-4361) flow:\n * fetch the sign-in challenge, sign it with the connected wallet, and exchange\n * the signature for a bearer token.\n *\n * The signing address comes from the resolved wallet account. Wallet or viem\n * rejection errors from signing pass through unwrapped.\n *\n * Enigma-only: the listing backend is an Enigma capability.\n *\n * @param config - The SDK config.\n * @param parameters - Domain, uri, and optional statement.\n * @returns The issued bearer token.\n * @throws {SymmApiError} when the sign-in or login request fails.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend.\n *\n * @example\n * ```ts\n * const token = await authenticateListing(config, {\n * domain: \"app.example.com\",\n * uri: \"https://app.example.com\",\n * });\n * // Authorization: `Bearer ${token.accessToken}`\n * ```\n */\nexport async function authenticateListing(\n config: Config,\n parameters: AuthenticateListingParameters,\n): Promise<AuthenticateListingReturnType> {\n const { url } = resolveListingService(config, { chainId: parameters.chainId });\n\n const walletClient = await config.getWalletClient({ chainId: parameters.chainId, from: parameters.from });\n const address = walletClient.account.address;\n const chainId = config.getChainConfig(parameters.chainId).chainId;\n\n const signIn =\n (parameters.signInMessage && canReuseListingChallenge(parameters.signInMessage, { ...parameters, address, chainId })\n ? parameters.signInMessage\n : undefined) ??\n (await getListingSignInMessage(config, {\n chainId: parameters.chainId,\n address,\n domain: parameters.domain,\n uri: parameters.uri,\n statement: parameters.statement,\n }));\n\n const signature = await walletClient.signMessage({\n account: walletClient.account,\n message: signIn.message,\n });\n\n try {\n const response = await loginV2AuthLoginPost(\n { message: toCustomSiweMessage(signIn.params), signature },\n { baseURL: url },\n );\n\n return toListingAuthToken(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"LISTING_LOGIN_FAILED\", baseURL: url });\n }\n\n throw new SymmError(\n \"api\",\n \"LISTING_LOGIN_FAILED\",\n `Failed to log in to the listing service: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;;AA4DA,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EAAE,WAAQ,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC,GAEvE,IAAe,MAAM,EAAO,gBAAgB;EAAE,SAAS,EAAW;EAAS,MAAM,EAAW;CAAK,CAAC,GAClG,IAAU,EAAa,QAAQ,SAC/B,IAAU,EAAO,eAAe,EAAW,OAAO,EAAE,SAEpD,KACH,EAAW,iBAAiB,EAAyB,EAAW,eAAe;EAAE,GAAG;EAAY;EAAS;CAAQ,CAAC,IAC/G,EAAW,gBACX,KAAA,MACH,MAAM,EAAwB,GAAQ;EACrC,SAAS,EAAW;EACpB;EACA,QAAQ,EAAW;EACnB,KAAK,EAAW;EAChB,WAAW,EAAW;CACxB,CAAC,GAEG,IAAY,MAAM,EAAa,YAAY;EAC/C,SAAS,EAAa;EACtB,SAAS,EAAO;CAClB,CAAC;CAED,IAAI;EAMF,OAAO,GAAmB,MALH,EACrB;GAAE,SAAS,EAAoB,EAAO,MAAM;GAAG;EAAU,GACzD,EAAE,SAAS,EAAI,CACjB,GAEmC,IAAI;CACzC,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAwB,SAAS;EAAI,CAAC,IAG5E,IAAI,EACR,OACA,wBACA,4CAA4C,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC3F,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
@@ -0,0 +1,5 @@
1
+ import { GetListingSignInMessageParameters } from './get-sign-in-message.js';
2
+ import { ListingSignInMessage } from './types.js';
3
+ /** Select cached challenges only for their original signing context. The server validates signatures and nonces. */
4
+ export declare function canReuseListingChallenge(challenge: ListingSignInMessage, request: GetListingSignInMessageParameters): boolean;
5
+ //# sourceMappingURL=can-reuse-listing-challenge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-reuse-listing-challenge.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/can-reuse-listing-challenge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,oHAAoH;AACpH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAUT"}
@@ -0,0 +1,9 @@
1
+ //#region src/pools/auth/can-reuse-listing-challenge.ts
2
+ function e(e, t) {
3
+ let n = e.params;
4
+ return n.address.toLowerCase() === t.address.toLowerCase() && n.domain === t.domain && n.uri === t.uri && (n.statement ?? "") === (t.statement ?? "") && (t.chainId == null || n.chainId === t.chainId) && (n.expirationTime == null || Date.parse(n.expirationTime) > Date.now());
5
+ }
6
+ //#endregion
7
+ export { e as canReuseListingChallenge };
8
+
9
+ //# sourceMappingURL=can-reuse-listing-challenge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-reuse-listing-challenge.js","names":[],"sources":["../../../src/pools/auth/can-reuse-listing-challenge.ts"],"sourcesContent":["import type { GetListingSignInMessageParameters } from \"./get-sign-in-message\";\nimport type { ListingSignInMessage } from \"./types\";\n\n/** Select cached challenges only for their original signing context. The server validates signatures and nonces. */\nexport function canReuseListingChallenge(\n challenge: ListingSignInMessage,\n request: GetListingSignInMessageParameters,\n): boolean {\n const fields = challenge.params;\n return (\n fields.address.toLowerCase() === request.address.toLowerCase() &&\n fields.domain === request.domain &&\n fields.uri === request.uri &&\n (fields.statement ?? \"\") === (request.statement ?? \"\") &&\n (request.chainId == null || fields.chainId === request.chainId) &&\n (fields.expirationTime == null || Date.parse(fields.expirationTime) > Date.now())\n );\n}\n"],"mappings":";AAIA,SAAgB,EACd,GACA,GACS;CACT,IAAM,IAAS,EAAU;CACzB,OACE,EAAO,QAAQ,YAAY,MAAM,EAAQ,QAAQ,YAAY,KAC7D,EAAO,WAAW,EAAQ,UAC1B,EAAO,QAAQ,EAAQ,QACtB,EAAO,aAAa,SAAS,EAAQ,aAAa,QAClD,EAAQ,WAAW,QAAQ,EAAO,YAAY,EAAQ,aACtD,EAAO,kBAAkB,QAAQ,KAAK,MAAM,EAAO,cAAc,IAAI,KAAK,IAAI;AAEnF"}
@@ -1,5 +1,8 @@
1
1
  import { Config } from '../../core/config/index.js';
2
+ import { ConfigKeyParameter } from '../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
2
4
  import { AuthenticateListingParameters, AuthenticateListingReturnType } from './authenticate-listing.js';
5
+ import { GetListingSignInMessageParameters, GetListingSignInMessageReturnType } from './get-sign-in-message.js';
3
6
  /**
4
7
  * Build TanStack Mutation options for {@link authenticateListing}. Modeled as a
5
8
  * mutation (not a query): it signs a message with the wallet and exchanges it
@@ -18,4 +21,16 @@ export declare function authenticateListingMutationOptions(config: Config): {
18
21
  mutationKey: readonly ["authenticateListing"];
19
22
  mutationFn: (variables: AuthenticateListingParameters) => Promise<AuthenticateListingReturnType>;
20
23
  };
24
+ /** Stable sign-in query identity, including deployment, wallet, origin and statement. */
25
+ export declare function getListingSignInMessageQueryKey(options: GetListingSignInMessageParameters & ConfigKeyParameter): readonly ["getListingSignInMessage", Record<string, unknown>];
26
+ /** Sign-in query key. */
27
+ export type GetListingSignInMessageQueryKey = ReturnType<typeof getListingSignInMessageQueryKey>;
28
+ /** Required challenge identity plus optional query controls. */
29
+ export type GetListingSignInMessageOptions = GetListingSignInMessageParameters & QueryParameter<GetListingSignInMessageReturnType, Error, GetListingSignInMessageReturnType, GetListingSignInMessageQueryKey>;
30
+ /** Fetch a challenge without signing; React callers should normally use prefetchChallenge on useAuthenticateListing.
31
+ * @param config - SDK configuration.
32
+ * @param options - Wallet, origin, deployment and query controls.
33
+ * @returns Options for a single-use sign-in challenge.
34
+ */
35
+ export declare function getListingSignInMessageQueryOptions(config: Config, options: GetListingSignInMessageOptions): SymmioQueryOptions<GetListingSignInMessageReturnType, Error, GetListingSignInMessageReturnType, GetListingSignInMessageQueryKey>;
21
36
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EACnC,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM;;4BAGrC,6BAA6B,KAAG,OAAO,CAAC,6BAA6B,CAAC;EAGjG"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,6BAA6B,EACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACvC,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM;;4BAGrC,6BAA6B,KAAG,OAAO,CAAC,6BAA6B,CAAC;EAGjG;AAED,yFAAyF;AACzF,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,iCAAiC,GAAG,kBAAkB,iEAE9G;AACD,yBAAyB;AACzB,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACjG,gEAAgE;AAChE,MAAM,MAAM,8BAA8B,GAAG,iCAAiC,GAC5E,cAAc,CACZ,iCAAiC,EACjC,KAAK,EACL,iCAAiC,EACjC,+BAA+B,CAChC,CAAC;AACJ;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,8BAA8B,GACtC,kBAAkB,CACnB,iCAAiC,EACjC,KAAK,EACL,iCAAiC,EACjC,+BAA+B,CAChC,CAOA"}
@@ -1,12 +1,36 @@
1
- import { authenticateListing as e } from "./authenticate-listing.js";
1
+ import { filterQueryOptions as e } from "../../shared/utils/query.js";
2
+ import { getListingSignInMessage as t } from "./get-sign-in-message.js";
3
+ import { authenticateListing as n } from "./authenticate-listing.js";
2
4
  //#region src/pools/auth/query.ts
3
- function t(t) {
5
+ function r(e) {
4
6
  return {
5
7
  mutationKey: ["authenticateListing"],
6
- mutationFn: (n) => e(t, n)
8
+ mutationFn: (t) => n(e, t)
7
9
  };
8
10
  }
11
+ function i(t) {
12
+ return ["getListingSignInMessage", e({ ...t })];
13
+ }
14
+ function a(e, n) {
15
+ return {
16
+ ...n.query,
17
+ queryKey: i({
18
+ ...n,
19
+ configKey: o(e, n)
20
+ }),
21
+ enabled: n.query?.enabled ?? !0,
22
+ queryFn: () => t(e, n)
23
+ };
24
+ }
25
+ function o(e, t) {
26
+ try {
27
+ return e.getChainConfigKey(t.chainId);
28
+ } catch (e) {
29
+ if (t.query?.enabled === !1) return;
30
+ throw e;
31
+ }
32
+ }
9
33
  //#endregion
10
- export { t as authenticateListingMutationOptions };
34
+ export { r as authenticateListingMutationOptions, i as getListingSignInMessageQueryKey, a as getListingSignInMessageQueryOptions };
11
35
 
12
36
  //# sourceMappingURL=query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/auth/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport {\n authenticateListing,\n type AuthenticateListingParameters,\n type AuthenticateListingReturnType,\n} from \"./authenticate-listing\";\n\n/**\n * Build TanStack Mutation options for {@link authenticateListing}. Modeled as a\n * mutation (not a query): it signs a message with the wallet and exchanges it\n * for a bearer token.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * const { mutateAsync } = useMutation(authenticateListingMutationOptions(config));\n * const token = await mutateAsync({ domain: \"app.example.com\", uri: \"https://app.example.com\" });\n * ```\n */\nexport function authenticateListingMutationOptions(config: Config) {\n return {\n mutationKey: [\"authenticateListing\"] as const,\n mutationFn: (variables: AuthenticateListingParameters): Promise<AuthenticateListingReturnType> =>\n authenticateListing(config, variables),\n };\n}\n"],"mappings":";;AAqBA,SAAgB,EAAmC,GAAgB;CACjE,OAAO;EACL,aAAa,CAAC,qBAAqB;EACnC,aAAa,MACX,EAAoB,GAAQ,CAAS;CACzC;AACF"}
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/auth/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n authenticateListing,\n type AuthenticateListingParameters,\n type AuthenticateListingReturnType,\n} from \"./authenticate-listing\";\nimport {\n getListingSignInMessage,\n type GetListingSignInMessageParameters,\n type GetListingSignInMessageReturnType,\n} from \"./get-sign-in-message\";\n\n/**\n * Build TanStack Mutation options for {@link authenticateListing}. Modeled as a\n * mutation (not a query): it signs a message with the wallet and exchanges it\n * for a bearer token.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * const { mutateAsync } = useMutation(authenticateListingMutationOptions(config));\n * const token = await mutateAsync({ domain: \"app.example.com\", uri: \"https://app.example.com\" });\n * ```\n */\nexport function authenticateListingMutationOptions(config: Config) {\n return {\n mutationKey: [\"authenticateListing\"] as const,\n mutationFn: (variables: AuthenticateListingParameters): Promise<AuthenticateListingReturnType> =>\n authenticateListing(config, variables),\n };\n}\n\n/** Stable sign-in query identity, including deployment, wallet, origin and statement. */\nexport function getListingSignInMessageQueryKey(options: GetListingSignInMessageParameters & ConfigKeyParameter) {\n return [\"getListingSignInMessage\", filterQueryOptions({ ...options })] as const;\n}\n/** Sign-in query key. */\nexport type GetListingSignInMessageQueryKey = ReturnType<typeof getListingSignInMessageQueryKey>;\n/** Required challenge identity plus optional query controls. */\nexport type GetListingSignInMessageOptions = GetListingSignInMessageParameters &\n QueryParameter<\n GetListingSignInMessageReturnType,\n Error,\n GetListingSignInMessageReturnType,\n GetListingSignInMessageQueryKey\n >;\n/** Fetch a challenge without signing; React callers should normally use prefetchChallenge on useAuthenticateListing.\n * @param config - SDK configuration.\n * @param options - Wallet, origin, deployment and query controls.\n * @returns Options for a single-use sign-in challenge.\n */\nexport function getListingSignInMessageQueryOptions(\n config: Config,\n options: GetListingSignInMessageOptions,\n): SymmioQueryOptions<\n GetListingSignInMessageReturnType,\n Error,\n GetListingSignInMessageReturnType,\n GetListingSignInMessageQueryKey\n> {\n return {\n ...options.query,\n queryKey: getListingSignInMessageQueryKey({ ...options, configKey: challengeConfigKey(config, options) }),\n enabled: options.query?.enabled ?? true,\n queryFn: () => getListingSignInMessage(config, options),\n };\n}\n\nfunction challengeConfigKey(config: Config, options: GetListingSignInMessageOptions): string | undefined {\n try {\n return config.getChainConfigKey(options.chainId);\n } catch (error) {\n if (options.query?.enabled === false) return undefined;\n throw error;\n }\n}\n"],"mappings":";;;;AA6BA,SAAgB,EAAmC,GAAgB;CACjE,OAAO;EACL,aAAa,CAAC,qBAAqB;EACnC,aAAa,MACX,EAAoB,GAAQ,CAAS;CACzC;AACF;AAGA,SAAgB,EAAgC,GAAiE;CAC/G,OAAO,CAAC,2BAA2B,EAAmB,EAAE,GAAG,EAAQ,CAAC,CAAC;AACvE;AAgBA,SAAgB,EACd,GACA,GAMA;CACA,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAgC;GAAE,GAAG;GAAS,WAAW,EAAmB,GAAQ,CAAO;EAAE,CAAC;EACxG,SAAS,EAAQ,OAAO,WAAW;EACnC,eAAe,EAAwB,GAAQ,CAAO;CACxD;AACF;AAEA,SAAS,EAAmB,GAAgB,GAA6D;CACvG,IAAI;EACF,OAAO,EAAO,kBAAkB,EAAQ,OAAO;CACjD,SAAS,GAAO;EACd,IAAI,EAAQ,OAAO,YAAY,IAAO;EACtC,MAAM;CACR;AACF"}
@@ -7,7 +7,11 @@ import { ListingAuthToken, ListingSignInMessage, ListingSiweParams } from './typ
7
7
  * @param raw - The generated `SignInMessageResponseSchema` from the backend.
8
8
  * @returns The normalized sign-in message.
9
9
  */
10
- export declare function toListingSignInMessage(raw: SignInMessageResponseSchema): ListingSignInMessage;
10
+ export declare function toListingSignInMessage(raw: SignInMessageResponseSchema & {
11
+ params: {
12
+ expirationTime?: string | null;
13
+ };
14
+ }): ListingSignInMessage;
11
15
  /**
12
16
  * Rebuild the backend's `CustomSiweMessage` login payload from the normalized
13
17
  * SIWE params, so the login request echoes back the exact message the backend
@@ -1 +1 @@
1
- {"version":3,"file":"to-siwe.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/to-siwe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,2BAA2B,GAAG,oBAAoB,CAc7F;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAWhF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,KAAK,GAAG,gBAAgB,CAK/D"}
1
+ {"version":3,"file":"to-siwe.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/to-siwe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,2BAA2B,GAAG;IAAE,MAAM,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAAE,GAChF,oBAAoB,CAetB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAYhF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,KAAK,GAAG,gBAAgB,CAK/D"}
@@ -10,7 +10,8 @@ function e(e) {
10
10
  chainId: e.params.chainId,
11
11
  issuedAt: e.params.issuedAt,
12
12
  nonce: e.params.nonce,
13
- statement: e.params.statement
13
+ statement: e.params.statement,
14
+ ...e.params.expirationTime == null ? {} : { expirationTime: e.params.expirationTime }
14
15
  }
15
16
  };
16
17
  }
@@ -23,7 +24,8 @@ function t(e) {
23
24
  chainId: e.chainId,
24
25
  issuedAt: e.issuedAt,
25
26
  nonce: e.nonce,
26
- statement: e.statement
27
+ statement: e.statement,
28
+ ...e.expirationTime == null ? {} : { expirationTime: e.expirationTime }
27
29
  };
28
30
  }
29
31
  function n(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"to-siwe.js","names":[],"sources":["../../../src/pools/auth/to-siwe.ts"],"sourcesContent":["import type { CustomSiweMessage, SignInMessageResponseSchema, Token } from \"../types/generated/listing-backend\";\nimport type { ListingAuthToken, ListingSignInMessage, ListingSiweParams } from \"./types\";\n\n/**\n * Normalize the backend's raw sign-in challenge into the SDK's\n * {@link ListingSignInMessage}.\n *\n * @param raw - The generated `SignInMessageResponseSchema` from the backend.\n * @returns The normalized sign-in message.\n */\nexport function toListingSignInMessage(raw: SignInMessageResponseSchema): ListingSignInMessage {\n return {\n message: raw.message,\n params: {\n domain: raw.params.domain,\n address: raw.params.address,\n uri: raw.params.uri,\n version: raw.params.version,\n chainId: raw.params.chainId,\n issuedAt: raw.params.issuedAt,\n nonce: raw.params.nonce,\n statement: raw.params.statement,\n },\n };\n}\n\n/**\n * Rebuild the backend's `CustomSiweMessage` login payload from the normalized\n * SIWE params, so the login request echoes back the exact message the backend\n * minted.\n *\n * @param params - The normalized SIWE params from a sign-in challenge.\n * @returns The generated `CustomSiweMessage` to send in the login request.\n */\nexport function toCustomSiweMessage(params: ListingSiweParams): CustomSiweMessage {\n return {\n domain: params.domain,\n address: params.address,\n uri: params.uri,\n version: params.version,\n chainId: params.chainId,\n issuedAt: params.issuedAt,\n nonce: params.nonce,\n statement: params.statement,\n };\n}\n\n/**\n * Normalize the backend's raw `Token` into the SDK's {@link ListingAuthToken}.\n *\n * @param raw - The generated `Token` from a successful login.\n * @returns The normalized bearer token.\n */\nexport function toListingAuthToken(raw: Token): ListingAuthToken {\n return {\n accessToken: raw.accessToken,\n tokenType: raw.tokenType,\n };\n}\n"],"mappings":";AAUA,SAAgB,EAAuB,GAAwD;CAC7F,OAAO;EACL,SAAS,EAAI;EACb,QAAQ;GACN,QAAQ,EAAI,OAAO;GACnB,SAAS,EAAI,OAAO;GACpB,KAAK,EAAI,OAAO;GAChB,SAAS,EAAI,OAAO;GACpB,SAAS,EAAI,OAAO;GACpB,UAAU,EAAI,OAAO;GACrB,OAAO,EAAI,OAAO;GAClB,WAAW,EAAI,OAAO;EACxB;CACF;AACF;AAUA,SAAgB,EAAoB,GAA8C;CAChF,OAAO;EACL,QAAQ,EAAO;EACf,SAAS,EAAO;EAChB,KAAK,EAAO;EACZ,SAAS,EAAO;EAChB,SAAS,EAAO;EAChB,UAAU,EAAO;EACjB,OAAO,EAAO;EACd,WAAW,EAAO;CACpB;AACF;AAQA,SAAgB,EAAmB,GAA8B;CAC/D,OAAO;EACL,aAAa,EAAI;EACjB,WAAW,EAAI;CACjB;AACF"}
1
+ {"version":3,"file":"to-siwe.js","names":[],"sources":["../../../src/pools/auth/to-siwe.ts"],"sourcesContent":["import type { CustomSiweMessage, SignInMessageResponseSchema, Token } from \"../types/generated/listing-backend\";\nimport type { ListingAuthToken, ListingSignInMessage, ListingSiweParams } from \"./types\";\n\n/**\n * Normalize the backend's raw sign-in challenge into the SDK's\n * {@link ListingSignInMessage}.\n *\n * @param raw - The generated `SignInMessageResponseSchema` from the backend.\n * @returns The normalized sign-in message.\n */\nexport function toListingSignInMessage(\n raw: SignInMessageResponseSchema & { params: { expirationTime?: string | null } },\n): ListingSignInMessage {\n return {\n message: raw.message,\n params: {\n domain: raw.params.domain,\n address: raw.params.address,\n uri: raw.params.uri,\n version: raw.params.version,\n chainId: raw.params.chainId,\n issuedAt: raw.params.issuedAt,\n nonce: raw.params.nonce,\n statement: raw.params.statement,\n ...(raw.params.expirationTime != null ? { expirationTime: raw.params.expirationTime } : {}),\n },\n };\n}\n\n/**\n * Rebuild the backend's `CustomSiweMessage` login payload from the normalized\n * SIWE params, so the login request echoes back the exact message the backend\n * minted.\n *\n * @param params - The normalized SIWE params from a sign-in challenge.\n * @returns The generated `CustomSiweMessage` to send in the login request.\n */\nexport function toCustomSiweMessage(params: ListingSiweParams): CustomSiweMessage {\n return {\n domain: params.domain,\n address: params.address,\n uri: params.uri,\n version: params.version,\n chainId: params.chainId,\n issuedAt: params.issuedAt,\n nonce: params.nonce,\n statement: params.statement,\n ...(params.expirationTime != null ? { expirationTime: params.expirationTime } : {}),\n };\n}\n\n/**\n * Normalize the backend's raw `Token` into the SDK's {@link ListingAuthToken}.\n *\n * @param raw - The generated `Token` from a successful login.\n * @returns The normalized bearer token.\n */\nexport function toListingAuthToken(raw: Token): ListingAuthToken {\n return {\n accessToken: raw.accessToken,\n tokenType: raw.tokenType,\n };\n}\n"],"mappings":";AAUA,SAAgB,EACd,GACsB;CACtB,OAAO;EACL,SAAS,EAAI;EACb,QAAQ;GACN,QAAQ,EAAI,OAAO;GACnB,SAAS,EAAI,OAAO;GACpB,KAAK,EAAI,OAAO;GAChB,SAAS,EAAI,OAAO;GACpB,SAAS,EAAI,OAAO;GACpB,UAAU,EAAI,OAAO;GACrB,OAAO,EAAI,OAAO;GAClB,WAAW,EAAI,OAAO;GACtB,GAAI,EAAI,OAAO,kBAAkB,OAAuD,CAAC,IAAjD,EAAE,gBAAgB,EAAI,OAAO,eAAe;EACtF;CACF;AACF;AAUA,SAAgB,EAAoB,GAA8C;CAChF,OAAO;EACL,QAAQ,EAAO;EACf,SAAS,EAAO;EAChB,KAAK,EAAO;EACZ,SAAS,EAAO;EAChB,SAAS,EAAO;EAChB,UAAU,EAAO;EACjB,OAAO,EAAO;EACd,WAAW,EAAO;EAClB,GAAI,EAAO,kBAAkB,OAAmD,CAAC,IAA7C,EAAE,gBAAgB,EAAO,eAAe;CAC9E;AACF;AAQA,SAAgB,EAAmB,GAA8B;CAC/D,OAAO;EACL,aAAa,EAAI;EACjB,WAAW,EAAI;CACjB;AACF"}
@@ -32,6 +32,8 @@ export interface ListingSiweParams {
32
32
  nonce: string;
33
33
  /** Human-readable assertion the user signs. */
34
34
  statement: string;
35
+ /** Optional SIWE expiry, echoed unchanged in the exchange. */
36
+ expirationTime?: string;
35
37
  }
36
38
  /**
37
39
  * The listing backend's sign-in challenge: the full message to sign plus the
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,MAAM,EAAE,iBAAiB,CAAC;CAC3B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pools/auth/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,MAAM,EAAE,iBAAiB,CAAC;CAC3B"}
@@ -7,7 +7,7 @@ import { isAxiosError as a } from "axios";
7
7
  async function o(o, s) {
8
8
  let { url: c } = n(o, { chainId: s.chainId });
9
9
  try {
10
- return i((await r(s.withdrawId, {
10
+ return i((await r(encodeURIComponent(s.withdrawId), {
11
11
  baseURL: c,
12
12
  headers: { Authorization: `Bearer ${s.accessToken}` }
13
13
  })).data);
@@ -1 +1 @@
1
- {"version":3,"file":"cancel-withdraw.js","names":[],"sources":["../../../src/pools/cancel-withdraw/cancel-withdraw.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport type { PoolCancelWithdrawResult } from \"../types\";\nimport { cancelWithdrawV2MarketWithdrawWithdrawIdDelete } from \"../types/generated/listing-backend\";\nimport { toCancelWithdrawResult } from \"./to-cancel-withdraw-result\";\n\n/**\n * Parameters for {@link cancelWithdraw}.\n *\n * Pool listing is chain-level, so this takes only a `chainId`: the listing\n * backend is resolved from the chain. The endpoint is authed and scoped to the\n * caller — a user may only cancel their own queued withdrawal.\n */\nexport type CancelWithdrawParameters = Compute<\n ChainIdParameter & {\n /**\n * Bearer token from `authenticateListing`; required — the endpoint is authed.\n * Sent as the `Authorization: Bearer <token>` header; a bad or expired token\n * yields a `401`.\n */\n accessToken: string;\n /**\n * Id of the queued withdrawal to cancel — the `transactionId` of the pending\n * `withdraw` row from the pool's transaction history (`getPoolTransactions`),\n * whose `status` is still `PENDING`.\n */\n withdrawId: string;\n }\n>;\n\n/**\n * Return type of {@link cancelWithdraw}: the cancellation receipt — the affected\n * transaction id and its resulting status.\n */\nexport type CancelWithdrawReturnType = PoolCancelWithdrawResult;\n\n/**\n * Cancel a queued LP withdrawal — remove a pending withdrawal from the pool's\n * withdrawal queue before it settles.\n *\n * `DELETE`s `/v2/market/withdraw/{withdrawId}` with the caller's bearer token.\n * The `withdrawId` is the `transactionId` of a still-`PENDING` `withdraw` row\n * from {@link getPoolTransactions}. On success the shares return to the user's\n * available balance, so refetch {@link getUserProfit} to see `availableLpAmount`\n * rise and `pendingWithdrawLpAmount` fall. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token and the queued withdrawal's id.\n * @returns The cancellation receipt: the transaction id and its resulting status.\n * @throws {SymmApiError} `CANCEL_WITHDRAW_FAILED` when the endpoint request fails — including a `401` on a bad or expired token, a `404` for an unknown id, and the service's rejection when the withdrawal has already settled (no longer cancelable), which surface with the service's message and status as-is.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide the cancel action instead.\n *\n * @example\n * ```ts\n * const receipt = await cancelWithdraw(config, {\n * accessToken: token.accessToken,\n * withdrawId: pendingWithdrawal.transactionId,\n * });\n * ```\n */\nexport async function cancelWithdraw(\n config: Config,\n parameters: CancelWithdrawParameters,\n): Promise<CancelWithdrawReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n\n try {\n const response = await cancelWithdrawV2MarketWithdrawWithdrawIdDelete(parameters.withdrawId, {\n baseURL,\n headers: { Authorization: `Bearer ${parameters.accessToken}` },\n });\n\n return toCancelWithdrawResult(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"CANCEL_WITHDRAW_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"CANCEL_WITHDRAW_FAILED\",\n `Failed to cancel withdrawal: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;AAgEA,eAAsB,EACpB,GACA,GACmC;CACnC,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;CAEtF,IAAI;EAMF,OAAO,GAAuB,MALP,EAA+C,EAAW,YAAY;GAC3F;GACA,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAC/D,CAAC,GAEsC,IAAI;CAC7C,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA0B;EAAQ,CAAC,IAGzE,IAAI,EACR,OACA,0BACA,gCAAgC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC/E,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
1
+ {"version":3,"file":"cancel-withdraw.js","names":[],"sources":["../../../src/pools/cancel-withdraw/cancel-withdraw.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport type { PoolCancelWithdrawResult } from \"../types\";\nimport { cancelWithdrawV2MarketWithdrawWithdrawIdDelete } from \"../types/generated/listing-backend\";\nimport { toCancelWithdrawResult } from \"./to-cancel-withdraw-result\";\n\n/**\n * Parameters for {@link cancelWithdraw}.\n *\n * Pool listing is chain-level, so this takes only a `chainId`: the listing\n * backend is resolved from the chain. The endpoint is authed and scoped to the\n * caller — a user may only cancel their own queued withdrawal.\n */\nexport type CancelWithdrawParameters = Compute<\n ChainIdParameter & {\n /**\n * Bearer token from `authenticateListing`; required — the endpoint is authed.\n * Sent as the `Authorization: Bearer <token>` header; a bad or expired token\n * yields a `401`.\n */\n accessToken: string;\n /**\n * Id of the queued withdrawal to cancel — the `transactionId` of the pending\n * `withdraw` row from the pool's transaction history (`getPoolTransactions`),\n * whose `status` is still `PENDING`.\n */\n withdrawId: string;\n }\n>;\n\n/**\n * Return type of {@link cancelWithdraw}: the cancellation receipt — the affected\n * transaction id and its resulting status.\n */\nexport type CancelWithdrawReturnType = PoolCancelWithdrawResult;\n\n/**\n * Cancel a queued LP withdrawal — remove a pending withdrawal from the pool's\n * withdrawal queue before it settles.\n *\n * `DELETE`s `/v2/market/withdraw/{withdrawId}` with the caller's bearer token.\n * The `withdrawId` is the `transactionId` of a still-`PENDING` `withdraw` row\n * from {@link getPoolTransactions}. On success the shares return to the user's\n * available balance, so refetch {@link getUserProfit} to see `availableLpAmount`\n * rise and `pendingWithdrawLpAmount` fall. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token and the queued withdrawal's id.\n * @returns The cancellation receipt: the transaction id and its resulting status.\n * @throws {SymmApiError} `CANCEL_WITHDRAW_FAILED` when the endpoint request fails — including a `401` on a bad or expired token, a `404` for an unknown id, and the service's rejection when the withdrawal has already settled (no longer cancelable), which surface with the service's message and status as-is.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide the cancel action instead.\n *\n * @example\n * ```ts\n * const receipt = await cancelWithdraw(config, {\n * accessToken: token.accessToken,\n * withdrawId: pendingWithdrawal.transactionId,\n * });\n * ```\n */\nexport async function cancelWithdraw(\n config: Config,\n parameters: CancelWithdrawParameters,\n): Promise<CancelWithdrawReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n\n try {\n const response = await cancelWithdrawV2MarketWithdrawWithdrawIdDelete(encodeURIComponent(parameters.withdrawId), {\n baseURL,\n headers: { Authorization: `Bearer ${parameters.accessToken}` },\n });\n\n return toCancelWithdrawResult(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"CANCEL_WITHDRAW_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"CANCEL_WITHDRAW_FAILED\",\n `Failed to cancel withdrawal: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;AAgEA,eAAsB,EACpB,GACA,GACmC;CACnC,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;CAEtF,IAAI;EAMF,OAAO,GAAuB,MALP,EAA+C,mBAAmB,EAAW,UAAU,GAAG;GAC/G;GACA,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAC/D,CAAC,GAEsC,IAAI;CAC7C,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA0B;EAAQ,CAAC,IAGzE,IAAI,EACR,OACA,0BACA,gCAAgC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC/E,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
@@ -0,0 +1,11 @@
1
+ import { Config } from '../../core/config/index.js';
2
+ import { ChainIdParameter } from '../../shared/types/properties.js';
3
+ import { PoolClaim } from '../types.js';
4
+ /** Identity and bearer token for a single accepted claim. */
5
+ export type GetPoolClaimParameters = ChainIdParameter & {
6
+ claimRequestId: string;
7
+ accessToken: string;
8
+ };
9
+ /** Read a claim by its UUID, independently of a history page's current filters. */
10
+ export declare function getPoolClaim(config: Config, parameters: GetPoolClaimParameters): Promise<PoolClaim>;
11
+ //# sourceMappingURL=get-pool-claim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-claim.d.ts","sourceRoot":"","sources":["../../../src/pools/claim-history/get-pool-claim.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C,6DAA6D;AAC7D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAExG,mFAAmF;AACnF,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CAYzG"}
@@ -0,0 +1,25 @@
1
+ import { SymmApiError as e } from "../../shared/errors/symm-error.js";
2
+ import { resolveListingService as t } from "../resolve-listing.js";
3
+ import { getClaimProfitV2ClaimClaimRequestIdGet as n } from "../types/generated/listing-backend.js";
4
+ import { toPoolClaim as r } from "./to-pool-claim.js";
5
+ import { isAxiosError as i } from "axios";
6
+ //#region src/pools/claim-history/get-pool-claim.ts
7
+ async function a(a, o) {
8
+ let { url: s } = t(a, o);
9
+ try {
10
+ let { data: e } = await n(o.claimRequestId, {
11
+ baseURL: s,
12
+ headers: { Authorization: `Bearer ${o.accessToken}` }
13
+ });
14
+ return r(e);
15
+ } catch (t) {
16
+ throw i(t) ? e.fromAxios(t, {
17
+ code: "GET_POOL_CLAIM_FAILED",
18
+ baseURL: s
19
+ }) : t;
20
+ }
21
+ }
22
+ //#endregion
23
+ export { a as getPoolClaim };
24
+
25
+ //# sourceMappingURL=get-pool-claim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-pool-claim.js","names":[],"sources":["../../../src/pools/claim-history/get-pool-claim.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport type { PoolClaim } from \"../types\";\nimport { getClaimProfitV2ClaimClaimRequestIdGet } from \"../types/generated/listing-backend\";\nimport { toPoolClaim } from \"./to-pool-claim\";\n\n/** Identity and bearer token for a single accepted claim. */\nexport type GetPoolClaimParameters = ChainIdParameter & { claimRequestId: string; accessToken: string };\n\n/** Read a claim by its UUID, independently of a history page's current filters. */\nexport async function getPoolClaim(config: Config, parameters: GetPoolClaimParameters): Promise<PoolClaim> {\n const { url: baseURL } = resolveListingService(config, parameters);\n try {\n const { data } = await getClaimProfitV2ClaimClaimRequestIdGet(parameters.claimRequestId, {\n baseURL,\n headers: { Authorization: `Bearer ${parameters.accessToken}` },\n });\n return toPoolClaim(data);\n } catch (error) {\n if (isAxiosError(error)) throw SymmApiError.fromAxios(error, { code: \"GET_POOL_CLAIM_FAILED\", baseURL });\n throw error;\n }\n}\n"],"mappings":";;;;;;AAaA,eAAsB,EAAa,GAAgB,GAAwD;CACzG,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,CAAU;CACjE,IAAI;EACF,IAAM,EAAE,YAAS,MAAM,EAAuC,EAAW,gBAAgB;GACvF;GACA,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAC/D,CAAC;EACD,OAAO,EAAY,CAAI;CACzB,SAAS,GAAO;EAEd,MADI,EAAa,CAAK,IAAS,EAAa,UAAU,GAAO;GAAE,MAAM;GAAyB;EAAQ,CAAC,IACjG;CACR;AACF"}
@@ -1,4 +1,5 @@
1
1
  export * from './get-claim-history.js';
2
+ export * from './get-pool-claim.js';
2
3
  export * from './query.js';
3
4
  export * from './to-pool-claim.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/claim-history/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/claim-history/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"to-pool-claim.d.ts","sourceRoot":"","sources":["../../../src/pools/claim-history/to-pool-claim.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAE7G;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,sBAAsB,GAAG,SAAS,CAQlE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,0BAA0B,GAAG,oBAAoB,CAK5F"}
1
+ {"version":3,"file":"to-pool-claim.d.ts","sourceRoot":"","sources":["../../../src/pools/claim-history/to-pool-claim.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAE7G;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,sBAAsB,GAAG,SAAS,CAUlE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,0BAA0B,GAAG,oBAAoB,CAK5F"}
@@ -3,6 +3,8 @@ import { parseListingValue as e } from "../markets/to-listing-market.js";
3
3
  function t(t) {
4
4
  return {
5
5
  claimRequestId: t.claim_request_id,
6
+ walletId: t.wallet_id,
7
+ marketId: t.market_id,
6
8
  accountAddress: t.account_address,
7
9
  amount: e(t.amount) ?? 0n,
8
10
  transactionHash: t.transaction_hash ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"to-pool-claim.js","names":[],"sources":["../../../src/pools/claim-history/to-pool-claim.ts"],"sourcesContent":["import { parseListingValue } from \"../markets/to-listing-market\";\nimport type { PoolClaim, PoolClaimHistoryPage } from \"../types\";\nimport type { GetClaimResponseSchema, SearchClaimsResponseSchema } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw claim record into the SDK's {@link PoolClaim}.\n *\n * `amount` is the claimed USDC in **plain decimal units** (`\"0.0377\"`), the same\n * form as `claimable_reward` on `/v2/profit` — it is scaled up with\n * {@link parseListingValue} to the SDK's uniform 18-decimal `bigint`. The wire's\n * internal `wallet_id` / `market_id` UUIDs are dropped; they address rows in the\n * service, not anything a consumer renders.\n *\n * @param raw - One claim record from the search response.\n * @returns The normalized claim.\n */\nexport function toPoolClaim(raw: GetClaimResponseSchema): PoolClaim {\n return {\n claimRequestId: raw.claim_request_id,\n accountAddress: raw.account_address,\n amount: parseListingValue(raw.amount) ?? 0n,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time,\n };\n}\n\n/**\n * Map the `/v2/claim/search` envelope into a {@link PoolClaimHistoryPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toPoolClaimHistoryPage(raw: SearchClaimsResponseSchema): PoolClaimHistoryPage {\n return {\n count: raw.total,\n items: (raw.data ?? []).map(toPoolClaim),\n };\n}\n"],"mappings":";;AAgBA,SAAgB,EAAY,GAAwC;CAClE,OAAO;EACL,gBAAgB,EAAI;EACpB,gBAAgB,EAAI;EACpB,QAAQ,EAAkB,EAAI,MAAM,KAAK;EACzC,iBAAiB,EAAI,oBAAoB;EACzC,MAAM,EAAI;CACZ;AACF;AAQA,SAAgB,EAAuB,GAAuD;CAC5F,OAAO;EACL,OAAO,EAAI;EACX,QAAQ,EAAI,QAAQ,CAAC,GAAG,IAAI,CAAW;CACzC;AACF"}
1
+ {"version":3,"file":"to-pool-claim.js","names":[],"sources":["../../../src/pools/claim-history/to-pool-claim.ts"],"sourcesContent":["import { parseListingValue } from \"../markets/to-listing-market\";\nimport type { PoolClaim, PoolClaimHistoryPage } from \"../types\";\nimport type { GetClaimResponseSchema, SearchClaimsResponseSchema } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw claim record into the SDK's {@link PoolClaim}.\n *\n * `amount` is the claimed USDC in **plain decimal units** (`\"0.0377\"`), the same\n * form as `claimable_reward` on `/v2/profit` — it is scaled up with\n * {@link parseListingValue} to the SDK's uniform 18-decimal `bigint`. The wire's\n * internal `wallet_id` / `market_id` UUIDs are dropped; they address rows in the\n * service, not anything a consumer renders.\n *\n * @param raw - One claim record from the search response.\n * @returns The normalized claim.\n */\nexport function toPoolClaim(raw: GetClaimResponseSchema): PoolClaim {\n return {\n claimRequestId: raw.claim_request_id,\n walletId: raw.wallet_id,\n marketId: raw.market_id,\n accountAddress: raw.account_address,\n amount: parseListingValue(raw.amount) ?? 0n,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time,\n };\n}\n\n/**\n * Map the `/v2/claim/search` envelope into a {@link PoolClaimHistoryPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toPoolClaimHistoryPage(raw: SearchClaimsResponseSchema): PoolClaimHistoryPage {\n return {\n count: raw.total,\n items: (raw.data ?? []).map(toPoolClaim),\n };\n}\n"],"mappings":";;AAgBA,SAAgB,EAAY,GAAwC;CAClE,OAAO;EACL,gBAAgB,EAAI;EACpB,UAAU,EAAI;EACd,UAAU,EAAI;EACd,gBAAgB,EAAI;EACpB,QAAQ,EAAkB,EAAI,MAAM,KAAK;EACzC,iBAAiB,EAAI,oBAAoB;EACzC,MAAM,EAAI;CACZ;AACF;AAQA,SAAgB,EAAuB,GAAuD;CAC5F,OAAO;EACL,OAAO,EAAI;EACX,QAAQ,EAAI,QAAQ,CAAC,GAAG,IAAI,CAAW;CACzC;AACF"}
@@ -0,0 +1,16 @@
1
+ /** A source that could not supply a complete snapshot. Never contains credentials or response bodies. */
2
+ export interface PoolReadGap {
3
+ /** Read family, such as deposits, profit, detail, or listed. */
4
+ source: string;
5
+ /** Exact pool address, when the gap belongs to one pool. */
6
+ tokenContractAddress?: string;
7
+ /** Failed requests are distinct from bounded or repeated pagination. */
8
+ reason: "failed" | "truncated" | "repeated-page" | "ambiguous-address";
9
+ }
10
+ export declare function units(value: bigint | null | undefined): number | null;
11
+ export declare function readOptional<T>(read: () => Promise<T>, gaps: PoolReadGap[], source: string, tokenContractAddress?: string): Promise<T | null>;
12
+ export declare function readPages<T>(read: (offset: number) => Promise<{
13
+ items: T[];
14
+ total: number;
15
+ }>, identity: (item: T) => string, gaps: PoolReadGap[], source: string, maxPages?: number): Promise<T[]>;
16
+ //# sourceMappingURL=composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../src/pools/composition.ts"],"names":[],"mappings":"AAEA,yGAAyG;AACzG,MAAM,WAAW,WAAW;IAC1B,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wEAAwE;IACxE,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,eAAe,GAAG,mBAAmB,CAAC;CACxE;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAErE;AAED,wBAAsB,YAAY,CAAC,CAAC,EAClC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,IAAI,EAAE,WAAW,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,oBAAoB,CAAC,EAAE,MAAM,GAC5B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAUnB;AAED,wBAAsB,SAAS,CAAC,CAAC,EAC/B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAChE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC7B,IAAI,EAAE,WAAW,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,SAAK,GACZ,OAAO,CAAC,CAAC,EAAE,CAAC,CAmBd"}
@@ -0,0 +1,39 @@
1
+ import { formatUnits as e } from "viem";
2
+ //#region src/pools/composition.ts
3
+ function t(t) {
4
+ return t == null ? null : Number(e(t, 18));
5
+ }
6
+ async function n(e, t, n, r) {
7
+ try {
8
+ return await e();
9
+ } catch (e) {
10
+ if (e && typeof e == "object" && "status" in e && (e.status === 401 || e.status === 403)) throw e;
11
+ return t.push({
12
+ source: n,
13
+ tokenContractAddress: r,
14
+ reason: "failed"
15
+ }), null;
16
+ }
17
+ }
18
+ async function r(e, t, r, i, a = 10) {
19
+ let o = /* @__PURE__ */ new Map(), s = 0;
20
+ for (let c = 0; c < a; c++) {
21
+ let a = await n(() => e(s), r, i);
22
+ if (a == null) return [...o.values()];
23
+ let c = o.size;
24
+ for (let e of a.items) o.set(t(e), e);
25
+ if (s += a.items.length, o.size >= a.total) return [...o.values()];
26
+ if (o.size === c) return r.push({
27
+ source: i,
28
+ reason: "repeated-page"
29
+ }), [...o.values()];
30
+ }
31
+ return r.push({
32
+ source: i,
33
+ reason: "truncated"
34
+ }), [...o.values()];
35
+ }
36
+ //#endregion
37
+ export { n as readOptional, r as readPages, t as units };
38
+
39
+ //# sourceMappingURL=composition.js.map