@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.
- package/dist/balance-history/get-balance-history/types.d.ts +3 -1
- package/dist/balance-history/get-balance-history/types.d.ts.map +1 -1
- package/dist/balance-history/get-balance-history/types.js +1 -1
- package/dist/balance-history/get-balance-history/types.js.map +1 -1
- package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts +50 -0
- package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.d.ts.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js +30 -0
- package/dist/funding/get-funding-index-checkpoints/get-funding-index-checkpoints.js.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/index.d.ts +5 -0
- package/dist/funding/get-funding-index-checkpoints/index.d.ts.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/query-document.d.ts +16 -0
- package/dist/funding/get-funding-index-checkpoints/query-document.d.ts.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/query-document.js +7 -0
- package/dist/funding/get-funding-index-checkpoints/query-document.js.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/query.d.ts +37 -0
- package/dist/funding/get-funding-index-checkpoints/query.d.ts.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/query.js +23 -0
- package/dist/funding/get-funding-index-checkpoints/query.js.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts +12 -0
- package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.d.ts.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js +31 -0
- package/dist/funding/get-funding-index-checkpoints/to-funding-index-checkpoint-row.js.map +1 -0
- package/dist/funding/get-funding-index-checkpoints/types.d.ts +51 -0
- package/dist/funding/get-funding-index-checkpoints/types.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts +47 -0
- package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js +30 -0
- package/dist/funding/get-quote-funding-settlements/get-quote-funding-settlements.js.map +1 -0
- package/dist/funding/get-quote-funding-settlements/index.d.ts +5 -0
- package/dist/funding/get-quote-funding-settlements/index.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/query-document.d.ts +16 -0
- package/dist/funding/get-quote-funding-settlements/query-document.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/query-document.js +7 -0
- package/dist/funding/get-quote-funding-settlements/query-document.js.map +1 -0
- package/dist/funding/get-quote-funding-settlements/query.d.ts +37 -0
- package/dist/funding/get-quote-funding-settlements/query.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/query.js +23 -0
- package/dist/funding/get-quote-funding-settlements/query.js.map +1 -0
- package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts +12 -0
- package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.d.ts.map +1 -0
- package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js +33 -0
- package/dist/funding/get-quote-funding-settlements/to-quote-funding-settlement-row.js.map +1 -0
- package/dist/funding/get-quote-funding-settlements/types.d.ts +56 -0
- package/dist/funding/get-quote-funding-settlements/types.d.ts.map +1 -0
- package/dist/funding/index.d.ts +3 -0
- package/dist/funding/index.d.ts.map +1 -0
- package/dist/index.d.ts +63 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +427 -386
- package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts +44 -0
- package/dist/liquidation/get-liquidation-details/get-liquidation-details.d.ts.map +1 -0
- package/dist/liquidation/get-liquidation-details/get-liquidation-details.js +30 -0
- package/dist/liquidation/get-liquidation-details/get-liquidation-details.js.map +1 -0
- package/dist/liquidation/get-liquidation-details/index.d.ts +5 -0
- package/dist/liquidation/get-liquidation-details/index.d.ts.map +1 -0
- package/dist/liquidation/get-liquidation-details/query-document.d.ts +16 -0
- package/dist/liquidation/get-liquidation-details/query-document.d.ts.map +1 -0
- package/dist/liquidation/get-liquidation-details/query-document.js +7 -0
- package/dist/liquidation/get-liquidation-details/query-document.js.map +1 -0
- package/dist/liquidation/get-liquidation-details/query.d.ts +37 -0
- package/dist/liquidation/get-liquidation-details/query.d.ts.map +1 -0
- package/dist/liquidation/get-liquidation-details/query.js +23 -0
- package/dist/liquidation/get-liquidation-details/query.js.map +1 -0
- package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts +12 -0
- package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.d.ts.map +1 -0
- package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js +32 -0
- package/dist/liquidation/get-liquidation-details/to-liquidation-detail-row.js.map +1 -0
- package/dist/liquidation/get-liquidation-details/types.d.ts +47 -0
- package/dist/liquidation/get-liquidation-details/types.d.ts.map +1 -0
- package/dist/liquidation/index.d.ts +2 -0
- package/dist/liquidation/index.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts +51 -0
- package/dist/margin/get-margin-transfers/get-margin-transfers.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/get-margin-transfers.js +32 -0
- package/dist/margin/get-margin-transfers/get-margin-transfers.js.map +1 -0
- package/dist/margin/get-margin-transfers/index.d.ts +5 -0
- package/dist/margin/get-margin-transfers/index.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/query-document.d.ts +17 -0
- package/dist/margin/get-margin-transfers/query-document.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/query-document.js +7 -0
- package/dist/margin/get-margin-transfers/query-document.js.map +1 -0
- package/dist/margin/get-margin-transfers/query.d.ts +37 -0
- package/dist/margin/get-margin-transfers/query.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/query.js +23 -0
- package/dist/margin/get-margin-transfers/query.js.map +1 -0
- package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts +12 -0
- package/dist/margin/get-margin-transfers/to-margin-transfer-row.d.ts.map +1 -0
- package/dist/margin/get-margin-transfers/to-margin-transfer-row.js +19 -0
- package/dist/margin/get-margin-transfers/to-margin-transfer-row.js.map +1 -0
- package/dist/margin/get-margin-transfers/types.d.ts +27 -0
- package/dist/margin/get-margin-transfers/types.d.ts.map +1 -0
- package/dist/margin/index.d.ts +1 -0
- package/dist/margin/index.d.ts.map +1 -1
- package/dist/pools/add-market/to-created-pool.d.ts.map +1 -1
- package/dist/pools/add-market/to-created-pool.js +4 -0
- package/dist/pools/add-market/to-created-pool.js.map +1 -1
- package/dist/pools/add-market/types.d.ts +8 -0
- package/dist/pools/add-market/types.d.ts.map +1 -1
- package/dist/pools/auth/authenticate-listing.d.ts +3 -1
- package/dist/pools/auth/authenticate-listing.d.ts.map +1 -1
- package/dist/pools/auth/authenticate-listing.js +28 -23
- package/dist/pools/auth/authenticate-listing.js.map +1 -1
- package/dist/pools/auth/can-reuse-listing-challenge.d.ts +5 -0
- package/dist/pools/auth/can-reuse-listing-challenge.d.ts.map +1 -0
- package/dist/pools/auth/can-reuse-listing-challenge.js +9 -0
- package/dist/pools/auth/can-reuse-listing-challenge.js.map +1 -0
- package/dist/pools/auth/query.d.ts +15 -0
- package/dist/pools/auth/query.d.ts.map +1 -1
- package/dist/pools/auth/query.js +28 -4
- package/dist/pools/auth/query.js.map +1 -1
- package/dist/pools/auth/to-siwe.d.ts +5 -1
- package/dist/pools/auth/to-siwe.d.ts.map +1 -1
- package/dist/pools/auth/to-siwe.js +4 -2
- package/dist/pools/auth/to-siwe.js.map +1 -1
- package/dist/pools/auth/types.d.ts +2 -0
- package/dist/pools/auth/types.d.ts.map +1 -1
- package/dist/pools/cancel-withdraw/cancel-withdraw.js +1 -1
- package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -1
- package/dist/pools/claim-history/get-pool-claim.d.ts +11 -0
- package/dist/pools/claim-history/get-pool-claim.d.ts.map +1 -0
- package/dist/pools/claim-history/get-pool-claim.js +25 -0
- package/dist/pools/claim-history/get-pool-claim.js.map +1 -0
- package/dist/pools/claim-history/index.d.ts +1 -0
- package/dist/pools/claim-history/index.d.ts.map +1 -1
- package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -1
- package/dist/pools/claim-history/to-pool-claim.js +2 -0
- package/dist/pools/claim-history/to-pool-claim.js.map +1 -1
- package/dist/pools/composition.d.ts +16 -0
- package/dist/pools/composition.d.ts.map +1 -0
- package/dist/pools/composition.js +39 -0
- package/dist/pools/composition.js.map +1 -0
- package/dist/pools/empty-pool-profit.d.ts +4 -0
- package/dist/pools/empty-pool-profit.d.ts.map +1 -0
- package/dist/pools/empty-pool-profit.js +17 -0
- package/dist/pools/empty-pool-profit.js.map +1 -0
- package/dist/pools/index.d.ts +8 -0
- package/dist/pools/index.d.ts.map +1 -1
- package/dist/pools/listing-config/to-listing-config.d.ts +5 -1
- package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
- package/dist/pools/listing-config/to-listing-config.js +19 -8
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts +37 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js +35 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js.map +1 -0
- package/dist/pools/maintenance-fees/index.d.ts +3 -0
- package/dist/pools/maintenance-fees/index.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/query.d.ts +11 -0
- package/dist/pools/maintenance-fees/query.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/query.js +21 -0
- package/dist/pools/maintenance-fees/query.js.map +1 -0
- package/dist/pools/market-config/to-listing-market-config.d.ts +6 -1
- package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -1
- package/dist/pools/market-config/to-listing-market-config.js +1 -0
- package/dist/pools/market-config/to-listing-market-config.js.map +1 -1
- package/dist/pools/market-config/types.d.ts +5 -0
- package/dist/pools/market-config/types.d.ts.map +1 -1
- package/dist/pools/market-config/types.js.map +1 -1
- package/dist/pools/market-data/get-pool-market-data.d.ts +14 -0
- package/dist/pools/market-data/get-pool-market-data.d.ts.map +1 -0
- package/dist/pools/market-data/get-pool-market-data.js +25 -0
- package/dist/pools/market-data/get-pool-market-data.js.map +1 -0
- package/dist/pools/market-data/index.d.ts +2 -0
- package/dist/pools/market-data/index.d.ts.map +1 -0
- package/dist/pools/market-detail/to-listing-market-detail.d.ts +5 -1
- package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.js +45 -33
- package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
- package/dist/pools/markets/to-listing-market.d.ts +13 -1
- package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
- package/dist/pools/markets/to-listing-market.js +24 -12
- package/dist/pools/markets/to-listing-market.js.map +1 -1
- package/dist/pools/open-positions/calculate-pool-open-positions.d.ts +39 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.d.ts.map +1 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.js +83 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.js.map +1 -0
- package/dist/pools/open-positions/get-pool-open-positions.d.ts +17 -0
- package/dist/pools/open-positions/get-pool-open-positions.d.ts.map +1 -0
- package/dist/pools/open-positions/get-pool-open-positions.js +39 -0
- package/dist/pools/open-positions/get-pool-open-positions.js.map +1 -0
- package/dist/pools/open-positions/index.d.ts +4 -0
- package/dist/pools/open-positions/index.d.ts.map +1 -0
- package/dist/pools/open-positions/query.d.ts +17 -0
- package/dist/pools/open-positions/query.d.ts.map +1 -0
- package/dist/pools/open-positions/query.js +21 -0
- package/dist/pools/open-positions/query.js.map +1 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.d.ts +66 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.d.ts.map +1 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.js +96 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.js.map +1 -0
- package/dist/pools/portfolio/get-pool-portfolio.d.ts +19 -0
- package/dist/pools/portfolio/get-pool-portfolio.d.ts.map +1 -0
- package/dist/pools/portfolio/get-pool-portfolio.js +88 -0
- package/dist/pools/portfolio/get-pool-portfolio.js.map +1 -0
- package/dist/pools/portfolio/index.d.ts +4 -0
- package/dist/pools/portfolio/index.d.ts.map +1 -0
- package/dist/pools/portfolio/query.d.ts +17 -0
- package/dist/pools/portfolio/query.d.ts.map +1 -0
- package/dist/pools/portfolio/query.js +21 -0
- package/dist/pools/portfolio/query.js.map +1 -0
- package/dist/pools/portfolio/read-positions.d.ts +4 -0
- package/dist/pools/portfolio/read-positions.d.ts.map +1 -0
- package/dist/pools/portfolio/read-positions.js +31 -0
- package/dist/pools/portfolio/read-positions.js.map +1 -0
- package/dist/pools/position/calculate-pool-position.d.ts +85 -0
- package/dist/pools/position/calculate-pool-position.d.ts.map +1 -0
- package/dist/pools/position/calculate-pool-position.js +59 -0
- package/dist/pools/position/calculate-pool-position.js.map +1 -0
- package/dist/pools/position/get-pool-position.d.ts +22 -0
- package/dist/pools/position/get-pool-position.d.ts.map +1 -0
- package/dist/pools/position/get-pool-position.js +47 -0
- package/dist/pools/position/get-pool-position.js.map +1 -0
- package/dist/pools/position/index.d.ts +4 -0
- package/dist/pools/position/index.d.ts.map +1 -0
- package/dist/pools/position/query.d.ts +17 -0
- package/dist/pools/position/query.d.ts.map +1 -0
- package/dist/pools/position/query.js +21 -0
- package/dist/pools/position/query.js.map +1 -0
- package/dist/pools/position/sum-deposits.d.ts +10 -0
- package/dist/pools/position/sum-deposits.d.ts.map +1 -0
- package/dist/pools/position/sum-deposits.js +35 -0
- package/dist/pools/position/sum-deposits.js.map +1 -0
- package/dist/pools/profit/get-user-profit.d.ts +4 -0
- package/dist/pools/profit/get-user-profit.d.ts.map +1 -1
- package/dist/pools/profit/get-user-profit.js +18 -12
- package/dist/pools/profit/get-user-profit.js.map +1 -1
- package/dist/pools/profit/to-user-pool-profit.d.ts +22 -4
- package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -1
- package/dist/pools/profit/to-user-pool-profit.js +28 -12
- package/dist/pools/profit/to-user-pool-profit.js.map +1 -1
- package/dist/pools/quotes/get-pool-quotes.d.ts +8 -1
- package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -1
- package/dist/pools/quotes/get-pool-quotes.js +8 -1
- package/dist/pools/quotes/get-pool-quotes.js.map +1 -1
- package/dist/pools/quotes/query-document.d.ts.map +1 -1
- package/dist/pools/quotes/query-document.js +1 -1
- package/dist/pools/quotes/query-document.js.map +1 -1
- package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -1
- package/dist/pools/quotes/to-pool-quote.js +13 -0
- package/dist/pools/quotes/to-pool-quote.js.map +1 -1
- package/dist/pools/rewards/query.js +25 -25
- package/dist/pools/statistics/calculate-pool-statistics.d.ts +69 -0
- package/dist/pools/statistics/calculate-pool-statistics.d.ts.map +1 -0
- package/dist/pools/statistics/calculate-pool-statistics.js +42 -0
- package/dist/pools/statistics/calculate-pool-statistics.js.map +1 -0
- package/dist/pools/statistics/get-pool-statistics.d.ts +29 -0
- package/dist/pools/statistics/get-pool-statistics.d.ts.map +1 -0
- package/dist/pools/statistics/get-pool-statistics.js +61 -0
- package/dist/pools/statistics/get-pool-statistics.js.map +1 -0
- package/dist/pools/statistics/index.d.ts +4 -0
- package/dist/pools/statistics/index.d.ts.map +1 -0
- package/dist/pools/statistics/query.d.ts +17 -0
- package/dist/pools/statistics/query.d.ts.map +1 -0
- package/dist/pools/statistics/query.js +21 -0
- package/dist/pools/statistics/query.js.map +1 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.d.ts +32 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.d.ts.map +1 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.js +43 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.js.map +1 -0
- package/dist/pools/token-metadata/index.d.ts +3 -0
- package/dist/pools/token-metadata/index.d.ts.map +1 -0
- package/dist/pools/token-metadata/query.d.ts +11 -0
- package/dist/pools/token-metadata/query.d.ts.map +1 -0
- package/dist/pools/token-metadata/query.js +21 -0
- package/dist/pools/token-metadata/query.js.map +1 -0
- package/dist/pools/token-support/check-listing-token-support.d.ts +23 -0
- package/dist/pools/token-support/check-listing-token-support.d.ts.map +1 -0
- package/dist/pools/token-support/check-listing-token-support.js +36 -0
- package/dist/pools/token-support/check-listing-token-support.js.map +1 -0
- package/dist/pools/token-support/index.d.ts +3 -0
- package/dist/pools/token-support/index.d.ts.map +1 -0
- package/dist/pools/token-support/query.d.ts +11 -0
- package/dist/pools/token-support/query.d.ts.map +1 -0
- package/dist/pools/token-support/query.js +21 -0
- package/dist/pools/token-support/query.js.map +1 -0
- package/dist/pools/trade-history/calculate-history-metrics.d.ts +12 -0
- package/dist/pools/trade-history/calculate-history-metrics.d.ts.map +1 -0
- package/dist/pools/trade-history/calculate-history-metrics.js +36 -0
- package/dist/pools/trade-history/calculate-history-metrics.js.map +1 -0
- package/dist/pools/trade-history/get-pool-trade-history.d.ts +21 -1
- package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -1
- package/dist/pools/trade-history/get-pool-trade-history.js +57 -18
- package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -1
- package/dist/pools/trade-history/query-document.d.ts +3 -0
- package/dist/pools/trade-history/query-document.d.ts.map +1 -1
- package/dist/pools/trade-history/query-document.js +1 -1
- package/dist/pools/trade-history/query-document.js.map +1 -1
- package/dist/pools/transactions/get-pool-transaction-range.d.ts +6 -0
- package/dist/pools/transactions/get-pool-transaction-range.d.ts.map +1 -0
- package/dist/pools/transactions/get-pool-transaction-range.js +26 -0
- package/dist/pools/transactions/get-pool-transaction-range.js.map +1 -0
- package/dist/pools/transactions/index.d.ts +1 -0
- package/dist/pools/transactions/index.d.ts.map +1 -1
- package/dist/pools/types/generated/listing-backend.js +34 -10
- package/dist/pools/types/generated/listing-backend.js.map +1 -1
- package/dist/pools/types.d.ts +129 -6
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js.map +1 -1
- package/dist/pools/user-markets/get-user-listing-markets.d.ts +2 -0
- package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -1
- package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -1
- package/dist/pools/user-markets/to-user-listing-market.js +1 -1
- package/dist/pools/user-markets/to-user-listing-market.js.map +1 -1
- package/dist/pools/user-transactions/get-user-transactions.d.ts +2 -0
- package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -1
- package/dist/pools/user-transactions/get-user-transactions.js.map +1 -1
- package/dist/pools/user-transactions/to-user-transaction.d.ts +5 -1
- package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -1
- package/dist/pools/user-transactions/to-user-transaction.js +3 -0
- package/dist/pools/user-transactions/to-user-transaction.js.map +1 -1
- package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts +22 -12
- package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.d.ts.map +1 -1
- package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js +20 -21
- package/dist/quotes/get-quote-events-by-type/get-quote-events-by-type.js.map +1 -1
- package/dist/quotes/get-quote-events-by-type/query-document.d.ts +5 -5
- package/dist/quotes/get-quote-events-by-type/query-document.d.ts.map +1 -1
- package/dist/quotes/get-quote-events-by-type/query-document.js +1 -1
- package/dist/quotes/get-quote-events-by-type/query-document.js.map +1 -1
- package/dist/quotes/get-quote-events-by-type/query.d.ts +7 -6
- package/dist/quotes/get-quote-events-by-type/query.d.ts.map +1 -1
- package/dist/quotes/get-quote-events-by-type/query.js +19 -17
- package/dist/quotes/get-quote-events-by-type/query.js.map +1 -1
- package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts +2 -2
- package/dist/quotes/get-quote-events-by-type/to-quote-event-row.d.ts.map +1 -1
- package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js +1 -3
- package/dist/quotes/get-quote-events-by-type/to-quote-event-row.js.map +1 -1
- package/dist/quotes/get-quote-events-by-type/types.d.ts +14 -3
- package/dist/quotes/get-quote-events-by-type/types.d.ts.map +1 -1
- package/dist/quotes/get-quote-events-by-type/types.js.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts +12 -2
- package/dist/quotes/get-quote-funding/get-quote-funding.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/get-quote-funding.js +21 -17
- package/dist/quotes/get-quote-funding/get-quote-funding.js.map +1 -1
- package/dist/quotes/get-quote-funding/query-document.d.ts +3 -2
- package/dist/quotes/get-quote-funding/query-document.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/query-document.js +1 -1
- package/dist/quotes/get-quote-funding/query-document.js.map +1 -1
- package/dist/quotes/get-quote-funding/query.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/query.js +2 -1
- package/dist/quotes/get-quote-funding/query.js.map +1 -1
- package/dist/quotes/get-quote-funding/to-funding-row.d.ts.map +1 -1
- package/dist/quotes/get-quote-funding/to-funding-row.js +1 -3
- package/dist/quotes/get-quote-funding/to-funding-row.js.map +1 -1
- package/dist/quotes/get-quote-history/get-quote-history.d.ts +18 -7
- package/dist/quotes/get-quote-history/get-quote-history.d.ts.map +1 -1
- package/dist/quotes/get-quote-history/get-quote-history.js +32 -22
- package/dist/quotes/get-quote-history/get-quote-history.js.map +1 -1
- package/dist/quotes/get-quote-history/query-document.d.ts +12 -7
- package/dist/quotes/get-quote-history/query-document.d.ts.map +1 -1
- package/dist/quotes/get-quote-history/query-document.js +1 -1
- package/dist/quotes/get-quote-history/query-document.js.map +1 -1
- package/dist/quotes/get-quote-history/query.d.ts +3 -2
- package/dist/quotes/get-quote-history/query.d.ts.map +1 -1
- package/dist/quotes/get-quote-history/query.js +22 -19
- package/dist/quotes/get-quote-history/query.js.map +1 -1
- package/dist/quotes/get-quote-history/to-history-row.d.ts.map +1 -1
- package/dist/quotes/get-quote-history/to-history-row.js +52 -37
- package/dist/quotes/get-quote-history/to-history-row.js.map +1 -1
- package/dist/quotes/get-quote-history/types.d.ts +41 -0
- package/dist/quotes/get-quote-history/types.d.ts.map +1 -1
- package/dist/quotes/get-quote-history/types.js.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts +21 -11
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js +19 -21
- package/dist/quotes/get-quotes-events-by-type/get-quotes-events-by-type.js.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/query-document.d.ts +7 -7
- package/dist/quotes/get-quotes-events-by-type/query-document.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/query-document.js +1 -1
- package/dist/quotes/get-quotes-events-by-type/query-document.js.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/query.d.ts +8 -6
- package/dist/quotes/get-quotes-events-by-type/query.d.ts.map +1 -1
- package/dist/quotes/get-quotes-events-by-type/query.js +22 -20
- package/dist/quotes/get-quotes-events-by-type/query.js.map +1 -1
- package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts +38 -0
- package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.d.ts.map +1 -0
- package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js +28 -0
- package/dist/quotes/get-subgraph-quotes/get-subgraph-quotes.js.map +1 -0
- package/dist/quotes/get-subgraph-quotes/index.d.ts +5 -0
- package/dist/quotes/get-subgraph-quotes/index.d.ts.map +1 -0
- package/dist/quotes/get-subgraph-quotes/query-document.d.ts +15 -0
- package/dist/quotes/get-subgraph-quotes/query-document.d.ts.map +1 -0
- package/dist/quotes/get-subgraph-quotes/query-document.js +7 -0
- package/dist/quotes/get-subgraph-quotes/query-document.js.map +1 -0
- package/dist/quotes/get-subgraph-quotes/query.d.ts +37 -0
- package/dist/quotes/get-subgraph-quotes/query.d.ts.map +1 -0
- package/dist/quotes/get-subgraph-quotes/query.js +23 -0
- package/dist/quotes/get-subgraph-quotes/query.js.map +1 -0
- package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts +12 -0
- package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.d.ts.map +1 -0
- package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js +32 -0
- package/dist/quotes/get-subgraph-quotes/to-subgraph-quote-row.js.map +1 -0
- package/dist/quotes/get-subgraph-quotes/types.d.ts +54 -0
- package/dist/quotes/get-subgraph-quotes/types.d.ts.map +1 -0
- package/dist/quotes/index.d.ts +1 -0
- package/dist/quotes/index.d.ts.map +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +5 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.d.ts.map +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.js +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-pnl.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-pnl.js +8 -8
- package/dist/quotes/upnl/calculate-quote-pnl.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-upnl.d.ts +2 -2
- package/dist/quotes/upnl/calculate-quote-upnl.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-upnl.js +16 -15
- package/dist/quotes/upnl/calculate-quote-upnl.js.map +1 -1
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts +122 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js +80 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.js.map +1 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts +37 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js +27 -0
- package/dist/symmio-contracts/symmio/get-party-a-open-positions-batch/query.js.map +1 -0
- package/dist/symmio-contracts/symmio/index.d.ts +2 -0
- package/dist/symmio-contracts/symmio/index.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts +3 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/index.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts +37 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js +15 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.js.map +1 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts +38 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js +29 -0
- package/dist/symmio-contracts/symmio/is-party-a-liquidated/query.js.map +1 -0
- package/dist/symmio-subgraph/index.d.ts +1 -0
- package/dist/symmio-subgraph/index.d.ts.map +1 -1
- package/dist/symmio-subgraph/subgraph-decode.d.ts +51 -0
- package/dist/symmio-subgraph/subgraph-decode.d.ts.map +1 -0
- package/dist/symmio-subgraph/subgraph-decode.js +24 -0
- package/dist/symmio-subgraph/subgraph-decode.js.map +1 -0
- package/dist/symmio-subgraph/subgraph-filters.d.ts +97 -0
- package/dist/symmio-subgraph/subgraph-filters.d.ts.map +1 -0
- package/dist/symmio-subgraph/subgraph-filters.js +39 -0
- package/dist/symmio-subgraph/subgraph-filters.js.map +1 -0
- package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +26 -6
- package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/gql.js +16 -11
- package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +3661 -9
- package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/graphql.js +2 -2
- package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
- package/package.json +1 -1
package/dist/pools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/pools/types.ts"],"sourcesContent":["import type { MarketStatus } from \"./types/generated/listing-backend\";\n\n/**\n * Fixed-point scale of every money and rate field the listing service returns.\n *\n * The service reports these as decimal **strings** at 18 decimals, regardless of\n * the token's own decimals or the collateral's (`\"1000000000000000000\"` = `1`).\n * The SDK keeps them as `bigint` at this scale so nothing is lost; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` from `@symmio/utils/decimal` at\n * the display edge.\n *\n * **What the descaled number means differs by field.** For money fields it is a\n * USD amount (`1e18` = `$1`). For rate fields it is **already a percentage**\n * (`1e18` = `1%`), *not* a fraction — do **not** multiply by 100 to render one.\n *\n * Verified against the live service: a pool with `tvl` `177.78` and `reward_24h`\n * `0.0055` annualizes to `1.1295%`, and its `apr_24h` descales to exactly\n * `1.1295`.\n */\nexport const LISTING_VALUE_DECIMALS = 18;\n\n/**\n * Lifecycle status of a market in the permissionless-listing service.\n *\n * The service — not the chain — owns this state machine. A market becomes\n * tradable only at {@link ListingMarketStatus.LISTED}; before that it has no\n * `symbolId` and no solver market behind it.\n *\n * - `WAITING_FOR_DEPOSIT` — application accepted, the listing deposit has not\n * landed at the custodial address yet.\n * - `UNDER_REVIEW` — deposit received, awaiting the operator's decision.\n * - `REJECTED` — the operator declined the listing; the deposit is refundable.\n * - `LISTED` — live and tradable; `symbolId` is assigned.\n * - `DELISTED` — was live, has since been withdrawn from trading.\n */\nexport enum ListingMarketStatus {\n WAITING_FOR_DEPOSIT = \"waiting_for_deposit\",\n UNDER_REVIEW = \"under_review\",\n REJECTED = \"rejected\",\n LISTED = \"listed\",\n DELISTED = \"delisted\",\n}\n\n/**\n * Why the inventory service has locked a market's pool against new deposits.\n *\n * A lock blocks deposits only: trading, withdrawals, claims and every other\n * flow stay available. It is also orthogonal to {@link ListingMarketStatus}: a\n * `LISTED` market can be locked, and the lock lifts without the lifecycle\n * status moving. The catalogue\n * row carries only the flag ({@link ListingMarket.isLocked}); the reasons are on\n * the detail read ({@link ListingMarketDetail.lockReasons}).\n *\n * - `LIQUIDITY_EXPOSURE` — locked on the service's liquidity-exposure limit.\n * - `LOW_TVL` — the pool's TVL is below the service's threshold.\n * - `PRICE_UNAVAILABLE` — the service has no price for the token.\n * - `SHORT_CIRCUIT` — the service's short-circuit guard tripped.\n * - `MANUAL` — an operator locked the market by hand.\n * - `UNKNOWN` — a reason this SDK release does not recognize. The mapper folds\n * every unrecognized wire value here rather than throwing, so a newer backend\n * cannot break the read.\n */\nexport enum MarketLockReason {\n LIQUIDITY_EXPOSURE = \"LIQUIDITY_EXPOSURE\",\n LOW_TVL = \"LOW_TVL\",\n PRICE_UNAVAILABLE = \"PRICE_UNAVAILABLE\",\n SHORT_CIRCUIT = \"SHORT_CIRCUIT\",\n MANUAL = \"MANUAL\",\n UNKNOWN = \"UNKNOWN\",\n}\n\n/**\n * Chains the listing service accepts a listing deposit on.\n *\n * This is the chain the **token** lives on and where its listing collateral was\n * deposited — it is **not** the chain the resulting market trades on. A market\n * whose token is on Solana or BSC still trades on the SYMMIO deployment the\n * listing service is configured for.\n *\n * `SOLANA = 0` is a sentinel the service uses for its one non-EVM chain, not a\n * real chain id: a `ListingMarket` on it carries a base58 `contractAddress`, so\n * never feed one to an EVM address helper without checking `chainId` first.\n */\nexport enum ListingDepositChainId {\n /** Sentinel for Solana — not an EVM chain id. Addresses are base58. */\n SOLANA = 0,\n BSC = 56,\n BASE = 8453,\n SONIC = 146,\n ARBITRUM_ONE = 42161,\n ROBINHOOD = 4663,\n ARC = 5042,\n HYPER_EVM = 999,\n}\n\n/**\n * Chains the listing backend's token-price endpoint accepts, keyed by the\n * vendor's chain **name** — the `chain` input of `getTokenPrice`.\n *\n * This is a different key space from {@link ListingDepositChainId}: that enum\n * is numeric (an EVM chain id, or the `0` sentinel for Solana) and names where\n * a listing deposit lands; this one is a string name the price endpoint\n * understands, and two of its members (`ROBINHOOD`, `ARC`) have no numeric\n * twin at all. Do not cast between the two — pick the member explicitly.\n */\nexport enum TokenPriceChain {\n BASE = \"BASE\",\n SOLANA = \"SOLANA\",\n BSC = \"BSC\",\n ARBITRUM_ONE = \"ARBITRUM_ONE\",\n SONIC = \"SONIC\",\n ROBINHOOD = \"ROBINHOOD\",\n ARC = \"ARC\",\n}\n\n/**\n * The same metric measured over each trailing window the listing service\n * reports.\n *\n * Every entry is a `bigint` at {@link LISTING_VALUE_DECIMALS}, or `null` when\n * the service has no value for that window — a young market has no 30-day\n * figure, and `null` means *absent*, never zero.\n */\nexport interface ListingTrailingWindows {\n /** Trailing 1 hour. */\n h1: bigint | null;\n /** Trailing 6 hours. */\n h6: bigint | null;\n /** Trailing 24 hours. */\n h24: bigint | null;\n /** Trailing 30 days. */\n d30: bigint | null;\n}\n\n/**\n * A metric the service reports over the trailing windows **and** since listing.\n *\n * Only the two APY series carry a lifetime column; APR does not, which is why\n * `lifetime` lives here rather than on {@link ListingTrailingWindows}.\n */\nexport interface ListingApyWindows extends ListingTrailingWindows {\n /** Since the market was listed. */\n lifetime: bigint | null;\n}\n\n/**\n * One market in the permissionless-listing catalog — a row of the pools list.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; `null`\n * means the service reported no value, which is distinct from zero.\n */\nexport interface ListingMarket {\n /**\n * The listed token's contract address on {@link ListingMarket.chainId}.\n *\n * Typed as `string`, **not** viem's `Address`: Solana listings\n * (`chainId === ListingDepositChainId.SOLANA`) carry a base58 address that is\n * not 0x-prefixed. This is also the id used to address a single market in the\n * rest of the listing API.\n */\n contractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n chainId: ListingDepositChainId;\n /**\n * The solver market id this listing trades under, or `null` when it has none\n * yet. Assigned when the market reaches {@link ListingMarketStatus.LISTED};\n * everything downstream (prices, notional caps, quotes, subgraph rows) keys\n * off it, so a `null` here means the market is not tradable.\n */\n symbolId: number | null;\n /** Token ticker, e.g. `\"SYMM\"`. */\n tokenTicker: string;\n /** Token display name, e.g. `\"Symmio\"`. */\n tokenName: string;\n /** Maximum leverage the market allows, as a whole multiplier (`20` = 20x). */\n maxLeverage: number;\n /** Token market capitalization, in USD. */\n marketCap: bigint | null;\n /** Trailing 24-hour trading volume, in USD. */\n vol24h: bigint | null;\n /** Total value locked in the market's pool, in USD. */\n tvl: bigint | null;\n /** Notional the solver will still take on this market, in USD. */\n liquidity: bigint | null;\n /** Notional currently open on this market, in USD. */\n openInterest: bigint | null;\n /** LP rewards accrued over the trailing 24 hours, in USD. */\n reward24h: bigint | null;\n /** Headline APR: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n apr: bigint | null;\n /**\n * APR broken out per trailing window, same units as {@link ListingMarket.apr}.\n * There is no lifetime APR — use {@link ListingMarket.apr} for the headline.\n */\n aprByWindow: ListingTrailingWindows;\n /** APY attributed to TVL growth, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n priceDrivenApy: ListingApyWindows;\n /** When the market went live, as a Unix timestamp in **seconds**. `null` before it is listed. */\n listingTime: number | null;\n /** Where the market sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this market's pool locked\n * against new deposits. Only deposits are blocked; trading, withdrawals and\n * every other flow stay available. Independent of\n * {@link ListingMarket.marketStatus}: a `LISTED` market can be locked. The row\n * carries only the flag; the reasons are on\n * {@link ListingMarketDetail.lockReasons}.\n */\n isLocked: boolean;\n}\n\n/** One page of {@link ListingMarket} rows, with the totals needed to paginate. */\nexport interface ListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: ListingMarket[];\n}\n\n/**\n * A {@link ListingMarket} enriched with the signed-in user's position in it — one\n * row of \"Your Pools\", the markets that generated a deposit address for the user.\n */\nexport interface UserListingMarket extends ListingMarket {\n /** The user's current deposit into this pool, in USD (18-dec bigint). `null` when the deposit address exists but nothing has been deposited yet. */\n userDeposit: bigint | null;\n /** The user's share of the pool, as a percentage number (not 18-dec scaled). */\n userSharePercentage: number;\n /** The user's accrued revenue from this pool, in USD (18-dec bigint), or `null` when absent. */\n userRevenue: bigint | null;\n}\n\n/** One page of {@link UserListingMarket} rows, with the totals needed to paginate. */\nexport interface UserListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: UserListingMarket[];\n}\n\n/**\n * The signed-in user's LP position and profit in a single pool — the authed\n * per-token read behind a pool's \"your position\" panel.\n *\n * Every field is a `bigint` at {@link LISTING_VALUE_DECIMALS} (18), independent\n * of the token's or collateral's own decimals; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge. An absent\n * figure is normalized to `0n`, not `null`.\n */\nexport interface UserPoolProfit {\n /** LP balance valued in the pool's token units, 18-dec bigint. */\n userBalanceInTokens: bigint;\n /** LP balance valued in USDC, 18-dec bigint USD. */\n userBalanceInUsdc: bigint;\n /** Rewards the user can claim now, 18-dec bigint USD. */\n claimableReward: bigint;\n /** Rewards already claimed, 18-dec bigint USD. */\n claimedReward: bigint;\n /** Token amount the user deposited, 18-dec bigint. */\n userDepositedTokenAmount: bigint;\n /** The user's LP shares, 18-dec bigint. */\n userLpAmount: bigint;\n /** LP shares queued for withdrawal (the pending-withdrawal amount), 18-dec bigint. */\n pendingWithdrawLpAmount: bigint;\n /**\n * LP shares free to withdraw right now — `userLpAmount − pendingWithdrawLpAmount`,\n * floored at `0n`. This is the ceiling a withdrawal (`withdrawLp`) may request;\n * the shares already counted in {@link UserPoolProfit.pendingWithdrawLpAmount}\n * are spoken for. Derived by the SDK, not a field the service returns. 18-dec\n * bigint.\n */\n availableLpAmount: bigint;\n}\n\n/**\n * The receipt returned by `claimProfit` — the outcome of a `/v2/claim` request.\n *\n * The claim is synchronous: a `200` means the USDC was moved to the target\n * sub-account. `amountClaimed` is the moved figure normalized to a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18), `claimRequestId` references the claim in the\n * service, and `transactionHash` is the on-chain transfer hash when the service\n * has one (`null` otherwise).\n */\nexport interface PoolClaimResult {\n /** The service's status string, e.g. `\"ok\"`. */\n status: string;\n /** USDC moved to the sub-account, 18-dec bigint USD. */\n amountClaimed: bigint;\n /** Claim id — reference it to restore or look up the claim later. */\n claimRequestId: string;\n /** On-chain hash of the claim transfer, or `null` when the service has none yet. */\n transactionHash: string | null;\n}\n\n/**\n * One past pool-reward claim, from the user's claim history (`getClaimHistory`).\n *\n * The internal `wallet_id` / `market_id` UUIDs the service carries are dropped —\n * they address rows in the backend, not anything a consumer renders.\n */\nexport interface PoolClaim {\n /** Claim id — reference it to look the claim up in the service. */\n claimRequestId: string;\n /** Sub-account address that received the claimed USDC. */\n accountAddress: string;\n /** USDC claimed, 18-dec bigint USD. */\n amount: bigint;\n /** On-chain hash of the claim transfer, or `null` when the service has none. */\n transactionHash: string | null;\n /** When the claim was created, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolClaim} rows — the signed-in user's claim history. */\nexport interface PoolClaimHistoryPage {\n /** Total claims matching the query across all pages — what a pager divides. */\n count: number;\n /** The claims themselves, newest first. */\n items: PoolClaim[];\n}\n\n/**\n * The receipt returned by `cancelWithdraw` — the outcome of cancelling a queued\n * LP withdrawal.\n */\nexport interface PoolCancelWithdrawResult {\n /** The affected withdrawal's transaction id, echoed by the service. */\n transactionId: string;\n /**\n * The withdrawal's resulting status, e.g. `\"canceled\"`. Carried through as the\n * service's raw string — its enum (`canceled` | `pending` | `transferred` | …)\n * is a superset of {@link PoolTransactionStatus}, so it is not narrowed to it.\n */\n status: string;\n}\n\n/**\n * The receipt returned by `refundMarket` — the outcome of refunding a deposit on\n * a rejected market.\n */\nexport interface PoolRefundResult {\n /** On-chain hash of the refund transfer. */\n transactionHash: string;\n}\n\n/**\n * The signed-in user's **retry allowance** for one rejected market\n * (`getRetryListingInfo`) — how many listing retries remain and the cooldown\n * before the next.\n */\nexport interface RetryListingInfo {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries the user has left for this market. */\n remainingRetries: number;\n /** Seconds until the next retry is allowed, or `null` when no cooldown is in effect. */\n remainingCooldownSeconds: number | null;\n}\n\n/**\n * The result of `retryListing` — the retry allowance left after re-submitting a\n * rejected market.\n */\nexport interface RetryListingResult {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries left after this one. */\n remainingRetries: number;\n /** Seconds before the next retry is allowed. */\n cooldownSeconds: number;\n}\n\n/**\n * The signed-in user's deposit wallet for one market — the get-or-create result\n * of the authed `/v2/market/deposit-address` endpoint. This is the address the\n * user sends funds to in order to deposit into the market's pool.\n */\nexport interface MarketDepositAddress {\n /** The market's token contract address (EVM 0x… or Solana base58). */\n tokenContractAddress: string;\n /** The signed-in user this deposit wallet belongs to. */\n userAddress: string;\n /** The market's deposit chain. */\n depositChain: ListingDepositChainId;\n /** The deposit address — where the user sends funds to deposit into this market. `null` when the service returned none. */\n depositAddress: string | null;\n /** The token's on-chain decimals. */\n tokenDecimal: number;\n /** The market's listing lifecycle status. */\n marketStatus: ListingMarketStatus;\n}\n\n/**\n * A pre-listing price **estimate** for one token — the normalized result of\n * the authed `/v2/market/token-price` endpoint, which asks the Price Service\n * for a token that is not (yet) listed.\n *\n * The backend caches the figure for about five minutes and rate-limits the\n * endpoint, so treat `price` as a display estimate, never as a mark or trade\n * price: render it with a `~`, and do not poll for a fresher one.\n */\nexport interface TokenPrice {\n /** USD per token, as the service reports it — a plain float, always `> 0`. */\n price: number;\n}\n\n/**\n * The listing-pipeline status of a single market — the normalized result of\n * `getListingStatus`, keyed by the market's token address and deposit chain.\n *\n * `marketStatus` is the overall lifecycle status (the same machine as\n * {@link ListingMarketStatus}); the remaining fields describe where the listing\n * is in the backend's step pipeline and whether the current step is retrying or\n * has errored.\n */\nexport interface ListingStatus {\n /** Overall lifecycle status of the market, mapped from the service's `market_status`. */\n marketStatus: ListingMarketStatus;\n /** The step the listing pipeline is currently on, or `null` when it is not in a step. */\n currentStep: string | null;\n /** The ordered pipeline steps the listing moves through. */\n steps: string[];\n /** Error code reported for the current step, or `null` when there is no error. */\n errorCode: number | null;\n /** Human-readable detail for the current step's error, or `null`. */\n errorDetail: string | null;\n /** How many times the current step has been retried. */\n retryCount: number;\n /** The maximum retries allowed for the current step. */\n retryLimit: number;\n}\n\n/**\n * The protocol's global new-market listing cap for the current rolling weekly\n * window — how many pools may still be listed across the protocol before the\n * window resets.\n */\nexport interface WeeklyListingLimit {\n /** Total new-market listings allowed per rolling weekly window. */\n limit: number;\n /** Listings still available in the current window — `0` means no more pools can be listed until reset. */\n remaining: number;\n /** When the window resets, as the Unix timestamp the service returns (`reset_at`). */\n resetAt: number;\n}\n\n/**\n * Server-side sort keys accepted by `getListingMarkets`.\n *\n * Mirrors the service's `sort_by` enum verbatim — snake_case, not the SDK's\n * camelCase field names — because the value is a wire literal, and translating\n * it would break silently the moment the service adds a key.\n *\n * Note the two bare keys: `tvl_driven_apy` and `price_driven_apy` have no\n * matching bare response field. They sort by the **lifetime** column\n * (`tvl_driven_apy_lifetime` / `price_driven_apy_lifetime`).\n */\nexport type ListingMarketSortField =\n | \"liquidity\"\n | \"tvl\"\n | \"market_cap\"\n | \"vol24h\"\n | \"open_interest\"\n | \"apr_1h\"\n | \"apr_6h\"\n | \"apr_24h\"\n | \"apr_30d\"\n | \"reward_24h\"\n | \"apr\"\n | \"tvl_driven_apy_1h\"\n | \"tvl_driven_apy_6h\"\n | \"tvl_driven_apy_24h\"\n | \"tvl_driven_apy_30d\"\n | \"tvl_driven_apy\"\n | \"price_driven_apy_1h\"\n | \"price_driven_apy_6h\"\n | \"price_driven_apy_24h\"\n | \"price_driven_apy_30d\"\n | \"price_driven_apy\"\n | \"listing_time\";\n\n/** Sort direction. */\nexport type ListingSortDirection = \"asc\" | \"desc\";\n\n/**\n * An inclusive `[min, max]` bound on one of the service's value fields. Either\n * end may be omitted for a one-sided bound.\n *\n * Bounds use the **same 18-decimal scale as the response**\n * ({@link LISTING_VALUE_DECIMALS}), not the human-readable figure. Filtering for\n * \"market cap of at least one million USD\" is\n * `{ min: parseUnits(\"1000000\", LISTING_VALUE_DECIMALS) }`, not `{ min: 1_000_000 }`\n * — the latter is a bound of `0.000000000001` USD and silently matches nothing\n * useful. Verified against the live service.\n */\nexport interface ListingValueRange {\n /** Inclusive lower bound at 18 decimals (`__ge` on the wire). */\n min?: bigint;\n /** Inclusive upper bound at 18 decimals (`__le` on the wire). */\n max?: bigint;\n}\n\n/**\n * An inclusive `[min, max]` bound on a timestamp field, in Unix **seconds**\n * (not milliseconds, and not 18-decimal scaled).\n */\nexport interface ListingTimeRange {\n /** Inclusive lower bound, Unix seconds (`__ge` on the wire). */\n min?: number;\n /** Inclusive upper bound, Unix seconds (`__le` on the wire). */\n max?: number;\n}\n\n/**\n * Range filters `getListingMarkets` accepts. Every key is optional; omitted keys\n * are not sent.\n *\n * All {@link ListingValueRange} bounds are at {@link LISTING_VALUE_DECIMALS};\n * `listingTime` is the one exception and takes Unix seconds.\n */\nexport interface ListingMarketFilters {\n /** Token market capitalization, USD. */\n marketCap?: ListingValueRange;\n /** Trailing 24-hour volume, USD. */\n vol24h?: ListingValueRange;\n /** Total value locked, USD. */\n tvl?: ListingValueRange;\n /** Available notional, USD. */\n liquidity?: ListingValueRange;\n /** Open notional, USD. */\n openInterest?: ListingValueRange;\n /** Trailing 24-hour LP rewards, USD. */\n reward24h?: ListingValueRange;\n /** Headline APR bounds, at the field's own scale (`1e18` = `1%`). */\n apr?: ListingValueRange;\n /** APR over the trailing hour. */\n apr1h?: ListingValueRange;\n /** APR over the trailing 6 hours. */\n apr6h?: ListingValueRange;\n /** APR over the trailing 24 hours. */\n apr24h?: ListingValueRange;\n /** APR over the trailing 30 days. */\n apr30d?: ListingValueRange;\n /** TVL-driven APY over the trailing hour. */\n tvlDrivenApy1h?: ListingValueRange;\n /** TVL-driven APY over the trailing 6 hours. */\n tvlDrivenApy6h?: ListingValueRange;\n /** TVL-driven APY over the trailing 24 hours. */\n tvlDrivenApy24h?: ListingValueRange;\n /** TVL-driven APY over the trailing 30 days. */\n tvlDrivenApy30d?: ListingValueRange;\n /** TVL-driven APY over the market's lifetime. */\n tvlDrivenApy?: ListingValueRange;\n /** Price-driven APY over the trailing hour. */\n priceDrivenApy1h?: ListingValueRange;\n /** Price-driven APY over the trailing 6 hours. */\n priceDrivenApy6h?: ListingValueRange;\n /** Price-driven APY over the trailing 24 hours. */\n priceDrivenApy24h?: ListingValueRange;\n /** Price-driven APY over the trailing 30 days. */\n priceDrivenApy30d?: ListingValueRange;\n /** Price-driven APY over the market's lifetime. */\n priceDrivenApy?: ListingValueRange;\n /** Listing timestamp bounds, Unix seconds. */\n listingTime?: ListingTimeRange;\n}\n\n/**\n * Which side of the pool's book a {@link PoolPosition} row describes.\n *\n * The pool's inventory is reported as two aggregates, not a list of individual\n * trades — the detail read gives one long total and one short total.\n */\nexport enum PoolPositionSide {\n LONG = \"long\",\n SHORT = \"short\",\n}\n\n/**\n * One side of a pool's aggregate position book.\n *\n * Every figure is a `bigint` at {@link LISTING_VALUE_DECIMALS}. `upnl` is signed\n * — a losing side reports a negative value — and is the only field here that\n * routinely is.\n */\nexport interface PoolPosition {\n /** Which side this row aggregates. */\n side: PoolPositionSide;\n /** Total size held on this side, in the pool token's units. */\n size: bigint;\n /** Notional value of the side, in USD. */\n value: bigint;\n /** Size-weighted average open price of the side, in USD. */\n avgOpenPrice: bigint;\n /** Unrealized PnL of the side, in USD. Signed. */\n upnl: bigint;\n}\n\n/**\n * A pool's public detail — the aggregate stats and inventory position behind a\n * pool page.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; recall\n * that a descaled *rate* is already a percentage (`1e18` = `1%`) while a\n * descaled *money* field is USD (`1e18` = `$1`). `null` means the backend\n * reported no value, which is not zero.\n *\n * A **delisted** pool is a documented special case: the backend returns cached\n * remaining token and USDC balances with `tvl` fixed at zero.\n */\nexport interface ListingMarketDetail {\n /** The pool's token contract address — its id in the listing API. */\n tokenContractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n depositChain: ListingDepositChainId;\n /** Token display name. */\n tokenName: string;\n /** Token ticker, or `null` when the backend has none. */\n tokenTicker: string | null;\n /** Token decimals. */\n tokenDecimal: number;\n /** Solver market id, or `null` when the pool is not tradable yet. */\n symbolId: number | null;\n /** Where the pool sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this pool locked against new\n * deposits. Only deposits are blocked; trading, withdrawals and every other\n * flow stay available. Independent of {@link ListingMarketDetail.marketStatus}.\n * `false` when the backend reports no lock state, as it does for a delisted\n * pool.\n */\n isLocked: boolean;\n /**\n * Why the pool is locked, one entry per active reason; empty when it is not\n * locked. A reason this SDK release does not recognize arrives as\n * {@link MarketLockReason.UNKNOWN}.\n */\n lockReasons: MarketLockReason[];\n /** Maximum leverage the market allows, as a whole multiplier. */\n maxLeverage: number;\n /** Share of revenue routed to token buybacks, as a percentage (`50` = 50%). */\n buybackRatio: number;\n /** When the market went live, as a Unix timestamp in **seconds**. */\n listingTime: number | null;\n /** Pool age in **seconds**, or `null` before listing. */\n age: number | null;\n /** Number of distinct LPs in the pool. */\n activeLps: number;\n /** Total value locked in the pool, USD. `0` for a delisted pool by design. */\n tvl: bigint | null;\n /** Collateral held by the pool, USD. */\n totalUsdcInPool: bigint;\n /** Pool token held by the pool, in the token's own units. */\n totalTokenInPool: bigint;\n /** Accrued maintenance fees, USD. */\n maintenanceFees: bigint;\n /** LP rewards per window, USD. */\n rewards: ListingApyWindows;\n /** Solver revenue per window, USD. */\n solverRevenue: ListingApyWindows;\n /** Headline APY per window, as a percentage. */\n apy: ListingApyWindows;\n /** APY attributed to TVL growth, per window, as a percentage. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window, as a percentage. */\n priceDrivenApy: ListingApyWindows;\n /** The pool's aggregate long side, or `null` when the backend reported none. */\n longPosition: PoolPosition | null;\n /** The pool's aggregate short side, or `null` when the backend reported none. */\n shortPosition: PoolPosition | null;\n}\n\n/** Whether a pool transaction is money going in or coming out. */\nexport enum PoolTransactionType {\n DEPOSIT = \"deposit\",\n WITHDRAW = \"withdraw\",\n}\n\n/**\n * Where a pool transaction sits in its lifecycle, as the backend reports it to\n * users.\n */\nexport enum PoolTransactionStatus {\n PENDING = \"pending\",\n SUCCESS = \"success\",\n REJECTED = \"rejected\",\n REFUND = \"refund\",\n CANCELED = \"canceled\",\n}\n\n/**\n * One deposit or withdrawal against a pool.\n *\n * Each row names its own pool (`tokenAddress`, `chainId`), so a page read across\n * every pool stays attributable row by row. `amount`, `usdcAmount` and\n * `tokenAmount` are `bigint` at {@link LISTING_VALUE_DECIMALS}. The refund fields\n * are populated only for a refunded row.\n */\nexport interface PoolTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** The pool's token contract address (EVM `0x…` or Solana base58) — the pool this row belongs to. */\n tokenAddress: string;\n /** The chain the pool's token lives on — not the chain the market trades on. */\n chainId: ListingDepositChainId;\n /** The wallet that made it. */\n walletAddress: string;\n /** Amount moved, in the transaction's own denomination. */\n amount: bigint;\n /** Collateral value moved, USD. */\n usdcAmount: bigint;\n /** Token amount moved, in the pool token's units. */\n tokenAmount: bigint;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** Hash of the refund transaction, or `null` when this is not a refund. */\n refundTransactionHash: string | null;\n /** When the refund completed, Unix **seconds**; `null` when not a refund. */\n refundTime: number | null;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** When the transaction happened, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolTransaction} rows — one pool's, or every pool's when the read is not narrowed to a token. */\nexport interface PoolTransactionPage {\n /**\n * The token address the page was narrowed to, echoed by the backend in its canonical form, or `null` when the page\n * spans every pool. Each row carries its own `tokenAddress` either way.\n */\n marketAddress: string | null;\n /** Total rows matching the query across all pages — what a pager divides, not `items.length`. */\n count: number;\n /** The rows themselves, newest first. */\n items: PoolTransaction[];\n}\n\n/**\n * One row of the signed-in user's transaction history (`getUserTransactions`) —\n * a deposit or withdrawal they made, on any pool.\n *\n * Unlike {@link PoolTransaction} (public, every LP), this is authed and scoped to\n * one user, every pool — and each row carries the token's display metadata\n * (`tokenName`, `tokenTicker`, `tokenDecimals`), not just its identity\n * (`tokenAddress`, `chainId`).\n */\nexport interface UserTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** Amount moved, 18-dec bigint (a 1e18-scaled figure, like every listing value). */\n amount: bigint;\n /** The token's own decimals, as reported by the service — metadata, not the `amount` scale. */\n tokenDecimals: number;\n /** The pool's token contract address (EVM `0x…` or Solana base58). */\n tokenAddress: string;\n /** The token's name. */\n tokenName: string;\n /** The token's ticker. */\n tokenTicker: string;\n /** The chain the transaction's token lives on. */\n chainId: ListingDepositChainId;\n /** The temporary deposit wallet involved, or `null` when the service omits it. */\n wallet: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** When the transaction happened, Unix **seconds**; `null` when the service omits it. */\n time: number | null;\n}\n\n/** One page of {@link UserTransaction} rows — the signed-in user's transaction history. */\nexport interface UserTransactionPage {\n /** Total rows matching the query across all pages — what a pager divides. */\n count: number;\n /** The rows themselves, newest first. */\n items: UserTransaction[];\n}\n\n/**\n * The generated `MarketStatus` enum and {@link ListingMarketStatus} carry the\n * same string values; this alias documents that the cast in the mapper is\n * value-preserving rather than a widening.\n *\n * @internal\n */\nexport type GeneratedMarketStatus = MarketStatus;\n\n/**\n * One deposit chain a new listing may use, from the listing service's public\n * config ({@link ListingConfig.supportedDepositChains}).\n */\nexport interface ListingDepositChain {\n /** Numeric chain id to send with market/deposit requests. */\n chainId: ListingDepositChainId;\n /** Human-readable chain name, e.g. \"HyperEVM\". */\n chainName: string;\n}\n\n/**\n * The client mutation limits the listing service enforces, from its public\n * config ({@link ListingConfig.rateLimits}).\n */\nexport interface ListingRateLimits {\n /** Max successful market-config updates per user+market in a rolling 24h window. */\n marketConfigUpdatesPerDay: number;\n /** Max successful profit claims per user+market in a rolling 24h window. */\n profitClaimsPerDay: number;\n}\n\n/**\n * The listing service's public client configuration — the deposit guidance,\n * listing fee, supported deposit chains, rate limits, and protocol reward share\n * a create-listing flow needs.\n *\n * The three USDC figures are `bigint` at {@link LISTING_VALUE_DECIMALS} (18),\n * independent of the collateral token's own decimals; format them with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge.\n */\nexport interface ListingConfig {\n /** Recommended initial USDC deposit to start a listing, USD at LISTING_VALUE_DECIMALS (18) as a bigint. */\n recommendedInitialDepositUsdc: bigint;\n /** Minimum accepted initial USDC deposit after slippage, USD 18-dec bigint. */\n minimumInitialDepositUsdc: bigint;\n /** Listing fee in USDC, USD 18-dec bigint. */\n listingFeeUsdc: bigint;\n /** Deposit chains new markets may use — the source of truth for a chain picker. */\n supportedDepositChains: ListingDepositChain[];\n /** Rolling-24h client mutation limits. */\n rateLimits: ListingRateLimits;\n /** Whole-percent of market revenue to the protocol before buyback/LP. */\n protocolRewardSharePercent: number;\n}\n\n/**\n * One quote in a pool's book, decoded from the analytics subgraph.\n *\n * A pool's book is **every trader's** quotes on that market, not one account's —\n * `partyA` differs from row to row. Amounts and prices are `bigint` at 18\n * decimals (the protocol's own scale, not the listing backend's), and `null`\n * means the subgraph had no value for that field.\n */\nexport interface PoolQuote {\n /** Subgraph row id (`{quoteId}-{source}`); stable, use as a table key. */\n id: string;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Raw `QuoteStatus` ordinal as the subgraph reports it. */\n quoteStatus: number | null;\n /** Raw `PositionType` ordinal — `0` long, `1` short. */\n positionType: number | null;\n /** Raw `OrderType` ordinal of the open — `0` limit, `1` market. */\n orderTypeOpen: number | null;\n /** Market ticker, when the subgraph carries one. */\n symbol: string | null;\n /** Solver market id. */\n symbolId: number | null;\n /** The account that opened the quote. */\n partyA: string;\n /** The solver that took the other side. */\n partyB: string | null;\n /** Quote size. */\n quantity: bigint | null;\n /** How much of {@link PoolQuote.quantity} has been closed. */\n closedAmount: bigint | null;\n /** Size of an in-flight close request. */\n quantityToClose: bigint | null;\n /** Price the quote actually opened at. */\n openedPrice: bigint | null;\n /** Price the opener asked for. */\n requestedOpenPrice: bigint | null;\n /** Size-weighted average of the closes so far. */\n averageClosedPrice: bigint | null;\n /** Price of an in-flight close request. */\n closePrice: bigint | null;\n /** Open price before any modification. */\n initialOpenedPrice: bigint | null;\n /** Size liquidated, when the quote was liquidated. */\n liquidateAmount: bigint | null;\n /** Price the liquidation executed at. */\n liquidatePrice: bigint | null;\n /** Block timestamp of the quote's last update, Unix **seconds**. */\n timestamp: number;\n /** Block the quote was last updated in. */\n blockNumber: bigint;\n}\n\n/**\n * One day of LP reward for a pool.\n *\n * A series of these is what a pool page's rewards chart plots — the public\n * per-pool series from `getPoolRewardChart`, or one market's slice of the\n * signed-in user's {@link UserPoolRewardChart}.\n */\nexport interface PoolRewardPoint {\n /** Start of the reward day, unix **seconds**. */\n timestamp: number;\n /**\n * Reward earned that day, `bigint` at {@link LISTING_VALUE_DECIMALS} (18).\n *\n * A **money** field, so the descaled number is a USD amount (`1e18` = `$1`) —\n * unlike the catalog's rate fields, which are already percentages. A day the\n * service reports as absent collapses to `0n` rather than `null`: a missing\n * snapshot and a zero-reward day are the same point on a chart.\n */\n reward: bigint;\n}\n\n/**\n * The signed-in user's daily reward series for **one** market, as returned by\n * `getUserRewardChart` — which reports every market the user has rewards in,\n * one entry each.\n *\n * A market is addressed by the pair `(marketAddress, marketChainId)`, matching\n * {@link ListingMarket.contractAddress} and {@link ListingMarket.chainId}. Note\n * `marketChainId` is the chain the **token** lives on, not the SYMMIO chain the\n * market trades on.\n */\nexport interface UserPoolRewardChart {\n /** The pool's token contract address — matches {@link ListingMarket.contractAddress}. */\n marketAddress: string;\n /** Chain the token lives on — matches {@link ListingMarket.chainId}. */\n marketChainId: ListingDepositChainId;\n /** The user's daily rewards in this pool, in the order the service returns them. */\n rewards: PoolRewardPoint[];\n}\n"],"mappings":";AAmBA,IAAa,IAAyB,IAgB1B,IAAL,yBAAA,GAAA;QACL,EAAA,sBAAA,uBACA,EAAA,eAAA,gBACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAqBY,IAAL,yBAAA,GAAA;QACL,EAAA,qBAAA,sBACA,EAAA,UAAA,WACA,EAAA,oBAAA,qBACA,EAAA,gBAAA,iBACA,EAAA,SAAA,UACA,EAAA,UAAA;AACF,EAAA,CAAA,CAAA,GAcY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,SAAA,KAAA,UACA,EAAA,EAAA,MAAA,MAAA,OACA,EAAA,EAAA,OAAA,QAAA,QACA,EAAA,EAAA,QAAA,OAAA,SACA,EAAA,EAAA,eAAA,SAAA,gBACA,EAAA,EAAA,YAAA,QAAA,aACA,EAAA,EAAA,MAAA,QAAA,OACA,EAAA,EAAA,YAAA,OAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,SAAA,UACA,EAAA,MAAA,OACA,EAAA,eAAA,gBACA,EAAA,QAAA,SACA,EAAA,YAAA,aACA,EAAA,MAAA;AACF,EAAA,CAAA,CAAA,GAudY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAkGY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAMY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,UAAA,WACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/pools/types.ts"],"sourcesContent":["import type { MarketStatus } from \"./types/generated/listing-backend\";\n\n/**\n * Fixed-point scale of every money and rate field the listing service returns.\n *\n * The service reports these as decimal **strings** at 18 decimals, regardless of\n * the token's own decimals or the collateral's (`\"1000000000000000000\"` = `1`).\n * The SDK keeps them as `bigint` at this scale so nothing is lost; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` from `@symmio/utils/decimal` at\n * the display edge.\n *\n * **What the descaled number means differs by field.** For money fields it is a\n * USD amount (`1e18` = `$1`). For rate fields it is **already a percentage**\n * (`1e18` = `1%`), *not* a fraction — do **not** multiply by 100 to render one.\n *\n * Verified against the live service: a pool with `tvl` `177.78` and `reward_24h`\n * `0.0055` annualizes to `1.1295%`, and its `apr_24h` descales to exactly\n * `1.1295`.\n */\nexport const LISTING_VALUE_DECIMALS = 18;\n\n/**\n * Lifecycle status of a market in the permissionless-listing service.\n *\n * The service — not the chain — owns this state machine. A market becomes\n * tradable only at {@link ListingMarketStatus.LISTED}; before that it has no\n * `symbolId` and no solver market behind it.\n *\n * - `WAITING_FOR_DEPOSIT` — application accepted, the listing deposit has not\n * landed at the custodial address yet.\n * - `UNDER_REVIEW` — deposit received, awaiting the operator's decision.\n * - `REJECTED` — the operator declined the listing; the deposit is refundable.\n * - `LISTED` — live and tradable; `symbolId` is assigned.\n * - `DELISTED` — was live, has since been withdrawn from trading.\n */\nexport enum ListingMarketStatus {\n WAITING_FOR_DEPOSIT = \"waiting_for_deposit\",\n UNDER_REVIEW = \"under_review\",\n REJECTED = \"rejected\",\n LISTED = \"listed\",\n DELISTED = \"delisted\",\n}\n\n/**\n * Why the inventory service has locked a market's pool against new deposits.\n *\n * A lock blocks deposits only: trading, withdrawals, claims and every other\n * flow stay available. It is also orthogonal to {@link ListingMarketStatus}: a\n * `LISTED` market can be locked, and the lock lifts without the lifecycle\n * status moving. The catalogue\n * row carries only the flag ({@link ListingMarket.isLocked}); the reasons are on\n * the detail read ({@link ListingMarketDetail.lockReasons}).\n *\n * - `LIQUIDITY_EXPOSURE` — locked on the service's liquidity-exposure limit.\n * - `LOW_TVL` — the pool's TVL is below the service's threshold.\n * - `PRICE_UNAVAILABLE` — the service has no price for the token.\n * - `SHORT_CIRCUIT` — the service's short-circuit guard tripped.\n * - `MANUAL` — an operator locked the market by hand.\n * - `UNKNOWN` — a reason this SDK release does not recognize. The mapper folds\n * every unrecognized wire value here rather than throwing, so a newer backend\n * cannot break the read.\n */\nexport enum MarketLockReason {\n LIQUIDITY_EXPOSURE = \"LIQUIDITY_EXPOSURE\",\n LOW_TVL = \"LOW_TVL\",\n PRICE_UNAVAILABLE = \"PRICE_UNAVAILABLE\",\n SHORT_CIRCUIT = \"SHORT_CIRCUIT\",\n MANUAL = \"MANUAL\",\n UNKNOWN = \"UNKNOWN\",\n}\n\n/**\n * Chains the listing service accepts a listing deposit on.\n *\n * This is the chain the **token** lives on and where its listing collateral was\n * deposited — it is **not** the chain the resulting market trades on. A market\n * whose token is on Solana or BSC still trades on the SYMMIO deployment the\n * listing service is configured for.\n *\n * `SOLANA = 0` is a sentinel the service uses for its one non-EVM chain, not a\n * real chain id: a `ListingMarket` on it carries a base58 `contractAddress`, so\n * never feed one to an EVM address helper without checking `chainId` first.\n */\nexport enum ListingDepositChainId {\n /** Sentinel for Solana — not an EVM chain id. Addresses are base58. */\n SOLANA = 0,\n BSC = 56,\n BASE = 8453,\n SONIC = 146,\n ARBITRUM_ONE = 42161,\n ROBINHOOD = 4663,\n ARC = 5042,\n HYPER_EVM = 999,\n}\n\n/**\n * Chains the listing backend's token-price endpoint accepts, keyed by the\n * vendor's chain **name** — the `chain` input of `getTokenPrice`.\n *\n * This is a different key space from {@link ListingDepositChainId}: that enum\n * is numeric (an EVM chain id, or the `0` sentinel for Solana) and names where\n * a listing deposit lands; this one is a string name the price endpoint\n * understands, and two of its members (`ROBINHOOD`, `ARC`) have no numeric\n * twin at all. Do not cast between the two — pick the member explicitly.\n */\nexport enum TokenPriceChain {\n BASE = \"BASE\",\n SOLANA = \"SOLANA\",\n BSC = \"BSC\",\n ARBITRUM_ONE = \"ARBITRUM_ONE\",\n SONIC = \"SONIC\",\n ROBINHOOD = \"ROBINHOOD\",\n ARC = \"ARC\",\n}\n\n/**\n * The same metric measured over each trailing window the listing service\n * reports.\n *\n * Every entry is a `bigint` at {@link LISTING_VALUE_DECIMALS}, or `null` when\n * the service has no value for that window — a young market has no 30-day\n * figure, and `null` means *absent*, never zero.\n */\nexport interface ListingTrailingWindows {\n /** Trailing 1 hour. */\n h1: bigint | null;\n /** Trailing 6 hours. */\n h6: bigint | null;\n /** Trailing 24 hours. */\n h24: bigint | null;\n /** Trailing 30 days. */\n d30: bigint | null;\n}\n\n/**\n * A metric the service reports over the trailing windows **and** since listing.\n *\n * Only the two APY series carry a lifetime column; APR does not, which is why\n * `lifetime` lives here rather than on {@link ListingTrailingWindows}.\n */\nexport interface ListingApyWindows extends ListingTrailingWindows {\n /** Since the market was listed. */\n lifetime: bigint | null;\n}\n\n/**\n * One market in the permissionless-listing catalog — a row of the pools list.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; `null`\n * means the service reported no value, which is distinct from zero.\n */\nexport interface ListingMarket {\n /** Rollout price, kept as a string because services used both plain and scaled units. */\n priceUsd?: string | null;\n /** Legacy headline APY, 18-decimal percentage. */\n apy24h?: bigint | null;\n /** Legacy 30-day APY, 18-decimal percentage. */\n apy30d?: bigint | null;\n /** Lifetime APY, 18-decimal percentage. */\n apyLifetime?: bigint | null;\n /** 30-day rewards in USD at 18 decimals. */\n reward30d?: bigint | null;\n /** Lifetime rewards in USD at 18 decimals. */\n rewardLifetime?: bigint | null;\n /** 24-hour solver revenue in USD at 18 decimals. */\n solverRevenue24h?: bigint | null;\n /** 30-day solver revenue in USD at 18 decimals. */\n solverRevenue30d?: bigint | null;\n /** Lifetime solver revenue in USD at 18 decimals. */\n solverRevenueLifetime?: bigint | null;\n /**\n * The listed token's contract address on {@link ListingMarket.chainId}.\n *\n * Typed as `string`, **not** viem's `Address`: Solana listings\n * (`chainId === ListingDepositChainId.SOLANA`) carry a base58 address that is\n * not 0x-prefixed. This is also the id used to address a single market in the\n * rest of the listing API.\n */\n contractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n chainId: ListingDepositChainId;\n /**\n * The solver market id this listing trades under, or `null` when it has none\n * yet. Assigned when the market reaches {@link ListingMarketStatus.LISTED};\n * everything downstream (prices, notional caps, quotes, subgraph rows) keys\n * off it, so a `null` here means the market is not tradable.\n */\n symbolId: number | null;\n /** Token ticker, e.g. `\"SYMM\"`. */\n tokenTicker: string;\n /** Token display name, e.g. `\"Symmio\"`. */\n tokenName: string;\n /** Maximum leverage the market allows, as a whole multiplier (`20` = 20x). */\n maxLeverage: number;\n /** Token market capitalization, in USD. */\n marketCap: bigint | null;\n /** Trailing 24-hour trading volume, in USD. */\n vol24h: bigint | null;\n /** Total value locked in the market's pool, in USD. */\n tvl: bigint | null;\n /** Notional the solver will still take on this market, in USD. */\n liquidity: bigint | null;\n /** Notional currently open on this market, in USD. */\n openInterest: bigint | null;\n /** LP rewards accrued over the trailing 24 hours, in USD. */\n reward24h: bigint | null;\n /** Headline APR: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n apr: bigint | null;\n /**\n * APR broken out per trailing window, same units as {@link ListingMarket.apr}.\n * There is no lifetime APR — use {@link ListingMarket.apr} for the headline.\n */\n aprByWindow: ListingTrailingWindows;\n /** APY attributed to TVL growth, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window: a percentage already (`1e18` = `1%`), not a fraction — render it without multiplying by 100. */\n priceDrivenApy: ListingApyWindows;\n /** When the market went live, as a Unix timestamp in **seconds**. `null` before it is listed. */\n listingTime: number | null;\n /** Where the market sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this market's pool locked\n * against new deposits. Only deposits are blocked; trading, withdrawals and\n * every other flow stay available. Independent of\n * {@link ListingMarket.marketStatus}: a `LISTED` market can be locked. The row\n * carries only the flag; the reasons are on\n * {@link ListingMarketDetail.lockReasons}.\n */\n isLocked: boolean;\n}\n\n/** One page of {@link ListingMarket} rows, with the totals needed to paginate. */\nexport interface ListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: ListingMarket[];\n}\n\n/**\n * A {@link ListingMarket} enriched with the signed-in user's position in it — one\n * row of \"Your Pools\", the markets that generated a deposit address for the user.\n */\nexport interface UserListingMarket extends ListingMarket {\n /** The user's current deposit into this pool, in USD (18-dec bigint). `null` when the deposit address exists but nothing has been deposited yet. */\n userDeposit: bigint | null;\n /** The user's share in whole percent (not 18-dec scaled); null when absent or non-finite. */\n userSharePercentage: number | null;\n /** The user's accrued revenue from this pool, in USD (18-dec bigint), or `null` when absent. */\n userRevenue: bigint | null;\n}\n\n/** One page of {@link UserListingMarket} rows, with the totals needed to paginate. */\nexport interface UserListingMarketPage {\n /** Total rows matching the query across all pages. */\n total: number;\n /** Page size the service applied. */\n limit: number;\n /** Row offset of this page. */\n offset: number;\n /** The rows themselves. */\n items: UserListingMarket[];\n}\n\n/**\n * The signed-in user's LP position and profit in a single pool — the authed\n * per-token read behind a pool's \"your position\" panel.\n *\n * Every field is a `bigint` at {@link LISTING_VALUE_DECIMALS} (18), independent\n * of the token's or collateral's own decimals; format with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge. An absent\n * figure is normalized to `0n`, not `null`.\n */\nexport interface UserPoolProfit {\n /** Legacy service pool snapshot; null when the newer profit endpoint omits it. */\n tvl?: bigint | null;\n /** Legacy 30-day APY snapshot, 18-decimal percent. */\n apy30d?: bigint | null;\n /** Legacy lifetime APY snapshot, 18-decimal percent. */\n apyLifetime?: bigint | null;\n /** Legacy whole-percent buyback setting. */\n buybackRatio?: number | null;\n /** Legacy active LP count. */\n activeLps?: number | null;\n /** Legacy pool age in seconds. */\n age?: number | null;\n /** Legacy long-side size at 18 decimals. */\n longPositionAmount?: bigint | null;\n /** Legacy long-side USD value at 18 decimals. */\n longPositionValue?: bigint | null;\n /** Legacy long-side average entry price at 18 decimals. */\n longPositionAvgOpenPrice?: bigint | null;\n /** Legacy long-side unrealized PnL at 18 decimals. */\n longPositionUpnl?: bigint | null;\n /** Legacy short-side size at 18 decimals. */\n shortPositionAmount?: bigint | null;\n /** Legacy short-side USD value at 18 decimals. */\n shortPositionValue?: bigint | null;\n /** Legacy short-side average entry price at 18 decimals. */\n shortPositionAvgOpenPrice?: bigint | null;\n /** Legacy short-side unrealized PnL at 18 decimals. */\n shortPositionUpnl?: bigint | null;\n /** Pool USDC total reported by older services; null when omitted. */\n totalUsdcInPool?: bigint | null;\n /** Pool token total at 18 decimals; null when omitted. */\n totalTokenInPool?: bigint | null;\n /** LP balance valued in the pool's token units, 18-dec bigint. */\n userBalanceInTokens: bigint;\n /** LP balance valued in USDC, 18-dec bigint USD. */\n userBalanceInUsdc: bigint;\n /** Rewards the user can claim now, 18-dec bigint USD. */\n claimableReward: bigint;\n /** Rewards already claimed, 18-dec bigint USD. */\n claimedReward: bigint;\n /** Token amount the user deposited, 18-dec bigint. */\n userDepositedTokenAmount: bigint;\n /** The user's LP shares, 18-dec bigint. */\n userLpAmount: bigint;\n /** LP shares queued for withdrawal (the pending-withdrawal amount), 18-dec bigint. */\n pendingWithdrawLpAmount: bigint;\n /**\n * LP shares free to withdraw right now — `userLpAmount − pendingWithdrawLpAmount`,\n * floored at `0n`. This is the ceiling a withdrawal (`withdrawLp`) may request;\n * the shares already counted in {@link UserPoolProfit.pendingWithdrawLpAmount}\n * are spoken for. Derived by the SDK, not a field the service returns. 18-dec\n * bigint.\n */\n availableLpAmount: bigint;\n}\n\n/**\n * The receipt returned by `claimProfit` — the outcome of a `/v2/claim` request.\n *\n * The claim is synchronous: a `200` means the USDC was moved to the target\n * sub-account. `amountClaimed` is the moved figure normalized to a `bigint` at\n * `LISTING_VALUE_DECIMALS` (18), `claimRequestId` references the claim in the\n * service, and `transactionHash` is the on-chain transfer hash when the service\n * has one (`null` otherwise).\n */\nexport interface PoolClaimResult {\n /** The service's status string, e.g. `\"ok\"`. */\n status: string;\n /** USDC moved to the sub-account, 18-dec bigint USD. */\n amountClaimed: bigint;\n /** Claim id — reference it to restore or look up the claim later. */\n claimRequestId: string;\n /** On-chain hash of the claim transfer, or `null` when the service has none yet. */\n transactionHash: string | null;\n}\n\n/**\n * One past pool-reward claim, from the user's claim history (`getClaimHistory`).\n *\n * The internal `wallet_id` / `market_id` UUIDs the service carries are dropped —\n * they address rows in the backend, not anything a consumer renders.\n */\nexport interface PoolClaim {\n /** Service wallet identity, retained for history correlation. */\n walletId?: string;\n /** Service market identity, retained for history correlation. */\n marketId?: string;\n /** Claim id — reference it to look the claim up in the service. */\n claimRequestId: string;\n /** Sub-account address that received the claimed USDC. */\n accountAddress: string;\n /** USDC claimed, 18-dec bigint USD. */\n amount: bigint;\n /** On-chain hash of the claim transfer, or `null` when the service has none. */\n transactionHash: string | null;\n /** When the claim was created, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolClaim} rows — the signed-in user's claim history. */\nexport interface PoolClaimHistoryPage {\n /** Total claims matching the query across all pages — what a pager divides. */\n count: number;\n /** The claims themselves, newest first. */\n items: PoolClaim[];\n}\n\n/**\n * The receipt returned by `cancelWithdraw` — the outcome of cancelling a queued\n * LP withdrawal.\n */\nexport interface PoolCancelWithdrawResult {\n /** The affected withdrawal's transaction id, echoed by the service. */\n transactionId: string;\n /**\n * The withdrawal's resulting status, e.g. `\"canceled\"`. Carried through as the\n * service's raw string — its enum (`canceled` | `pending` | `transferred` | …)\n * is a superset of {@link PoolTransactionStatus}, so it is not narrowed to it.\n */\n status: string;\n}\n\n/**\n * The receipt returned by `refundMarket` — the outcome of refunding a deposit on\n * a rejected market.\n */\nexport interface PoolRefundResult {\n /** On-chain hash of the refund transfer. */\n transactionHash: string;\n}\n\n/**\n * The signed-in user's **retry allowance** for one rejected market\n * (`getRetryListingInfo`) — how many listing retries remain and the cooldown\n * before the next.\n */\nexport interface RetryListingInfo {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries the user has left for this market. */\n remainingRetries: number;\n /** Seconds until the next retry is allowed, or `null` when no cooldown is in effect. */\n remainingCooldownSeconds: number | null;\n}\n\n/**\n * The result of `retryListing` — the retry allowance left after re-submitting a\n * rejected market.\n */\nexport interface RetryListingResult {\n /** Maximum retries allowed per market. */\n retryLimit: number;\n /** Retries left after this one. */\n remainingRetries: number;\n /** Seconds before the next retry is allowed. */\n cooldownSeconds: number;\n}\n\n/**\n * The signed-in user's deposit wallet for one market — the get-or-create result\n * of the authed `/v2/market/deposit-address` endpoint. This is the address the\n * user sends funds to in order to deposit into the market's pool.\n */\nexport interface MarketDepositAddress {\n /** The market's token contract address (EVM 0x… or Solana base58). */\n tokenContractAddress: string;\n /** The signed-in user this deposit wallet belongs to. */\n userAddress: string;\n /** The market's deposit chain. */\n depositChain: ListingDepositChainId;\n /** The deposit address — where the user sends funds to deposit into this market. `null` when the service returned none. */\n depositAddress: string | null;\n /** The token's on-chain decimals. */\n tokenDecimal: number;\n /** The market's listing lifecycle status. */\n marketStatus: ListingMarketStatus;\n}\n\n/**\n * A pre-listing price **estimate** for one token — the normalized result of\n * the authed `/v2/market/token-price` endpoint, which asks the Price Service\n * for a token that is not (yet) listed.\n *\n * The backend caches the figure for about five minutes and rate-limits the\n * endpoint, so treat `price` as a display estimate, never as a mark or trade\n * price: render it with a `~`, and do not poll for a fresher one.\n */\nexport interface TokenPrice {\n /** USD per token, as the service reports it — a plain float, always `> 0`. */\n price: number;\n}\n\n/**\n * The listing-pipeline status of a single market — the normalized result of\n * `getListingStatus`, keyed by the market's token address and deposit chain.\n *\n * `marketStatus` is the overall lifecycle status (the same machine as\n * {@link ListingMarketStatus}); the remaining fields describe where the listing\n * is in the backend's step pipeline and whether the current step is retrying or\n * has errored.\n */\nexport interface ListingStatus {\n /** Overall lifecycle status of the market, mapped from the service's `market_status`. */\n marketStatus: ListingMarketStatus;\n /** The step the listing pipeline is currently on, or `null` when it is not in a step. */\n currentStep: string | null;\n /** The ordered pipeline steps the listing moves through. */\n steps: string[];\n /** Error code reported for the current step, or `null` when there is no error. */\n errorCode: number | null;\n /** Human-readable detail for the current step's error, or `null`. */\n errorDetail: string | null;\n /** How many times the current step has been retried. */\n retryCount: number;\n /** The maximum retries allowed for the current step. */\n retryLimit: number;\n}\n\n/**\n * The protocol's global new-market listing cap for the current rolling weekly\n * window — how many pools may still be listed across the protocol before the\n * window resets.\n */\nexport interface WeeklyListingLimit {\n /** Total new-market listings allowed per rolling weekly window. */\n limit: number;\n /** Listings still available in the current window — `0` means no more pools can be listed until reset. */\n remaining: number;\n /** When the window resets, as the Unix timestamp the service returns (`reset_at`). */\n resetAt: number;\n}\n\n/**\n * Server-side sort keys accepted by `getListingMarkets`.\n *\n * Mirrors the service's `sort_by` enum verbatim — snake_case, not the SDK's\n * camelCase field names — because the value is a wire literal, and translating\n * it would break silently the moment the service adds a key.\n *\n * Note the two bare keys: `tvl_driven_apy` and `price_driven_apy` have no\n * matching bare response field. They sort by the **lifetime** column\n * (`tvl_driven_apy_lifetime` / `price_driven_apy_lifetime`).\n */\nexport type ListingMarketSortField =\n | \"liquidity\"\n | \"tvl\"\n | \"market_cap\"\n | \"vol24h\"\n | \"open_interest\"\n | \"apr_1h\"\n | \"apr_6h\"\n | \"apr_24h\"\n | \"apr_30d\"\n | \"reward_24h\"\n | \"apr\"\n | \"tvl_driven_apy_1h\"\n | \"tvl_driven_apy_6h\"\n | \"tvl_driven_apy_24h\"\n | \"tvl_driven_apy_30d\"\n | \"tvl_driven_apy\"\n | \"price_driven_apy_1h\"\n | \"price_driven_apy_6h\"\n | \"price_driven_apy_24h\"\n | \"price_driven_apy_30d\"\n | \"price_driven_apy\"\n | \"listing_time\";\n\n/** Sort direction. */\nexport type ListingSortDirection = \"asc\" | \"desc\";\n\n/**\n * An inclusive `[min, max]` bound on one of the service's value fields. Either\n * end may be omitted for a one-sided bound.\n *\n * Bounds use the **same 18-decimal scale as the response**\n * ({@link LISTING_VALUE_DECIMALS}), not the human-readable figure. Filtering for\n * \"market cap of at least one million USD\" is\n * `{ min: parseUnits(\"1000000\", LISTING_VALUE_DECIMALS) }`, not `{ min: 1_000_000 }`\n * — the latter is a bound of `0.000000000001` USD and silently matches nothing\n * useful. Verified against the live service.\n */\nexport interface ListingValueRange {\n /** Inclusive lower bound at 18 decimals (`__ge` on the wire). */\n min?: bigint;\n /** Inclusive upper bound at 18 decimals (`__le` on the wire). */\n max?: bigint;\n}\n\n/**\n * An inclusive `[min, max]` bound on a timestamp field, in Unix **seconds**\n * (not milliseconds, and not 18-decimal scaled).\n */\nexport interface ListingTimeRange {\n /** Inclusive lower bound, Unix seconds (`__ge` on the wire). */\n min?: number;\n /** Inclusive upper bound, Unix seconds (`__le` on the wire). */\n max?: number;\n}\n\n/**\n * Range filters `getListingMarkets` accepts. Every key is optional; omitted keys\n * are not sent.\n *\n * All {@link ListingValueRange} bounds are at {@link LISTING_VALUE_DECIMALS};\n * `listingTime` is the one exception and takes Unix seconds.\n */\nexport interface ListingMarketFilters {\n /** Token market capitalization, USD. */\n marketCap?: ListingValueRange;\n /** Trailing 24-hour volume, USD. */\n vol24h?: ListingValueRange;\n /** Total value locked, USD. */\n tvl?: ListingValueRange;\n /** Available notional, USD. */\n liquidity?: ListingValueRange;\n /** Open notional, USD. */\n openInterest?: ListingValueRange;\n /** Trailing 24-hour LP rewards, USD. */\n reward24h?: ListingValueRange;\n /** Headline APR bounds, at the field's own scale (`1e18` = `1%`). */\n apr?: ListingValueRange;\n /** APR over the trailing hour. */\n apr1h?: ListingValueRange;\n /** APR over the trailing 6 hours. */\n apr6h?: ListingValueRange;\n /** APR over the trailing 24 hours. */\n apr24h?: ListingValueRange;\n /** APR over the trailing 30 days. */\n apr30d?: ListingValueRange;\n /** TVL-driven APY over the trailing hour. */\n tvlDrivenApy1h?: ListingValueRange;\n /** TVL-driven APY over the trailing 6 hours. */\n tvlDrivenApy6h?: ListingValueRange;\n /** TVL-driven APY over the trailing 24 hours. */\n tvlDrivenApy24h?: ListingValueRange;\n /** TVL-driven APY over the trailing 30 days. */\n tvlDrivenApy30d?: ListingValueRange;\n /** TVL-driven APY over the market's lifetime. */\n tvlDrivenApy?: ListingValueRange;\n /** Price-driven APY over the trailing hour. */\n priceDrivenApy1h?: ListingValueRange;\n /** Price-driven APY over the trailing 6 hours. */\n priceDrivenApy6h?: ListingValueRange;\n /** Price-driven APY over the trailing 24 hours. */\n priceDrivenApy24h?: ListingValueRange;\n /** Price-driven APY over the trailing 30 days. */\n priceDrivenApy30d?: ListingValueRange;\n /** Price-driven APY over the market's lifetime. */\n priceDrivenApy?: ListingValueRange;\n /** Listing timestamp bounds, Unix seconds. */\n listingTime?: ListingTimeRange;\n}\n\n/**\n * Which side of the pool's book a {@link PoolPosition} row describes.\n *\n * The pool's inventory is reported as two aggregates, not a list of individual\n * trades — the detail read gives one long total and one short total.\n */\nexport enum PoolPositionSide {\n LONG = \"long\",\n SHORT = \"short\",\n}\n\n/**\n * One side of a pool's aggregate position book.\n *\n * Every figure is a `bigint` at {@link LISTING_VALUE_DECIMALS}. `upnl` is signed\n * — a losing side reports a negative value — and is the only field here that\n * routinely is.\n */\nexport interface PoolPosition {\n /** Which side this row aggregates. */\n side: PoolPositionSide;\n /** Total size held on this side, in the pool token's units. */\n size: bigint;\n /** Notional value of the side, in USD. */\n value: bigint;\n /** Size-weighted average open price of the side, in USD. */\n avgOpenPrice: bigint;\n /** Unrealized PnL of the side, in USD. Signed. */\n upnl: bigint;\n}\n\n/**\n * A pool's public detail — the aggregate stats and inventory position behind a\n * pool page.\n *\n * Money and rate fields are `bigint` at {@link LISTING_VALUE_DECIMALS}; recall\n * that a descaled *rate* is already a percentage (`1e18` = `1%`) while a\n * descaled *money* field is USD (`1e18` = `$1`). `null` means the backend\n * reported no value, which is not zero.\n *\n * A **delisted** pool is a documented special case: the backend returns cached\n * remaining token and USDC balances with `tvl` fixed at zero.\n */\nexport interface ListingMarketDetail {\n /** Token amount reported by the backend, retaining missing versus zero. */\n reportedTotalTokenInPool?: bigint | null;\n /** Collateral amount reported by the backend, retaining missing versus zero. */\n reportedTotalUsdcInPool?: bigint | null;\n /** Maintenance amount reported by the backend, retaining missing versus zero. */\n reportedMaintenanceFees?: bigint | null;\n /** Legacy lifetime reward in plain USD; used only after current reward fields. */\n legacyLifetimeReward?: string | null;\n /** Whether the token has transfer tax; null when not reported. */\n isTax?: boolean | null;\n /** Whether the listing wallet is tax-whitelisted. */\n userWhitelistTax?: boolean | null;\n /** Other chains where the token is listed. */\n additionalChains?: number[] | null;\n /** Primary pool identifier when supplied. */\n mainPool?: string | null;\n /** Centralized exchange listings. */\n cexList?: string[] | null;\n /** The pool's token contract address — its id in the listing API. */\n tokenContractAddress: string;\n /** Chain the token lives on and its listing deposit was made on. */\n depositChain: ListingDepositChainId;\n /** Token display name. */\n tokenName: string;\n /** Token ticker, or `null` when the backend has none. */\n tokenTicker: string | null;\n /** Token decimals. */\n tokenDecimal: number;\n /** Solver market id, or `null` when the pool is not tradable yet. */\n symbolId: number | null;\n /** Where the pool sits in the listing lifecycle. */\n marketStatus: ListingMarketStatus;\n /**\n * Whether the inventory service currently has this pool locked against new\n * deposits. Only deposits are blocked; trading, withdrawals and every other\n * flow stay available. Independent of {@link ListingMarketDetail.marketStatus}.\n * `false` when the backend reports no lock state, as it does for a delisted\n * pool.\n */\n isLocked: boolean;\n /**\n * Why the pool is locked, one entry per active reason; empty when it is not\n * locked. A reason this SDK release does not recognize arrives as\n * {@link MarketLockReason.UNKNOWN}.\n */\n lockReasons: MarketLockReason[];\n /** Maximum leverage the market allows, as a whole multiplier. */\n maxLeverage: number;\n /** Share of revenue routed to token buybacks, as a percentage (`50` = 50%). */\n buybackRatio: number;\n /** When the market went live, as a Unix timestamp in **seconds**. */\n listingTime: number | null;\n /** Pool age in **seconds**, or `null` before listing. */\n age: number | null;\n /** Number of distinct LPs in the pool. */\n activeLps: number;\n /** Total value locked in the pool, USD. `0` for a delisted pool by design. */\n tvl: bigint | null;\n /** Collateral held by the pool, USD. */\n totalUsdcInPool: bigint;\n /** Pool token held by the pool, in the token's own units. */\n totalTokenInPool: bigint;\n /** Accrued maintenance fees, USD. */\n maintenanceFees: bigint;\n /** LP rewards per window, USD. */\n rewards: ListingApyWindows;\n /** Solver revenue per window, USD. */\n solverRevenue: ListingApyWindows;\n /** Headline APY per window, as a percentage. */\n apy: ListingApyWindows;\n /** APY attributed to TVL growth, per window, as a percentage. */\n tvlDrivenApy: ListingApyWindows;\n /** APY attributed to token price movement, per window, as a percentage. */\n priceDrivenApy: ListingApyWindows;\n /** The pool's aggregate long side, or `null` when the backend reported none. */\n longPosition: PoolPosition | null;\n /** The pool's aggregate short side, or `null` when the backend reported none. */\n shortPosition: PoolPosition | null;\n}\n\n/** Whether a pool transaction is money going in or coming out. */\nexport enum PoolTransactionType {\n DEPOSIT = \"deposit\",\n WITHDRAW = \"withdraw\",\n}\n\n/**\n * Where a pool transaction sits in its lifecycle, as the backend reports it to\n * users.\n */\nexport enum PoolTransactionStatus {\n PENDING = \"pending\",\n SUCCESS = \"success\",\n REJECTED = \"rejected\",\n REFUND = \"refund\",\n CANCELED = \"canceled\",\n}\n\n/**\n * One deposit or withdrawal against a pool.\n *\n * Each row names its own pool (`tokenAddress`, `chainId`), so a page read across\n * every pool stays attributable row by row. `amount`, `usdcAmount` and\n * `tokenAmount` are `bigint` at {@link LISTING_VALUE_DECIMALS}. The refund fields\n * are populated only for a refunded row.\n */\nexport interface PoolTransaction {\n /** Backend id for the transaction. */\n transactionId: string;\n /** The pool's token contract address (EVM `0x…` or Solana base58) — the pool this row belongs to. */\n tokenAddress: string;\n /** The chain the pool's token lives on — not the chain the market trades on. */\n chainId: ListingDepositChainId;\n /** The wallet that made it. */\n walletAddress: string;\n /** Amount moved, in the transaction's own denomination. */\n amount: bigint;\n /** Collateral value moved, USD. */\n usdcAmount: bigint;\n /** Token amount moved, in the pool token's units. */\n tokenAmount: bigint;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** Hash of the refund transaction, or `null` when this is not a refund. */\n refundTransactionHash: string | null;\n /** When the refund completed, Unix **seconds**; `null` when not a refund. */\n refundTime: number | null;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** When the transaction happened, Unix **seconds**. */\n time: number;\n}\n\n/** One page of {@link PoolTransaction} rows — one pool's, or every pool's when the read is not narrowed to a token. */\nexport interface PoolTransactionPage {\n /**\n * The token address the page was narrowed to, echoed by the backend in its canonical form, or `null` when the page\n * spans every pool. Each row carries its own `tokenAddress` either way.\n */\n marketAddress: string | null;\n /** Total rows matching the query across all pages — what a pager divides, not `items.length`. */\n count: number;\n /** The rows themselves, newest first. */\n items: PoolTransaction[];\n}\n\n/**\n * One row of the signed-in user's transaction history (`getUserTransactions`) —\n * a deposit or withdrawal they made, on any pool.\n *\n * Unlike {@link PoolTransaction} (public, every LP), this is authed and scoped to\n * one user, every pool — and each row carries the token's display metadata\n * (`tokenName`, `tokenTicker`, `tokenDecimals`), not just its identity\n * (`tokenAddress`, `chainId`).\n */\nexport interface UserTransaction {\n /** Token payout when reported; absence is not a zero payout. */\n tokenAmount?: bigint | null;\n /** USDC payout when reported; absence is not a zero payout. */\n usdcAmount?: bigint | null;\n /** Hash of a separate refund leg, when reported. */\n refundTransactionHash?: string | null;\n /** Backend id for the transaction. */\n transactionId: string;\n /** Deposit or withdrawal. */\n type: PoolTransactionType;\n /** Lifecycle status. */\n status: PoolTransactionStatus;\n /** Amount moved, 18-dec bigint (a 1e18-scaled figure, like every listing value). */\n amount: bigint;\n /** The token's own decimals, as reported by the service — metadata, not the `amount` scale. */\n tokenDecimals: number;\n /** The pool's token contract address (EVM `0x…` or Solana base58). */\n tokenAddress: string;\n /** The token's name. */\n tokenName: string;\n /** The token's ticker. */\n tokenTicker: string;\n /** The chain the transaction's token lives on. */\n chainId: ListingDepositChainId;\n /** The temporary deposit wallet involved, or `null` when the service omits it. */\n wallet: string | null;\n /** Address a refund was sent to, or `null` when this is not a refund. */\n refundAddress: string | null;\n /** On-chain transaction hash or Solana signature, when known. */\n transactionHash: string | null;\n /** When the transaction happened, Unix **seconds**; `null` when the service omits it. */\n time: number | null;\n}\n\n/** One page of {@link UserTransaction} rows — the signed-in user's transaction history. */\nexport interface UserTransactionPage {\n /** Total rows matching the query across all pages — what a pager divides. */\n count: number;\n /** The rows themselves, newest first. */\n items: UserTransaction[];\n}\n\n/**\n * The generated `MarketStatus` enum and {@link ListingMarketStatus} carry the\n * same string values; this alias documents that the cast in the mapper is\n * value-preserving rather than a widening.\n *\n * @internal\n */\nexport type GeneratedMarketStatus = MarketStatus;\n\n/**\n * One deposit chain a new listing may use, from the listing service's public\n * config ({@link ListingConfig.supportedDepositChains}).\n */\nexport interface ListingDepositChain {\n /** Numeric chain id to send with market/deposit requests. */\n chainId: ListingDepositChainId;\n /** Human-readable chain name, e.g. \"HyperEVM\". */\n chainName: string;\n}\n\n/**\n * The client mutation limits the listing service enforces, from its public\n * config ({@link ListingConfig.rateLimits}).\n */\nexport interface ListingRateLimits {\n /** Max successful market-config updates per user+market in a rolling 24h window; null when unknown. */\n marketConfigUpdatesPerDay: number | null;\n /** Max successful profit claims per user+market in a rolling 24h window; null when unknown. */\n profitClaimsPerDay: number | null;\n}\n\n/**\n * The listing service's public client configuration — the deposit guidance,\n * listing fee, supported deposit chains, rate limits, and protocol reward share\n * a create-listing flow needs.\n *\n * The three USDC figures are `bigint` at {@link LISTING_VALUE_DECIMALS} (18),\n * independent of the collateral token's own decimals; format them with\n * `formatUnits(value, LISTING_VALUE_DECIMALS)` at the display edge.\n */\nexport interface ListingConfig {\n /** Actual server limit, retaining absence separately from the legacy zero default. */\n reportedMarketConfigUpdatesPerDay?: number | null;\n /** Actual server claim limit, retaining absence separately from zero. */\n reportedProfitClaimsPerDay?: number | null;\n /** Reported whole-percent revenue share, or null when unknown. */\n reportedProtocolRewardSharePercent?: number | null;\n /** Recommended deposit, or null when not reported (supports legacy config responses). */\n recommendedDepositUsdc?: bigint | null;\n /** Initial/deposit floor, distinct from the legacy universal top-up floor. */\n minimumDepositUsdc?: bigint | null;\n /** Older services' separate universal floor; null on the current schema. */\n legacyUniversalDepositFloorUsdc?: bigint | null;\n /** Fee without an invented zero when the service omitted it. */\n reportedListingFeeUsdc?: bigint | null;\n /** Inclusive accepted leverage range; null when missing or invalid. */\n maxLeverageBounds?: { minimum: number; maximum: number } | null;\n /** Recommended initial USDC deposit to start a listing, USD at LISTING_VALUE_DECIMALS (18) as a bigint. */\n recommendedInitialDepositUsdc: bigint;\n /** Minimum accepted initial USDC deposit after slippage, USD 18-dec bigint. */\n minimumInitialDepositUsdc: bigint;\n /** Listing fee in USDC, USD 18-dec bigint. */\n listingFeeUsdc: bigint;\n /** Deposit chains new markets may use — the source of truth for a chain picker. */\n supportedDepositChains: ListingDepositChain[];\n /** Rolling-24h client mutation limits. */\n rateLimits: ListingRateLimits;\n /** Whole-percent of market revenue to the protocol before buyback/LP. */\n protocolRewardSharePercent: number;\n}\n\n/**\n * One quote in a pool's book, decoded from the analytics subgraph.\n *\n * A pool's book is **every trader's** quotes on that market, not one account's —\n * `partyA` differs from row to row. Amounts and prices are `bigint` at 18\n * decimals (the protocol's own scale, not the listing backend's), and `null`\n * means the subgraph had no value for that field.\n */\nexport interface PoolQuote {\n /** Subgraph row id (`{quoteId}-{source}`); stable, use as a table key. */\n id: string;\n /** Original submission timestamp in seconds, when indexed. */\n timestampSendQuote?: number | null;\n /** Opening fill timestamp in seconds, when indexed. */\n timestampOpenPosition?: number | null;\n /** Owner wallet of the subaccount, when indexed. */\n ownerAddress?: string | null;\n /** closedPrice: raw 18-decimal protocol value, null when not indexed. */\n closedPrice?: bigint | null;\n /** marketPrice: raw 18-decimal protocol value, null when not indexed. */\n marketPrice?: bigint | null;\n /** Open-fee rate at 18 decimals (1e18 = 100%), not a charged amount. Null when not indexed. */\n tradingFee?: bigint | null;\n /** Close-fee rate at 18 decimals (1e18 = 100%), not a charged amount. Null when not indexed. */\n closeFee?: bigint | null;\n /** leverage: raw 18-decimal protocol value, null when not indexed. */\n leverage?: bigint | null;\n /** initialCva: raw 18-decimal protocol value, null when not indexed. */\n initialCva?: bigint | null;\n /** initialPartyAmm: raw 18-decimal protocol value, null when not indexed. */\n initialPartyAmm?: bigint | null;\n /** initialLf: raw 18-decimal protocol value, null when not indexed. */\n initialLf?: bigint | null;\n /** userPaidFunding: raw 18-decimal protocol value, null when not indexed. */\n userPaidFunding?: bigint | null;\n /** userReceivedFunding: raw 18-decimal protocol value, null when not indexed. */\n userReceivedFunding?: bigint | null;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Raw `QuoteStatus` ordinal as the subgraph reports it. */\n quoteStatus: number | null;\n /** Raw `PositionType` ordinal — `0` long, `1` short. */\n positionType: number | null;\n /** Raw `OrderType` ordinal of the open — `0` limit, `1` market. */\n orderTypeOpen: number | null;\n /** Market ticker, when the subgraph carries one. */\n symbol: string | null;\n /** Solver market id. */\n symbolId: number | null;\n /** The account that opened the quote. */\n partyA: string;\n /** The solver that took the other side. */\n partyB: string | null;\n /** Quote size. */\n quantity: bigint | null;\n /** How much of {@link PoolQuote.quantity} has been closed. */\n closedAmount: bigint | null;\n /** Size of an in-flight close request. */\n quantityToClose: bigint | null;\n /** Price the quote actually opened at. */\n openedPrice: bigint | null;\n /** Price the opener asked for. */\n requestedOpenPrice: bigint | null;\n /** Size-weighted average of the closes so far. */\n averageClosedPrice: bigint | null;\n /** Price of an in-flight close request. */\n closePrice: bigint | null;\n /** Open price before any modification. */\n initialOpenedPrice: bigint | null;\n /** Size liquidated, when the quote was liquidated. */\n liquidateAmount: bigint | null;\n /** Price the liquidation executed at. */\n liquidatePrice: bigint | null;\n /** Block timestamp of the quote's last update, Unix **seconds**. */\n timestamp: number;\n /** Block the quote was last updated in. */\n blockNumber: bigint;\n}\n\n/**\n * One day of LP reward for a pool.\n *\n * A series of these is what a pool page's rewards chart plots — the public\n * per-pool series from `getPoolRewardChart`, or one market's slice of the\n * signed-in user's {@link UserPoolRewardChart}.\n */\nexport interface PoolRewardPoint {\n /** Start of the reward day, unix **seconds**. */\n timestamp: number;\n /**\n * Reward earned that day, `bigint` at {@link LISTING_VALUE_DECIMALS} (18).\n *\n * A **money** field, so the descaled number is a USD amount (`1e18` = `$1`) —\n * unlike the catalog's rate fields, which are already percentages. A day the\n * service reports as absent collapses to `0n` rather than `null`: a missing\n * snapshot and a zero-reward day are the same point on a chart.\n */\n reward: bigint;\n}\n\n/**\n * The signed-in user's daily reward series for **one** market, as returned by\n * `getUserRewardChart` — which reports every market the user has rewards in,\n * one entry each.\n *\n * A market is addressed by the pair `(marketAddress, marketChainId)`, matching\n * {@link ListingMarket.contractAddress} and {@link ListingMarket.chainId}. Note\n * `marketChainId` is the chain the **token** lives on, not the SYMMIO chain the\n * market trades on.\n */\nexport interface UserPoolRewardChart {\n /** The pool's token contract address — matches {@link ListingMarket.contractAddress}. */\n marketAddress: string;\n /** Chain the token lives on — matches {@link ListingMarket.chainId}. */\n marketChainId: ListingDepositChainId;\n /** The user's daily rewards in this pool, in the order the service returns them. */\n rewards: PoolRewardPoint[];\n}\n"],"mappings":";AAmBA,IAAa,IAAyB,IAgB1B,IAAL,yBAAA,GAAA;QACL,EAAA,sBAAA,uBACA,EAAA,eAAA,gBACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAqBY,IAAL,yBAAA,GAAA;QACL,EAAA,qBAAA,sBACA,EAAA,UAAA,WACA,EAAA,oBAAA,qBACA,EAAA,gBAAA,iBACA,EAAA,SAAA,UACA,EAAA,UAAA;AACF,EAAA,CAAA,CAAA,GAcY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,SAAA,KAAA,UACA,EAAA,EAAA,MAAA,MAAA,OACA,EAAA,EAAA,OAAA,QAAA,QACA,EAAA,EAAA,QAAA,OAAA,SACA,EAAA,EAAA,eAAA,SAAA,gBACA,EAAA,EAAA,YAAA,QAAA,aACA,EAAA,EAAA,MAAA,QAAA,OACA,EAAA,EAAA,YAAA,OAAA;AACF,EAAA,CAAA,CAAA,GAYY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,SAAA,UACA,EAAA,MAAA,OACA,EAAA,eAAA,gBACA,EAAA,QAAA,SACA,EAAA,YAAA,aACA,EAAA,MAAA;AACF,EAAA,CAAA,CAAA,GA6gBY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAoHY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA,GAMY,IAAL,yBAAA,GAAA;QACL,EAAA,UAAA,WACA,EAAA,UAAA,WACA,EAAA,WAAA,YACA,EAAA,SAAA,UACA,EAAA,WAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -15,6 +15,8 @@ export type GetUserListingMarketsParameters = Compute<ChainIdParameter & {
|
|
|
15
15
|
* yields a `401`.
|
|
16
16
|
*/
|
|
17
17
|
accessToken: string;
|
|
18
|
+
/** Optional authenticated wallet cache scope. Supply it consistently in all private read hooks; it is not sent to the endpoint. */
|
|
19
|
+
userAddress?: string;
|
|
18
20
|
/**
|
|
19
21
|
* Free-text search, matched against contract address, ticker, and token
|
|
20
22
|
* name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-listing-markets.d.ts","sourceRoot":"","sources":["../../../src/pools/user-markets/get-user-listing-markets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAOlB;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC5C,wCAAwC;IACxC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,gDAAgD;IAChD,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,uCAAuC;IACvC,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CACF,CAAC;AAEF,gGAAgG;AAChG,MAAM,MAAM,+BAA+B,GAAG,qBAAqB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,+BAA+B,CAAC,CA8C1C"}
|
|
1
|
+
{"version":3,"file":"get-user-listing-markets.d.ts","sourceRoot":"","sources":["../../../src/pools/user-markets/get-user-listing-markets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAOlB;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,CACnD,gBAAgB,GAAG;IACjB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,mIAAmI;IACnI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC5C,wCAAwC;IACxC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,gDAAgD;IAChD,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,uCAAuC;IACvC,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CACF,CAAC;AAEF,gGAAgG;AAChG,MAAM,MAAM,+BAA+B,GAAG,qBAAqB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,+BAA+B,CAAC,CA8C1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-listing-markets.js","names":[],"sources":["../../../src/pools/user-markets/get-user-listing-markets.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 { toSearchParams } from \"../markets/to-search-params\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport type {\n ListingDepositChainId,\n ListingMarketFilters,\n ListingMarketSortField,\n ListingMarketStatus,\n ListingSortDirection,\n UserListingMarketPage,\n} from \"../types\";\nimport {\n marketUserSearchV2MarketSearchUserGet,\n type MarketUserSearchV2MarketSearchUserGetParams,\n} from \"../types/generated/listing-backend\";\nimport { toUserListingMarketPage } from \"./to-user-listing-market\";\n\n/**\n * Parameters for {@link getUserListingMarkets}.\n *\n * `accessToken` is required — the endpoint is authed. Every other field is\n * optional and shares the semantics of the public {@link getListingMarkets}\n * search: with none set the service returns its default first page.\n */\nexport type GetUserListingMarketsParameters = 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 * Free-text search, matched against contract address, ticker, and token\n * name.\n *\n * Named `search` rather than `query` because the TanStack options bag on the\n * matching query factory already owns `query`.\n */\n search?: string;\n /**\n * Restrict to tokens deposited on these chains. An empty array is sent as\n * no filter, matching the service's behavior for an absent param.\n */\n chainIds?: readonly ListingDepositChainId[];\n /** Restrict to one lifecycle status. */\n marketStatus?: ListingMarketStatus;\n /** Page size, `1`–`100`. Service default `20`. */\n limit?: number;\n /** Row offset. Service default `0`. */\n offset?: number;\n /** Server-side sort key. */\n sortBy?: ListingMarketSortField;\n /** Sort direction. Service default `\"desc\"`. */\n orderBy?: ListingSortDirection;\n /** Inclusive numeric range filters. */\n filters?: ListingMarketFilters;\n }\n>;\n\n/** Return type of {@link getUserListingMarkets}: one page of the signed-in user's pool rows. */\nexport type GetUserListingMarketsReturnType = UserListingMarketPage;\n\n/**\n * Fetch a page of \"Your Pools\" — the markets that generated a deposit address for\n * the signed-in user, whether or not they have deposited into them yet.\n *\n * This is the authed twin of {@link getListingMarkets}: it hits\n * `/v2/market/search-user` with the caller's bearer token and returns the same\n * catalog rows enriched with the user's `userDeposit`, `userSharePercentage`, and\n * `userRevenue`. Search, filter, sort, and pagination all behave identically to\n * the public catalog. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token plus search, filter, sort, and pagination inputs.\n * @returns One page of {@link UserListingMarketPage} rows plus the total row count.\n * @throws {SymmApiError} when the endpoint request fails, including a `401` on a bad or expired token.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide Pools instead.\n *\n * @example\n * ```ts\n * const page = await getUserListingMarkets(config, {\n * accessToken: token.accessToken,\n * sortBy: \"tvl\",\n * orderBy: \"desc\",\n * limit: 50,\n * });\n * ```\n */\nexport async function getUserListingMarkets(\n config: Config,\n parameters: GetUserListingMarketsParameters,\n): Promise<GetUserListingMarketsReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n\n // `toSearchParams` types its output as the *public* endpoint's params. The\n // authed endpoint's params are structurally the same except its `sort_by` enum\n // drops `reward_24h` and adds the user-scoped keys, so the two nominal types do\n // not assign. The values built here are plain strings from `ListingMarketSortField`\n // — the SDK's real sort contract — so the cast is safe; it only re-labels the\n // generated param type at this one internal boundary.\n const params = toSearchParams({\n query: parameters.search,\n chainIds: parameters.chainIds,\n marketStatus: parameters.marketStatus,\n limit: parameters.limit,\n offset: parameters.offset,\n sortBy: parameters.sortBy,\n orderBy: parameters.orderBy,\n filters: parameters.filters,\n }) as unknown as MarketUserSearchV2MarketSearchUserGetParams;\n\n try {\n const response = await marketUserSearchV2MarketSearchUserGet(params, {\n baseURL,\n headers: { Authorization: `Bearer ${parameters.accessToken}` },\n // The service expects repeated keys for array params (`chain_ids=1&chain_ids=2`).\n // Axios's default bracket form (`chain_ids[]=1`) is not rejected — it is\n // silently *ignored*, so the chain filter would drop and the caller would\n // get the whole catalog back. `indexes: null` selects the repeat form.\n paramsSerializer: { indexes: null },\n });\n\n return toUserListingMarketPage(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_USER_LISTING_MARKETS_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_USER_LISTING_MARKETS_FAILED\",\n `Failed to fetch your listing markets: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"get-user-listing-markets.js","names":[],"sources":["../../../src/pools/user-markets/get-user-listing-markets.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 { toSearchParams } from \"../markets/to-search-params\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport type {\n ListingDepositChainId,\n ListingMarketFilters,\n ListingMarketSortField,\n ListingMarketStatus,\n ListingSortDirection,\n UserListingMarketPage,\n} from \"../types\";\nimport {\n marketUserSearchV2MarketSearchUserGet,\n type MarketUserSearchV2MarketSearchUserGetParams,\n} from \"../types/generated/listing-backend\";\nimport { toUserListingMarketPage } from \"./to-user-listing-market\";\n\n/**\n * Parameters for {@link getUserListingMarkets}.\n *\n * `accessToken` is required — the endpoint is authed. Every other field is\n * optional and shares the semantics of the public {@link getListingMarkets}\n * search: with none set the service returns its default first page.\n */\nexport type GetUserListingMarketsParameters = 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 /** Optional authenticated wallet cache scope. Supply it consistently in all private read hooks; it is not sent to the endpoint. */\n userAddress?: string;\n /**\n * Free-text search, matched against contract address, ticker, and token\n * name.\n *\n * Named `search` rather than `query` because the TanStack options bag on the\n * matching query factory already owns `query`.\n */\n search?: string;\n /**\n * Restrict to tokens deposited on these chains. An empty array is sent as\n * no filter, matching the service's behavior for an absent param.\n */\n chainIds?: readonly ListingDepositChainId[];\n /** Restrict to one lifecycle status. */\n marketStatus?: ListingMarketStatus;\n /** Page size, `1`–`100`. Service default `20`. */\n limit?: number;\n /** Row offset. Service default `0`. */\n offset?: number;\n /** Server-side sort key. */\n sortBy?: ListingMarketSortField;\n /** Sort direction. Service default `\"desc\"`. */\n orderBy?: ListingSortDirection;\n /** Inclusive numeric range filters. */\n filters?: ListingMarketFilters;\n }\n>;\n\n/** Return type of {@link getUserListingMarkets}: one page of the signed-in user's pool rows. */\nexport type GetUserListingMarketsReturnType = UserListingMarketPage;\n\n/**\n * Fetch a page of \"Your Pools\" — the markets that generated a deposit address for\n * the signed-in user, whether or not they have deposited into them yet.\n *\n * This is the authed twin of {@link getListingMarkets}: it hits\n * `/v2/market/search-user` with the caller's bearer token and returns the same\n * catalog rows enriched with the user's `userDeposit`, `userSharePercentage`, and\n * `userRevenue`. Search, filter, sort, and pagination all behave identically to\n * the public catalog. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token plus search, filter, sort, and pagination inputs.\n * @returns One page of {@link UserListingMarketPage} rows plus the total row count.\n * @throws {SymmApiError} when the endpoint request fails, including a `401` on a bad or expired token.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide Pools instead.\n *\n * @example\n * ```ts\n * const page = await getUserListingMarkets(config, {\n * accessToken: token.accessToken,\n * sortBy: \"tvl\",\n * orderBy: \"desc\",\n * limit: 50,\n * });\n * ```\n */\nexport async function getUserListingMarkets(\n config: Config,\n parameters: GetUserListingMarketsParameters,\n): Promise<GetUserListingMarketsReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n\n // `toSearchParams` types its output as the *public* endpoint's params. The\n // authed endpoint's params are structurally the same except its `sort_by` enum\n // drops `reward_24h` and adds the user-scoped keys, so the two nominal types do\n // not assign. The values built here are plain strings from `ListingMarketSortField`\n // — the SDK's real sort contract — so the cast is safe; it only re-labels the\n // generated param type at this one internal boundary.\n const params = toSearchParams({\n query: parameters.search,\n chainIds: parameters.chainIds,\n marketStatus: parameters.marketStatus,\n limit: parameters.limit,\n offset: parameters.offset,\n sortBy: parameters.sortBy,\n orderBy: parameters.orderBy,\n filters: parameters.filters,\n }) as unknown as MarketUserSearchV2MarketSearchUserGetParams;\n\n try {\n const response = await marketUserSearchV2MarketSearchUserGet(params, {\n baseURL,\n headers: { Authorization: `Bearer ${parameters.accessToken}` },\n // The service expects repeated keys for array params (`chain_ids=1&chain_ids=2`).\n // Axios's default bracket form (`chain_ids[]=1`) is not rejected — it is\n // silently *ignored*, so the chain filter would drop and the caller would\n // get the whole catalog back. `indexes: null` selects the repeat form.\n paramsSerializer: { indexes: null },\n });\n\n return toUserListingMarketPage(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_USER_LISTING_MARKETS_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_USER_LISTING_MARKETS_FAILED\",\n `Failed to fetch your listing markets: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;AA+FA,eAAsB,EACpB,GACA,GAC0C;CAC1C,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC,GAQhF,IAAS,EAAe;EAC5B,OAAO,EAAW;EAClB,UAAU,EAAW;EACrB,cAAc,EAAW;EACzB,OAAO,EAAW;EAClB,QAAQ,EAAW;EACnB,QAAQ,EAAW;EACnB,SAAS,EAAW;EACpB,SAAS,EAAW;CACtB,CAAC;CAED,IAAI;EAWF,OAAO,GAAwB,MAVR,EAAsC,GAAQ;GACnE;GACA,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;GAK7D,kBAAkB,EAAE,SAAS,KAAK;EACpC,CAAC,GAEuC,IAAI;CAC9C,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAqC;EAAQ,CAAC,IAGpF,IAAI,EACR,OACA,qCACA,yCAAyC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KACxF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-user-listing-market.js","names":[],"sources":["../../../src/pools/user-markets/to-user-listing-market.ts"],"sourcesContent":["import { toListingMarket, toListingValue } from \"../markets/to-listing-market\";\nimport type { UserListingMarket, UserListingMarketPage } from \"../types\";\nimport type {\n MarketSearchItem,\n PaginationResponseUserMarketSearchItem,\n UserMarketSearchItem,\n} from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw `UserMarketSearchItem` from the authed listing endpoint into the\n * SDK's {@link UserListingMarket}.\n *\n * A user row is the public market row plus three user-scoped fields, so this\n * reuses {@link toListingMarket} for the shared base and appends the extras.\n * The `as unknown as MarketSearchItem` cast is safe and intentional: every field\n * the base mapper reads exists on the user row with the same wire name and type,\n * with one wrinkle — the user row omits `reward_24h`, which the base mapper reads\n * through {@link toListingValue}, so it normalizes to `null` (absent, not zero),\n * exactly as it should. `userDeposit` and `userRevenue` go through the same\n * 18-decimal parser and stay `null` when absent; `userSharePercentage` is a plain\n * percentage number the service always sends.\n *\n * @param raw - One row of the endpoint's `/v2/market/search-user` response.\n * @returns The normalized user market.\n */\nexport function toUserListingMarket(raw: UserMarketSearchItem): UserListingMarket {\n return {\n ...toListingMarket(raw as unknown as MarketSearchItem),\n userDeposit: toListingValue(raw.user_deposit),\n userSharePercentage: raw.user_share_percentage,\n userRevenue: toListingValue(raw.user_revenue),\n };\n}\n\n/**\n * Map the endpoint's paginated envelope into a {@link UserListingMarketPage}.\n *\n * The generated schema marks every envelope field optional (the service declares\n * defaults rather than requiring them), so each is defaulted here: counts to `0`\n * and `items` to an empty array.\n *\n * @param raw - The endpoint's `/v2/market/search-user` response body.\n * @returns The normalized page.\n */\nexport function toUserListingMarketPage(raw: PaginationResponseUserMarketSearchItem): UserListingMarketPage {\n return {\n total: raw.total ?? 0,\n limit: raw.limit ?? 0,\n offset: raw.offset ?? 0,\n items: (raw.items ?? []).map(toUserListingMarket),\n };\n}\n"],"mappings":";;AAyBA,SAAgB,EAAoB,GAA8C;CAChF,OAAO;EACL,GAAG,EAAgB,CAAkC;EACrD,aAAa,EAAe,EAAI,YAAY;EAC5C,qBAAqB,EAAI;
|
|
1
|
+
{"version":3,"file":"to-user-listing-market.js","names":[],"sources":["../../../src/pools/user-markets/to-user-listing-market.ts"],"sourcesContent":["import { toListingMarket, toListingValue } from \"../markets/to-listing-market\";\nimport type { UserListingMarket, UserListingMarketPage } from \"../types\";\nimport type {\n MarketSearchItem,\n PaginationResponseUserMarketSearchItem,\n UserMarketSearchItem,\n} from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw `UserMarketSearchItem` from the authed listing endpoint into the\n * SDK's {@link UserListingMarket}.\n *\n * A user row is the public market row plus three user-scoped fields, so this\n * reuses {@link toListingMarket} for the shared base and appends the extras.\n * The `as unknown as MarketSearchItem` cast is safe and intentional: every field\n * the base mapper reads exists on the user row with the same wire name and type,\n * with one wrinkle — the user row omits `reward_24h`, which the base mapper reads\n * through {@link toListingValue}, so it normalizes to `null` (absent, not zero),\n * exactly as it should. `userDeposit` and `userRevenue` go through the same\n * 18-decimal parser and stay `null` when absent; `userSharePercentage` is a plain\n * percentage number the service always sends.\n *\n * @param raw - One row of the endpoint's `/v2/market/search-user` response.\n * @returns The normalized user market.\n */\nexport function toUserListingMarket(raw: UserMarketSearchItem): UserListingMarket {\n return {\n ...toListingMarket(raw as unknown as MarketSearchItem),\n userDeposit: toListingValue(raw.user_deposit),\n userSharePercentage: Number.isFinite(raw.user_share_percentage) ? raw.user_share_percentage : null,\n userRevenue: toListingValue(raw.user_revenue),\n };\n}\n\n/**\n * Map the endpoint's paginated envelope into a {@link UserListingMarketPage}.\n *\n * The generated schema marks every envelope field optional (the service declares\n * defaults rather than requiring them), so each is defaulted here: counts to `0`\n * and `items` to an empty array.\n *\n * @param raw - The endpoint's `/v2/market/search-user` response body.\n * @returns The normalized page.\n */\nexport function toUserListingMarketPage(raw: PaginationResponseUserMarketSearchItem): UserListingMarketPage {\n return {\n total: raw.total ?? 0,\n limit: raw.limit ?? 0,\n offset: raw.offset ?? 0,\n items: (raw.items ?? []).map(toUserListingMarket),\n };\n}\n"],"mappings":";;AAyBA,SAAgB,EAAoB,GAA8C;CAChF,OAAO;EACL,GAAG,EAAgB,CAAkC;EACrD,aAAa,EAAe,EAAI,YAAY;EAC5C,qBAAqB,OAAO,SAAS,EAAI,qBAAqB,IAAI,EAAI,wBAAwB;EAC9F,aAAa,EAAe,EAAI,YAAY;CAC9C;AACF;AAYA,SAAgB,EAAwB,GAAoE;CAC1G,OAAO;EACL,OAAO,EAAI,SAAS;EACpB,OAAO,EAAI,SAAS;EACpB,QAAQ,EAAI,UAAU;EACtB,QAAQ,EAAI,SAAS,CAAC,GAAG,IAAI,CAAmB;CAClD;AACF"}
|
|
@@ -17,6 +17,8 @@ export type GetUserTransactionsParameters = Compute<ChainIdParameter & {
|
|
|
17
17
|
* `401`.
|
|
18
18
|
*/
|
|
19
19
|
accessToken: string;
|
|
20
|
+
/** Optional authenticated wallet cache scope. Supply it consistently in all private read hooks; it is not sent to the endpoint. */
|
|
21
|
+
userAddress?: string;
|
|
20
22
|
/** Narrow to deposits or withdrawals only. Omit for both. */
|
|
21
23
|
transactionType?: PoolTransactionType;
|
|
22
24
|
/** Narrow to one status (e.g. only pending). Omit for all statuses. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-transactions.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/get-user-transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQhG;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gBAAgB,GAAG;IACjB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CAmCxC"}
|
|
1
|
+
{"version":3,"file":"get-user-transactions.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/get-user-transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQhG;;;;;;;GAOG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gBAAgB,GAAG;IACjB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,mIAAmI;IACnI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CAmCxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-transactions.js","names":[],"sources":["../../../src/pools/user-transactions/get-user-transactions.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 { PoolTransactionStatus, PoolTransactionType, UserTransactionPage } from \"../types\";\nimport {\n searchUserTransactionsV2MarketUserTransactionsStartSizeGet,\n type TransactionType,\n type UserReadableTransactionStatus,\n} from \"../types/generated/listing-backend\";\nimport { toUserTransactionPage } from \"./to-user-transaction\";\n\n/**\n * Parameters for {@link getUserTransactions}.\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 — it only ever returns the signed-in user's own transactions, across\n * **every** pool — so the optional filters narrow within that set.\n */\nexport type GetUserTransactionsParameters = Compute<\n ChainIdParameter & {\n /**\n * Bearer token from `authenticateListing`; required — the endpoint is authed\n * and returns only the authenticated user's transactions. Sent as the\n * `Authorization: Bearer <token>` header; a bad or expired token yields a\n * `401`.\n */\n accessToken: string;\n /** Narrow to deposits or withdrawals only. Omit for both. */\n transactionType?: PoolTransactionType;\n /** Narrow to one status (e.g. only pending). Omit for all statuses. */\n transactionStatus?: PoolTransactionStatus;\n /** Narrow to one pool's token contract address. Omit for every pool. */\n tokenAddress?: string;\n /** Row offset. @default 0 */\n start?: number;\n /** Page size. @default 150 */\n size?: number;\n }\n>;\n\n/** Return type of {@link getUserTransactions}: one page of the user's transactions. */\nexport type GetUserTransactionsReturnType = UserTransactionPage;\n\n/**\n * Fetch the signed-in user's transaction history — their pool deposits and\n * withdrawals across **every** pool, newest first, refunded deposits included.\n *\n * Hits the authed `/v2/market/user-transactions/{start}/{size}` endpoint with the\n * caller's bearer token; it only ever returns transactions the user owns.\n * Optionally narrow by type, status, or pool. Pagination is path-based\n * (`/{start}/{size}`), and `count` is the total across all pages — so it is what\n * a pager should divide, not `items.length`. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token, optional type/status/pool filters, and paging.\n * @returns One {@link UserTransactionPage}.\n * @throws {SymmApiError} `FETCH_USER_TRANSACTIONS_FAILED` when the endpoint request fails, including a `401` on a bad or expired token.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide the history instead.\n *\n * @example\n * ```ts\n * const page = await getUserTransactions(config, {\n * accessToken: token.accessToken,\n * size: 25,\n * });\n * ```\n */\nexport async function getUserTransactions(\n config: Config,\n parameters: GetUserTransactionsParameters,\n): Promise<GetUserTransactionsReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n const { start = 0, size = 150 } = parameters;\n\n try {\n const response = await searchUserTransactionsV2MarketUserTransactionsStartSizeGet(\n start,\n size,\n {\n ...(parameters.transactionType === undefined\n ? {}\n : { transaction_type: parameters.transactionType as unknown as TransactionType }),\n ...(parameters.transactionStatus === undefined\n ? {}\n : { transaction_status: parameters.transactionStatus as unknown as UserReadableTransactionStatus }),\n ...(parameters.tokenAddress === undefined ? {} : { token_address: parameters.tokenAddress }),\n },\n { baseURL, headers: { Authorization: `Bearer ${parameters.accessToken}` } },\n );\n\n return toUserTransactionPage(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_USER_TRANSACTIONS_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_USER_TRANSACTIONS_FAILED\",\n `Failed to fetch user transactions: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"get-user-transactions.js","names":[],"sources":["../../../src/pools/user-transactions/get-user-transactions.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 { PoolTransactionStatus, PoolTransactionType, UserTransactionPage } from \"../types\";\nimport {\n searchUserTransactionsV2MarketUserTransactionsStartSizeGet,\n type TransactionType,\n type UserReadableTransactionStatus,\n} from \"../types/generated/listing-backend\";\nimport { toUserTransactionPage } from \"./to-user-transaction\";\n\n/**\n * Parameters for {@link getUserTransactions}.\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 — it only ever returns the signed-in user's own transactions, across\n * **every** pool — so the optional filters narrow within that set.\n */\nexport type GetUserTransactionsParameters = Compute<\n ChainIdParameter & {\n /**\n * Bearer token from `authenticateListing`; required — the endpoint is authed\n * and returns only the authenticated user's transactions. Sent as the\n * `Authorization: Bearer <token>` header; a bad or expired token yields a\n * `401`.\n */\n accessToken: string;\n /** Optional authenticated wallet cache scope. Supply it consistently in all private read hooks; it is not sent to the endpoint. */\n userAddress?: string;\n /** Narrow to deposits or withdrawals only. Omit for both. */\n transactionType?: PoolTransactionType;\n /** Narrow to one status (e.g. only pending). Omit for all statuses. */\n transactionStatus?: PoolTransactionStatus;\n /** Narrow to one pool's token contract address. Omit for every pool. */\n tokenAddress?: string;\n /** Row offset. @default 0 */\n start?: number;\n /** Page size. @default 150 */\n size?: number;\n }\n>;\n\n/** Return type of {@link getUserTransactions}: one page of the user's transactions. */\nexport type GetUserTransactionsReturnType = UserTransactionPage;\n\n/**\n * Fetch the signed-in user's transaction history — their pool deposits and\n * withdrawals across **every** pool, newest first, refunded deposits included.\n *\n * Hits the authed `/v2/market/user-transactions/{start}/{size}` endpoint with the\n * caller's bearer token; it only ever returns transactions the user owns.\n * Optionally narrow by type, status, or pool. Pagination is path-based\n * (`/{start}/{size}`), and `count` is the total across all pages — so it is what\n * a pager should divide, not `items.length`. Enigma-only.\n *\n * @param config - The SDK config.\n * @param parameters - The bearer token, optional type/status/pool filters, and paging.\n * @returns One {@link UserTransactionPage}.\n * @throws {SymmApiError} `FETCH_USER_TRANSACTIONS_FAILED` when the endpoint request fails, including a `401` on a bad or expired token.\n * @throws {SymmError} `LISTING_NOT_CONFIGURED` when the chain has no listing\n * backend. Gate with `supportsListingService` to hide the history instead.\n *\n * @example\n * ```ts\n * const page = await getUserTransactions(config, {\n * accessToken: token.accessToken,\n * size: 25,\n * });\n * ```\n */\nexport async function getUserTransactions(\n config: Config,\n parameters: GetUserTransactionsParameters,\n): Promise<GetUserTransactionsReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n const { start = 0, size = 150 } = parameters;\n\n try {\n const response = await searchUserTransactionsV2MarketUserTransactionsStartSizeGet(\n start,\n size,\n {\n ...(parameters.transactionType === undefined\n ? {}\n : { transaction_type: parameters.transactionType as unknown as TransactionType }),\n ...(parameters.transactionStatus === undefined\n ? {}\n : { transaction_status: parameters.transactionStatus as unknown as UserReadableTransactionStatus }),\n ...(parameters.tokenAddress === undefined ? {} : { token_address: parameters.tokenAddress }),\n },\n { baseURL, headers: { Authorization: `Bearer ${parameters.accessToken}` } },\n );\n\n return toUserTransactionPage(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_USER_TRANSACTIONS_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_USER_TRANSACTIONS_FAILED\",\n `Failed to fetch user transactions: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;AAyEA,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC,GAChF,EAAE,WAAQ,GAAG,UAAO,QAAQ;CAElC,IAAI;EAgBF,OAAO,GAAsB,MAfN,EACrB,GACA,GACA;GACE,GAAI,EAAW,oBAAoB,KAAA,IAC/B,CAAC,IACD,EAAE,kBAAkB,EAAW,gBAA8C;GACjF,GAAI,EAAW,sBAAsB,KAAA,IACjC,CAAC,IACD,EAAE,oBAAoB,EAAW,kBAA8D;GACnG,GAAI,EAAW,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,EAAW,aAAa;EAC5F,GACA;GAAE;GAAS,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAAE,CAC5E,GAEsC,IAAI;CAC5C,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAkC;EAAQ,CAAC,IAGjF,IAAI,EACR,OACA,kCACA,sCAAsC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KACrF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
|
|
@@ -14,7 +14,11 @@ import { SearchUserTransactionsResult, UserTransactionItem } from '../types/gene
|
|
|
14
14
|
* @param raw - One row of the user-transactions response.
|
|
15
15
|
* @returns The normalized transaction.
|
|
16
16
|
*/
|
|
17
|
-
export declare function toUserTransaction(raw: UserTransactionItem
|
|
17
|
+
export declare function toUserTransaction(raw: UserTransactionItem & {
|
|
18
|
+
token_amount?: string | null;
|
|
19
|
+
usdc_amount?: string | null;
|
|
20
|
+
refund_transaction_hash?: string | null;
|
|
21
|
+
}): UserTransaction;
|
|
18
22
|
/**
|
|
19
23
|
* Map the user-transactions envelope into a {@link UserTransactionPage}.
|
|
20
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-user-transaction.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"to-user-transaction.d.ts","sourceRoot":"","sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC,GACA,eAAe,CAmBjB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,4BAA4B,GAAG,mBAAmB,CAK5F"}
|
|
@@ -2,6 +2,9 @@ import { toListingValue as e } from "../markets/to-listing-market.js";
|
|
|
2
2
|
//#region src/pools/user-transactions/to-user-transaction.ts
|
|
3
3
|
function t(t) {
|
|
4
4
|
return {
|
|
5
|
+
tokenAmount: e(t.token_amount),
|
|
6
|
+
usdcAmount: e(t.usdc_amount),
|
|
7
|
+
refundTransactionHash: t.refund_transaction_hash ?? null,
|
|
5
8
|
transactionId: t.transaction_id,
|
|
6
9
|
type: t.transaction_type,
|
|
7
10
|
status: t.transaction_status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-user-transaction.js","names":[],"sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport {\n type ListingDepositChainId,\n type PoolTransactionStatus,\n type PoolTransactionType,\n type UserTransaction,\n type UserTransactionPage,\n} from \"../types\";\nimport type { SearchUserTransactionsResult, UserTransactionItem } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw user-transaction row into the SDK's {@link UserTransaction}.\n *\n * `amount` is a 1e18-scaled integer string like the rest of the listing money\n * fields, parsed to a `bigint` at `LISTING_VALUE_DECIMALS` with\n * {@link toListingValue} (absent → `0n`); `tokenDecimals` is carried as metadata,\n * not as the amount's scale. The generated `transaction_type` /\n * `transaction_status` / `chain_id` enums share their string/number values with\n * the SDK's {@link PoolTransactionType} / {@link PoolTransactionStatus} /\n * {@link ListingDepositChainId}, so the casts are value-preserving.\n *\n * @param raw - One row of the user-transactions response.\n * @returns The normalized transaction.\n */\nexport function toUserTransaction(raw: UserTransactionItem): UserTransaction {\n return {\n transactionId: raw.transaction_id,\n type: raw.transaction_type as unknown as PoolTransactionType,\n status: raw.transaction_status as unknown as PoolTransactionStatus,\n amount: toListingValue(raw.amount) ?? 0n,\n tokenDecimals: raw.token_decimal,\n tokenAddress: raw.token_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n chainId: raw.chain_id as unknown as ListingDepositChainId,\n wallet: raw.wallet ?? null,\n refundAddress: raw.refund_address ?? null,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time ?? null,\n };\n}\n\n/**\n * Map the user-transactions envelope into a {@link UserTransactionPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toUserTransactionPage(raw: SearchUserTransactionsResult): UserTransactionPage {\n return {\n count: raw.count,\n items: (raw.items ?? []).map(toUserTransaction),\n };\n}\n"],"mappings":";;AAwBA,SAAgB,
|
|
1
|
+
{"version":3,"file":"to-user-transaction.js","names":[],"sources":["../../../src/pools/user-transactions/to-user-transaction.ts"],"sourcesContent":["import { toListingValue } from \"../markets/to-listing-market\";\nimport {\n type ListingDepositChainId,\n type PoolTransactionStatus,\n type PoolTransactionType,\n type UserTransaction,\n type UserTransactionPage,\n} from \"../types\";\nimport type { SearchUserTransactionsResult, UserTransactionItem } from \"../types/generated/listing-backend\";\n\n/**\n * Map one raw user-transaction row into the SDK's {@link UserTransaction}.\n *\n * `amount` is a 1e18-scaled integer string like the rest of the listing money\n * fields, parsed to a `bigint` at `LISTING_VALUE_DECIMALS` with\n * {@link toListingValue} (absent → `0n`); `tokenDecimals` is carried as metadata,\n * not as the amount's scale. The generated `transaction_type` /\n * `transaction_status` / `chain_id` enums share their string/number values with\n * the SDK's {@link PoolTransactionType} / {@link PoolTransactionStatus} /\n * {@link ListingDepositChainId}, so the casts are value-preserving.\n *\n * @param raw - One row of the user-transactions response.\n * @returns The normalized transaction.\n */\nexport function toUserTransaction(\n raw: UserTransactionItem & {\n token_amount?: string | null;\n usdc_amount?: string | null;\n refund_transaction_hash?: string | null;\n },\n): UserTransaction {\n return {\n tokenAmount: toListingValue(raw.token_amount),\n usdcAmount: toListingValue(raw.usdc_amount),\n refundTransactionHash: raw.refund_transaction_hash ?? null,\n transactionId: raw.transaction_id,\n type: raw.transaction_type as unknown as PoolTransactionType,\n status: raw.transaction_status as unknown as PoolTransactionStatus,\n amount: toListingValue(raw.amount) ?? 0n,\n tokenDecimals: raw.token_decimal,\n tokenAddress: raw.token_address,\n tokenName: raw.token_name,\n tokenTicker: raw.token_ticker,\n chainId: raw.chain_id as unknown as ListingDepositChainId,\n wallet: raw.wallet ?? null,\n refundAddress: raw.refund_address ?? null,\n transactionHash: raw.transaction_hash ?? null,\n time: raw.create_time ?? null,\n };\n}\n\n/**\n * Map the user-transactions envelope into a {@link UserTransactionPage}.\n *\n * @param raw - The response body.\n * @returns The normalized page. `count` is the total across all pages.\n */\nexport function toUserTransactionPage(raw: SearchUserTransactionsResult): UserTransactionPage {\n return {\n count: raw.count,\n items: (raw.items ?? []).map(toUserTransaction),\n };\n}\n"],"mappings":";;AAwBA,SAAgB,EACd,GAKiB;CACjB,OAAO;EACL,aAAa,EAAe,EAAI,YAAY;EAC5C,YAAY,EAAe,EAAI,WAAW;EAC1C,uBAAuB,EAAI,2BAA2B;EACtD,eAAe,EAAI;EACnB,MAAM,EAAI;EACV,QAAQ,EAAI;EACZ,QAAQ,EAAe,EAAI,MAAM,KAAK;EACtC,eAAe,EAAI;EACnB,cAAc,EAAI;EAClB,WAAW,EAAI;EACf,aAAa,EAAI;EACjB,SAAS,EAAI;EACb,QAAQ,EAAI,UAAU;EACtB,eAAe,EAAI,kBAAkB;EACrC,iBAAiB,EAAI,oBAAoB;EACzC,MAAM,EAAI,eAAe;CAC3B;AACF;AAQA,SAAgB,EAAsB,GAAwD;CAC5F,OAAO;EACL,OAAO,EAAI;EACX,QAAQ,EAAI,SAAS,CAAC,GAAG,IAAI,CAAiB;CAChD;AACF"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
1
2
|
import { Config } from '../../core/config/index.js';
|
|
2
3
|
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
3
|
-
import { QuoteEventRow, QuoteEventType } from './types.js';
|
|
4
|
+
import { QuoteEventRow, QuoteEventType, QuoteSubgraphEventType } from './types.js';
|
|
4
5
|
/** Default page size when `first` is omitted. */
|
|
5
6
|
export declare const DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE = 50;
|
|
6
7
|
/**
|
|
7
8
|
* Parameters for {@link getQuoteEventsByType}.
|
|
8
9
|
*/
|
|
9
|
-
export type GetQuoteEventsByTypeParameters = Compute<ChainIdParameter & {
|
|
10
|
+
export type GetQuoteEventsByTypeParameters<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType> = Compute<ChainIdParameter & {
|
|
10
11
|
/** On-chain quote id to read events for. */
|
|
11
12
|
quoteId: bigint;
|
|
12
|
-
/**
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Event types to include — e.g. {@link PRICE_HISTORY_EVENT_TYPES}, or any
|
|
15
|
+
* subgraph type such as `"OPEN_POSITION"`. Omit to read every type; an empty
|
|
16
|
+
* array reads nothing. The rows' `type` narrows to what is passed.
|
|
17
|
+
*/
|
|
18
|
+
types?: readonly TType[];
|
|
19
|
+
/**
|
|
20
|
+
* The deployment's diamond address (the subgraph's `source`). Omit to match
|
|
21
|
+
* the quote id on any deployment the subgraph indexes.
|
|
22
|
+
*/
|
|
23
|
+
source?: Address;
|
|
14
24
|
/** Page size. @default 50 */
|
|
15
25
|
first?: number;
|
|
16
26
|
/** Page offset. @default 0 */
|
|
@@ -19,20 +29,20 @@ export type GetQuoteEventsByTypeParameters = Compute<ChainIdParameter & {
|
|
|
19
29
|
orderDirection?: "asc" | "desc";
|
|
20
30
|
}>;
|
|
21
31
|
/** Return type of {@link getQuoteEventsByType}. */
|
|
22
|
-
export interface GetQuoteEventsByTypeReturnType {
|
|
32
|
+
export interface GetQuoteEventsByTypeReturnType<TType extends QuoteSubgraphEventType = QuoteEventType> {
|
|
23
33
|
/** The decoded event rows. */
|
|
24
|
-
rows: QuoteEventRow[];
|
|
34
|
+
rows: QuoteEventRow<TType>[];
|
|
25
35
|
/** `true` when the page came back full — caller should fetch the next page. */
|
|
26
36
|
hasMore: boolean;
|
|
27
37
|
}
|
|
28
38
|
/**
|
|
29
|
-
* Read a single quote's
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
39
|
+
* Read a single quote's events from the analytics subgraph, optionally filtered
|
|
40
|
+
* to the requested event types and deployment. The action does no event-type
|
|
41
|
+
* interpretation beyond decoding the metadata JSON — pass
|
|
42
|
+
* {@link PRICE_HISTORY_EVENT_TYPES} for the price-history list.
|
|
33
43
|
*
|
|
34
44
|
* @param config - The SDK config.
|
|
35
|
-
* @param parameters - Quote id, types, pagination, sort, optional chain id.
|
|
45
|
+
* @param parameters - Quote id, optional types and diamond, pagination, sort, optional chain id.
|
|
36
46
|
* @returns The decoded rows plus a `hasMore` flag.
|
|
37
47
|
* @throws {SymmError} when the chain is unsupported or has no analytics subgraph.
|
|
38
48
|
* @throws {SymmApiError} when the subgraph request fails.
|
|
@@ -45,5 +55,5 @@ export interface GetQuoteEventsByTypeReturnType {
|
|
|
45
55
|
* });
|
|
46
56
|
* ```
|
|
47
57
|
*/
|
|
48
|
-
export declare function getQuoteEventsByType(config: Config, parameters: GetQuoteEventsByTypeParameters): Promise<GetQuoteEventsByTypeReturnType
|
|
58
|
+
export declare function getQuoteEventsByType<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType>(config: Config, parameters: GetQuoteEventsByTypeParameters<TType>): Promise<GetQuoteEventsByTypeReturnType<TType>>;
|
|
49
59
|
//# sourceMappingURL=get-quote-events-by-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quote-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/get-quote-events-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-quote-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/get-quote-events-by-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAM/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAErF,iDAAiD;AACjD,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,8BAA8B,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,OAAO,CACjH,gBAAgB,GAAG;IACjB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC,CACF,CAAC;AAEF,mDAAmD;AACnD,MAAM,WAAW,8BAA8B,CAAC,KAAK,SAAS,sBAAsB,GAAG,cAAc;IACnG,8BAA8B;IAC9B,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7B,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,EACtG,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,8BAA8B,CAAC,KAAK,CAAC,GAChD,OAAO,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC,CAgChD"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { querySubgraph as e } from "../../symmio-subgraph/query-subgraph/query-subgraph.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { compactWhere as t, hasEmptyListFilter as n, toSubgraphPage as r } from "../../symmio-subgraph/subgraph-filters.js";
|
|
3
|
+
import { QuoteEventsForQuoteByTypeDocument as i } from "./query-document.js";
|
|
4
|
+
import { toQuoteEventRow as a } from "./to-quote-event-row.js";
|
|
4
5
|
//#region src/quotes/get-quote-events-by-type/get-quote-events-by-type.ts
|
|
5
|
-
var
|
|
6
|
-
async function
|
|
7
|
-
let { chainId:
|
|
8
|
-
|
|
6
|
+
var o = 50;
|
|
7
|
+
async function s(o, s) {
|
|
8
|
+
let { chainId: c, quoteId: l, types: u, source: d, first: f = 50, skip: p = 0, orderDirection: m = "desc" } = s;
|
|
9
|
+
return n(u) ? {
|
|
9
10
|
rows: [],
|
|
10
11
|
hasMore: !1
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
document: t,
|
|
12
|
+
} : r((await e(o, {
|
|
13
|
+
chainId: c,
|
|
14
|
+
document: i,
|
|
15
15
|
variables: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
where: t({
|
|
17
|
+
quoteId: l.toString(),
|
|
18
|
+
type_in: u,
|
|
19
|
+
source: d?.toLowerCase()
|
|
20
|
+
}),
|
|
21
|
+
first: f,
|
|
22
|
+
skip: p,
|
|
23
|
+
orderDirection: m
|
|
21
24
|
}
|
|
22
|
-
})).quoteEvents.map(
|
|
23
|
-
return {
|
|
24
|
-
rows: d,
|
|
25
|
-
hasMore: d.length === c
|
|
26
|
-
};
|
|
25
|
+
})).quoteEvents.map((e) => a(e)), f);
|
|
27
26
|
}
|
|
28
27
|
//#endregion
|
|
29
|
-
export {
|
|
28
|
+
export { o as DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE, s as getQuoteEventsByType };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=get-quote-events-by-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quote-events-by-type.js","names":[],"sources":["../../../src/quotes/get-quote-events-by-type/get-quote-events-by-type.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { QuoteEventsForQuoteByTypeDocument } from \"./query-document\";\nimport { toQuoteEventRow } from \"./to-quote-event-row\";\nimport {
|
|
1
|
+
{"version":3,"file":"get-quote-events-by-type.js","names":[],"sources":["../../../src/quotes/get-quote-events-by-type/get-quote-events-by-type.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { compactWhere, hasEmptyListFilter, toSubgraphPage } from \"../../symmio-subgraph/subgraph-filters\";\nimport type { QuoteEvent_Filter } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { QuoteEventsForQuoteByTypeDocument } from \"./query-document\";\nimport { toQuoteEventRow } from \"./to-quote-event-row\";\nimport type { QuoteEventRow, QuoteEventType, QuoteSubgraphEventType } from \"./types\";\n\n/** Default page size when `first` is omitted. */\nexport const DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE = 50;\n\n/**\n * Parameters for {@link getQuoteEventsByType}.\n */\nexport type GetQuoteEventsByTypeParameters<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType> = Compute<\n ChainIdParameter & {\n /** On-chain quote id to read events for. */\n quoteId: bigint;\n /**\n * Event types to include — e.g. {@link PRICE_HISTORY_EVENT_TYPES}, or any\n * subgraph type such as `\"OPEN_POSITION\"`. Omit to read every type; an empty\n * array reads nothing. The rows' `type` narrows to what is passed.\n */\n types?: readonly TType[];\n /**\n * The deployment's diamond address (the subgraph's `source`). Omit to match\n * the quote id on any deployment the subgraph indexes.\n */\n source?: Address;\n /** Page size. @default 50 */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Sort direction on the event timestamp. @default \"desc\" (newest first). */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getQuoteEventsByType}. */\nexport interface GetQuoteEventsByTypeReturnType<TType extends QuoteSubgraphEventType = QuoteEventType> {\n /** The decoded event rows. */\n rows: QuoteEventRow<TType>[];\n /** `true` when the page came back full — caller should fetch the next page. */\n hasMore: boolean;\n}\n\n/**\n * Read a single quote's events from the analytics subgraph, optionally filtered\n * to the requested event types and deployment. The action does no event-type\n * interpretation beyond decoding the metadata JSON — pass\n * {@link PRICE_HISTORY_EVENT_TYPES} for the price-history list.\n *\n * @param config - The SDK config.\n * @param parameters - Quote id, optional types and diamond, pagination, sort, optional chain id.\n * @returns The decoded rows plus a `hasMore` flag.\n * @throws {SymmError} when the chain is unsupported or has no analytics subgraph.\n * @throws {SymmApiError} when the subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows, hasMore } = await getQuoteEventsByType(config, {\n * quoteId: 7334n,\n * types: PRICE_HISTORY_EVENT_TYPES,\n * });\n * ```\n */\nexport async function getQuoteEventsByType<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType>(\n config: Config,\n parameters: GetQuoteEventsByTypeParameters<TType>,\n): Promise<GetQuoteEventsByTypeReturnType<TType>> {\n const {\n chainId,\n quoteId,\n types,\n source,\n first = DEFAULT_QUOTE_EVENTS_BY_TYPE_PAGE_SIZE,\n skip = 0,\n orderDirection = \"desc\",\n } = parameters;\n\n if (hasEmptyListFilter(types)) return { rows: [], hasMore: false };\n\n const data = await querySubgraph(config, {\n chainId,\n document: QuoteEventsForQuoteByTypeDocument,\n variables: {\n where: compactWhere<QuoteEvent_Filter>({\n quoteId: quoteId.toString(),\n type_in: types as string[] | undefined,\n source: source?.toLowerCase(),\n }),\n first,\n skip,\n orderDirection,\n },\n });\n\n return toSubgraphPage(\n data.quoteEvents.map((row) => toQuoteEventRow<TType>(row)),\n first,\n );\n}\n"],"mappings":";;;;;AAWA,IAAa,IAAyC;AAyDtD,eAAsB,EACpB,GACA,GACgD;CAChD,IAAM,EACJ,YACA,YACA,UACA,WACA,WAAA,IACA,UAAO,GACP,oBAAiB,WACf;CAmBJ,OAjBI,EAAmB,CAAK,IAAU;EAAE,MAAM,CAAC;EAAG,SAAS;CAAM,IAiB1D,GACL,MAhBiB,EAAc,GAAQ;EACvC;EACA,UAAU;EACV,WAAW;GACT,OAAO,EAAgC;IACrC,SAAS,EAAQ,SAAS;IAC1B,SAAS;IACT,QAAQ,GAAQ,YAAY;GAC9B,CAAC;GACD;GACA;GACA;EACF;CACF,CAAC,GAGM,YAAY,KAAK,MAAQ,EAAuB,CAAG,CAAC,GACzD,CACF;AACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Read
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Read `QuoteEvent`s for one quote id, paginated and sorted by `timestamp`.
|
|
3
|
+
* Filter by the protocol-level `quoteId` scalar so callers never need the diamond
|
|
4
|
+
* address. The action builds `$where`: `quoteId` always, `type_in` and `source`
|
|
5
|
+
* only when passed. Caller decodes `metadata` per row.
|
|
5
6
|
*/
|
|
6
7
|
export declare const QuoteEventsForQuoteByTypeDocument: import('../../symmio-subgraph/types/generated/analytics/graphql.js').TypedDocumentString<import('../../symmio-subgraph/types/generated/analytics/graphql.js').QuoteEventsForQuoteByTypeQuery, {
|
|
7
|
-
|
|
8
|
-
typeIn: Array<string> | string;
|
|
8
|
+
where: import('../../symmio-subgraph/types/generated/analytics/graphql.js').QuoteEvent_Filter;
|
|
9
9
|
first: number;
|
|
10
10
|
skip: number;
|
|
11
11
|
orderDirection: import('../../symmio-subgraph/types/generated/analytics/graphql.js').OrderDirection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/query-document.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-events-by-type/query-document.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC;;;;;EAiB5C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { graphql as e } from "../../symmio-subgraph/types/generated/analytics/gql.js";
|
|
2
2
|
//#region src/quotes/get-quote-events-by-type/query-document.ts
|
|
3
|
-
var t = e("\n query QuoteEventsForQuoteByType(\n $
|
|
3
|
+
var t = e("\n query QuoteEventsForQuoteByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n");
|
|
4
4
|
//#endregion
|
|
5
5
|
export { t as QuoteEventsForQuoteByTypeDocument };
|
|
6
6
|
|