@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
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
import { SubAccountIsolationType as e } from "../../symmio-contracts/account-layer/types.js";
|
|
2
2
|
import { querySubgraph as t } from "../../symmio-subgraph/query-subgraph/query-subgraph.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { compactWhere as n, hasEmptyListFilter as r, lowercaseList as i, stringList as a } from "../../symmio-subgraph/subgraph-filters.js";
|
|
4
|
+
import { QuoteCloseType as o } from "./types.js";
|
|
5
|
+
import { closeTypeToEventTypes as s } from "./close-type.js";
|
|
6
|
+
import { QuoteEventsForHistoryDocument as c } from "./query-document.js";
|
|
7
|
+
import { toQuoteHistoryRow as l } from "./to-history-row.js";
|
|
7
8
|
//#region src/quotes/get-quote-history/get-quote-history.ts
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
9
|
+
function u(t) {
|
|
10
|
+
let r = i(t.subAccounts), o = t.isolationType === e.CUSTOM;
|
|
11
|
+
return n({
|
|
12
|
+
subAccount_in: o ? void 0 : r,
|
|
13
|
+
partyA_in: o ? r : void 0,
|
|
14
|
+
source: t.source?.toLowerCase(),
|
|
15
|
+
symbolId_in: a(t.marketIds)
|
|
16
|
+
});
|
|
11
17
|
}
|
|
12
|
-
var
|
|
13
|
-
async function
|
|
14
|
-
let { chainId:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
var d = 50, f = 2e9;
|
|
19
|
+
async function p(e, i) {
|
|
20
|
+
let { chainId: a, subAccounts: p, marketIds: m, closeType: h = o.All, first: g = d, skip: _ = 0, startTime: v = 0, endTime: y = f, orderDirection: b = "desc" } = i;
|
|
21
|
+
if (r(p, m)) return { rows: [] };
|
|
22
|
+
let x = u(i);
|
|
23
|
+
return { rows: (await t(e, {
|
|
24
|
+
chainId: a,
|
|
25
|
+
document: c,
|
|
18
26
|
variables: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
where: n({
|
|
28
|
+
type_in: s[h],
|
|
29
|
+
timestamp_gte: v.toString(),
|
|
30
|
+
timestamp_lte: y.toString(),
|
|
31
|
+
quote_: Object.keys(x).length > 0 ? x : void 0
|
|
32
|
+
}),
|
|
33
|
+
first: g,
|
|
34
|
+
skip: _,
|
|
35
|
+
orderDirection: b
|
|
26
36
|
}
|
|
27
|
-
})).quoteEvents.map(
|
|
37
|
+
})).quoteEvents.map(l) };
|
|
28
38
|
}
|
|
29
39
|
//#endregion
|
|
30
|
-
export {
|
|
40
|
+
export { p as getQuoteHistory };
|
|
31
41
|
|
|
32
42
|
//# sourceMappingURL=get-quote-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quote-history.js","names":[],"sources":["../../../src/quotes/get-quote-history/get-quote-history.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { SubAccountIsolationType } from \"../../symmio-contracts/account-layer/types\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport type {
|
|
1
|
+
{"version":3,"file":"get-quote-history.js","names":[],"sources":["../../../src/quotes/get-quote-history/get-quote-history.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { SubAccountIsolationType } from \"../../symmio-contracts/account-layer/types\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport { compactWhere, hasEmptyListFilter, lowercaseList, stringList } from \"../../symmio-subgraph/subgraph-filters\";\nimport type { Quote_Filter, QuoteEvent_Filter } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { closeTypeToEventTypes } from \"./close-type\";\nimport { QuoteEventsForHistoryDocument } from \"./query-document\";\nimport { toQuoteHistoryRow } from \"./to-history-row\";\nimport { QuoteCloseType, type QuoteHistoryRow } from \"./types\";\n\n/**\n * The `quote_` filter for the requested accounts, deployment and markets.\n * Cross-margin (`CUSTOM`) quotes carry **no** `subAccount` on the subgraph, so\n * their accounts filter `partyA` (which equals the subaccount address); VA\n * isolation (`MARKET` / `MARKET_DIRECTION`) filters the quote's `subAccount`.\n * Each filter is present only when the caller passed it.\n */\nfunction quoteFilterFor(parameters: GetQuoteHistoryParameters): Quote_Filter {\n const accounts = lowercaseList(parameters.subAccounts);\n const isCrossMargin = parameters.isolationType === SubAccountIsolationType.CUSTOM;\n return compactWhere<Quote_Filter>({\n subAccount_in: isCrossMargin ? undefined : accounts,\n partyA_in: isCrossMargin ? accounts : undefined,\n source: parameters.source?.toLowerCase(),\n symbolId_in: stringList(parameters.marketIds),\n });\n}\n\n/** Default page size when `first` is omitted. */\nconst DEFAULT_PAGE_SIZE = 50;\n/** Default upper time bound (far-future unix seconds) when `endTime` is omitted. */\nconst DEFAULT_END_TIME = 2_000_000_000;\n\n/**\n * Parameters for {@link getQuoteHistory}.\n */\nexport type GetQuoteHistoryParameters = Compute<\n ChainIdParameter & {\n /**\n * The accounts whose history to read — a SubAccount and/or its Virtual\n * Accounts. Pass every account that may own the relevant quotes. Omit to read\n * every account's history; an empty array reads nothing. All accounts in one\n * call must share the `isolationType` below (they select the same filter\n * field).\n */\n subAccounts?: readonly Address[];\n /**\n * The subaccount's isolation type, which picks the subgraph filter field:\n * `CUSTOM` (cross-margin) filters by `partyA` because those quotes carry no\n * `subAccount`; `MARKET` / `MARKET_DIRECTION` (and the default) filter by the\n * quote's `subAccount`. Omit for VA-isolation reads.\n */\n isolationType?: SubAccountIsolationType;\n /**\n * The deployment's diamond address (the subgraph's `source`). Omit to read\n * every deployment the subgraph indexes.\n */\n source?: Address;\n /** Market ids (`symbolId`) to read. Omit for every market; an empty array reads nothing. */\n marketIds?: readonly number[];\n /** Close-type filter. @default QuoteCloseType.All */\n closeType?: QuoteCloseType;\n /** Page size. @default 50 */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Lower bound on the event timestamp (unix seconds). @default 0 */\n startTime?: number;\n /** Upper bound on the event timestamp (unix seconds). @default 2_000_000_000 */\n endTime?: number;\n /** Sort direction on the event timestamp. @default \"desc\" */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getQuoteHistory}. */\nexport interface GetQuoteHistoryReturnType {\n /** The decoded, snapshot-applied history rows (one per close/liquidation event). */\n rows: QuoteHistoryRow[];\n}\n\n/**\n * Read a subaccount's closed/liquidated quote history from the analytics\n * subgraph's immutable `quoteEvents` collection.\n *\n * Each row is one terminal event with its frozen `metadata` snapshot overlaid, so\n * a quote closed across multiple partial closes yields multiple, individually\n * accurate rows (see {@link \"toQuoteHistoryRow\"}). Filtering by account,\n * deployment, market, close type, time range, and pagination all happen\n * server-side. Account, deployment and market filters are optional and applied\n * only when passed.\n *\n * @param config - The SDK config.\n * @param parameters - Optional accounts, deployment, markets, close type, pagination, time range, sort, chain id.\n * @returns The history rows.\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 } = await getQuoteHistory(config, {\n * subAccounts: [\"0xsub…\"],\n * source: \"0xdiamond…\",\n * closeType: QuoteCloseType.Liquidated,\n * first: 10,\n * });\n * ```\n */\nexport async function getQuoteHistory(\n config: Config,\n parameters: GetQuoteHistoryParameters,\n): Promise<GetQuoteHistoryReturnType> {\n const {\n chainId,\n subAccounts,\n marketIds,\n closeType = QuoteCloseType.All,\n first = DEFAULT_PAGE_SIZE,\n skip = 0,\n startTime = 0,\n endTime = DEFAULT_END_TIME,\n orderDirection = \"desc\",\n } = parameters;\n\n if (hasEmptyListFilter(subAccounts, marketIds)) return { rows: [] };\n\n const quoteFilter = quoteFilterFor(parameters);\n const where = compactWhere<QuoteEvent_Filter>({\n type_in: closeTypeToEventTypes[closeType] as string[],\n timestamp_gte: startTime.toString(),\n timestamp_lte: endTime.toString(),\n quote_: Object.keys(quoteFilter).length > 0 ? quoteFilter : undefined,\n });\n\n const data = await querySubgraph(config, {\n chainId,\n document: QuoteEventsForHistoryDocument,\n variables: { where, first, skip, orderDirection },\n });\n\n return { rows: data.quoteEvents.map(toQuoteHistoryRow) };\n}\n"],"mappings":";;;;;;;;AAmBA,SAAS,EAAe,GAAqD;CAC3E,IAAM,IAAW,EAAc,EAAW,WAAW,GAC/C,IAAgB,EAAW,kBAAkB,EAAwB;CAC3E,OAAO,EAA2B;EAChC,eAAe,IAAgB,KAAA,IAAY;EAC3C,WAAW,IAAgB,IAAW,KAAA;EACtC,QAAQ,EAAW,QAAQ,YAAY;EACvC,aAAa,EAAW,EAAW,SAAS;CAC9C,CAAC;AACH;AAGA,IAAM,IAAoB,IAEpB,IAAmB;AA6EzB,eAAsB,EACpB,GACA,GACoC;CACpC,IAAM,EACJ,YACA,gBACA,cACA,eAAY,EAAe,KAC3B,WAAQ,GACR,UAAO,GACP,eAAY,GACZ,aAAU,GACV,oBAAiB,WACf;CAEJ,IAAI,EAAmB,GAAa,CAAS,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE;CAElE,IAAM,IAAc,EAAe,CAAU;CAc7C,OAAO,EAAE,OAAM,MANI,EAAc,GAAQ;EACvC;EACA,UAAU;EACV,WAAW;GAAE,OAVD,EAAgC;IAC5C,SAAS,EAAsB;IAC/B,eAAe,EAAU,SAAS;IAClC,eAAe,EAAQ,SAAS;IAChC,QAAQ,OAAO,KAAK,CAAW,EAAE,SAAS,IAAI,IAAc,KAAA;GAC9D,CAKe;GAAO;GAAO;GAAM;EAAe;CAClD,CAAC,GAEmB,YAAY,IAAI,CAAiB,EAAE;AACzD"}
|
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
* snapshot plus the (mutable) `quote` it belongs to — the snapshot is what makes
|
|
5
5
|
* multiple partial-close rows of the same quote distinct.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* the
|
|
9
|
-
*
|
|
7
|
+
* Every filter travels in one `$where` object that the action builds, so a
|
|
8
|
+
* filter the caller omits is absent rather than sent as `null` (graph-node
|
|
9
|
+
* rejects a null `_in` filter). The action always sets the event `type_in`
|
|
10
|
+
* (close-type) and `timestamp` range; account (`subAccount_in` / `partyA_in`),
|
|
11
|
+
* deployment (`source`) and market (`symbolId_in`) filters go on `quote_` only
|
|
12
|
+
* when passed. Sorted by event `timestamp` (the row's close time).
|
|
13
|
+
*
|
|
14
|
+
* Alongside the quote's own fields it reads two relations: the `SEND_QUOTE`
|
|
15
|
+
* event's transaction (the open transaction), and the raw `metadata` of the
|
|
16
|
+
* quote's `OPEN_POSITION` events, left undecoded for the consumer. The document
|
|
17
|
+
* compiles to a typed query string via graphql-codegen.
|
|
10
18
|
*/
|
|
11
19
|
export declare const QuoteEventsForHistoryDocument: import('../../symmio-subgraph/types/generated/analytics/graphql.js').TypedDocumentString<import('../../symmio-subgraph/types/generated/analytics/graphql.js').QuoteEventsForHistoryQuery, {
|
|
12
|
-
|
|
13
|
-
subAccounts: Array<string> | string;
|
|
20
|
+
where: import('../../symmio-subgraph/types/generated/analytics/graphql.js').QuoteEvent_Filter;
|
|
14
21
|
first: number;
|
|
15
22
|
skip: number;
|
|
16
23
|
orderDirection: import('../../symmio-subgraph/types/generated/analytics/graphql.js').OrderDirection;
|
|
17
|
-
startDate: string;
|
|
18
|
-
endDate: string;
|
|
19
24
|
}>;
|
|
20
25
|
//# sourceMappingURL=query-document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/query-document.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/query-document.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B;;;;;EAuDxC,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-history/query-document.ts
|
|
3
|
-
var t = e("\n query QuoteEventsForHistory(
|
|
3
|
+
var t = e("\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n");
|
|
4
4
|
//#endregion
|
|
5
5
|
export { t as QuoteEventsForHistoryDocument };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-document.js","names":[],"sources":["../../../src/quotes/get-quote-history/query-document.ts"],"sourcesContent":["import { graphql } from \"../../symmio-subgraph/types/generated/analytics\";\n\n/**\n * History query over the immutable `quoteEvents` collection (SYMMIO subgraphs\n * v0.8.6+). Each row is one close/liquidation event with a frozen `metadata`\n * snapshot plus the (mutable) `quote` it belongs to — the snapshot is what makes\n * multiple partial-close rows of the same quote distinct.\n *\n *
|
|
1
|
+
{"version":3,"file":"query-document.js","names":[],"sources":["../../../src/quotes/get-quote-history/query-document.ts"],"sourcesContent":["import { graphql } from \"../../symmio-subgraph/types/generated/analytics\";\n\n/**\n * History query over the immutable `quoteEvents` collection (SYMMIO subgraphs\n * v0.8.6+). Each row is one close/liquidation event with a frozen `metadata`\n * snapshot plus the (mutable) `quote` it belongs to — the snapshot is what makes\n * multiple partial-close rows of the same quote distinct.\n *\n * Every filter travels in one `$where` object that the action builds, so a\n * filter the caller omits is absent rather than sent as `null` (graph-node\n * rejects a null `_in` filter). The action always sets the event `type_in`\n * (close-type) and `timestamp` range; account (`subAccount_in` / `partyA_in`),\n * deployment (`source`) and market (`symbolId_in`) filters go on `quote_` only\n * when passed. Sorted by event `timestamp` (the row's close time).\n *\n * Alongside the quote's own fields it reads two relations: the `SEND_QUOTE`\n * event's transaction (the open transaction), and the raw `metadata` of the\n * quote's `OPEN_POSITION` events, left undecoded for the consumer. The document\n * compiles to a typed query string via graphql-codegen.\n */\nexport const QuoteEventsForHistoryDocument = graphql(`\n query QuoteEventsForHistory($where: QuoteEvent_filter!, $first: Int!, $skip: Int!, $orderDirection: OrderDirection!) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n quoteId\n blockNumber\n transaction\n source\n quote {\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n`);\n"],"mappings":";;AAoBA,IAAa,IAAgC,EAAQ,yzCAuDpD"}
|
|
@@ -22,8 +22,9 @@ export type GetQuoteHistoryOptions = Compute<GetQuoteHistoryParameters & QueryPa
|
|
|
22
22
|
export type GetQuoteHistoryQueryOptions = SymmioQueryOptions<GetQuoteHistoryData, Error, GetQuoteHistoryData, GetQuoteHistoryQueryKey>;
|
|
23
23
|
/**
|
|
24
24
|
* Build TanStack Query options for {@link getQuoteHistory}. Pass
|
|
25
|
-
* `query.refetchInterval` to poll
|
|
26
|
-
* `
|
|
25
|
+
* `query.refetchInterval` to poll. The query is disabled while `subAccounts` or
|
|
26
|
+
* `marketIds` is an empty array (it would match nothing); omitting either reads
|
|
27
|
+
* without that filter.
|
|
27
28
|
*
|
|
28
29
|
* @param config - The SDK config.
|
|
29
30
|
* @param options - Query parameters and TanStack overrides.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnF,OAAO,EAAmB,KAAK,yBAAyB,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEtH,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,yBAAyB,GAAG,kBAAkB,CAAC,yDAEvG;AAED,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEjF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,yBAAyB,GAAG,cAAc,CAAC,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CACrH,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,2BAA2B,GAAG,kBAAkB,CAC1D,mBAAmB,EACnB,KAAK,EACL,mBAAmB,EACnB,uBAAuB,CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,sBAAsB,GAC9B,2BAA2B,CAuB7B"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
-
import {
|
|
2
|
+
import { hasEmptyListFilter as t } from "../../symmio-subgraph/subgraph-filters.js";
|
|
3
|
+
import { getQuoteHistory as n } from "./get-quote-history.js";
|
|
3
4
|
//#region src/quotes/get-quote-history/query.ts
|
|
4
|
-
function
|
|
5
|
+
function r(t) {
|
|
5
6
|
return ["getQuoteHistory", e(t)];
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
+
function i(e, i) {
|
|
8
9
|
return {
|
|
9
|
-
...
|
|
10
|
-
queryKey:
|
|
11
|
-
...
|
|
12
|
-
configKey: e.getChainConfigKey(
|
|
10
|
+
...i.query,
|
|
11
|
+
queryKey: r({
|
|
12
|
+
...i,
|
|
13
|
+
configKey: e.getChainConfigKey(i.chainId)
|
|
13
14
|
}),
|
|
14
|
-
enabled: (
|
|
15
|
-
queryFn: () =>
|
|
16
|
-
chainId:
|
|
17
|
-
subAccounts:
|
|
18
|
-
isolationType:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
enabled: (i.query?.enabled ?? !0) && !t(i.subAccounts, i.marketIds),
|
|
16
|
+
queryFn: () => n(e, {
|
|
17
|
+
chainId: i.chainId,
|
|
18
|
+
subAccounts: i.subAccounts,
|
|
19
|
+
isolationType: i.isolationType,
|
|
20
|
+
source: i.source,
|
|
21
|
+
marketIds: i.marketIds,
|
|
22
|
+
closeType: i.closeType,
|
|
23
|
+
first: i.first,
|
|
24
|
+
skip: i.skip,
|
|
25
|
+
startTime: i.startTime,
|
|
26
|
+
endTime: i.endTime,
|
|
27
|
+
orderDirection: i.orderDirection
|
|
25
28
|
})
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
//#endregion
|
|
29
|
-
export {
|
|
32
|
+
export { r as getQuoteHistoryQueryKey, i as getQuoteHistoryQueryOptions };
|
|
30
33
|
|
|
31
34
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-quote-history/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { getQuoteHistory, type GetQuoteHistoryParameters, type GetQuoteHistoryReturnType } from \"./get-quote-history\";\n\n/** Data resolved by the {@link getQuoteHistoryQueryOptions} query. */\nexport type GetQuoteHistoryData = GetQuoteHistoryReturnType;\n\n/**\n * Build the TanStack Query key for {@link getQuoteHistoryQueryOptions}.\n *\n * @param options - Query parameters (accounts, close type, paging, time range, chain id, config key).\n * @returns A stable, hashable query key.\n */\nexport function getQuoteHistoryQueryKey(options: Compute<GetQuoteHistoryParameters & ConfigKeyParameter>) {\n return [\"getQuoteHistory\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getQuoteHistoryQueryKey}. */\nexport type GetQuoteHistoryQueryKey = ReturnType<typeof getQuoteHistoryQueryKey>;\n\n/**\n * Options accepted by {@link getQuoteHistoryQueryOptions}: the action's\n * parameters plus TanStack overrides.\n */\nexport type GetQuoteHistoryOptions = Compute<\n GetQuoteHistoryParameters & QueryParameter<GetQuoteHistoryData, Error, GetQuoteHistoryData, GetQuoteHistoryQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getQuoteHistoryQueryOptions}. */\nexport type GetQuoteHistoryQueryOptions = SymmioQueryOptions<\n GetQuoteHistoryData,\n Error,\n GetQuoteHistoryData,\n GetQuoteHistoryQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getQuoteHistory}. Pass\n * `query.refetchInterval` to poll
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-quote-history/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport { hasEmptyListFilter } from \"../../symmio-subgraph/subgraph-filters\";\nimport { getQuoteHistory, type GetQuoteHistoryParameters, type GetQuoteHistoryReturnType } from \"./get-quote-history\";\n\n/** Data resolved by the {@link getQuoteHistoryQueryOptions} query. */\nexport type GetQuoteHistoryData = GetQuoteHistoryReturnType;\n\n/**\n * Build the TanStack Query key for {@link getQuoteHistoryQueryOptions}.\n *\n * @param options - Query parameters (accounts, close type, paging, time range, chain id, config key).\n * @returns A stable, hashable query key.\n */\nexport function getQuoteHistoryQueryKey(options: Compute<GetQuoteHistoryParameters & ConfigKeyParameter>) {\n return [\"getQuoteHistory\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getQuoteHistoryQueryKey}. */\nexport type GetQuoteHistoryQueryKey = ReturnType<typeof getQuoteHistoryQueryKey>;\n\n/**\n * Options accepted by {@link getQuoteHistoryQueryOptions}: the action's\n * parameters plus TanStack overrides.\n */\nexport type GetQuoteHistoryOptions = Compute<\n GetQuoteHistoryParameters & QueryParameter<GetQuoteHistoryData, Error, GetQuoteHistoryData, GetQuoteHistoryQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getQuoteHistoryQueryOptions}. */\nexport type GetQuoteHistoryQueryOptions = SymmioQueryOptions<\n GetQuoteHistoryData,\n Error,\n GetQuoteHistoryData,\n GetQuoteHistoryQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getQuoteHistory}. Pass\n * `query.refetchInterval` to poll. The query is disabled while `subAccounts` or\n * `marketIds` is an empty array (it would match nothing); omitting either reads\n * without that filter.\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(\n * getQuoteHistoryQueryOptions(config, {\n * subAccounts: [\"0xsub…\"],\n * query: { refetchInterval: 20_000 },\n * }),\n * );\n * ```\n */\nexport function getQuoteHistoryQueryOptions(\n config: Config,\n options: GetQuoteHistoryOptions,\n): GetQuoteHistoryQueryOptions {\n return {\n ...options.query,\n queryKey: getQuoteHistoryQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: (options.query?.enabled ?? true) && !hasEmptyListFilter(options.subAccounts, options.marketIds),\n queryFn: () =>\n getQuoteHistory(config, {\n chainId: options.chainId,\n subAccounts: options.subAccounts,\n isolationType: options.isolationType,\n source: options.source,\n marketIds: options.marketIds,\n closeType: options.closeType,\n first: options.first,\n skip: options.skip,\n startTime: options.startTime,\n endTime: options.endTime,\n orderDirection: options.orderDirection,\n }),\n };\n}\n"],"mappings":";;;;AAgBA,SAAgB,EAAwB,GAAkE;CACxG,OAAO,CAAC,mBAAmB,EAAmB,CAAO,CAAC;AACxD;AAyCA,SAAgB,EACd,GACA,GAC6B;CAC7B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAwB;GAChC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,UAAU,EAAQ,OAAO,WAAW,OAAS,CAAC,EAAmB,EAAQ,aAAa,EAAQ,SAAS;EACvG,eACE,EAAgB,GAAQ;GACtB,SAAS,EAAQ;GACjB,aAAa,EAAQ;GACrB,eAAe,EAAQ;GACvB,QAAQ,EAAQ;GAChB,WAAW,EAAQ;GACnB,WAAW,EAAQ;GACnB,OAAO,EAAQ;GACf,MAAM,EAAQ;GACd,WAAW,EAAQ;GACnB,SAAS,EAAQ;GACjB,gBAAgB,EAAQ;EAC1B,CAAC;CACL;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-history-row.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/to-history-row.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"to-history-row.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/to-history-row.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AAG1G,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG,0BAA0B,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAgCjF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,eAAe,CAsExE"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { toAddressOrNull as e, toBigIntOrNull as t, toBigIntOrZero as n, toNumberOrNull as r } from "../../symmio-subgraph/subgraph-decode.js";
|
|
2
|
+
import { LIQUIDATION_EVENT_TYPES as i, eventTypeToQuoteStatus as a } from "./close-type.js";
|
|
3
|
+
import { parseSolverFees as o } from "./solver-fees.js";
|
|
4
|
+
import { getAddress as s } from "viem";
|
|
4
5
|
//#region src/quotes/get-quote-history/to-history-row.ts
|
|
5
|
-
function
|
|
6
|
-
return e ? BigInt(e) : 0n;
|
|
7
|
-
}
|
|
8
|
-
function a(e) {
|
|
6
|
+
function c(e) {
|
|
9
7
|
if (!e) return null;
|
|
10
8
|
try {
|
|
11
9
|
return JSON.parse(e);
|
|
@@ -13,7 +11,7 @@ function a(e) {
|
|
|
13
11
|
return null;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
function
|
|
14
|
+
function l(e) {
|
|
17
15
|
if (e == null) return null;
|
|
18
16
|
let t = String(e).trim();
|
|
19
17
|
if (t === "") return null;
|
|
@@ -25,38 +23,55 @@ function o(e) {
|
|
|
25
23
|
}
|
|
26
24
|
return n > 0n ? n : null;
|
|
27
25
|
}
|
|
28
|
-
function
|
|
29
|
-
let
|
|
26
|
+
function u(u) {
|
|
27
|
+
let d = u.type, f = u.quote, p = i.has(d), m = c(u.metadata), h = m ? l(m.amount) : null, g = m ? l(m.closePrice) : null, _ = m ? l(m.openedPrice) : null, v = o(m?.solverFees), y = h ?? n(f.closedAmount), b = h ?? n(f.quantityToClose), x = g ?? n(f.averageClosedPrice), S = _ ?? n(f.openedPrice), C = p ? h ?? n(f.liquidateAmount) : n(f.liquidateAmount), w = p ? g ?? n(f.liquidatePrice) : n(f.liquidatePrice);
|
|
30
28
|
return {
|
|
31
|
-
eventId:
|
|
32
|
-
closeEventType:
|
|
33
|
-
closedAt: Number(
|
|
34
|
-
quoteId:
|
|
35
|
-
marketId:
|
|
36
|
-
symbol:
|
|
37
|
-
positionType:
|
|
38
|
-
orderType:
|
|
39
|
-
quoteStatus:
|
|
40
|
-
quantity:
|
|
41
|
-
openedPrice:
|
|
42
|
-
requestedOpenPrice:
|
|
43
|
-
avgClosedPrice:
|
|
44
|
-
closedAmount:
|
|
45
|
-
quantityToClose:
|
|
46
|
-
liquidateAmount:
|
|
47
|
-
liquidatePrice:
|
|
48
|
-
solverFee:
|
|
49
|
-
staticSolverFee:
|
|
50
|
-
totalSolverFee:
|
|
51
|
-
partyA:
|
|
52
|
-
partyB:
|
|
53
|
-
subAccount:
|
|
54
|
-
blockNumber:
|
|
55
|
-
transaction:
|
|
56
|
-
rawMetadata:
|
|
29
|
+
eventId: u.id,
|
|
30
|
+
closeEventType: d,
|
|
31
|
+
closedAt: Number(u.timestamp),
|
|
32
|
+
quoteId: n(u.quoteId),
|
|
33
|
+
marketId: f.symbolId ? Number(f.symbolId) : 0,
|
|
34
|
+
symbol: f.symbol ?? null,
|
|
35
|
+
positionType: f.positionType ?? 0,
|
|
36
|
+
orderType: f.orderTypeOpen ?? 0,
|
|
37
|
+
quoteStatus: a[d] ?? f.quoteStatus ?? 0,
|
|
38
|
+
quantity: n(f.quantity),
|
|
39
|
+
openedPrice: S,
|
|
40
|
+
requestedOpenPrice: n(f.requestedOpenPrice),
|
|
41
|
+
avgClosedPrice: x,
|
|
42
|
+
closedAmount: y,
|
|
43
|
+
quantityToClose: b,
|
|
44
|
+
liquidateAmount: C,
|
|
45
|
+
liquidatePrice: w,
|
|
46
|
+
solverFee: v.solverFee,
|
|
47
|
+
staticSolverFee: v.staticSolverFee,
|
|
48
|
+
totalSolverFee: v.totalSolverFee,
|
|
49
|
+
partyA: s(f.partyA),
|
|
50
|
+
partyB: f.partyB ? s(f.partyB) : null,
|
|
51
|
+
subAccount: f.subAccount ? s(f.subAccount.id) : null,
|
|
52
|
+
blockNumber: u.blockNumber ? BigInt(u.blockNumber) : void 0,
|
|
53
|
+
transaction: u.transaction ? u.transaction : void 0,
|
|
54
|
+
rawMetadata: u.metadata,
|
|
55
|
+
source: s(u.source),
|
|
56
|
+
closedPrice: t(f.closedPrice),
|
|
57
|
+
initialOpenedPrice: t(f.initialOpenedPrice),
|
|
58
|
+
marketPrice: t(f.marketPrice),
|
|
59
|
+
tradingFee: n(f.tradingFee),
|
|
60
|
+
closeFee: n(f.closeFee),
|
|
61
|
+
leverage: t(f.leverage),
|
|
62
|
+
cva: t(f.cva),
|
|
63
|
+
lf: t(f.lf),
|
|
64
|
+
initialCva: n(f.initialCva),
|
|
65
|
+
initialLf: n(f.initialLf),
|
|
66
|
+
initialPartyAmm: t(f.initialPartyAmm),
|
|
67
|
+
timestampSendQuote: r(f.timestampSendQuote),
|
|
68
|
+
timestampOpenPosition: r(f.timestampOpenPosition),
|
|
69
|
+
subAccountOwner: e(f.subAccount?.owner),
|
|
70
|
+
sendQuoteTransaction: f.sendQuoteEvents[0]?.transaction ? f.sendQuoteEvents[0].transaction : null,
|
|
71
|
+
openPositionMetadata: f.openPositionEvents.map((e) => e.metadata)
|
|
57
72
|
};
|
|
58
73
|
}
|
|
59
74
|
//#endregion
|
|
60
|
-
export {
|
|
75
|
+
export { u as toQuoteHistoryRow };
|
|
61
76
|
|
|
62
77
|
//# sourceMappingURL=to-history-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-history-row.js","names":[],"sources":["../../../src/quotes/get-quote-history/to-history-row.ts"],"sourcesContent":["import { getAddress, type Hex } from \"viem\";\nimport type { OrderType, PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport type { QuoteEventsForHistoryQuery } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { eventTypeToQuoteStatus, LIQUIDATION_EVENT_TYPES } from \"./close-type\";\nimport { parseSolverFees } from \"./solver-fees\";\nimport { QuoteCloseEventType, type QuoteHistoryRow } from \"./types\";\n\n/** A single `quoteEvents` row as returned by the history query. */\nexport type RawQuoteEventRow = QuoteEventsForHistoryQuery[\"quoteEvents\"][number];\n\n/** Parse
|
|
1
|
+
{"version":3,"file":"to-history-row.js","names":[],"sources":["../../../src/quotes/get-quote-history/to-history-row.ts"],"sourcesContent":["import { getAddress, type Hex } from \"viem\";\nimport type { OrderType, PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport { toAddressOrNull, toBigIntOrNull, toBigIntOrZero, toNumberOrNull } from \"../../symmio-subgraph/subgraph-decode\";\nimport type { QuoteEventsForHistoryQuery } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { eventTypeToQuoteStatus, LIQUIDATION_EVENT_TYPES } from \"./close-type\";\nimport { parseSolverFees } from \"./solver-fees\";\nimport { QuoteCloseEventType, type QuoteHistoryRow } from \"./types\";\n\n/** A single `quoteEvents` row as returned by the history query. */\nexport type RawQuoteEventRow = QuoteEventsForHistoryQuery[\"quoteEvents\"][number];\n\n/** Parse the event `metadata` JSON, returning `null` on absence or malformed input. */\nfunction parseMetadata(raw: string | null): Record<string, unknown> | null {\n if (!raw) return null;\n try {\n return JSON.parse(raw) as Record<string, unknown>;\n } catch {\n return null;\n }\n}\n\n/**\n * Read a wei field from the metadata snapshot as a positive `bigint`, or `null`\n * when it is absent, malformed, or non-positive (so a missing snapshot field\n * falls back to the quote's mutable value rather than overwriting it with zero).\n */\nfunction positiveWei(value: unknown): bigint | null {\n if (value === undefined || value === null) return null;\n\n const text = String(value).trim();\n if (text === \"\") return null;\n\n let parsed: bigint;\n try {\n parsed = BigInt(text);\n } catch {\n return null;\n }\n return parsed > 0n ? parsed : null;\n}\n\n/**\n * Build a {@link QuoteHistoryRow} from one immutable `quoteEvents` row, overlaying\n * the event's frozen `metadata` snapshot (amount, close price, open price) onto\n * the otherwise-mutable quote. Without this overlay, every partial-close row of a\n * quote would show its final mutable state instead of the amount/price of that\n * individual close.\n *\n * @param row - One `quoteEvents` row from {@link \"QuoteEventsForHistoryDocument\"}.\n * @returns The decoded, snapshot-applied history row.\n */\nexport function toQuoteHistoryRow(row: RawQuoteEventRow): QuoteHistoryRow {\n const eventType = row.type as QuoteCloseEventType;\n const quote = row.quote;\n const isLiquidation = LIQUIDATION_EVENT_TYPES.has(eventType);\n\n const metadata = parseMetadata(row.metadata);\n const snapshotAmount = metadata ? positiveWei(metadata.amount) : null;\n const snapshotClosePrice = metadata ? positiveWei(metadata.closePrice) : null;\n const snapshotOpenedPrice = metadata ? positiveWei(metadata.openedPrice) : null;\n const solverFees = parseSolverFees(metadata?.solverFees);\n\n // Overlay the immutable per-event snapshot over the mutable quote values. The\n // snapshot `amount` is this event's settled size — it drives both the closed\n // amount and the close-request quantity (mirrors the reference frontend's applyHistoryCloseEventMetadata).\n const closedAmount = snapshotAmount ?? toBigIntOrZero(quote.closedAmount);\n const quantityToClose = snapshotAmount ?? toBigIntOrZero(quote.quantityToClose);\n const avgClosedPrice = snapshotClosePrice ?? toBigIntOrZero(quote.averageClosedPrice);\n const openedPrice = snapshotOpenedPrice ?? toBigIntOrZero(quote.openedPrice);\n const liquidateAmount = isLiquidation\n ? (snapshotAmount ?? toBigIntOrZero(quote.liquidateAmount))\n : toBigIntOrZero(quote.liquidateAmount);\n const liquidatePrice = isLiquidation\n ? (snapshotClosePrice ?? toBigIntOrZero(quote.liquidatePrice))\n : toBigIntOrZero(quote.liquidatePrice);\n\n return {\n eventId: row.id,\n closeEventType: eventType,\n closedAt: Number(row.timestamp),\n quoteId: toBigIntOrZero(row.quoteId),\n marketId: quote.symbolId ? Number(quote.symbolId) : 0,\n symbol: quote.symbol ?? null,\n positionType: (quote.positionType ?? 0) as PositionType,\n orderType: (quote.orderTypeOpen ?? 0) as OrderType,\n quoteStatus: eventTypeToQuoteStatus[eventType] ?? ((quote.quoteStatus ?? 0) as QuoteStatus),\n quantity: toBigIntOrZero(quote.quantity),\n openedPrice,\n requestedOpenPrice: toBigIntOrZero(quote.requestedOpenPrice),\n avgClosedPrice,\n closedAmount,\n quantityToClose,\n liquidateAmount,\n liquidatePrice,\n solverFee: solverFees.solverFee,\n staticSolverFee: solverFees.staticSolverFee,\n totalSolverFee: solverFees.totalSolverFee,\n partyA: getAddress(quote.partyA),\n partyB: quote.partyB ? getAddress(quote.partyB) : null,\n subAccount: quote.subAccount ? getAddress(quote.subAccount.id) : null,\n blockNumber: row.blockNumber ? BigInt(row.blockNumber) : undefined,\n transaction: row.transaction ? (row.transaction as Hex) : undefined,\n rawMetadata: row.metadata,\n source: getAddress(row.source),\n closedPrice: toBigIntOrNull(quote.closedPrice),\n initialOpenedPrice: toBigIntOrNull(quote.initialOpenedPrice),\n marketPrice: toBigIntOrNull(quote.marketPrice),\n tradingFee: toBigIntOrZero(quote.tradingFee),\n closeFee: toBigIntOrZero(quote.closeFee),\n leverage: toBigIntOrNull(quote.leverage),\n cva: toBigIntOrNull(quote.cva),\n lf: toBigIntOrNull(quote.lf),\n initialCva: toBigIntOrZero(quote.initialCva),\n initialLf: toBigIntOrZero(quote.initialLf),\n initialPartyAmm: toBigIntOrNull(quote.initialPartyAmm),\n timestampSendQuote: toNumberOrNull(quote.timestampSendQuote),\n timestampOpenPosition: toNumberOrNull(quote.timestampOpenPosition),\n subAccountOwner: toAddressOrNull(quote.subAccount?.owner),\n sendQuoteTransaction: quote.sendQuoteEvents[0]?.transaction ? (quote.sendQuoteEvents[0].transaction as Hex) : null,\n openPositionMetadata: quote.openPositionEvents.map((event) => event.metadata),\n };\n}\n"],"mappings":";;;;;AAYA,SAAS,EAAc,GAAoD;CACzE,IAAI,CAAC,GAAK,OAAO;CACjB,IAAI;EACF,OAAO,KAAK,MAAM,CAAG;CACvB,QAAQ;EACN,OAAO;CACT;AACF;AAOA,SAAS,EAAY,GAA+B;CAClD,IAAI,KAAiC,MAAM,OAAO;CAElD,IAAM,IAAO,OAAO,CAAK,EAAE,KAAK;CAChC,IAAI,MAAS,IAAI,OAAO;CAExB,IAAI;CACJ,IAAI;EACF,IAAS,OAAO,CAAI;CACtB,QAAQ;EACN,OAAO;CACT;CACA,OAAO,IAAS,KAAK,IAAS;AAChC;AAYA,SAAgB,EAAkB,GAAwC;CACxE,IAAM,IAAY,EAAI,MAChB,IAAQ,EAAI,OACZ,IAAgB,EAAwB,IAAI,CAAS,GAErD,IAAW,EAAc,EAAI,QAAQ,GACrC,IAAiB,IAAW,EAAY,EAAS,MAAM,IAAI,MAC3D,IAAqB,IAAW,EAAY,EAAS,UAAU,IAAI,MACnE,IAAsB,IAAW,EAAY,EAAS,WAAW,IAAI,MACrE,IAAa,EAAgB,GAAU,UAAU,GAKjD,IAAe,KAAkB,EAAe,EAAM,YAAY,GAClE,IAAkB,KAAkB,EAAe,EAAM,eAAe,GACxE,IAAiB,KAAsB,EAAe,EAAM,kBAAkB,GAC9E,IAAc,KAAuB,EAAe,EAAM,WAAW,GACrE,IAAkB,IACnB,KAAkB,EAAe,EAAM,eAAe,IACvD,EAAe,EAAM,eAAe,GAClC,IAAiB,IAClB,KAAsB,EAAe,EAAM,cAAc,IAC1D,EAAe,EAAM,cAAc;CAEvC,OAAO;EACL,SAAS,EAAI;EACb,gBAAgB;EAChB,UAAU,OAAO,EAAI,SAAS;EAC9B,SAAS,EAAe,EAAI,OAAO;EACnC,UAAU,EAAM,WAAW,OAAO,EAAM,QAAQ,IAAI;EACpD,QAAQ,EAAM,UAAU;EACxB,cAAe,EAAM,gBAAgB;EACrC,WAAY,EAAM,iBAAiB;EACnC,aAAa,EAAuB,MAAgB,EAAM,eAAe;EACzE,UAAU,EAAe,EAAM,QAAQ;EACvC;EACA,oBAAoB,EAAe,EAAM,kBAAkB;EAC3D;EACA;EACA;EACA;EACA;EACA,WAAW,EAAW;EACtB,iBAAiB,EAAW;EAC5B,gBAAgB,EAAW;EAC3B,QAAQ,EAAW,EAAM,MAAM;EAC/B,QAAQ,EAAM,SAAS,EAAW,EAAM,MAAM,IAAI;EAClD,YAAY,EAAM,aAAa,EAAW,EAAM,WAAW,EAAE,IAAI;EACjE,aAAa,EAAI,cAAc,OAAO,EAAI,WAAW,IAAI,KAAA;EACzD,aAAa,EAAI,cAAe,EAAI,cAAsB,KAAA;EAC1D,aAAa,EAAI;EACjB,QAAQ,EAAW,EAAI,MAAM;EAC7B,aAAa,EAAe,EAAM,WAAW;EAC7C,oBAAoB,EAAe,EAAM,kBAAkB;EAC3D,aAAa,EAAe,EAAM,WAAW;EAC7C,YAAY,EAAe,EAAM,UAAU;EAC3C,UAAU,EAAe,EAAM,QAAQ;EACvC,UAAU,EAAe,EAAM,QAAQ;EACvC,KAAK,EAAe,EAAM,GAAG;EAC7B,IAAI,EAAe,EAAM,EAAE;EAC3B,YAAY,EAAe,EAAM,UAAU;EAC3C,WAAW,EAAe,EAAM,SAAS;EACzC,iBAAiB,EAAe,EAAM,eAAe;EACrD,oBAAoB,EAAe,EAAM,kBAAkB;EAC3D,uBAAuB,EAAe,EAAM,qBAAqB;EACjE,iBAAiB,EAAgB,EAAM,YAAY,KAAK;EACxD,sBAAsB,EAAM,gBAAgB,IAAI,cAAe,EAAM,gBAAgB,GAAG,cAAsB;EAC9G,sBAAsB,EAAM,mBAAmB,KAAK,MAAU,EAAM,QAAQ;CAC9E;AACF"}
|
|
@@ -124,5 +124,46 @@ export interface QuoteHistoryRow {
|
|
|
124
124
|
transaction?: Hex;
|
|
125
125
|
/** Raw event `metadata` JSON string, preserved for power users. */
|
|
126
126
|
rawMetadata: string | null;
|
|
127
|
+
/** Diamond address the event was indexed from (the subgraph's `source`). */
|
|
128
|
+
source: Address;
|
|
129
|
+
/**
|
|
130
|
+
* The quote's own `closedPrice`, as indexed — not snapshot-overlaid. Prefer
|
|
131
|
+
* {@link QuoteHistoryRow.avgClosedPrice} for this event's close price.
|
|
132
|
+
*/
|
|
133
|
+
closedPrice: bigint | null;
|
|
134
|
+
/** The fill price before any `SETTLE_UPNL` moved the open price; `null` when not indexed. */
|
|
135
|
+
initialOpenedPrice: bigint | null;
|
|
136
|
+
/** Market price when the quote was sent; `null` when not indexed. */
|
|
137
|
+
marketPrice: bigint | null;
|
|
138
|
+
/** Platform (trading) fee rate the quote was sent with (18-decimal fraction). */
|
|
139
|
+
tradingFee: bigint;
|
|
140
|
+
/** Platform close fee rate the quote was sent with (18-decimal fraction). */
|
|
141
|
+
closeFee: bigint;
|
|
142
|
+
/** Quote leverage as indexed (18-decimal); `null` when not indexed. */
|
|
143
|
+
leverage: bigint | null;
|
|
144
|
+
/** Live locked CVA (shrinks on partial close); `null` when not indexed. */
|
|
145
|
+
cva: bigint | null;
|
|
146
|
+
/** Live locked LF (shrinks on partial close); `null` when not indexed. */
|
|
147
|
+
lf: bigint | null;
|
|
148
|
+
/** CVA the quote was sent with. */
|
|
149
|
+
initialCva: bigint;
|
|
150
|
+
/** LF the quote was sent with. */
|
|
151
|
+
initialLf: bigint;
|
|
152
|
+
/** PartyA maintenance margin the quote was sent with; `null` when not indexed. */
|
|
153
|
+
initialPartyAmm: bigint | null;
|
|
154
|
+
/** When the quote was sent (unix seconds); `null` when not indexed. */
|
|
155
|
+
timestampSendQuote: number | null;
|
|
156
|
+
/** When the position opened (unix seconds); `null` when not indexed. */
|
|
157
|
+
timestampOpenPosition: number | null;
|
|
158
|
+
/** Owner of the quote's SubAccount, or `null` when the quote has none (cross-margin). */
|
|
159
|
+
subAccountOwner: Address | null;
|
|
160
|
+
/** Transaction of the quote's `SEND_QUOTE` event (its open transaction), or `null`. */
|
|
161
|
+
sendQuoteTransaction: Hex | null;
|
|
162
|
+
/**
|
|
163
|
+
* Raw `metadata` of the quote's `OPEN_POSITION` events — at most 1000, the
|
|
164
|
+
* subgraph's page ceiling — undecoded. Decoding (e.g. the solver fees paid at
|
|
165
|
+
* open) and judging whether the list is complete are the consumer's choice.
|
|
166
|
+
*/
|
|
167
|
+
openPositionMetadata: readonly (string | null)[];
|
|
127
168
|
}
|
|
128
169
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEhG;;;;;GAKG;AACH,oBAAY,cAAc;IACxB,yCAAyC;IACzC,GAAG,QAAQ;IACX,mCAAmC;IACnC,MAAM,WAAW;IACjB,mCAAmC;IACnC,WAAW,gBAAgB;IAC3B,2CAA2C;IAC3C,eAAe,oBAAoB;IACnC,6CAA6C;IAC7C,SAAS,cAAc;IACvB,0EAA0E;IAC1E,UAAU,eAAe;CAC1B;AAED;;;;;;;GAOG;AACH,oBAAY,mBAAmB;IAC7B,wCAAwC;IACxC,SAAS,eAAe;IACxB,qBAAqB;IACrB,UAAU,gBAAgB;IAC1B,0BAA0B;IAC1B,cAAc,oBAAoB;IAClC,kCAAkC;IAClC,QAAQ,cAAc;IACtB,4CAA4C;IAC5C,eAAe,sBAAsB;IACrC,4CAA4C;IAC5C,eAAe,sBAAsB;IACrC,mDAAmD;IACnD,sBAAsB,6BAA6B;CACpD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,cAAc,EAAE,mBAAmB,CAAC;IACpC,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,+EAA+E;IAC/E,WAAW,EAAE,WAAW,CAAC;IACzB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;;;OAQG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,mEAAmE;IACnE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quote-history/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEhG;;;;;GAKG;AACH,oBAAY,cAAc;IACxB,yCAAyC;IACzC,GAAG,QAAQ;IACX,mCAAmC;IACnC,MAAM,WAAW;IACjB,mCAAmC;IACnC,WAAW,gBAAgB;IAC3B,2CAA2C;IAC3C,eAAe,oBAAoB;IACnC,6CAA6C;IAC7C,SAAS,cAAc;IACvB,0EAA0E;IAC1E,UAAU,eAAe;CAC1B;AAED;;;;;;;GAOG;AACH,oBAAY,mBAAmB;IAC7B,wCAAwC;IACxC,SAAS,eAAe;IACxB,qBAAqB;IACrB,UAAU,gBAAgB;IAC1B,0BAA0B;IAC1B,cAAc,oBAAoB;IAClC,kCAAkC;IAClC,QAAQ,cAAc;IACtB,4CAA4C;IAC5C,eAAe,sBAAsB;IACrC,4CAA4C;IAC5C,eAAe,sBAAsB;IACrC,mDAAmD;IACnD,sBAAsB,6BAA6B;CACpD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,cAAc,EAAE,mBAAmB,CAAC;IACpC,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,+EAA+E;IAC/E,WAAW,EAAE,WAAW,CAAC;IACzB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;;;OAQG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,mEAAmE;IACnE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,6FAA6F;IAC7F,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qEAAqE;IACrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,2EAA2E;IAC3E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,0EAA0E;IAC1E,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,uEAAuE;IACvE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wEAAwE;IACxE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,yFAAyF;IACzF,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,uFAAuF;IACvF,oBAAoB,EAAE,GAAG,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,oBAAoB,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/quotes/get-quote-history/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { OrderType, PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\n\n/**\n * Close-type filter for quote history.\n *\n * Selects which terminal events a history read returns. Maps to the subgraph's\n * `QuoteEvent.type` values via {@link \"closeTypeToEventTypes\"}.\n */\nexport enum QuoteCloseType {\n /** Every close and liquidation event. */\n All = \"All\",\n /** Normal close (`FILL_CLOSE`). */\n Closed = \"Closed\",\n /** Force close (`FORCE_CLOSE`). */\n ForceClosed = \"ForceClosed\",\n /** Emergency close (`EMERGENCY_CLOSE`). */\n EmergencyClosed = \"EmergencyClosed\",\n /** Auto-deleveraging close (`ADL_CLOSE`). */\n AdlClosed = \"AdlClosed\",\n /** Liquidation (`LIQUIDATE_PARTY_A` / `_PARTY_B` / `_CLEARING_HOUSE`). */\n Liquidated = \"Liquidated\",\n}\n\n/**\n * Subgraph `QuoteEvent.type` values that terminate a (partial) position and\n * therefore appear in history. Each carries an immutable `metadata` snapshot.\n *\n * @remarks\n * Mirrors the event-type strings emitted by the SYMMIO subgraphs (v0.8.6+);\n * see the subgraphs `0.8.6_migration` doc — QuoteEvent metadata.\n */\nexport enum QuoteCloseEventType {\n /** A normal (partial or full) close. */\n FillClose = \"FILL_CLOSE\",\n /** A force close. */\n ForceClose = \"FORCE_CLOSE\",\n /** An emergency close. */\n EmergencyClose = \"EMERGENCY_CLOSE\",\n /** An auto-deleveraging close. */\n AdlClose = \"ADL_CLOSE\",\n /** Liquidation initiated against partyA. */\n LiquidatePartyA = \"LIQUIDATE_PARTY_A\",\n /** Liquidation initiated against partyB. */\n LiquidatePartyB = \"LIQUIDATE_PARTY_B\",\n /** Liquidation initiated by the clearing house. */\n LiquidateClearingHouse = \"LIQUIDATE_CLEARING_HOUSE\",\n}\n\n/**\n * One row of quote history — a single immutable `QuoteEvent` with its per-event\n * `metadata` snapshot overlaid onto the (otherwise mutable) quote it belongs to.\n *\n * Because the underlying `Quote` entity is mutable, a quote closed across several\n * partial closes produces several history rows that would otherwise show the same\n * final state. The snapshot overlay restores each event's own amount/price, so\n * every partial-close row is distinct.\n *\n * @remarks\n * Amounts and prices are raw `bigint` (18-decimal fixed point, no scaling),\n * matching the SDK's on-chain {@link \"Quote\"} reads. Enum fields are decoded.\n */\nexport interface QuoteHistoryRow {\n /** Stable id of the underlying immutable `QuoteEvent` (use as a row key). */\n eventId: string;\n /** The close / liquidation event that produced this row. */\n closeEventType: QuoteCloseEventType;\n /** Event block timestamp in seconds (the row's \"close time\"). */\n closedAt: number;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Market identifier (`symbolId`). */\n marketId: number;\n /** Market ticker resolved by the subgraph, when known. */\n symbol: string | null;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order (open side). */\n orderType: OrderType;\n /** Lifecycle status, forced to `CLOSED` / `LIQUIDATED` from the event type. */\n quoteStatus: QuoteStatus;\n /** Total quote quantity. */\n quantity: bigint;\n /** Open price (snapshot-overlaid when the event carried one). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n requestedOpenPrice: bigint;\n /** Average close price (snapshot-overlaid with this event's close price). */\n avgClosedPrice: bigint;\n /** Amount closed by this event (snapshot `amount`). */\n closedAmount: bigint;\n /** Quantity of the close request this event settled. */\n quantityToClose: bigint;\n /** Liquidated amount (set only for liquidation rows). */\n liquidateAmount: bigint;\n /** Liquidation price (set only for liquidation rows). */\n liquidatePrice: bigint;\n /**\n * Rate-based solver fee charged by this event (`SOLVER_FEE`), or `null` when\n * the event carried none.\n */\n solverFee: bigint | null;\n /**\n * Flat solver fee charged by this event (`STATIC_SOLVER_FEE`), or `null` when\n * the event carried none.\n */\n staticSolverFee: bigint | null;\n /**\n * Sum of every solver fee on the event — including tags this version does not\n * name individually — or `null` when the event recorded none at all.\n *\n * @remarks\n * Only fill-close events carry solver fees: liquidation and ADL rows, and\n * deployments indexed before the fee was recorded, read `null` on all three\n * fee fields. The untruncated list stays on {@link QuoteHistoryRow.rawMetadata}.\n */\n totalSolverFee: bigint | null;\n /** PartyA (the SubAccount or Virtual Account that owns the quote). */\n partyA: Address;\n /** PartyB (the hedger/solver), or `null` when absent. */\n partyB: Address | null;\n /** The account-layer SubAccount address, or `null` when absent. */\n subAccount: Address | null;\n /** Block number of the event, when available. */\n blockNumber?: bigint;\n /** Transaction hash of the event, when available. */\n transaction?: Hex;\n /** Raw event `metadata` JSON string, preserved for power users. */\n rawMetadata: string | null;\n}\n"],"mappings":";AASA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,MAAA,OAEA,EAAA,SAAA,UAEA,EAAA,cAAA,eAEA,EAAA,kBAAA,mBAEA,EAAA,YAAA,aAEA,EAAA,aAAA;AACF,EAAA,CAAA,CAAA,GAUY,IAAL,yBAAA,GAAA;QAEL,EAAA,YAAA,cAEA,EAAA,aAAA,eAEA,EAAA,iBAAA,mBAEA,EAAA,WAAA,aAEA,EAAA,kBAAA,qBAEA,EAAA,kBAAA,qBAEA,EAAA,yBAAA;AACF,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/quotes/get-quote-history/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\nimport type { OrderType, PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\n\n/**\n * Close-type filter for quote history.\n *\n * Selects which terminal events a history read returns. Maps to the subgraph's\n * `QuoteEvent.type` values via {@link \"closeTypeToEventTypes\"}.\n */\nexport enum QuoteCloseType {\n /** Every close and liquidation event. */\n All = \"All\",\n /** Normal close (`FILL_CLOSE`). */\n Closed = \"Closed\",\n /** Force close (`FORCE_CLOSE`). */\n ForceClosed = \"ForceClosed\",\n /** Emergency close (`EMERGENCY_CLOSE`). */\n EmergencyClosed = \"EmergencyClosed\",\n /** Auto-deleveraging close (`ADL_CLOSE`). */\n AdlClosed = \"AdlClosed\",\n /** Liquidation (`LIQUIDATE_PARTY_A` / `_PARTY_B` / `_CLEARING_HOUSE`). */\n Liquidated = \"Liquidated\",\n}\n\n/**\n * Subgraph `QuoteEvent.type` values that terminate a (partial) position and\n * therefore appear in history. Each carries an immutable `metadata` snapshot.\n *\n * @remarks\n * Mirrors the event-type strings emitted by the SYMMIO subgraphs (v0.8.6+);\n * see the subgraphs `0.8.6_migration` doc — QuoteEvent metadata.\n */\nexport enum QuoteCloseEventType {\n /** A normal (partial or full) close. */\n FillClose = \"FILL_CLOSE\",\n /** A force close. */\n ForceClose = \"FORCE_CLOSE\",\n /** An emergency close. */\n EmergencyClose = \"EMERGENCY_CLOSE\",\n /** An auto-deleveraging close. */\n AdlClose = \"ADL_CLOSE\",\n /** Liquidation initiated against partyA. */\n LiquidatePartyA = \"LIQUIDATE_PARTY_A\",\n /** Liquidation initiated against partyB. */\n LiquidatePartyB = \"LIQUIDATE_PARTY_B\",\n /** Liquidation initiated by the clearing house. */\n LiquidateClearingHouse = \"LIQUIDATE_CLEARING_HOUSE\",\n}\n\n/**\n * One row of quote history — a single immutable `QuoteEvent` with its per-event\n * `metadata` snapshot overlaid onto the (otherwise mutable) quote it belongs to.\n *\n * Because the underlying `Quote` entity is mutable, a quote closed across several\n * partial closes produces several history rows that would otherwise show the same\n * final state. The snapshot overlay restores each event's own amount/price, so\n * every partial-close row is distinct.\n *\n * @remarks\n * Amounts and prices are raw `bigint` (18-decimal fixed point, no scaling),\n * matching the SDK's on-chain {@link \"Quote\"} reads. Enum fields are decoded.\n */\nexport interface QuoteHistoryRow {\n /** Stable id of the underlying immutable `QuoteEvent` (use as a row key). */\n eventId: string;\n /** The close / liquidation event that produced this row. */\n closeEventType: QuoteCloseEventType;\n /** Event block timestamp in seconds (the row's \"close time\"). */\n closedAt: number;\n /** Protocol quote id. */\n quoteId: bigint;\n /** Market identifier (`symbolId`). */\n marketId: number;\n /** Market ticker resolved by the subgraph, when known. */\n symbol: string | null;\n /** Long or short. */\n positionType: PositionType;\n /** Limit or market order (open side). */\n orderType: OrderType;\n /** Lifecycle status, forced to `CLOSED` / `LIQUIDATED` from the event type. */\n quoteStatus: QuoteStatus;\n /** Total quote quantity. */\n quantity: bigint;\n /** Open price (snapshot-overlaid when the event carried one). */\n openedPrice: bigint;\n /** Price partyA originally requested to open at. */\n requestedOpenPrice: bigint;\n /** Average close price (snapshot-overlaid with this event's close price). */\n avgClosedPrice: bigint;\n /** Amount closed by this event (snapshot `amount`). */\n closedAmount: bigint;\n /** Quantity of the close request this event settled. */\n quantityToClose: bigint;\n /** Liquidated amount (set only for liquidation rows). */\n liquidateAmount: bigint;\n /** Liquidation price (set only for liquidation rows). */\n liquidatePrice: bigint;\n /**\n * Rate-based solver fee charged by this event (`SOLVER_FEE`), or `null` when\n * the event carried none.\n */\n solverFee: bigint | null;\n /**\n * Flat solver fee charged by this event (`STATIC_SOLVER_FEE`), or `null` when\n * the event carried none.\n */\n staticSolverFee: bigint | null;\n /**\n * Sum of every solver fee on the event — including tags this version does not\n * name individually — or `null` when the event recorded none at all.\n *\n * @remarks\n * Only fill-close events carry solver fees: liquidation and ADL rows, and\n * deployments indexed before the fee was recorded, read `null` on all three\n * fee fields. The untruncated list stays on {@link QuoteHistoryRow.rawMetadata}.\n */\n totalSolverFee: bigint | null;\n /** PartyA (the SubAccount or Virtual Account that owns the quote). */\n partyA: Address;\n /** PartyB (the hedger/solver), or `null` when absent. */\n partyB: Address | null;\n /** The account-layer SubAccount address, or `null` when absent. */\n subAccount: Address | null;\n /** Block number of the event, when available. */\n blockNumber?: bigint;\n /** Transaction hash of the event, when available. */\n transaction?: Hex;\n /** Raw event `metadata` JSON string, preserved for power users. */\n rawMetadata: string | null;\n /** Diamond address the event was indexed from (the subgraph's `source`). */\n source: Address;\n /**\n * The quote's own `closedPrice`, as indexed — not snapshot-overlaid. Prefer\n * {@link QuoteHistoryRow.avgClosedPrice} for this event's close price.\n */\n closedPrice: bigint | null;\n /** The fill price before any `SETTLE_UPNL` moved the open price; `null` when not indexed. */\n initialOpenedPrice: bigint | null;\n /** Market price when the quote was sent; `null` when not indexed. */\n marketPrice: bigint | null;\n /** Platform (trading) fee rate the quote was sent with (18-decimal fraction). */\n tradingFee: bigint;\n /** Platform close fee rate the quote was sent with (18-decimal fraction). */\n closeFee: bigint;\n /** Quote leverage as indexed (18-decimal); `null` when not indexed. */\n leverage: bigint | null;\n /** Live locked CVA (shrinks on partial close); `null` when not indexed. */\n cva: bigint | null;\n /** Live locked LF (shrinks on partial close); `null` when not indexed. */\n lf: bigint | null;\n /** CVA the quote was sent with. */\n initialCva: bigint;\n /** LF the quote was sent with. */\n initialLf: bigint;\n /** PartyA maintenance margin the quote was sent with; `null` when not indexed. */\n initialPartyAmm: bigint | null;\n /** When the quote was sent (unix seconds); `null` when not indexed. */\n timestampSendQuote: number | null;\n /** When the position opened (unix seconds); `null` when not indexed. */\n timestampOpenPosition: number | null;\n /** Owner of the quote's SubAccount, or `null` when the quote has none (cross-margin). */\n subAccountOwner: Address | null;\n /** Transaction of the quote's `SEND_QUOTE` event (its open transaction), or `null`. */\n sendQuoteTransaction: Hex | null;\n /**\n * Raw `metadata` of the quote's `OPEN_POSITION` events — at most 1000, the\n * subgraph's page ceiling — undecoded. Decoding (e.g. the solver fees paid at\n * open) and judging whether the list is complete are the consumer's choice.\n */\n openPositionMetadata: readonly (string | null)[];\n}\n"],"mappings":";AASA,IAAY,IAAL,yBAAA,GAAA;QAEL,EAAA,MAAA,OAEA,EAAA,SAAA,UAEA,EAAA,cAAA,eAEA,EAAA,kBAAA,mBAEA,EAAA,YAAA,aAEA,EAAA,aAAA;AACF,EAAA,CAAA,CAAA,GAUY,IAAL,yBAAA,GAAA;QAEL,EAAA,YAAA,cAEA,EAAA,aAAA,eAEA,EAAA,iBAAA,mBAEA,EAAA,WAAA,aAEA,EAAA,kBAAA,qBAEA,EAAA,kBAAA,qBAEA,EAAA,yBAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1,14 +1,24 @@
|
|
|
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 '../get-quote-events-by-type/types.js';
|
|
4
|
+
import { QuoteEventRow, QuoteEventType, QuoteSubgraphEventType } from '../get-quote-events-by-type/types.js';
|
|
4
5
|
/**
|
|
5
6
|
* Parameters for {@link getQuotesEventsByType}.
|
|
6
7
|
*/
|
|
7
|
-
export type GetQuotesEventsByTypeParameters = Compute<ChainIdParameter & {
|
|
8
|
+
export type GetQuotesEventsByTypeParameters<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType> = Compute<ChainIdParameter & {
|
|
8
9
|
/** On-chain quote ids to read events for. Order is irrelevant — rows come back merged. */
|
|
9
10
|
quoteIds: readonly bigint[];
|
|
10
|
-
/**
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Event types to include — e.g. {@link FUNDING_HISTORY_EVENT_TYPES}, or any
|
|
13
|
+
* subgraph type such as `"OPEN_POSITION"`. Omit to read every type; an empty
|
|
14
|
+
* array reads nothing. The rows' `type` narrows to what is passed.
|
|
15
|
+
*/
|
|
16
|
+
types?: readonly TType[];
|
|
17
|
+
/**
|
|
18
|
+
* The deployment's diamond address (the subgraph's `source`). Omit to match
|
|
19
|
+
* the quote ids on any deployment the subgraph indexes.
|
|
20
|
+
*/
|
|
21
|
+
source?: Address;
|
|
12
22
|
/**
|
|
13
23
|
* Page size across the whole batch, not per quote id. The subgraph caps it at
|
|
14
24
|
* 1000, and omitting it asks for that ceiling — one round-trip returns as much
|
|
@@ -22,21 +32,21 @@ export type GetQuotesEventsByTypeParameters = Compute<ChainIdParameter & {
|
|
|
22
32
|
orderDirection?: "asc" | "desc";
|
|
23
33
|
}>;
|
|
24
34
|
/** Return type of {@link getQuotesEventsByType}. */
|
|
25
|
-
export interface GetQuotesEventsByTypeReturnType {
|
|
35
|
+
export interface GetQuotesEventsByTypeReturnType<TType extends QuoteSubgraphEventType = QuoteEventType> {
|
|
26
36
|
/**
|
|
27
37
|
* The decoded event rows for every requested quote id, already merged and
|
|
28
38
|
* sorted by `timestamp` server-side (newest first unless `orderDirection` says
|
|
29
39
|
* otherwise). Each row carries its own `quoteId`, so a caller that needs a
|
|
30
40
|
* per-quote view groups by that field.
|
|
31
41
|
*/
|
|
32
|
-
rows: QuoteEventRow[];
|
|
42
|
+
rows: QuoteEventRow<TType>[];
|
|
33
43
|
/** `true` when the page came back full — caller should fetch the next page. */
|
|
34
44
|
hasMore: boolean;
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
|
-
* Batched sibling of `getQuoteEventsByType`: read the
|
|
38
|
-
*
|
|
39
|
-
*
|
|
47
|
+
* Batched sibling of `getQuoteEventsByType`: read the events of **many** quotes
|
|
48
|
+
* from the analytics subgraph in one round-trip, optionally filtered to the
|
|
49
|
+
* requested event types and deployment.
|
|
40
50
|
*
|
|
41
51
|
* The subgraph does the merge: rows for all `quoteIds` come back interleaved and
|
|
42
52
|
* sorted by `timestamp`, newest first by default, and `first` / `skip` page over
|
|
@@ -60,7 +70,7 @@ export interface GetQuotesEventsByTypeReturnType {
|
|
|
60
70
|
* The action does no event-type interpretation beyond decoding the metadata JSON.
|
|
61
71
|
*
|
|
62
72
|
* @param config - The SDK config.
|
|
63
|
-
* @param parameters - Quote ids, types, pagination, sort, optional chain id.
|
|
73
|
+
* @param parameters - Quote ids, optional types and diamond, pagination, sort, optional chain id.
|
|
64
74
|
* @returns The decoded rows plus a `hasMore` flag.
|
|
65
75
|
* @throws {SymmError} when the chain is unsupported or has no analytics subgraph.
|
|
66
76
|
* @throws {SymmApiError} when the subgraph request fails.
|
|
@@ -73,5 +83,5 @@ export interface GetQuotesEventsByTypeReturnType {
|
|
|
73
83
|
* });
|
|
74
84
|
* ```
|
|
75
85
|
*/
|
|
76
|
-
export declare function getQuotesEventsByType(config: Config, parameters: GetQuotesEventsByTypeParameters): Promise<GetQuotesEventsByTypeReturnType
|
|
86
|
+
export declare function getQuotesEventsByType<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType>(config: Config, parameters: GetQuotesEventsByTypeParameters<TType>): Promise<GetQuotesEventsByTypeReturnType<TType>>;
|
|
77
87
|
//# sourceMappingURL=get-quotes-events-by-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-quotes-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-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-quotes-events-by-type.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/get-quotes-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;AAW/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAG/G;;GAEG;AACH,MAAM,MAAM,+BAA+B,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,OAAO,CAClH,gBAAgB,GAAG;IACjB,0FAA0F;IAC1F,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,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,oDAAoD;AACpD,MAAM,WAAW,+BAA+B,CAAC,KAAK,SAAS,sBAAsB,GAAG,cAAc;IACpG;;;;;OAKG;IACH,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7B,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,EACvG,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,+BAA+B,CAAC,KAAK,CAAC,GACjD,OAAO,CAAC,+BAA+B,CAAC,KAAK,CAAC,CAAC,CAkCjD"}
|