@symmio/trading-react 1.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-layer/index.d.ts +1 -0
- package/dist/account-layer/index.d.ts.map +1 -1
- package/dist/account-layer/index.js +26 -25
- package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts +53 -0
- package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts.map +1 -0
- package/dist/account-layer/use-deallocate-and-initiate-withdraw.js +49 -0
- package/dist/account-layer/use-deallocate-and-initiate-withdraw.js.map +1 -0
- package/dist/account-layer/use-deposit-and-allocate.d.ts +4 -2
- package/dist/account-layer/use-deposit-and-allocate.d.ts.map +1 -1
- package/dist/account-layer/use-deposit-and-allocate.js +17 -15
- package/dist/account-layer/use-deposit-and-allocate.js.map +1 -1
- package/dist/account-layer/use-edit-account-name.d.ts.map +1 -1
- package/dist/account-layer/use-edit-account-name.js +14 -14
- package/dist/account-layer/use-edit-account-name.js.map +1 -1
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +1 -1
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.js.map +1 -1
- package/dist/candles/index.d.ts +5 -0
- package/dist/candles/index.d.ts.map +1 -0
- package/dist/candles/index.js +5 -0
- package/dist/candles/use-binance-candle-source.d.ts +27 -0
- package/dist/candles/use-binance-candle-source.d.ts.map +1 -0
- package/dist/candles/use-binance-candle-source.js +24 -0
- package/dist/candles/use-binance-candle-source.js.map +1 -0
- package/dist/candles/use-candle-stream.d.ts +65 -0
- package/dist/candles/use-candle-stream.d.ts.map +1 -0
- package/dist/candles/use-candle-stream.js +44 -0
- package/dist/candles/use-candle-stream.js.map +1 -0
- package/dist/candles/use-candles.d.ts +40 -0
- package/dist/candles/use-candles.d.ts.map +1 -0
- package/dist/candles/use-candles.js +22 -0
- package/dist/candles/use-candles.js.map +1 -0
- package/dist/candles/use-tradingview-datafeed.d.ts +31 -0
- package/dist/candles/use-tradingview-datafeed.d.ts.map +1 -0
- package/dist/candles/use-tradingview-datafeed.js +21 -0
- package/dist/candles/use-tradingview-datafeed.js.map +1 -0
- package/dist/index.d.ts +125 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +201 -113
- package/dist/instant-layer/index.d.ts +4 -0
- package/dist/instant-layer/index.d.ts.map +1 -1
- package/dist/instant-layer/index.js +10 -6
- package/dist/instant-layer/use-instant-close-auto.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-close-auto.js +12 -11
- package/dist/instant-layer/use-instant-close-auto.js.map +1 -1
- package/dist/instant-layer/use-instant-close-bulk-auto.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-close-bulk-auto.js +12 -11
- package/dist/instant-layer/use-instant-close-bulk-auto.js.map +1 -1
- package/dist/instant-layer/use-instant-close-bulk.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-close-bulk.js +12 -11
- package/dist/instant-layer/use-instant-close-bulk.js.map +1 -1
- package/dist/instant-layer/use-instant-close.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-close.js +12 -11
- package/dist/instant-layer/use-instant-close.js.map +1 -1
- package/dist/instant-layer/use-instant-open-auto.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-open-auto.js +12 -11
- package/dist/instant-layer/use-instant-open-auto.js.map +1 -1
- package/dist/instant-layer/use-instant-open-fees.d.ts +43 -0
- package/dist/instant-layer/use-instant-open-fees.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open-fees.js +111 -0
- package/dist/instant-layer/use-instant-open-fees.js.map +1 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-open-with-tpsl.js +34 -31
- package/dist/instant-layer/use-instant-open-with-tpsl.js.map +1 -1
- package/dist/instant-layer/use-instant-open.d.ts +23 -18
- package/dist/instant-layer/use-instant-open.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-open.js +12 -11
- package/dist/instant-layer/use-instant-open.js.map +1 -1
- package/dist/instant-layer/use-instant-opens.d.ts +6 -6
- package/dist/instant-layer/use-instant-opens.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-opens.js.map +1 -1
- package/dist/instant-layer/use-instant-trade-required-selectors.d.ts +25 -0
- package/dist/instant-layer/use-instant-trade-required-selectors.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-trade-required-selectors.js +13 -0
- package/dist/instant-layer/use-instant-trade-required-selectors.js.map +1 -0
- package/dist/instant-layer/use-limit-close-auto.d.ts +30 -0
- package/dist/instant-layer/use-limit-close-auto.d.ts.map +1 -0
- package/dist/instant-layer/use-limit-close-auto.js +33 -0
- package/dist/instant-layer/use-limit-close-auto.js.map +1 -0
- package/dist/instant-layer/use-limit-open-auto.d.ts +30 -0
- package/dist/instant-layer/use-limit-open-auto.d.ts.map +1 -0
- package/dist/instant-layer/use-limit-open-auto.js +33 -0
- package/dist/instant-layer/use-limit-open-auto.js.map +1 -0
- package/dist/inventory/index.d.ts +3 -0
- package/dist/inventory/index.d.ts.map +1 -0
- package/dist/inventory/index.js +3 -0
- package/dist/inventory/use-inventory-tvl-history.d.ts +27 -0
- package/dist/inventory/use-inventory-tvl-history.d.ts.map +1 -0
- package/dist/inventory/use-inventory-tvl-history.js +28 -0
- package/dist/inventory/use-inventory-tvl-history.js.map +1 -0
- package/dist/inventory/use-inventory-tvl.d.ts +23 -0
- package/dist/inventory/use-inventory-tvl.d.ts.map +1 -0
- package/dist/inventory/use-inventory-tvl.js +27 -0
- package/dist/inventory/use-inventory-tvl.js.map +1 -0
- package/dist/margin/index.d.ts +1 -0
- package/dist/margin/index.d.ts.map +1 -1
- package/dist/margin/use-account-margin-risk.d.ts +68 -0
- package/dist/margin/use-account-margin-risk.d.ts.map +1 -0
- package/dist/margin/use-account-margin-risk.js +31 -0
- package/dist/margin/use-account-margin-risk.js.map +1 -0
- package/dist/margin/use-available-instant-open-margin.d.ts +27 -7
- package/dist/margin/use-available-instant-open-margin.d.ts.map +1 -1
- package/dist/margin/use-available-instant-open-margin.js +117 -46
- package/dist/margin/use-available-instant-open-margin.js.map +1 -1
- package/dist/market-info/use-market-info.d.ts +13 -13
- package/dist/market-info/use-market-info.d.ts.map +1 -1
- package/dist/market-info/use-market-info.js.map +1 -1
- package/dist/markets/use-markets.d.ts +14 -8
- package/dist/markets/use-markets.d.ts.map +1 -1
- package/dist/markets/use-markets.js.map +1 -1
- package/dist/muon/index.d.ts +2 -0
- package/dist/muon/index.d.ts.map +1 -1
- package/dist/muon/use-force-close-price-sig.d.ts +34 -0
- package/dist/muon/use-force-close-price-sig.d.ts.map +1 -0
- package/dist/muon/use-force-close-price-sig.js +31 -0
- package/dist/muon/use-force-close-price-sig.js.map +1 -0
- package/dist/muon/use-send-quote-upnl-sig.d.ts +30 -0
- package/dist/muon/use-send-quote-upnl-sig.d.ts.map +1 -0
- package/dist/muon/use-send-quote-upnl-sig.js +28 -0
- package/dist/muon/use-send-quote-upnl-sig.js.map +1 -0
- package/dist/notifications/use-search-notifications.d.ts +12 -12
- package/dist/notifications/use-search-notifications.d.ts.map +1 -1
- package/dist/notifications/use-search-notifications.js.map +1 -1
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +7 -7
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts.map +1 -1
- package/dist/notional-cap/use-notional-cap-by-symbol-id.js.map +1 -1
- package/dist/orderbook/index.d.ts +5 -0
- package/dist/orderbook/index.d.ts.map +1 -0
- package/dist/orderbook/index.js +5 -0
- package/dist/orderbook/use-binance-orderbook-source.d.ts +28 -0
- package/dist/orderbook/use-binance-orderbook-source.d.ts.map +1 -0
- package/dist/orderbook/use-binance-orderbook-source.js +26 -0
- package/dist/orderbook/use-binance-orderbook-source.js.map +1 -0
- package/dist/orderbook/use-live-orderbook.d.ts +104 -0
- package/dist/orderbook/use-live-orderbook.d.ts.map +1 -0
- package/dist/orderbook/use-live-orderbook.js +77 -0
- package/dist/orderbook/use-live-orderbook.js.map +1 -0
- package/dist/orderbook/use-orderbook-stream.d.ts +73 -0
- package/dist/orderbook/use-orderbook-stream.d.ts.map +1 -0
- package/dist/orderbook/use-orderbook-stream.js +49 -0
- package/dist/orderbook/use-orderbook-stream.js.map +1 -0
- package/dist/orderbook/use-orderbook.d.ts +35 -0
- package/dist/orderbook/use-orderbook.d.ts.map +1 -0
- package/dist/orderbook/use-orderbook.js +22 -0
- package/dist/orderbook/use-orderbook.js.map +1 -0
- package/dist/pools/index.d.ts +30 -0
- package/dist/pools/index.d.ts.map +1 -0
- package/dist/pools/index.js +30 -0
- package/dist/pools/use-add-market.d.ts +57 -0
- package/dist/pools/use-add-market.d.ts.map +1 -0
- package/dist/pools/use-add-market.js +30 -0
- package/dist/pools/use-add-market.js.map +1 -0
- package/dist/pools/use-authenticate-listing.d.ts +45 -0
- package/dist/pools/use-authenticate-listing.d.ts.map +1 -0
- package/dist/pools/use-authenticate-listing.js +30 -0
- package/dist/pools/use-authenticate-listing.js.map +1 -0
- package/dist/pools/use-cancel-withdraw.d.ts +47 -0
- package/dist/pools/use-cancel-withdraw.d.ts.map +1 -0
- package/dist/pools/use-cancel-withdraw.js +30 -0
- package/dist/pools/use-cancel-withdraw.js.map +1 -0
- package/dist/pools/use-claim-history.d.ts +25 -0
- package/dist/pools/use-claim-history.d.ts.map +1 -0
- package/dist/pools/use-claim-history.js +27 -0
- package/dist/pools/use-claim-history.js.map +1 -0
- package/dist/pools/use-claim-profit.d.ts +53 -0
- package/dist/pools/use-claim-profit.d.ts.map +1 -0
- package/dist/pools/use-claim-profit.js +30 -0
- package/dist/pools/use-claim-profit.js.map +1 -0
- package/dist/pools/use-deposit-address.d.ts +43 -0
- package/dist/pools/use-deposit-address.d.ts.map +1 -0
- package/dist/pools/use-deposit-address.js +28 -0
- package/dist/pools/use-deposit-address.js.map +1 -0
- package/dist/pools/use-listing-config.d.ts +28 -0
- package/dist/pools/use-listing-config.d.ts.map +1 -0
- package/dist/pools/use-listing-config.js +27 -0
- package/dist/pools/use-listing-config.js.map +1 -0
- package/dist/pools/use-listing-market-config-projection.d.ts +66 -0
- package/dist/pools/use-listing-market-config-projection.d.ts.map +1 -0
- package/dist/pools/use-listing-market-config-projection.js +57 -0
- package/dist/pools/use-listing-market-config-projection.js.map +1 -0
- package/dist/pools/use-listing-market-config.d.ts +49 -0
- package/dist/pools/use-listing-market-config.d.ts.map +1 -0
- package/dist/pools/use-listing-market-config.js +28 -0
- package/dist/pools/use-listing-market-config.js.map +1 -0
- package/dist/pools/use-listing-market-detail.d.ts +29 -0
- package/dist/pools/use-listing-market-detail.d.ts.map +1 -0
- package/dist/pools/use-listing-market-detail.js +27 -0
- package/dist/pools/use-listing-market-detail.js.map +1 -0
- package/dist/pools/use-listing-markets.d.ts +32 -0
- package/dist/pools/use-listing-markets.d.ts.map +1 -0
- package/dist/pools/use-listing-markets.js +27 -0
- package/dist/pools/use-listing-markets.js.map +1 -0
- package/dist/pools/use-listing-status.d.ts +29 -0
- package/dist/pools/use-listing-status.d.ts.map +1 -0
- package/dist/pools/use-listing-status.js +28 -0
- package/dist/pools/use-listing-status.js.map +1 -0
- package/dist/pools/use-pool-quotes.d.ts +26 -0
- package/dist/pools/use-pool-quotes.d.ts.map +1 -0
- package/dist/pools/use-pool-quotes.js +27 -0
- package/dist/pools/use-pool-quotes.js.map +1 -0
- package/dist/pools/use-pool-reward-chart.d.ts +32 -0
- package/dist/pools/use-pool-reward-chart.d.ts.map +1 -0
- package/dist/pools/use-pool-reward-chart.js +28 -0
- package/dist/pools/use-pool-reward-chart.js.map +1 -0
- package/dist/pools/use-pool-total-reward.d.ts +27 -0
- package/dist/pools/use-pool-total-reward.d.ts.map +1 -0
- package/dist/pools/use-pool-total-reward.js +28 -0
- package/dist/pools/use-pool-total-reward.js.map +1 -0
- package/dist/pools/use-pool-trade-history.d.ts +26 -0
- package/dist/pools/use-pool-trade-history.d.ts.map +1 -0
- package/dist/pools/use-pool-trade-history.js +27 -0
- package/dist/pools/use-pool-trade-history.js.map +1 -0
- package/dist/pools/use-pool-transactions.d.ts +23 -0
- package/dist/pools/use-pool-transactions.d.ts.map +1 -0
- package/dist/pools/use-pool-transactions.js +27 -0
- package/dist/pools/use-pool-transactions.js.map +1 -0
- package/dist/pools/use-refund-market.d.ts +51 -0
- package/dist/pools/use-refund-market.d.ts.map +1 -0
- package/dist/pools/use-refund-market.js +30 -0
- package/dist/pools/use-refund-market.js.map +1 -0
- package/dist/pools/use-retry-listing-info.d.ts +23 -0
- package/dist/pools/use-retry-listing-info.d.ts.map +1 -0
- package/dist/pools/use-retry-listing-info.js +27 -0
- package/dist/pools/use-retry-listing-info.js.map +1 -0
- package/dist/pools/use-retry-listing.d.ts +46 -0
- package/dist/pools/use-retry-listing.d.ts.map +1 -0
- package/dist/pools/use-retry-listing.js +30 -0
- package/dist/pools/use-retry-listing.js.map +1 -0
- package/dist/pools/use-supports-listing-service.d.ts +21 -0
- package/dist/pools/use-supports-listing-service.d.ts.map +1 -0
- package/dist/pools/use-supports-listing-service.js +13 -0
- package/dist/pools/use-supports-listing-service.js.map +1 -0
- package/dist/pools/use-update-listing-market-config.d.ts +60 -0
- package/dist/pools/use-update-listing-market-config.d.ts.map +1 -0
- package/dist/pools/use-update-listing-market-config.js +30 -0
- package/dist/pools/use-update-listing-market-config.js.map +1 -0
- package/dist/pools/use-user-listing-markets.d.ts +40 -0
- package/dist/pools/use-user-listing-markets.d.ts.map +1 -0
- package/dist/pools/use-user-listing-markets.js +28 -0
- package/dist/pools/use-user-listing-markets.js.map +1 -0
- package/dist/pools/use-user-profit.d.ts +39 -0
- package/dist/pools/use-user-profit.d.ts.map +1 -0
- package/dist/pools/use-user-profit.js +28 -0
- package/dist/pools/use-user-profit.js.map +1 -0
- package/dist/pools/use-user-reward-chart.d.ts +28 -0
- package/dist/pools/use-user-reward-chart.d.ts.map +1 -0
- package/dist/pools/use-user-reward-chart.js +28 -0
- package/dist/pools/use-user-reward-chart.js.map +1 -0
- package/dist/pools/use-user-total-reward.d.ts +30 -0
- package/dist/pools/use-user-total-reward.d.ts.map +1 -0
- package/dist/pools/use-user-total-reward.js +28 -0
- package/dist/pools/use-user-total-reward.js.map +1 -0
- package/dist/pools/use-user-transactions.d.ts +24 -0
- package/dist/pools/use-user-transactions.d.ts.map +1 -0
- package/dist/pools/use-user-transactions.js +27 -0
- package/dist/pools/use-user-transactions.js.map +1 -0
- package/dist/pools/use-weekly-listing-limit.d.ts +28 -0
- package/dist/pools/use-weekly-listing-limit.d.ts.map +1 -0
- package/dist/pools/use-weekly-listing-limit.js +28 -0
- package/dist/pools/use-weekly-listing-limit.js.map +1 -0
- package/dist/pools/use-withdraw-lp.d.ts +52 -0
- package/dist/pools/use-withdraw-lp.d.ts.map +1 -0
- package/dist/pools/use-withdraw-lp.js +30 -0
- package/dist/pools/use-withdraw-lp.js.map +1 -0
- package/dist/price-service/index.d.ts +8 -0
- package/dist/price-service/index.d.ts.map +1 -1
- package/dist/price-service/index.js +17 -9
- package/dist/price-service/use-binance-health.d.ts +16 -0
- package/dist/price-service/use-binance-health.d.ts.map +1 -0
- package/dist/price-service/use-binance-health.js +27 -0
- package/dist/price-service/use-binance-health.js.map +1 -0
- package/dist/price-service/use-binance-premium-index.d.ts +24 -0
- package/dist/price-service/use-binance-premium-index.d.ts.map +1 -0
- package/dist/price-service/use-binance-premium-index.js +27 -0
- package/dist/price-service/use-binance-premium-index.js.map +1 -0
- package/dist/price-service/use-binance-prices.d.ts +54 -0
- package/dist/price-service/use-binance-prices.d.ts.map +1 -0
- package/dist/price-service/use-binance-prices.js +57 -0
- package/dist/price-service/use-binance-prices.js.map +1 -0
- package/dist/price-service/use-binance-symbols-info.d.ts +18 -0
- package/dist/price-service/use-binance-symbols-info.d.ts.map +1 -0
- package/dist/price-service/use-binance-symbols-info.js +27 -0
- package/dist/price-service/use-binance-symbols-info.js.map +1 -0
- package/dist/price-service/use-enigma-price-by-market-id.d.ts +7 -1
- package/dist/price-service/use-enigma-price-by-market-id.d.ts.map +1 -1
- package/dist/price-service/use-enigma-price-by-market-id.js +1 -1
- package/dist/price-service/use-enigma-price-by-market-id.js.map +1 -1
- package/dist/price-service/use-mark-prices.d.ts +25 -0
- package/dist/price-service/use-mark-prices.d.ts.map +1 -0
- package/dist/price-service/use-mark-prices.js +27 -0
- package/dist/price-service/use-mark-prices.js.map +1 -0
- package/dist/price-service/use-price-by-market-id.d.ts +53 -0
- package/dist/price-service/use-price-by-market-id.d.ts.map +1 -0
- package/dist/price-service/use-price-by-market-id.js +33 -0
- package/dist/price-service/use-price-by-market-id.js.map +1 -0
- package/dist/price-service/use-price-by-name.d.ts +48 -0
- package/dist/price-service/use-price-by-name.d.ts.map +1 -0
- package/dist/price-service/use-price-by-name.js +23 -0
- package/dist/price-service/use-price-by-name.js.map +1 -0
- package/dist/price-service/use-prices.d.ts +87 -0
- package/dist/price-service/use-prices.d.ts.map +1 -0
- package/dist/price-service/use-prices.js +77 -0
- package/dist/price-service/use-prices.js.map +1 -0
- package/dist/provider/symmio-provider.d.ts +8 -2
- package/dist/provider/symmio-provider.d.ts.map +1 -1
- package/dist/provider/symmio-provider.js +19 -19
- package/dist/provider/symmio-provider.js.map +1 -1
- package/dist/quotes/confirm-hold.d.ts +121 -0
- package/dist/quotes/confirm-hold.d.ts.map +1 -0
- package/dist/quotes/confirm-hold.js +59 -0
- package/dist/quotes/confirm-hold.js.map +1 -0
- package/dist/quotes/index.d.ts +14 -0
- package/dist/quotes/index.d.ts.map +1 -1
- package/dist/quotes/use-account-upnl.d.ts +66 -0
- package/dist/quotes/use-account-upnl.d.ts.map +1 -0
- package/dist/quotes/use-account-upnl.js +73 -0
- package/dist/quotes/use-account-upnl.js.map +1 -0
- package/dist/quotes/use-close-quote-group.d.ts +126 -0
- package/dist/quotes/use-close-quote-group.d.ts.map +1 -0
- package/dist/quotes/use-close-quote-group.js +172 -0
- package/dist/quotes/use-close-quote-group.js.map +1 -0
- package/dist/quotes/use-cool-downs-of-ma.d.ts +26 -0
- package/dist/quotes/use-cool-downs-of-ma.d.ts.map +1 -0
- package/dist/quotes/use-cool-downs-of-ma.js +27 -0
- package/dist/quotes/use-cool-downs-of-ma.js.map +1 -0
- package/dist/quotes/use-force-cancel-close-request.d.ts +27 -0
- package/dist/quotes/use-force-cancel-close-request.d.ts.map +1 -0
- package/dist/quotes/use-force-cancel-close-request.js +41 -0
- package/dist/quotes/use-force-cancel-close-request.js.map +1 -0
- package/dist/quotes/use-force-cancel-quote.d.ts +26 -0
- package/dist/quotes/use-force-cancel-quote.d.ts.map +1 -0
- package/dist/quotes/use-force-cancel-quote.js +42 -0
- package/dist/quotes/use-force-cancel-quote.js.map +1 -0
- package/dist/quotes/use-force-close-eligibility.d.ts +30 -0
- package/dist/quotes/use-force-close-eligibility.d.ts.map +1 -0
- package/dist/quotes/use-force-close-eligibility.js +39 -0
- package/dist/quotes/use-force-close-eligibility.js.map +1 -0
- package/dist/quotes/use-force-close-params.d.ts +22 -0
- package/dist/quotes/use-force-close-params.d.ts.map +1 -0
- package/dist/quotes/use-force-close-params.js +27 -0
- package/dist/quotes/use-force-close-params.js.map +1 -0
- package/dist/quotes/use-force-close.d.ts +30 -0
- package/dist/quotes/use-force-close.d.ts.map +1 -0
- package/dist/quotes/use-force-close.js +38 -0
- package/dist/quotes/use-force-close.js.map +1 -0
- package/dist/quotes/use-grouped-quotes.d.ts +50 -10
- package/dist/quotes/use-grouped-quotes.d.ts.map +1 -1
- package/dist/quotes/use-grouped-quotes.js +40 -14
- package/dist/quotes/use-grouped-quotes.js.map +1 -1
- package/dist/quotes/use-grouping-isolation.d.ts +35 -0
- package/dist/quotes/use-grouping-isolation.d.ts.map +1 -0
- package/dist/quotes/use-grouping-isolation.js +39 -0
- package/dist/quotes/use-grouping-isolation.js.map +1 -0
- package/dist/quotes/use-limit-orders.d.ts +62 -0
- package/dist/quotes/use-limit-orders.d.ts.map +1 -0
- package/dist/quotes/use-limit-orders.js +82 -0
- package/dist/quotes/use-limit-orders.js.map +1 -0
- package/dist/quotes/use-managed-quotes.d.ts.map +1 -1
- package/dist/quotes/use-managed-quotes.js +198 -166
- package/dist/quotes/use-managed-quotes.js.map +1 -1
- package/dist/quotes/use-party-a-open-positions.d.ts +26 -6
- package/dist/quotes/use-party-a-open-positions.d.ts.map +1 -1
- package/dist/quotes/use-party-a-open-positions.js +32 -12
- package/dist/quotes/use-party-a-open-positions.js.map +1 -1
- package/dist/quotes/use-quote-funding.d.ts +2 -2
- package/dist/quotes/use-quote-funding.js.map +1 -1
- package/dist/quotes/use-quote-group-funding-history.d.ts +70 -0
- package/dist/quotes/use-quote-group-funding-history.d.ts.map +1 -0
- package/dist/quotes/use-quote-group-funding-history.js +38 -0
- package/dist/quotes/use-quote-group-funding-history.js.map +1 -0
- package/dist/quotes/use-quote-group-funding.d.ts +67 -0
- package/dist/quotes/use-quote-group-funding.d.ts.map +1 -0
- package/dist/quotes/use-quote-group-funding.js +26 -0
- package/dist/quotes/use-quote-group-funding.js.map +1 -0
- package/dist/quotes/use-quote-group-margin-risk.d.ts +111 -0
- package/dist/quotes/use-quote-group-margin-risk.d.ts.map +1 -0
- package/dist/quotes/use-quote-group-margin-risk.js +63 -0
- package/dist/quotes/use-quote-group-margin-risk.js.map +1 -0
- package/dist/quotes/use-quote-upnl-and-pnl.d.ts +4 -3
- package/dist/quotes/use-quote-upnl-and-pnl.d.ts.map +1 -1
- package/dist/quotes/use-quote-upnl-and-pnl.js +2 -1
- package/dist/quotes/use-quote-upnl-and-pnl.js.map +1 -1
- package/dist/quotes/use-quotes-funding.d.ts +46 -10
- package/dist/quotes/use-quotes-funding.d.ts.map +1 -1
- package/dist/quotes/use-quotes-funding.js +44 -42
- package/dist/quotes/use-quotes-funding.js.map +1 -1
- package/dist/quotes/use-request-to-cancel-close-request.d.ts +27 -0
- package/dist/quotes/use-request-to-cancel-close-request.d.ts.map +1 -0
- package/dist/quotes/use-request-to-cancel-close-request.js +41 -0
- package/dist/quotes/use-request-to-cancel-close-request.js.map +1 -0
- package/dist/quotes/use-request-to-cancel-quote.d.ts +32 -0
- package/dist/quotes/use-request-to-cancel-quote.d.ts.map +1 -0
- package/dist/quotes/use-request-to-cancel-quote.js +42 -0
- package/dist/quotes/use-request-to-cancel-quote.js.map +1 -0
- package/dist/rasa-solver/index.d.ts +7 -0
- package/dist/rasa-solver/index.d.ts.map +1 -0
- package/dist/rasa-solver/use-error-message.d.ts +14 -0
- package/dist/rasa-solver/use-error-message.d.ts.map +1 -0
- package/dist/rasa-solver/use-error-message.js +27 -0
- package/dist/rasa-solver/use-error-message.js.map +1 -0
- package/dist/rasa-solver/use-party-a-upnl.d.ts +14 -0
- package/dist/rasa-solver/use-party-a-upnl.d.ts.map +1 -0
- package/dist/rasa-solver/use-party-a-upnl.js +27 -0
- package/dist/rasa-solver/use-party-a-upnl.js.map +1 -0
- package/dist/rasa-solver/use-solver-balance-info.d.ts +14 -0
- package/dist/rasa-solver/use-solver-balance-info.d.ts.map +1 -0
- package/dist/rasa-solver/use-solver-balance-info.js +27 -0
- package/dist/rasa-solver/use-solver-balance-info.js.map +1 -0
- package/dist/rasa-solver/use-solver-open-interest.d.ts +14 -0
- package/dist/rasa-solver/use-solver-open-interest.d.ts.map +1 -0
- package/dist/rasa-solver/use-solver-open-interest.js +27 -0
- package/dist/rasa-solver/use-solver-open-interest.js.map +1 -0
- package/dist/rasa-solver/use-solver-price-range.d.ts +14 -0
- package/dist/rasa-solver/use-solver-price-range.d.ts.map +1 -0
- package/dist/rasa-solver/use-solver-price-range.js +27 -0
- package/dist/rasa-solver/use-solver-price-range.js.map +1 -0
- package/dist/rasa-solver/use-solver-readiness.d.ts +13 -0
- package/dist/rasa-solver/use-solver-readiness.d.ts.map +1 -0
- package/dist/rasa-solver/use-solver-readiness.js +27 -0
- package/dist/rasa-solver/use-solver-readiness.js.map +1 -0
- package/dist/revenue-records/index.d.ts +2 -0
- package/dist/revenue-records/index.d.ts.map +1 -0
- package/dist/revenue-records/use-revenue-records.d.ts +25 -0
- package/dist/revenue-records/use-revenue-records.d.ts.map +1 -0
- package/dist/revenue-records/use-revenue-records.js +27 -0
- package/dist/revenue-records/use-revenue-records.js.map +1 -0
- package/dist/solvers/index.d.ts +3 -0
- package/dist/solvers/index.d.ts.map +1 -0
- package/dist/solvers/use-solver-capabilities.d.ts +31 -0
- package/dist/solvers/use-solver-capabilities.d.ts.map +1 -0
- package/dist/solvers/use-solver-capabilities.js +30 -0
- package/dist/solvers/use-solver-capabilities.js.map +1 -0
- package/dist/solvers/use-solver-revenue.d.ts +28 -0
- package/dist/solvers/use-solver-revenue.d.ts.map +1 -0
- package/dist/solvers/use-solver-revenue.js +27 -0
- package/dist/solvers/use-solver-revenue.js.map +1 -0
- package/dist/symbols/index.d.ts +2 -0
- package/dist/symbols/index.d.ts.map +1 -0
- package/dist/symbols/use-symbols.d.ts +25 -0
- package/dist/symbols/use-symbols.d.ts.map +1 -0
- package/dist/symbols/use-symbols.js +27 -0
- package/dist/symbols/use-symbols.js.map +1 -0
- package/dist/tpsl/apply-tpsl-search-snapshot.d.ts +33 -0
- package/dist/tpsl/apply-tpsl-search-snapshot.d.ts.map +1 -0
- package/dist/tpsl/apply-tpsl-search-snapshot.js +51 -0
- package/dist/tpsl/apply-tpsl-search-snapshot.js.map +1 -0
- package/dist/tpsl/await-tpsl-confirmation.d.ts +77 -0
- package/dist/tpsl/await-tpsl-confirmation.d.ts.map +1 -0
- package/dist/tpsl/await-tpsl-confirmation.js +42 -0
- package/dist/tpsl/await-tpsl-confirmation.js.map +1 -0
- package/dist/tpsl/index.d.ts +11 -0
- package/dist/tpsl/index.d.ts.map +1 -1
- package/dist/tpsl/invalidate-tpsl.d.ts +23 -0
- package/dist/tpsl/invalidate-tpsl.d.ts.map +1 -0
- package/dist/tpsl/invalidate-tpsl.js +14 -0
- package/dist/tpsl/invalidate-tpsl.js.map +1 -0
- package/dist/tpsl/match-tpsl-notification.d.ts +27 -0
- package/dist/tpsl/match-tpsl-notification.d.ts.map +1 -0
- package/dist/tpsl/match-tpsl-notification.js +22 -0
- package/dist/tpsl/match-tpsl-notification.js.map +1 -0
- package/dist/tpsl/run-with-concurrency.d.ts +20 -0
- package/dist/tpsl/run-with-concurrency.d.ts.map +1 -0
- package/dist/tpsl/run-with-concurrency.js +15 -0
- package/dist/tpsl/run-with-concurrency.js.map +1 -0
- package/dist/tpsl/settled-side.d.ts +31 -0
- package/dist/tpsl/settled-side.d.ts.map +1 -0
- package/dist/tpsl/settled-side.js +21 -0
- package/dist/tpsl/settled-side.js.map +1 -0
- package/dist/tpsl/tpsl-fallback-poll.d.ts +74 -0
- package/dist/tpsl/tpsl-fallback-poll.d.ts.map +1 -0
- package/dist/tpsl/tpsl-fallback-poll.js +101 -0
- package/dist/tpsl/tpsl-fallback-poll.js.map +1 -0
- package/dist/tpsl/tpsl-store.d.ts +98 -2
- package/dist/tpsl/tpsl-store.d.ts.map +1 -1
- package/dist/tpsl/tpsl-store.js +111 -63
- package/dist/tpsl/tpsl-store.js.map +1 -1
- package/dist/tpsl/use-delete-quote-group-tpsl.d.ts +165 -0
- package/dist/tpsl/use-delete-quote-group-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-delete-quote-group-tpsl.js +247 -0
- package/dist/tpsl/use-delete-quote-group-tpsl.js.map +1 -0
- package/dist/tpsl/use-delete-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-delete-quote-tpsl.js +11 -10
- package/dist/tpsl/use-delete-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-quote-group-tpsl-editor.d.ts +66 -0
- package/dist/tpsl/use-quote-group-tpsl-editor.d.ts.map +1 -0
- package/dist/tpsl/use-quote-group-tpsl-editor.js +78 -0
- package/dist/tpsl/use-quote-group-tpsl-editor.js.map +1 -0
- package/dist/tpsl/use-quote-group-tpsl.d.ts +74 -0
- package/dist/tpsl/use-quote-group-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-quote-group-tpsl.js +67 -0
- package/dist/tpsl/use-quote-group-tpsl.js.map +1 -0
- package/dist/tpsl/use-quote-tpsl.d.ts +18 -2
- package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-quote-tpsl.js +32 -24
- package/dist/tpsl/use-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-search-tpsl-orders.d.ts +30 -0
- package/dist/tpsl/use-search-tpsl-orders.d.ts.map +1 -0
- package/dist/tpsl/use-search-tpsl-orders.js +27 -0
- package/dist/tpsl/use-search-tpsl-orders.js.map +1 -0
- package/dist/tpsl/use-set-quote-group-tpsl.d.ts +234 -0
- package/dist/tpsl/use-set-quote-group-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-set-quote-group-tpsl.js +358 -0
- package/dist/tpsl/use-set-quote-group-tpsl.js.map +1 -0
- package/dist/tpsl/use-set-quote-tpsl.d.ts +4 -4
- package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-set-quote-tpsl.js +15 -12
- package/dist/tpsl/use-set-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-tpsl-supported.d.ts +22 -0
- package/dist/tpsl/use-tpsl-supported.d.ts.map +1 -0
- package/dist/tpsl/use-tpsl-supported.js +16 -0
- package/dist/tpsl/use-tpsl-supported.js.map +1 -0
- package/dist/tpsl/use-watch-tpsl-accounts.d.ts +33 -0
- package/dist/tpsl/use-watch-tpsl-accounts.d.ts.map +1 -0
- package/dist/tpsl/use-watch-tpsl-accounts.js +44 -0
- package/dist/tpsl/use-watch-tpsl-accounts.js.map +1 -0
- package/dist/trade-volume/index.d.ts +2 -0
- package/dist/trade-volume/index.d.ts.map +1 -0
- package/dist/trade-volume/use-trade-volume.d.ts +26 -0
- package/dist/trade-volume/use-trade-volume.d.ts.map +1 -0
- package/dist/trade-volume/use-trade-volume.js +27 -0
- package/dist/trade-volume/use-trade-volume.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/invalidate-account-balances.d.ts +36 -0
- package/dist/utils/invalidate-account-balances.d.ts.map +1 -0
- package/dist/utils/invalidate-account-balances.js +10 -0
- package/dist/utils/invalidate-account-balances.js.map +1 -0
- package/dist/websocket/use-notifications.d.ts +3 -1
- package/dist/websocket/use-notifications.d.ts.map +1 -1
- package/dist/websocket/use-notifications.js +22 -20
- package/dist/websocket/use-notifications.js.map +1 -1
- package/dist/withdraw/index.d.ts +1 -0
- package/dist/withdraw/index.d.ts.map +1 -1
- package/dist/withdraw/use-initiate-withdraw.d.ts +1 -1
- package/dist/withdraw/use-initiate-withdraw.js.map +1 -1
- package/dist/withdraw/use-request-cancel-withdraw.d.ts +4 -2
- package/dist/withdraw/use-request-cancel-withdraw.d.ts.map +1 -1
- package/dist/withdraw/use-request-cancel-withdraw.js +15 -13
- package/dist/withdraw/use-request-cancel-withdraw.js.map +1 -1
- package/dist/withdraw/use-withdraw.d.ts +67 -0
- package/dist/withdraw/use-withdraw.d.ts.map +1 -0
- package/dist/withdraw/use-withdraw.js +49 -0
- package/dist/withdraw/use-withdraw.js.map +1 -0
- package/package.json +18 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ConfigParameter, UpdateListingMarketConfigParameters, UpdateListingMarketConfigReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUpdateListingMarketConfig}: just an optional `config`. */
|
|
5
|
+
export type UseUpdateListingMarketConfigParameters = ConfigParameter;
|
|
6
|
+
/**
|
|
7
|
+
* Variables for the {@link useUpdateListingMarketConfig} mutation — the same
|
|
8
|
+
* shape as core's {@link UpdateListingMarketConfigParameters}.
|
|
9
|
+
*
|
|
10
|
+
* `accessToken`, `tokenContractAddress`, and `depositChain` are required, along
|
|
11
|
+
* with at least one of `maxLeverage` / `buybackRatio`. `chainId` defaults to the
|
|
12
|
+
* connected chain when omitted, and `ensureDepositAddress` defaults to `true`.
|
|
13
|
+
*/
|
|
14
|
+
export type UpdateListingMarketConfigVariables = UpdateListingMarketConfigParameters;
|
|
15
|
+
/**
|
|
16
|
+
* Return type of {@link useUpdateListingMarketConfig}: resolves to the pool's
|
|
17
|
+
* `ListingMarketConfig` after the opinion is recorded, or a normalized error.
|
|
18
|
+
*/
|
|
19
|
+
export type UseUpdateListingMarketConfigReturnType = UseMutationResult<UpdateListingMarketConfigReturnType, SymmioRequestError, UpdateListingMarketConfigVariables>;
|
|
20
|
+
/**
|
|
21
|
+
* Submit the signed-in user's configuration opinion for one pool — their
|
|
22
|
+
* preferred max leverage, buyback percentage, or both.
|
|
23
|
+
*
|
|
24
|
+
* This never overwrites the pool's configuration. The listing service records
|
|
25
|
+
* the value as *this LP's* opinion and folds it into a deposit-weighted average
|
|
26
|
+
* across every LP, so one call nudges the pool rather than setting it. The
|
|
27
|
+
* mutation resolves to the config after the blend: `userMaxLeverage` /
|
|
28
|
+
* `userBuybackRatio` are what was just recorded, `maxLeverage` / `buybackRatio`
|
|
29
|
+
* are the new pool values. Both are plain whole numbers — `50` is 50%, `20` is
|
|
30
|
+
* 20x — bounded by `LISTING_MARKET_CONFIG_BOUNDS`.
|
|
31
|
+
*
|
|
32
|
+
* The caller's deposit wallet is minted first by default (see
|
|
33
|
+
* `ensureDepositAddress`), because the service only counts an opinion from an LP
|
|
34
|
+
* that holds one. On success `getListingMarketConfig` and
|
|
35
|
+
* `getListingMarketDetail` are invalidated so any mounted view re-reads the new
|
|
36
|
+
* blend.
|
|
37
|
+
*
|
|
38
|
+
* The endpoint is capped at
|
|
39
|
+
* `useListingConfig().data.rateLimits.marketConfigUpdatesPerDay` successful
|
|
40
|
+
* updates per pool in a rolling 24-hour window; exceeding it surfaces as a
|
|
41
|
+
* `429`. Pools is **chain-level** — `mutate` / `mutateAsync` reject with a
|
|
42
|
+
* normalized {@link SymmioRequestError} (`LISTING_NOT_CONFIGURED`) on a chain
|
|
43
|
+
* with no listing backend, and a bad or expired token comes back as an
|
|
44
|
+
* `UPDATE_LISTING_MARKET_CONFIG_FAILED` `401`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const update = useUpdateListingMarketConfig();
|
|
49
|
+
*
|
|
50
|
+
* update.mutate({
|
|
51
|
+
* accessToken, // from useAuthenticateListing
|
|
52
|
+
* tokenContractAddress,
|
|
53
|
+
* depositChain: market.chainId,
|
|
54
|
+
* buybackRatio: 50, // 50%
|
|
55
|
+
* maxLeverage: 20, // 20x
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function useUpdateListingMarketConfig(parameters?: UseUpdateListingMarketConfigParameters): UseUpdateListingMarketConfigReturnType;
|
|
60
|
+
//# sourceMappingURL=use-update-listing-market-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-listing-market-config.d.ts","sourceRoot":"","sources":["../../src/pools/use-update-listing-market-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,EACzC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,sFAAsF;AACtF,MAAM,MAAM,sCAAsC,GAAG,eAAe,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG,mCAAmC,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,sCAAsC,GAAG,iBAAiB,CACpE,mCAAmC,EACnC,kBAAkB,EAClB,kCAAkC,CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,GAAE,sCAA2C,GACtD,sCAAsC,CAwBxC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { updateListingMarketConfigMutationOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useMutation as i, useQueryClient as a } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-update-listing-market-config.ts
|
|
8
|
+
function o(o = {}) {
|
|
9
|
+
let s = t(o), c = e(), l = a(), u = r(s);
|
|
10
|
+
return i({
|
|
11
|
+
...u,
|
|
12
|
+
mutationFn: async (e) => {
|
|
13
|
+
try {
|
|
14
|
+
return await u.mutationFn({
|
|
15
|
+
...e,
|
|
16
|
+
chainId: e.chainId ?? c
|
|
17
|
+
});
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw n(e);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
onSuccess: () => {
|
|
23
|
+
l.invalidateQueries({ queryKey: ["getListingMarketConfig"] }), l.invalidateQueries({ queryKey: ["getListingMarketDetail"] });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { o as useUpdateListingMarketConfig };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=use-update-listing-market-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-listing-market-config.js","names":[],"sources":["../../src/pools/use-update-listing-market-config.ts"],"sourcesContent":["\"use client\";\n\nimport {\n updateListingMarketConfigMutationOptions,\n type ConfigParameter,\n type UpdateListingMarketConfigParameters,\n type UpdateListingMarketConfigReturnType,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUpdateListingMarketConfig}: just an optional `config`. */\nexport type UseUpdateListingMarketConfigParameters = ConfigParameter;\n\n/**\n * Variables for the {@link useUpdateListingMarketConfig} mutation — the same\n * shape as core's {@link UpdateListingMarketConfigParameters}.\n *\n * `accessToken`, `tokenContractAddress`, and `depositChain` are required, along\n * with at least one of `maxLeverage` / `buybackRatio`. `chainId` defaults to the\n * connected chain when omitted, and `ensureDepositAddress` defaults to `true`.\n */\nexport type UpdateListingMarketConfigVariables = UpdateListingMarketConfigParameters;\n\n/**\n * Return type of {@link useUpdateListingMarketConfig}: resolves to the pool's\n * `ListingMarketConfig` after the opinion is recorded, or a normalized error.\n */\nexport type UseUpdateListingMarketConfigReturnType = UseMutationResult<\n UpdateListingMarketConfigReturnType,\n SymmioRequestError,\n UpdateListingMarketConfigVariables\n>;\n\n/**\n * Submit the signed-in user's configuration opinion for one pool — their\n * preferred max leverage, buyback percentage, or both.\n *\n * This never overwrites the pool's configuration. The listing service records\n * the value as *this LP's* opinion and folds it into a deposit-weighted average\n * across every LP, so one call nudges the pool rather than setting it. The\n * mutation resolves to the config after the blend: `userMaxLeverage` /\n * `userBuybackRatio` are what was just recorded, `maxLeverage` / `buybackRatio`\n * are the new pool values. Both are plain whole numbers — `50` is 50%, `20` is\n * 20x — bounded by `LISTING_MARKET_CONFIG_BOUNDS`.\n *\n * The caller's deposit wallet is minted first by default (see\n * `ensureDepositAddress`), because the service only counts an opinion from an LP\n * that holds one. On success `getListingMarketConfig` and\n * `getListingMarketDetail` are invalidated so any mounted view re-reads the new\n * blend.\n *\n * The endpoint is capped at\n * `useListingConfig().data.rateLimits.marketConfigUpdatesPerDay` successful\n * updates per pool in a rolling 24-hour window; exceeding it surfaces as a\n * `429`. Pools is **chain-level** — `mutate` / `mutateAsync` reject with a\n * normalized {@link SymmioRequestError} (`LISTING_NOT_CONFIGURED`) on a chain\n * with no listing backend, and a bad or expired token comes back as an\n * `UPDATE_LISTING_MARKET_CONFIG_FAILED` `401`.\n *\n * @example\n * ```tsx\n * const update = useUpdateListingMarketConfig();\n *\n * update.mutate({\n * accessToken, // from useAuthenticateListing\n * tokenContractAddress,\n * depositChain: market.chainId,\n * buybackRatio: 50, // 50%\n * maxLeverage: 20, // 20x\n * });\n * ```\n */\nexport function useUpdateListingMarketConfig(\n parameters: UseUpdateListingMarketConfigParameters = {},\n): UseUpdateListingMarketConfigReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const options = updateListingMarketConfigMutationOptions(config);\n\n return useMutation({\n ...options,\n mutationFn: async (variables: UpdateListingMarketConfigVariables): Promise<UpdateListingMarketConfigReturnType> => {\n try {\n return await options.mutationFn({ ...variables, chainId: variables.chainId ?? chainId });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: () => {\n // The opinion changes both halves of the config: the caller's own values\n // and the pool-level blend `getListingMarketDetail` reports. Invalidate\n // both by key tag so mounted views refetch — the caller does not\n // invalidate these by hand.\n void queryClient.invalidateQueries({ queryKey: [\"getListingMarketConfig\"] });\n void queryClient.invalidateQueries({ queryKey: [\"getListingMarketDetail\"] });\n },\n }) as UseUpdateListingMarketConfigReturnType;\n}\n"],"mappings":";;;;;;;AA4EA,SAAgB,EACd,IAAqD,CAAC,GACd;CACxC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAU,EAAyC,CAAM;CAE/D,OAAO,EAAY;EACjB,GAAG;EACH,YAAY,OAAO,MAAgG;GACjH,IAAI;IACF,OAAO,MAAM,EAAQ,WAAW;KAAE,GAAG;KAAW,SAAS,EAAU,WAAW;IAAQ,CAAC;GACzF,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,iBAAiB;GAMf,AADA,EAAiB,kBAAkB,EAAE,UAAU,CAAC,wBAAwB,EAAE,CAAC,GAC3E,EAAiB,kBAAkB,EAAE,UAAU,CAAC,wBAAwB,EAAE,CAAC;EAC7E;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ConfigParameter, GetUserListingMarketsOptions, GetUserListingMarketsReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUserListingMarkets}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseUserListingMarketsParameters = GetUserListingMarketsOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useUserListingMarkets}: one page of the signed-in user's pool rows. */
|
|
7
|
+
export type UseUserListingMarketsReturnType = UseQueryResult<GetUserListingMarketsReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read a page of "Your Pools" — the listing markets that generated a deposit
|
|
10
|
+
* address for the signed-in user, whether or not they have deposited yet.
|
|
11
|
+
*
|
|
12
|
+
* This is the authed twin of {@link useListingMarkets}: it takes a Bearer
|
|
13
|
+
* `accessToken` from {@link useAuthenticateListing} and returns the same catalog
|
|
14
|
+
* rows enriched with the user's `userDeposit`, `userSharePercentage`, and
|
|
15
|
+
* `userRevenue`. Search, filtering, sorting, and pagination are all server-side,
|
|
16
|
+
* exactly as on the public catalog.
|
|
17
|
+
*
|
|
18
|
+
* The token gates the query: until `accessToken` is a non-empty string the hook
|
|
19
|
+
* stays idle (`enabled: false`) rather than firing an unauthenticated request, so
|
|
20
|
+
* it can be mounted before sign-in. Every money field on a row is a `bigint` at
|
|
21
|
+
* `LISTING_VALUE_DECIMALS` (18); `null` means the service reported no value, not
|
|
22
|
+
* zero. Enigma-only; errors are normalized to {@link SymmioRequestError}.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const login = useAuthenticateListing();
|
|
27
|
+
* const [token, setToken] = useState("");
|
|
28
|
+
*
|
|
29
|
+
* const { data, isPending } = useUserListingMarkets({
|
|
30
|
+
* accessToken: token,
|
|
31
|
+
* marketStatus: ListingMarketStatus.LISTED,
|
|
32
|
+
* limit: 25,
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // sign in first, then feed the token to the hook:
|
|
36
|
+
* login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function useUserListingMarkets(parameters: UseUserListingMarketsParameters): UseUserListingMarketsReturnType;
|
|
40
|
+
//# sourceMappingURL=use-user-listing-markets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-listing-markets.d.ts","sourceRoot":"","sources":["../../src/pools/use-user-listing-markets.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,sGAAsG;AACtG,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,GAAG,eAAe,CAAC;AAE7F,gGAAgG;AAChG,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,CAAC;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,+BAA+B,GAAG,+BAA+B,CAmBlH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getUserListingMarketsQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-user-listing-markets.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: (a.query?.enabled ?? !0) && a.accessToken.length > 0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useUserListingMarkets };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-user-listing-markets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-listing-markets.js","names":[],"sources":["../../src/pools/use-user-listing-markets.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getUserListingMarketsQueryOptions,\n type ConfigParameter,\n type GetUserListingMarketsOptions,\n type GetUserListingMarketsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUserListingMarkets}: the core query options plus an optional `config`. */\nexport type UseUserListingMarketsParameters = GetUserListingMarketsOptions & ConfigParameter;\n\n/** Return type of {@link useUserListingMarkets}: one page of the signed-in user's pool rows. */\nexport type UseUserListingMarketsReturnType = UseQueryResult<GetUserListingMarketsReturnType, SymmioRequestError>;\n\n/**\n * Read a page of \"Your Pools\" — the listing markets that generated a deposit\n * address for the signed-in user, whether or not they have deposited yet.\n *\n * This is the authed twin of {@link useListingMarkets}: it takes a Bearer\n * `accessToken` from {@link useAuthenticateListing} and returns the same catalog\n * rows enriched with the user's `userDeposit`, `userSharePercentage`, and\n * `userRevenue`. Search, filtering, sorting, and pagination are all server-side,\n * exactly as on the public catalog.\n *\n * The token gates the query: until `accessToken` is a non-empty string the hook\n * stays idle (`enabled: false`) rather than firing an unauthenticated request, so\n * it can be mounted before sign-in. Every money field on a row is a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18); `null` means the service reported no value, not\n * zero. Enigma-only; errors are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const login = useAuthenticateListing();\n * const [token, setToken] = useState(\"\");\n *\n * const { data, isPending } = useUserListingMarkets({\n * accessToken: token,\n * marketStatus: ListingMarketStatus.LISTED,\n * limit: 25,\n * });\n *\n * // sign in first, then feed the token to the hook:\n * login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });\n * ```\n */\nexport function useUserListingMarkets(parameters: UseUserListingMarketsParameters): UseUserListingMarketsReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getUserListingMarketsQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled: (parameters.query?.enabled ?? true) && parameters.accessToken.length > 0,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseUserListingMarketsReturnType;\n}\n"],"mappings":";;;;;;;AAmDA,SAAgB,EAAsB,GAA8E;CAClH,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAkC,GAAQ;EACxD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,UAAU,EAAW,OAAO,WAAW,OAAS,EAAW,YAAY,SAAS;EAChF,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ConfigParameter, GetUserProfitOptions, GetUserProfitReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUserProfit}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseUserProfitParameters = GetUserProfitOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useUserProfit}: the signed-in user's LP position in one pool. */
|
|
7
|
+
export type UseUserProfitReturnType = UseQueryResult<GetUserProfitReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the signed-in user's LP position in a single pool — their LP shares, LP
|
|
10
|
+
* balance valued in tokens and USDC, claimable and claimed rewards, deposited
|
|
11
|
+
* token amount, and the LP shares queued for withdrawal.
|
|
12
|
+
*
|
|
13
|
+
* This is an authed, per-pool read: it takes a Bearer `accessToken` from
|
|
14
|
+
* {@link useAuthenticateListing} and a `tokenContractAddress` (the token that
|
|
15
|
+
* addresses one market in the listing API). Both gate the query — until the
|
|
16
|
+
* token **and** the address are non-empty strings the hook stays idle
|
|
17
|
+
* (`enabled: false`) rather than firing an incomplete or unauthenticated
|
|
18
|
+
* request, so it can be mounted before sign-in or before an address is entered.
|
|
19
|
+
*
|
|
20
|
+
* Every field on the returned {@link UserPoolProfit} is a `bigint` at
|
|
21
|
+
* `LISTING_VALUE_DECIMALS` (18); an absent figure is normalized to `0n`, not
|
|
22
|
+
* `null`. Enigma-only; errors are normalized to {@link SymmioRequestError}.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const login = useAuthenticateListing();
|
|
27
|
+
* const [token, setToken] = useState("");
|
|
28
|
+
*
|
|
29
|
+
* const { data, isPending } = useUserProfit({
|
|
30
|
+
* accessToken: token,
|
|
31
|
+
* tokenContractAddress: "0x1234…",
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // sign in first, then feed the token to the hook:
|
|
35
|
+
* login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function useUserProfit(parameters: UseUserProfitParameters): UseUserProfitReturnType;
|
|
39
|
+
//# sourceMappingURL=use-user-profit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-profit.d.ts","sourceRoot":"","sources":["../../src/pools/use-user-profit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,8FAA8F;AAC9F,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE7E,0FAA0F;AAC1F,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,uBAAuB,GAAG,uBAAuB,CAsB1F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getUserProfitQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-user-profit.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: (a.query?.enabled ?? !0) && a.accessToken.length > 0 && a.tokenContractAddress.length > 0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useUserProfit };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-user-profit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-profit.js","names":[],"sources":["../../src/pools/use-user-profit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getUserProfitQueryOptions,\n type ConfigParameter,\n type GetUserProfitOptions,\n type GetUserProfitReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUserProfit}: the core query options plus an optional `config`. */\nexport type UseUserProfitParameters = GetUserProfitOptions & ConfigParameter;\n\n/** Return type of {@link useUserProfit}: the signed-in user's LP position in one pool. */\nexport type UseUserProfitReturnType = UseQueryResult<GetUserProfitReturnType, SymmioRequestError>;\n\n/**\n * Read the signed-in user's LP position in a single pool — their LP shares, LP\n * balance valued in tokens and USDC, claimable and claimed rewards, deposited\n * token amount, and the LP shares queued for withdrawal.\n *\n * This is an authed, per-pool read: it takes a Bearer `accessToken` from\n * {@link useAuthenticateListing} and a `tokenContractAddress` (the token that\n * addresses one market in the listing API). Both gate the query — until the\n * token **and** the address are non-empty strings the hook stays idle\n * (`enabled: false`) rather than firing an incomplete or unauthenticated\n * request, so it can be mounted before sign-in or before an address is entered.\n *\n * Every field on the returned {@link UserPoolProfit} is a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18); an absent figure is normalized to `0n`, not\n * `null`. Enigma-only; errors are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const login = useAuthenticateListing();\n * const [token, setToken] = useState(\"\");\n *\n * const { data, isPending } = useUserProfit({\n * accessToken: token,\n * tokenContractAddress: \"0x1234…\",\n * });\n *\n * // sign in first, then feed the token to the hook:\n * login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });\n * ```\n */\nexport function useUserProfit(parameters: UseUserProfitParameters): UseUserProfitReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getUserProfitQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled:\n (parameters.query?.enabled ?? true) &&\n parameters.accessToken.length > 0 &&\n parameters.tokenContractAddress.length > 0,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseUserProfitReturnType;\n}\n"],"mappings":";;;;;;;AAkDA,SAAgB,EAAc,GAA8D;CAC1F,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA0B,GAAQ;EAChD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,UACG,EAAW,OAAO,WAAW,OAC9B,EAAW,YAAY,SAAS,KAChC,EAAW,qBAAqB,SAAS;EAC3C,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConfigParameter, GetUserRewardChartOptions, GetUserRewardChartReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUserRewardChart}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseUserRewardChartParameters = GetUserRewardChartOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useUserRewardChart}: one reward series per market the user earns in. */
|
|
7
|
+
export type UseUserRewardChartReturnType = UseQueryResult<GetUserRewardChartReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the signed-in user's daily LP-reward series, grouped by market — the
|
|
10
|
+
* "your performance" side of a pool page's rewards chart.
|
|
11
|
+
*
|
|
12
|
+
* Authed and **not** scoped to one pool: the response covers every market the
|
|
13
|
+
* user has rewards in, so a single-pool view filters it by
|
|
14
|
+
* `(marketAddress, marketChainId)` itself. The `accessToken` comes from
|
|
15
|
+
* {@link useAuthenticateListing} and gates the query — until it is a non-empty
|
|
16
|
+
* string the hook stays idle (`enabled: false`), so it can be mounted before
|
|
17
|
+
* sign-in. Errors are normalized to {@link SymmioRequestError}.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { data: charts } = useUserRewardChart({ accessToken });
|
|
22
|
+
* const mine = charts?.find(
|
|
23
|
+
* (entry) => entry.marketAddress.toLowerCase() === pool.contractAddress.toLowerCase(),
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useUserRewardChart(parameters: UseUserRewardChartParameters): UseUserRewardChartReturnType;
|
|
28
|
+
//# sourceMappingURL=use-user-reward-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-reward-chart.d.ts","sourceRoot":"","sources":["../../src/pools/use-user-reward-chart.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,mGAAmG;AACnG,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,GAAG,eAAe,CAAC;AAEvF,iGAAiG;AACjG,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AAE5G;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,4BAA4B,GAAG,4BAA4B,CAmBzG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getUserRewardChartQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-user-reward-chart.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: (a.query?.enabled ?? !0) && a.accessToken.length > 0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useUserRewardChart };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-user-reward-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-reward-chart.js","names":[],"sources":["../../src/pools/use-user-reward-chart.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getUserRewardChartQueryOptions,\n type ConfigParameter,\n type GetUserRewardChartOptions,\n type GetUserRewardChartReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUserRewardChart}: the core query options plus an optional `config`. */\nexport type UseUserRewardChartParameters = GetUserRewardChartOptions & ConfigParameter;\n\n/** Return type of {@link useUserRewardChart}: one reward series per market the user earns in. */\nexport type UseUserRewardChartReturnType = UseQueryResult<GetUserRewardChartReturnType, SymmioRequestError>;\n\n/**\n * Read the signed-in user's daily LP-reward series, grouped by market — the\n * \"your performance\" side of a pool page's rewards chart.\n *\n * Authed and **not** scoped to one pool: the response covers every market the\n * user has rewards in, so a single-pool view filters it by\n * `(marketAddress, marketChainId)` itself. The `accessToken` comes from\n * {@link useAuthenticateListing} and gates the query — until it is a non-empty\n * string the hook stays idle (`enabled: false`), so it can be mounted before\n * sign-in. Errors are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data: charts } = useUserRewardChart({ accessToken });\n * const mine = charts?.find(\n * (entry) => entry.marketAddress.toLowerCase() === pool.contractAddress.toLowerCase(),\n * );\n * ```\n */\nexport function useUserRewardChart(parameters: UseUserRewardChartParameters): UseUserRewardChartReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getUserRewardChartQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled: (parameters.query?.enabled ?? true) && parameters.accessToken.length > 0,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseUserRewardChartReturnType;\n}\n"],"mappings":";;;;;;;AAuCA,SAAgB,EAAmB,GAAwE;CACzG,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA+B,GAAQ;EACrD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,UAAU,EAAW,OAAO,WAAW,OAAS,EAAW,YAAY,SAAS;EAChF,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ConfigParameter, GetUserTotalRewardOptions, GetUserTotalRewardReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUserTotalReward}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseUserTotalRewardParameters = GetUserTotalRewardOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useUserTotalReward}: aggregate reward as an 18-decimal `bigint`. */
|
|
7
|
+
export type UseUserTotalRewardReturnType = UseQueryResult<GetUserTotalRewardReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the signed-in user's aggregate LP reward over the last `days`, across
|
|
10
|
+
* **every** market they earn in.
|
|
11
|
+
*
|
|
12
|
+
* Built from earned daily snapshots, so claiming does not reduce it — it is
|
|
13
|
+
* lifetime-earned within the window, not an unclaimed balance; use
|
|
14
|
+
* {@link useUserProfit} for the claimable figure. `days` is capped at **30** by
|
|
15
|
+
* the service. Both the `accessToken` and `userAddress` gate the query, so the
|
|
16
|
+
* hook can be mounted before sign-in. Errors are normalized to
|
|
17
|
+
* {@link SymmioRequestError}.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { address } = useAccount();
|
|
22
|
+
* const { data: earned30d } = useUserTotalReward({
|
|
23
|
+
* accessToken,
|
|
24
|
+
* userAddress: address ?? "",
|
|
25
|
+
* days: 30,
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function useUserTotalReward(parameters: UseUserTotalRewardParameters): UseUserTotalRewardReturnType;
|
|
30
|
+
//# sourceMappingURL=use-user-total-reward.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-total-reward.d.ts","sourceRoot":"","sources":["../../src/pools/use-user-total-reward.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,mGAAmG;AACnG,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,GAAG,eAAe,CAAC;AAEvF,6FAA6F;AAC7F,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,4BAA4B,GAAG,4BAA4B,CAoBzG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getUserTotalRewardQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-user-total-reward.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: (a.query?.enabled ?? !0) && a.accessToken.length > 0 && a.userAddress.length > 0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useUserTotalReward };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-user-total-reward.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-total-reward.js","names":[],"sources":["../../src/pools/use-user-total-reward.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getUserTotalRewardQueryOptions,\n type ConfigParameter,\n type GetUserTotalRewardOptions,\n type GetUserTotalRewardReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUserTotalReward}: the core query options plus an optional `config`. */\nexport type UseUserTotalRewardParameters = GetUserTotalRewardOptions & ConfigParameter;\n\n/** Return type of {@link useUserTotalReward}: aggregate reward as an 18-decimal `bigint`. */\nexport type UseUserTotalRewardReturnType = UseQueryResult<GetUserTotalRewardReturnType, SymmioRequestError>;\n\n/**\n * Read the signed-in user's aggregate LP reward over the last `days`, across\n * **every** market they earn in.\n *\n * Built from earned daily snapshots, so claiming does not reduce it — it is\n * lifetime-earned within the window, not an unclaimed balance; use\n * {@link useUserProfit} for the claimable figure. `days` is capped at **30** by\n * the service. Both the `accessToken` and `userAddress` gate the query, so the\n * hook can be mounted before sign-in. Errors are normalized to\n * {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { address } = useAccount();\n * const { data: earned30d } = useUserTotalReward({\n * accessToken,\n * userAddress: address ?? \"\",\n * days: 30,\n * });\n * ```\n */\nexport function useUserTotalReward(parameters: UseUserTotalRewardParameters): UseUserTotalRewardReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getUserTotalRewardQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled:\n (parameters.query?.enabled ?? true) && parameters.accessToken.length > 0 && parameters.userAddress.length > 0,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseUserTotalRewardReturnType;\n}\n"],"mappings":";;;;;;;AAyCA,SAAgB,EAAmB,GAAwE;CACzG,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA+B,GAAQ;EACrD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,UACG,EAAW,OAAO,WAAW,OAAS,EAAW,YAAY,SAAS,KAAK,EAAW,YAAY,SAAS;EAC9G,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConfigParameter, GetUserTransactionsOptions, GetUserTransactionsReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useUserTransactions}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseUserTransactionsParameters = GetUserTransactionsOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useUserTransactions}: one page of the user's transactions. */
|
|
7
|
+
export type UseUserTransactionsReturnType = UseQueryResult<GetUserTransactionsReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the signed-in user's transaction history — their pool deposits and
|
|
10
|
+
* withdrawals across **every** pool, newest first.
|
|
11
|
+
*
|
|
12
|
+
* Authed and scoped to the caller: it only ever returns transactions the user
|
|
13
|
+
* owns, so pass the Bearer `accessToken` from {@link useAuthenticateListing}.
|
|
14
|
+
* Optionally narrow by `transactionType`, `transactionStatus`, or `tokenAddress`.
|
|
15
|
+
* `count` is the total across all pages, so it is what a pager should divide —
|
|
16
|
+
* not `items.length`. Errors are normalized to {@link SymmioRequestError}.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const { data } = useUserTransactions({ accessToken, size: 25 });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function useUserTransactions(parameters: UseUserTransactionsParameters): UseUserTransactionsReturnType;
|
|
24
|
+
//# sourceMappingURL=use-user-transactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-transactions.d.ts","sourceRoot":"","sources":["../../src/pools/use-user-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,oGAAoG;AACpG,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,GAAG,eAAe,CAAC;AAEzF,uFAAuF;AACvF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;AAE9G;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,6BAA6B,GAAG,6BAA6B,CAkB5G"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getUserTransactionsQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-user-transactions.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
queryFn: async () => {
|
|
16
|
+
try {
|
|
17
|
+
return await c.queryFn();
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw n(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as useUserTransactions };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=use-user-transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-transactions.js","names":[],"sources":["../../src/pools/use-user-transactions.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getUserTransactionsQueryOptions,\n type ConfigParameter,\n type GetUserTransactionsOptions,\n type GetUserTransactionsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useUserTransactions}: the core query options plus an optional `config`. */\nexport type UseUserTransactionsParameters = GetUserTransactionsOptions & ConfigParameter;\n\n/** Return type of {@link useUserTransactions}: one page of the user's transactions. */\nexport type UseUserTransactionsReturnType = UseQueryResult<GetUserTransactionsReturnType, SymmioRequestError>;\n\n/**\n * Read the signed-in user's transaction history — their pool deposits and\n * withdrawals across **every** pool, newest first.\n *\n * Authed and scoped to the caller: it only ever returns transactions the user\n * owns, so pass the Bearer `accessToken` from {@link useAuthenticateListing}.\n * Optionally narrow by `transactionType`, `transactionStatus`, or `tokenAddress`.\n * `count` is the total across all pages, so it is what a pager should divide —\n * not `items.length`. Errors are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const { data } = useUserTransactions({ accessToken, size: 25 });\n * ```\n */\nexport function useUserTransactions(parameters: UseUserTransactionsParameters): UseUserTransactionsReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getUserTransactionsQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseUserTransactionsReturnType;\n}\n"],"mappings":";;;;;;;AAmCA,SAAgB,EAAoB,GAA0E;CAC5G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAgC,GAAQ;EACtD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConfigParameter, GetWeeklyListingLimitOptions, WeeklyListingLimit } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useWeeklyListingLimit}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseWeeklyListingLimitParameters = GetWeeklyListingLimitOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useWeeklyListingLimit}: the protocol's global weekly listing cap. */
|
|
7
|
+
export type UseWeeklyListingLimitReturnType = UseQueryResult<WeeklyListingLimit, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the protocol's **global** remaining new-market listings for the current
|
|
10
|
+
* rolling weekly window — the cap a create-pool flow must check before
|
|
11
|
+
* {@link useAddMarket}.
|
|
12
|
+
*
|
|
13
|
+
* The service caps how many pools may be created across the whole protocol each
|
|
14
|
+
* week, not per user. Gate the Create button on `data.remaining <= 0`: when the
|
|
15
|
+
* cap is spent no more pools can be listed until `data.resetAt` (a Unix
|
|
16
|
+
* timestamp). This is a **public** read — no token, resolved from the config, so
|
|
17
|
+
* it can be mounted unconditionally. Enigma-only; errors are normalized to
|
|
18
|
+
* {@link SymmioRequestError}.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const weekly = useWeeklyListingLimit();
|
|
23
|
+
* const limitReached = weekly.data ? weekly.data.remaining <= 0 : false;
|
|
24
|
+
* // disable the create button while `limitReached`.
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useWeeklyListingLimit(parameters?: UseWeeklyListingLimitParameters): UseWeeklyListingLimitReturnType;
|
|
28
|
+
//# sourceMappingURL=use-weekly-listing-limit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-weekly-listing-limit.d.ts","sourceRoot":"","sources":["../../src/pools/use-weekly-listing-limit.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,sGAAsG;AACtG,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,GAAG,eAAe,CAAC;AAE7F,8FAA8F;AAC9F,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAErG;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,GAAE,+BAAoC,GAC/C,+BAA+B,CAmBjC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getWeeklyListingLimitQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-weekly-listing-limit.ts
|
|
8
|
+
function a(a = {}) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: a.query?.enabled ?? !0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useWeeklyListingLimit };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-weekly-listing-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-weekly-listing-limit.js","names":[],"sources":["../../src/pools/use-weekly-listing-limit.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getWeeklyListingLimitQueryOptions,\n type ConfigParameter,\n type GetWeeklyListingLimitOptions,\n type WeeklyListingLimit,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useWeeklyListingLimit}: the core query options plus an optional `config`. */\nexport type UseWeeklyListingLimitParameters = GetWeeklyListingLimitOptions & ConfigParameter;\n\n/** Return type of {@link useWeeklyListingLimit}: the protocol's global weekly listing cap. */\nexport type UseWeeklyListingLimitReturnType = UseQueryResult<WeeklyListingLimit, SymmioRequestError>;\n\n/**\n * Read the protocol's **global** remaining new-market listings for the current\n * rolling weekly window — the cap a create-pool flow must check before\n * {@link useAddMarket}.\n *\n * The service caps how many pools may be created across the whole protocol each\n * week, not per user. Gate the Create button on `data.remaining <= 0`: when the\n * cap is spent no more pools can be listed until `data.resetAt` (a Unix\n * timestamp). This is a **public** read — no token, resolved from the config, so\n * it can be mounted unconditionally. Enigma-only; errors are normalized to\n * {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * const weekly = useWeeklyListingLimit();\n * const limitReached = weekly.data ? weekly.data.remaining <= 0 : false;\n * // disable the create button while `limitReached`.\n * ```\n */\nexport function useWeeklyListingLimit(\n parameters: UseWeeklyListingLimitParameters = {},\n): UseWeeklyListingLimitReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getWeeklyListingLimitQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled: parameters.query?.enabled ?? true,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseWeeklyListingLimitReturnType;\n}\n"],"mappings":";;;;;;;AAuCA,SAAgB,EACd,IAA8C,CAAC,GACd;CACjC,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAkC,GAAQ;EACxD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,EAAW,OAAO,WAAW;EACtC,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ConfigParameter, WithdrawLpParameters, WithdrawLpReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useWithdrawLp}: just an optional `config`. */
|
|
5
|
+
export type UseWithdrawLpParameters = ConfigParameter;
|
|
6
|
+
/**
|
|
7
|
+
* Variables for the {@link useWithdrawLp} mutation — the same shape as core's
|
|
8
|
+
* {@link WithdrawLpParameters}.
|
|
9
|
+
*
|
|
10
|
+
* `accessToken`, `marketAddress`, `withdrawAddress`, and `amount` are required;
|
|
11
|
+
* `description` is optional. `chainId` defaults to the connected chain when
|
|
12
|
+
* omitted.
|
|
13
|
+
*/
|
|
14
|
+
export type WithdrawLpVariables = WithdrawLpParameters;
|
|
15
|
+
/**
|
|
16
|
+
* Return type of {@link useWithdrawLp}: resolves to `void` on success (the
|
|
17
|
+
* listing backend acknowledges with an empty body) or a normalized error.
|
|
18
|
+
*/
|
|
19
|
+
export type UseWithdrawLpReturnType = UseMutationResult<WithdrawLpReturnType, SymmioRequestError, WithdrawLpVariables>;
|
|
20
|
+
/**
|
|
21
|
+
* Withdraw LP shares from a pool — queue a withdrawal with the listing backend in
|
|
22
|
+
* one call.
|
|
23
|
+
*
|
|
24
|
+
* The mutation POSTs the LP `amount`, the pool's `marketAddress`, and the
|
|
25
|
+
* `withdrawAddress` to send the liquidity to, authed with the caller's Bearer
|
|
26
|
+
* `accessToken` (mint it with {@link useAuthenticateListing}). It resolves to
|
|
27
|
+
* `void`; the withdrawn shares move into the pool's pending-withdrawal queue, so
|
|
28
|
+
* refetch {@link useUserProfit} afterwards to see `pendingWithdrawLpAmount` rise
|
|
29
|
+
* and `availableLpAmount` fall.
|
|
30
|
+
*
|
|
31
|
+
* Cap `amount` at the pool's `availableLpAmount` from {@link useUserProfit} — the
|
|
32
|
+
* service rejects an over-withdrawal. Pools is **chain-level** — `mutate` /
|
|
33
|
+
* `mutateAsync` reject with a normalized {@link SymmioRequestError}
|
|
34
|
+
* (`LISTING_NOT_CONFIGURED`) on a chain with no listing backend, and a bad or
|
|
35
|
+
* expired token comes back as a `WITHDRAW_LP_FAILED` `401`. Failures are
|
|
36
|
+
* normalized to {@link SymmioRequestError}.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const withdraw = useWithdrawLp();
|
|
41
|
+
* const { data: profit } = useUserProfit({ accessToken, tokenContractAddress });
|
|
42
|
+
*
|
|
43
|
+
* withdraw.mutate({
|
|
44
|
+
* accessToken, // from useAuthenticateListing
|
|
45
|
+
* marketAddress: tokenContractAddress,
|
|
46
|
+
* withdrawAddress: "0xRecipient…",
|
|
47
|
+
* amount: profit?.availableLpAmount ?? 0n,
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function useWithdrawLp(parameters?: UseWithdrawLpParameters): UseWithdrawLpReturnType;
|
|
52
|
+
//# sourceMappingURL=use-withdraw-lp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-withdraw-lp.d.ts","sourceRoot":"","sources":["../../src/pools/use-withdraw-lp.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,uEAAuE;AACvE,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAEvH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,UAAU,GAAE,uBAA4B,GAAG,uBAAuB,CAyB/F"}
|