@symmio/trading-core 3.6.0 → 4.1.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 +48 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +408 -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/markets/get-listing-markets.d.ts +2 -0
- package/dist/pools/markets/get-listing-markets.d.ts.map +1 -1
- package/dist/pools/markets/get-listing-markets.js +1 -0
- package/dist/pools/markets/get-listing-markets.js.map +1 -1
- package/dist/pools/markets/query.d.ts.map +1 -1
- package/dist/pools/markets/query.js +1 -0
- package/dist/pools/markets/query.js.map +1 -1
- package/dist/pools/markets/to-search-params.d.ts +1 -0
- package/dist/pools/markets/to-search-params.d.ts.map +1 -1
- package/dist/pools/markets/to-search-params.js +1 -1
- package/dist/pools/markets/to-search-params.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/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/solvers/estimated-price/get-estimated-price.d.ts +2 -0
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.js +4 -1
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
- package/dist/solvers/estimated-price/query.d.ts +6 -2
- package/dist/solvers/estimated-price/query.d.ts.map +1 -1
- package/dist/solvers/estimated-price/query.js +3 -2
- package/dist/solvers/estimated-price/query.js.map +1 -1
- package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts +4 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.js +17 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts +4 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.js +21 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/get-funding-info.d.ts +22 -13
- package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -1
- package/dist/solvers/funding-info/get-funding-info.js +24 -12
- package/dist/solvers/funding-info/get-funding-info.js.map +1 -1
- package/dist/solvers/funding-info/query.d.ts +14 -6
- package/dist/solvers/funding-info/query.d.ts.map +1 -1
- package/dist/solvers/funding-info/query.js +1 -0
- package/dist/solvers/funding-info/query.js.map +1 -1
- package/dist/solvers/funding-info/to-funding-info.d.ts +8 -4
- package/dist/solvers/funding-info/to-funding-info.d.ts.map +1 -1
- package/dist/solvers/funding-info/to-funding-info.js +2 -1
- package/dist/solvers/funding-info/to-funding-info.js.map +1 -1
- package/dist/solvers/funding-info/types.d.ts +26 -4
- package/dist/solvers/funding-info/types.d.ts.map +1 -1
- package/dist/solvers/market-info/adapters/enigma-market-info.d.ts +3 -3
- package/dist/solvers/market-info/adapters/enigma-market-info.d.ts.map +1 -1
- package/dist/solvers/market-info/adapters/enigma-market-info.js +7 -5
- package/dist/solvers/market-info/adapters/enigma-market-info.js.map +1 -1
- package/dist/solvers/market-info/get-market-info.d.ts +3 -2
- package/dist/solvers/market-info/get-market-info.d.ts.map +1 -1
- package/dist/solvers/market-info/get-market-info.js.map +1 -1
- package/dist/solvers/market-info/types.d.ts +4 -3
- package/dist/solvers/market-info/types.d.ts.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +10 -10
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-all.js +26 -23
- package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-page.d.ts +49 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.d.ts.map +1 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.js +37 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.js.map +1 -0
- package/dist/solvers/notional-cap/index.d.ts +2 -0
- package/dist/solvers/notional-cap/index.d.ts.map +1 -1
- package/dist/solvers/notional-cap/query-page.d.ts +45 -0
- package/dist/solvers/notional-cap/query-page.d.ts.map +1 -0
- package/dist/solvers/notional-cap/query-page.js +26 -0
- package/dist/solvers/notional-cap/query-page.js.map +1 -0
- package/dist/solvers/symbols/get-symbols.d.ts +3 -2
- package/dist/solvers/symbols/get-symbols.d.ts.map +1 -1
- package/dist/solvers/symbols/get-symbols.js +17 -3
- package/dist/solvers/symbols/get-symbols.js.map +1 -1
- package/dist/solvers/trade-volume/get-trade-volume.d.ts +2 -1
- package/dist/solvers/trade-volume/get-trade-volume.d.ts.map +1 -1
- package/dist/solvers/trade-volume/get-trade-volume.js +6 -1
- package/dist/solvers/trade-volume/get-trade-volume.js.map +1 -1
- package/dist/solvers/trade-volume/to-daily-volume.d.ts +6 -6
- package/dist/solvers/trade-volume/to-daily-volume.js.map +1 -1
- package/dist/solvers/trade-volume/types.d.ts +4 -3
- package/dist/solvers/trade-volume/types.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js +3 -3
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/solvers/types/generated/rasa-solver.js +8 -2
- package/dist/solvers/types/generated/rasa-solver.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 +25 -5
- 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 +3640 -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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/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,EAEL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,6BAA6B,CAAC;AAErC,4EAA4E;AAC5E,MAAM,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-quotes-events-by-type/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,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhG,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,6BAA6B,CAAC;AAErC,4EAA4E;AAC5E,MAAM,MAAM,yBAAyB,CAAC,KAAK,SAAS,sBAAsB,GAAG,cAAc,IACzF,+BAA+B,CAAC,KAAK,CAAC,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,+BAA+B,GAAG,kBAAkB,CAAC;;;GAUnH;AAED,wEAAwE;AACxE,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE7F;;;GAGG;AACH,MAAM,MAAM,4BAA4B,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,OAAO,CAC/G,+BAA+B,CAAC,KAAK,CAAC,GACpC,cAAc,CACZ,yBAAyB,CAAC,KAAK,CAAC,EAChC,KAAK,EACL,yBAAyB,CAAC,KAAK,CAAC,EAChC,6BAA6B,CAC9B,CACJ,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,iCAAiC,CAAC,KAAK,SAAS,sBAAsB,GAAG,cAAc,IACjG,kBAAkB,CAChB,yBAAyB,CAAC,KAAK,CAAC,EAChC,KAAK,EACL,yBAAyB,CAAC,KAAK,CAAC,EAChC,6BAA6B,CAC9B,CAAC;AAEJ;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,EAC7G,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,4BAA4B,CAAC,KAAK,CAAC,GAC3C,iCAAiC,CAAC,KAAK,CAAC,CAmB1C"}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { hasEmptyListFilter as t } from "../../symmio-subgraph/subgraph-filters.js";
|
|
3
|
+
import { toQuoteIdKeyPart as n } from "../quote-id-key-part.js";
|
|
4
|
+
import { getQuotesEventsByType as r } from "./get-quotes-events-by-type.js";
|
|
4
5
|
//#region src/quotes/get-quotes-events-by-type/query.ts
|
|
5
|
-
function
|
|
6
|
+
function i(t) {
|
|
6
7
|
return ["getQuotesEventsByType", {
|
|
7
|
-
...e(
|
|
8
|
-
quoteIds: t
|
|
9
|
-
types: [...
|
|
8
|
+
...e(t),
|
|
9
|
+
quoteIds: n(t.quoteIds),
|
|
10
|
+
...t.types === void 0 ? {} : { types: [...t.types] }
|
|
10
11
|
}];
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function a(e, n) {
|
|
13
14
|
return {
|
|
14
|
-
...
|
|
15
|
-
queryKey:
|
|
16
|
-
...
|
|
17
|
-
configKey: e.getChainConfigKey(
|
|
15
|
+
...n.query,
|
|
16
|
+
queryKey: i({
|
|
17
|
+
...n,
|
|
18
|
+
configKey: e.getChainConfigKey(n.chainId)
|
|
18
19
|
}),
|
|
19
|
-
enabled: (
|
|
20
|
-
queryFn: () =>
|
|
21
|
-
chainId:
|
|
22
|
-
quoteIds:
|
|
23
|
-
types:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
enabled: (n.query?.enabled ?? !0) && !t(n.quoteIds, n.types),
|
|
21
|
+
queryFn: () => r(e, {
|
|
22
|
+
chainId: n.chainId,
|
|
23
|
+
quoteIds: n.quoteIds,
|
|
24
|
+
types: n.types,
|
|
25
|
+
source: n.source,
|
|
26
|
+
first: n.first,
|
|
27
|
+
skip: n.skip,
|
|
28
|
+
orderDirection: n.orderDirection
|
|
27
29
|
})
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
//#endregion
|
|
31
|
-
export {
|
|
33
|
+
export { i as getQuotesEventsByTypeQueryKey, a as getQuotesEventsByTypeQueryOptions };
|
|
32
34
|
|
|
33
35
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-quotes-events-by-type/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 { toQuoteIdKeyPart } from \"../quote-id-key-part\";\nimport {\n getQuotesEventsByType,\n type GetQuotesEventsByTypeParameters,\n type GetQuotesEventsByTypeReturnType,\n} from \"./get-quotes-events-by-type\";\n\n/** Data resolved by the {@link getQuotesEventsByTypeQueryOptions} query. */\nexport type GetQuotesEventsByTypeData = GetQuotesEventsByTypeReturnType
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-quotes-events-by-type/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 type { QuoteEventType, QuoteSubgraphEventType } from \"../get-quote-events-by-type/types\";\nimport { toQuoteIdKeyPart } from \"../quote-id-key-part\";\nimport {\n getQuotesEventsByType,\n type GetQuotesEventsByTypeParameters,\n type GetQuotesEventsByTypeReturnType,\n} from \"./get-quotes-events-by-type\";\n\n/** Data resolved by the {@link getQuotesEventsByTypeQueryOptions} query. */\nexport type GetQuotesEventsByTypeData<TType extends QuoteSubgraphEventType = QuoteEventType> =\n GetQuotesEventsByTypeReturnType<TType>;\n\n/**\n * Build the TanStack Query key for {@link getQuotesEventsByTypeQueryOptions}.\n *\n * @param options - Query parameters (quote ids, types, paging, sort, chain id, config key).\n * @returns A stable, hashable query key. The `bigint` quote ids are stringified so\n * the key is JSON-safe, and sorted so id order does not fragment the cache.\n */\nexport function getQuotesEventsByTypeQueryKey(options: Compute<GetQuotesEventsByTypeParameters & ConfigKeyParameter>) {\n const filtered = filterQueryOptions(options);\n return [\n \"getQuotesEventsByType\",\n {\n ...filtered,\n quoteIds: toQuoteIdKeyPart(options.quoteIds),\n ...(options.types === undefined ? {} : { types: [...options.types] }),\n },\n ] as const;\n}\n\n/** Query-key type produced by {@link getQuotesEventsByTypeQueryKey}. */\nexport type GetQuotesEventsByTypeQueryKey = ReturnType<typeof getQuotesEventsByTypeQueryKey>;\n\n/**\n * Options accepted by {@link getQuotesEventsByTypeQueryOptions}: the action's\n * parameters plus TanStack overrides.\n */\nexport type GetQuotesEventsByTypeOptions<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType> = Compute<\n GetQuotesEventsByTypeParameters<TType> &\n QueryParameter<\n GetQuotesEventsByTypeData<TType>,\n Error,\n GetQuotesEventsByTypeData<TType>,\n GetQuotesEventsByTypeQueryKey\n >\n>;\n\n/** TanStack Query options returned by {@link getQuotesEventsByTypeQueryOptions}. */\nexport type GetQuotesEventsByTypeQueryOptions<TType extends QuoteSubgraphEventType = QuoteEventType> =\n SymmioQueryOptions<\n GetQuotesEventsByTypeData<TType>,\n Error,\n GetQuotesEventsByTypeData<TType>,\n GetQuotesEventsByTypeQueryKey\n >;\n\n/**\n * Build TanStack Query options for {@link getQuotesEventsByType}. The query is\n * disabled until at least one quote id is supplied, and while `types` is an\n * empty array; omitting `types` reads every type.\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 * getQuotesEventsByTypeQueryOptions(config, {\n * quoteIds: [7334n, 7335n],\n * types: FUNDING_HISTORY_EVENT_TYPES,\n * }),\n * );\n * ```\n */\nexport function getQuotesEventsByTypeQueryOptions<TType extends QuoteSubgraphEventType = QuoteSubgraphEventType>(\n config: Config,\n options: GetQuotesEventsByTypeOptions<TType>,\n): GetQuotesEventsByTypeQueryOptions<TType> {\n return {\n ...options.query,\n queryKey: getQuotesEventsByTypeQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: (options.query?.enabled ?? true) && !hasEmptyListFilter(options.quoteIds, options.types),\n queryFn: () =>\n getQuotesEventsByType<TType>(config, {\n chainId: options.chainId,\n quoteIds: options.quoteIds,\n types: options.types,\n source: options.source,\n first: options.first,\n skip: options.skip,\n orderDirection: options.orderDirection,\n }),\n };\n}\n"],"mappings":";;;;;AAwBA,SAAgB,EAA8B,GAAwE;CAEpH,OAAO,CACL,yBACA;EACE,GAJa,EAAmB,CAI7B;EACH,UAAU,EAAiB,EAAQ,QAAQ;EAC3C,GAAI,EAAQ,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,EAAQ,KAAK,EAAE;CACrE,CACF;AACF;AA+CA,SAAgB,EACd,GACA,GAC0C;CAC1C,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA8B;GACtC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,UAAU,EAAQ,OAAO,WAAW,OAAS,CAAC,EAAmB,EAAQ,UAAU,EAAQ,KAAK;EAChG,eACE,EAA6B,GAAQ;GACnC,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,OAAO,EAAQ;GACf,QAAQ,EAAQ;GAChB,OAAO,EAAQ;GACf,MAAM,EAAQ;GACd,gBAAgB,EAAQ;EAC1B,CAAC;CACL;AACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { SubgraphPage, SubgraphPageParameters } from '../../symmio-subgraph/subgraph-filters.js';
|
|
5
|
+
import { SubgraphQuoteRow } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Parameters for {@link getSubgraphQuotes}. Every filter is optional and applied
|
|
8
|
+
* only when passed; an empty list filter reads nothing.
|
|
9
|
+
*/
|
|
10
|
+
export type GetSubgraphQuotesParameters = Compute<ChainIdParameter & SubgraphPageParameters & {
|
|
11
|
+
/** On-chain quote ids. */
|
|
12
|
+
quoteIds?: readonly bigint[];
|
|
13
|
+
/** The deployment's diamond address (the subgraph's `source`). */
|
|
14
|
+
source?: Address;
|
|
15
|
+
/** Owning accounts (`partyA`). */
|
|
16
|
+
partyAs?: readonly Address[];
|
|
17
|
+
}>;
|
|
18
|
+
/** Return type of {@link getSubgraphQuotes}: one page of quotes. */
|
|
19
|
+
export type GetSubgraphQuotesReturnType = SubgraphPage<SubgraphQuoteRow>;
|
|
20
|
+
/**
|
|
21
|
+
* Read the analytics subgraph's `Quote` entities, as indexed. For the live
|
|
22
|
+
* on-chain struct use `getQuote`. One call returns one page; see
|
|
23
|
+
* {@link SubgraphPageParameters} for paging by cursor.
|
|
24
|
+
*
|
|
25
|
+
* @param config - The SDK config.
|
|
26
|
+
* @param parameters - Optional filters, paging, sort, chain id.
|
|
27
|
+
* @returns One page of decoded quotes.
|
|
28
|
+
* @throws {SymmError} when the chain has no analytics subgraph, `first` / `skip` is out of range, or `idGt`
|
|
29
|
+
* is passed with a sort other than `id` ascending (`INVALID_SUBGRAPH_CURSOR`).
|
|
30
|
+
* @throws {SymmApiError} when the subgraph request fails.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const { rows } = await getSubgraphQuotes(config, { quoteIds: [7334n], source: "0xdiamond…" });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSubgraphQuotes(config: Config, parameters?: GetSubgraphQuotesParameters): Promise<GetSubgraphQuotesReturnType>;
|
|
38
|
+
//# sourceMappingURL=get-subgraph-quotes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-subgraph-quotes.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/get-subgraph-quotes.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;AAE/E,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,wCAAwC,CAAC;AAIhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,gBAAgB,GACd,sBAAsB,GAAG;IACvB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC9B,CACJ,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,2BAA2B,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,2BAAgC,GAC3C,OAAO,CAAC,2BAA2B,CAAC,CAqBtC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { querySubgraph as e } from "../../symmio-subgraph/query-subgraph/query-subgraph.js";
|
|
2
|
+
import { compactWhere as t, hasEmptyListFilter as n, lowercaseList as r, resolveSubgraphPage as i, stringList as a, toSubgraphPage as o } from "../../symmio-subgraph/subgraph-filters.js";
|
|
3
|
+
import { SubgraphQuotesDocument as s } from "./query-document.js";
|
|
4
|
+
import { toSubgraphQuoteRow as c } from "./to-subgraph-quote-row.js";
|
|
5
|
+
//#region src/quotes/get-subgraph-quotes/get-subgraph-quotes.ts
|
|
6
|
+
async function l(l, u = {}) {
|
|
7
|
+
let { chainId: d, quoteIds: f, source: p, partyAs: m, idGt: h } = u, g = i(u);
|
|
8
|
+
return n(f, m) ? {
|
|
9
|
+
rows: [],
|
|
10
|
+
hasMore: !1
|
|
11
|
+
} : o((await e(l, {
|
|
12
|
+
chainId: d,
|
|
13
|
+
document: s,
|
|
14
|
+
variables: {
|
|
15
|
+
where: t({
|
|
16
|
+
quoteId_in: a(f),
|
|
17
|
+
source: p?.toLowerCase(),
|
|
18
|
+
partyA_in: r(m),
|
|
19
|
+
id_gt: h
|
|
20
|
+
}),
|
|
21
|
+
...g
|
|
22
|
+
}
|
|
23
|
+
})).quotes.map(c), g.first);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { l as getSubgraphQuotes };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=get-subgraph-quotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-subgraph-quotes.js","names":[],"sources":["../../../src/quotes/get-subgraph-quotes/get-subgraph-quotes.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport {\n compactWhere,\n hasEmptyListFilter,\n lowercaseList,\n resolveSubgraphPage,\n stringList,\n toSubgraphPage,\n type SubgraphPage,\n type SubgraphPageParameters,\n} from \"../../symmio-subgraph/subgraph-filters\";\nimport type { Quote_Filter } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { SubgraphQuotesDocument } from \"./query-document\";\nimport { toSubgraphQuoteRow } from \"./to-subgraph-quote-row\";\nimport type { SubgraphQuoteRow } from \"./types\";\n\n/**\n * Parameters for {@link getSubgraphQuotes}. Every filter is optional and applied\n * only when passed; an empty list filter reads nothing.\n */\nexport type GetSubgraphQuotesParameters = Compute<\n ChainIdParameter &\n SubgraphPageParameters & {\n /** On-chain quote ids. */\n quoteIds?: readonly bigint[];\n /** The deployment's diamond address (the subgraph's `source`). */\n source?: Address;\n /** Owning accounts (`partyA`). */\n partyAs?: readonly Address[];\n }\n>;\n\n/** Return type of {@link getSubgraphQuotes}: one page of quotes. */\nexport type GetSubgraphQuotesReturnType = SubgraphPage<SubgraphQuoteRow>;\n\n/**\n * Read the analytics subgraph's `Quote` entities, as indexed. For the live\n * on-chain struct use `getQuote`. One call returns one page; see\n * {@link SubgraphPageParameters} for paging by cursor.\n *\n * @param config - The SDK config.\n * @param parameters - Optional filters, paging, sort, chain id.\n * @returns One page of decoded quotes.\n * @throws {SymmError} when the chain has no analytics subgraph, `first` / `skip` is out of range, or `idGt`\n * is passed with a sort other than `id` ascending (`INVALID_SUBGRAPH_CURSOR`).\n * @throws {SymmApiError} when the subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows } = await getSubgraphQuotes(config, { quoteIds: [7334n], source: \"0xdiamond…\" });\n * ```\n */\nexport async function getSubgraphQuotes(\n config: Config,\n parameters: GetSubgraphQuotesParameters = {},\n): Promise<GetSubgraphQuotesReturnType> {\n const { chainId, quoteIds, source, partyAs, idGt } = parameters;\n const page = resolveSubgraphPage(parameters);\n\n if (hasEmptyListFilter(quoteIds, partyAs)) return { rows: [], hasMore: false };\n\n const data = await querySubgraph(config, {\n chainId,\n document: SubgraphQuotesDocument,\n variables: {\n where: compactWhere<Quote_Filter>({\n quoteId_in: stringList(quoteIds),\n source: source?.toLowerCase(),\n partyA_in: lowercaseList(partyAs),\n id_gt: idGt,\n }),\n ...page,\n },\n });\n\n return toSubgraphPage(data.quotes.map(toSubgraphQuoteRow), page.first);\n}\n"],"mappings":";;;;;AAuDA,eAAsB,EACpB,GACA,IAA0C,CAAC,GACL;CACtC,IAAM,EAAE,YAAS,aAAU,WAAQ,YAAS,YAAS,GAC/C,IAAO,EAAoB,CAAU;CAkB3C,OAhBI,EAAmB,GAAU,CAAO,IAAU;EAAE,MAAM,CAAC;EAAG,SAAS;CAAM,IAgBtE,GAAe,MAdH,EAAc,GAAQ;EACvC;EACA,UAAU;EACV,WAAW;GACT,OAAO,EAA2B;IAChC,YAAY,EAAW,CAAQ;IAC/B,QAAQ,GAAQ,YAAY;IAC5B,WAAW,EAAc,CAAO;IAChC,OAAO;GACT,CAAC;GACD,GAAG;EACL;CACF,CAAC,GAE0B,OAAO,IAAI,CAAkB,GAAG,EAAK,KAAK;AACvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the analytics subgraph's `Quote` entities, as indexed. Every filter
|
|
3
|
+
* (`quoteId_in`, `source`, `partyA_in`, the `id_gt` cursor) travels in the
|
|
4
|
+
* action-built `$where`, present only when the caller passes it.
|
|
5
|
+
*
|
|
6
|
+
* The document compiles to a typed query string via graphql-codegen.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SubgraphQuotesDocument: import('../../symmio-subgraph/types/generated/analytics/graphql.js').TypedDocumentString<import('../../symmio-subgraph/types/generated/analytics/graphql.js').SubgraphQuotesQuery, {
|
|
9
|
+
where: import('../../symmio-subgraph/types/generated/analytics/graphql.js').Quote_Filter;
|
|
10
|
+
first: number;
|
|
11
|
+
skip: number;
|
|
12
|
+
orderBy: import('../../symmio-subgraph/types/generated/analytics/graphql.js').Quote_OrderBy;
|
|
13
|
+
orderDirection: import('../../symmio-subgraph/types/generated/analytics/graphql.js').OrderDirection;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=query-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/query-document.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;EAiCjC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { graphql as e } from "../../symmio-subgraph/types/generated/analytics/gql.js";
|
|
2
|
+
//#region src/quotes/get-subgraph-quotes/query-document.ts
|
|
3
|
+
var t = e("\n query SubgraphQuotes(\n $where: Quote_filter!\n $first: Int!\n $skip: Int!\n $orderBy: Quote_orderBy!\n $orderDirection: OrderDirection!\n ) {\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n source\n quoteId\n quoteStatus\n partyA\n partyB\n symbolId\n symbol\n positionType\n quantity\n fillAmount\n closedAmount\n openedPrice\n accumulatedPaidFunding\n lastFundingPaymentTimestamp\n userPaidFunding\n userReceivedFunding\n timestampSendQuote\n timestampOpenPosition\n timestampFullyClose\n timestamp\n blockNumber\n }\n }\n");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t as SubgraphQuotesDocument };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=query-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-document.js","names":[],"sources":["../../../src/quotes/get-subgraph-quotes/query-document.ts"],"sourcesContent":["import { graphql } from \"../../symmio-subgraph/types/generated/analytics\";\n\n/**\n * Read the analytics subgraph's `Quote` entities, as indexed. Every filter\n * (`quoteId_in`, `source`, `partyA_in`, the `id_gt` cursor) travels in the\n * action-built `$where`, present only when the caller passes it.\n *\n * The document compiles to a typed query string via graphql-codegen.\n */\nexport const SubgraphQuotesDocument = graphql(`\n query SubgraphQuotes(\n $where: Quote_filter!\n $first: Int!\n $skip: Int!\n $orderBy: Quote_orderBy!\n $orderDirection: OrderDirection!\n ) {\n quotes(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n source\n quoteId\n quoteStatus\n partyA\n partyB\n symbolId\n symbol\n positionType\n quantity\n fillAmount\n closedAmount\n openedPrice\n accumulatedPaidFunding\n lastFundingPaymentTimestamp\n userPaidFunding\n userReceivedFunding\n timestampSendQuote\n timestampOpenPosition\n timestampFullyClose\n timestamp\n blockNumber\n }\n }\n`);\n"],"mappings":";;AASA,IAAa,IAAyB,EAAQ,ytBAiC7C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetSubgraphQuotesParameters, GetSubgraphQuotesReturnType } from './get-subgraph-quotes.js';
|
|
5
|
+
/** Data resolved by the {@link getSubgraphQuotesQueryOptions} query. */
|
|
6
|
+
export type GetSubgraphQuotesData = GetSubgraphQuotesReturnType;
|
|
7
|
+
/**
|
|
8
|
+
* Build the TanStack Query key for {@link getSubgraphQuotesQueryOptions}.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Query parameters (filters, paging, chain id, config key).
|
|
11
|
+
* @returns A stable, hashable query key; `bigint` filters are stringified.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSubgraphQuotesQueryKey(options: Compute<GetSubgraphQuotesParameters & ConfigKeyParameter>): readonly ["getSubgraphQuotes", Record<string, unknown>];
|
|
14
|
+
/** Query-key type produced by {@link getSubgraphQuotesQueryKey}. */
|
|
15
|
+
export type GetSubgraphQuotesQueryKey = ReturnType<typeof getSubgraphQuotesQueryKey>;
|
|
16
|
+
/**
|
|
17
|
+
* Options accepted by {@link getSubgraphQuotesQueryOptions}: the action's parameters
|
|
18
|
+
* plus TanStack overrides.
|
|
19
|
+
*/
|
|
20
|
+
export type GetSubgraphQuotesOptions = Compute<GetSubgraphQuotesParameters & QueryParameter<GetSubgraphQuotesData, Error, GetSubgraphQuotesData, GetSubgraphQuotesQueryKey>>;
|
|
21
|
+
/** TanStack Query options returned by {@link getSubgraphQuotesQueryOptions}. */
|
|
22
|
+
export type GetSubgraphQuotesQueryOptions = SymmioQueryOptions<GetSubgraphQuotesData, Error, GetSubgraphQuotesData, GetSubgraphQuotesQueryKey>;
|
|
23
|
+
/**
|
|
24
|
+
* Build TanStack Query options for {@link getSubgraphQuotes}. The query is disabled while
|
|
25
|
+
* any list filter is an empty array (it would match nothing).
|
|
26
|
+
*
|
|
27
|
+
* @param config - The SDK config.
|
|
28
|
+
* @param options - Query parameters and TanStack overrides.
|
|
29
|
+
* @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* useQuery(getSubgraphQuotesQueryOptions(config, { quoteIds: [7334n], source: "0xdiamond…" }));
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSubgraphQuotesQueryOptions(config: Config, options?: GetSubgraphQuotesOptions): GetSubgraphQuotesQueryOptions;
|
|
37
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/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,EAEL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,2DAE3G;AAED,oEAAoE;AACpE,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,2BAA2B,GACzB,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACjG,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,kBAAkB,CAC5D,qBAAqB,EACrB,KAAK,EACL,qBAAqB,EACrB,yBAAyB,CAC1B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,wBAA6B,GACrC,6BAA6B,CAW/B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { hasEmptyListFilter as t } from "../../symmio-subgraph/subgraph-filters.js";
|
|
3
|
+
import { getSubgraphQuotes as n } from "./get-subgraph-quotes.js";
|
|
4
|
+
//#region src/quotes/get-subgraph-quotes/query.ts
|
|
5
|
+
function r(t) {
|
|
6
|
+
return ["getSubgraphQuotes", e(t)];
|
|
7
|
+
}
|
|
8
|
+
function i(e, i = {}) {
|
|
9
|
+
let { query: a, ...o } = i;
|
|
10
|
+
return {
|
|
11
|
+
...a,
|
|
12
|
+
queryKey: r({
|
|
13
|
+
...o,
|
|
14
|
+
configKey: e.getChainConfigKey(o.chainId)
|
|
15
|
+
}),
|
|
16
|
+
enabled: (a?.enabled ?? !0) && !t(o.quoteIds, o.partyAs),
|
|
17
|
+
queryFn: () => n(e, o)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as getSubgraphQuotesQueryKey, i as getSubgraphQuotesQueryOptions };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/quotes/get-subgraph-quotes/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 {\n getSubgraphQuotes,\n type GetSubgraphQuotesParameters,\n type GetSubgraphQuotesReturnType,\n} from \"./get-subgraph-quotes\";\n\n/** Data resolved by the {@link getSubgraphQuotesQueryOptions} query. */\nexport type GetSubgraphQuotesData = GetSubgraphQuotesReturnType;\n\n/**\n * Build the TanStack Query key for {@link getSubgraphQuotesQueryOptions}.\n *\n * @param options - Query parameters (filters, paging, chain id, config key).\n * @returns A stable, hashable query key; `bigint` filters are stringified.\n */\nexport function getSubgraphQuotesQueryKey(options: Compute<GetSubgraphQuotesParameters & ConfigKeyParameter>) {\n return [\"getSubgraphQuotes\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getSubgraphQuotesQueryKey}. */\nexport type GetSubgraphQuotesQueryKey = ReturnType<typeof getSubgraphQuotesQueryKey>;\n\n/**\n * Options accepted by {@link getSubgraphQuotesQueryOptions}: the action's parameters\n * plus TanStack overrides.\n */\nexport type GetSubgraphQuotesOptions = Compute<\n GetSubgraphQuotesParameters &\n QueryParameter<GetSubgraphQuotesData, Error, GetSubgraphQuotesData, GetSubgraphQuotesQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getSubgraphQuotesQueryOptions}. */\nexport type GetSubgraphQuotesQueryOptions = SymmioQueryOptions<\n GetSubgraphQuotesData,\n Error,\n GetSubgraphQuotesData,\n GetSubgraphQuotesQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getSubgraphQuotes}. The query is disabled while\n * any list filter is an empty array (it would match nothing).\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(getSubgraphQuotesQueryOptions(config, { quoteIds: [7334n], source: \"0xdiamond…\" }));\n * ```\n */\nexport function getSubgraphQuotesQueryOptions(\n config: Config,\n options: GetSubgraphQuotesOptions = {},\n): GetSubgraphQuotesQueryOptions {\n const { query, ...parameters } = options;\n return {\n ...query,\n queryKey: getSubgraphQuotesQueryKey({\n ...parameters,\n configKey: config.getChainConfigKey(parameters.chainId),\n }),\n enabled: (query?.enabled ?? true) && !hasEmptyListFilter(parameters.quoteIds, parameters.partyAs),\n queryFn: () => getSubgraphQuotes(config, parameters),\n };\n}\n"],"mappings":";;;;AAoBA,SAAgB,EAA0B,GAAoE;CAC5G,OAAO,CAAC,qBAAqB,EAAmB,CAAO,CAAC;AAC1D;AAmCA,SAAgB,EACd,GACA,IAAoC,CAAC,GACN;CAC/B,IAAM,EAAE,UAAO,GAAG,MAAe;CACjC,OAAO;EACL,GAAG;EACH,UAAU,EAA0B;GAClC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAW,OAAO;EACxD,CAAC;EACD,UAAU,GAAO,WAAW,OAAS,CAAC,EAAmB,EAAW,UAAU,EAAW,OAAO;EAChG,eAAe,EAAkB,GAAQ,CAAU;CACrD;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SubgraphQuotesQuery } from '../../symmio-subgraph/types/generated/analytics/graphql.js';
|
|
2
|
+
import { SubgraphQuoteRow } from './types.js';
|
|
3
|
+
/** A single `quotes` entity as returned by the subgraph. */
|
|
4
|
+
export type RawSubgraphQuoteRow = SubgraphQuotesQuery["quotes"][number];
|
|
5
|
+
/**
|
|
6
|
+
* Decode one raw `quotes` entity into a {@link SubgraphQuoteRow}.
|
|
7
|
+
*
|
|
8
|
+
* @param row - The raw entity.
|
|
9
|
+
* @returns The decoded row.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toSubgraphQuoteRow(row: RawSubgraphQuoteRow): SubgraphQuoteRow;
|
|
12
|
+
//# sourceMappingURL=to-subgraph-quote-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-subgraph-quote-row.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/to-subgraph-quote-row.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,GAAG,gBAAgB,CAyB7E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { toAddress as e, toAddressOrNull as t, toBigIntOrNull as n, toBigIntOrZero as r, toNumberOrNull as i } from "../../symmio-subgraph/subgraph-decode.js";
|
|
2
|
+
//#region src/quotes/get-subgraph-quotes/to-subgraph-quote-row.ts
|
|
3
|
+
function a(a) {
|
|
4
|
+
return {
|
|
5
|
+
id: a.id,
|
|
6
|
+
source: e(a.source),
|
|
7
|
+
quoteId: r(a.quoteId),
|
|
8
|
+
quoteStatus: a.quoteStatus === null ? null : a.quoteStatus,
|
|
9
|
+
partyA: e(a.partyA),
|
|
10
|
+
partyB: t(a.partyB),
|
|
11
|
+
symbolId: i(a.symbolId),
|
|
12
|
+
symbol: a.symbol,
|
|
13
|
+
positionType: a.positionType === null ? null : a.positionType,
|
|
14
|
+
quantity: n(a.quantity),
|
|
15
|
+
fillAmount: n(a.fillAmount),
|
|
16
|
+
closedAmount: n(a.closedAmount),
|
|
17
|
+
openedPrice: n(a.openedPrice),
|
|
18
|
+
accumulatedPaidFunding: n(a.accumulatedPaidFunding),
|
|
19
|
+
lastFundingPaymentTimestamp: i(a.lastFundingPaymentTimestamp),
|
|
20
|
+
userPaidFunding: n(a.userPaidFunding),
|
|
21
|
+
userReceivedFunding: n(a.userReceivedFunding),
|
|
22
|
+
timestampSendQuote: i(a.timestampSendQuote),
|
|
23
|
+
timestampOpenPosition: i(a.timestampOpenPosition),
|
|
24
|
+
timestampFullyClose: i(a.timestampFullyClose),
|
|
25
|
+
timestamp: Number(a.timestamp),
|
|
26
|
+
blockNumber: r(a.blockNumber)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as toSubgraphQuoteRow };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=to-subgraph-quote-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-subgraph-quote-row.js","names":[],"sources":["../../../src/quotes/get-subgraph-quotes/to-subgraph-quote-row.ts"],"sourcesContent":["import type { PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport {\n toAddress,\n toAddressOrNull,\n toBigIntOrNull,\n toBigIntOrZero,\n toNumberOrNull,\n} from \"../../symmio-subgraph/subgraph-decode\";\nimport type { SubgraphQuotesQuery } from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport type { SubgraphQuoteRow } from \"./types\";\n\n/** A single `quotes` entity as returned by the subgraph. */\nexport type RawSubgraphQuoteRow = SubgraphQuotesQuery[\"quotes\"][number];\n\n/**\n * Decode one raw `quotes` entity into a {@link SubgraphQuoteRow}.\n *\n * @param row - The raw entity.\n * @returns The decoded row.\n */\nexport function toSubgraphQuoteRow(row: RawSubgraphQuoteRow): SubgraphQuoteRow {\n return {\n id: row.id,\n source: toAddress(row.source),\n quoteId: toBigIntOrZero(row.quoteId),\n quoteStatus: row.quoteStatus === null ? null : (row.quoteStatus as QuoteStatus),\n partyA: toAddress(row.partyA),\n partyB: toAddressOrNull(row.partyB),\n symbolId: toNumberOrNull(row.symbolId),\n symbol: row.symbol,\n positionType: row.positionType === null ? null : (row.positionType as PositionType),\n quantity: toBigIntOrNull(row.quantity),\n fillAmount: toBigIntOrNull(row.fillAmount),\n closedAmount: toBigIntOrNull(row.closedAmount),\n openedPrice: toBigIntOrNull(row.openedPrice),\n accumulatedPaidFunding: toBigIntOrNull(row.accumulatedPaidFunding),\n lastFundingPaymentTimestamp: toNumberOrNull(row.lastFundingPaymentTimestamp),\n userPaidFunding: toBigIntOrNull(row.userPaidFunding),\n userReceivedFunding: toBigIntOrNull(row.userReceivedFunding),\n timestampSendQuote: toNumberOrNull(row.timestampSendQuote),\n timestampOpenPosition: toNumberOrNull(row.timestampOpenPosition),\n timestampFullyClose: toNumberOrNull(row.timestampFullyClose),\n timestamp: Number(row.timestamp),\n blockNumber: toBigIntOrZero(row.blockNumber),\n };\n}\n"],"mappings":";;AAoBA,SAAgB,EAAmB,GAA4C;CAC7E,OAAO;EACL,IAAI,EAAI;EACR,QAAQ,EAAU,EAAI,MAAM;EAC5B,SAAS,EAAe,EAAI,OAAO;EACnC,aAAa,EAAI,gBAAgB,OAAO,OAAQ,EAAI;EACpD,QAAQ,EAAU,EAAI,MAAM;EAC5B,QAAQ,EAAgB,EAAI,MAAM;EAClC,UAAU,EAAe,EAAI,QAAQ;EACrC,QAAQ,EAAI;EACZ,cAAc,EAAI,iBAAiB,OAAO,OAAQ,EAAI;EACtD,UAAU,EAAe,EAAI,QAAQ;EACrC,YAAY,EAAe,EAAI,UAAU;EACzC,cAAc,EAAe,EAAI,YAAY;EAC7C,aAAa,EAAe,EAAI,WAAW;EAC3C,wBAAwB,EAAe,EAAI,sBAAsB;EACjE,6BAA6B,EAAe,EAAI,2BAA2B;EAC3E,iBAAiB,EAAe,EAAI,eAAe;EACnD,qBAAqB,EAAe,EAAI,mBAAmB;EAC3D,oBAAoB,EAAe,EAAI,kBAAkB;EACzD,uBAAuB,EAAe,EAAI,qBAAqB;EAC/D,qBAAqB,EAAe,EAAI,mBAAmB;EAC3D,WAAW,OAAO,EAAI,SAAS;EAC/B,aAAa,EAAe,EAAI,WAAW;CAC7C;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { PositionType, QuoteStatus } from '../../symmio-contracts/symmio/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* One analytics-subgraph `Quote` entity, as indexed — not the on-chain struct
|
|
5
|
+
* (read that with `getQuote`). Amounts and prices are 18-decimal wei `bigint`;
|
|
6
|
+
* `null` marks a field the subgraph has not indexed for this quote.
|
|
7
|
+
*/
|
|
8
|
+
export interface SubgraphQuoteRow {
|
|
9
|
+
/** Subgraph entity id (`<quoteId>-<source>`; use as an `idGt` cursor). */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Diamond address the quote was indexed from (the subgraph's `source`). */
|
|
12
|
+
source: Address;
|
|
13
|
+
/** On-chain quote id. */
|
|
14
|
+
quoteId: bigint;
|
|
15
|
+
/** Lifecycle status, or `null`. */
|
|
16
|
+
quoteStatus: QuoteStatus | null;
|
|
17
|
+
/** PartyA (SubAccount or Virtual Account). */
|
|
18
|
+
partyA: Address;
|
|
19
|
+
/** PartyB (the solver), or `null`. */
|
|
20
|
+
partyB: Address | null;
|
|
21
|
+
/** Market id, or `null`. */
|
|
22
|
+
symbolId: number | null;
|
|
23
|
+
/** Market ticker, or `null`. */
|
|
24
|
+
symbol: string | null;
|
|
25
|
+
/** Long or short, or `null`. */
|
|
26
|
+
positionType: PositionType | null;
|
|
27
|
+
/** Quote quantity. */
|
|
28
|
+
quantity: bigint | null;
|
|
29
|
+
/** Filled quantity. */
|
|
30
|
+
fillAmount: bigint | null;
|
|
31
|
+
/** Quantity closed so far. */
|
|
32
|
+
closedAmount: bigint | null;
|
|
33
|
+
/** Current open price. */
|
|
34
|
+
openedPrice: bigint | null;
|
|
35
|
+
/** Funding index the quote has paid through (signed; an index, not an amount). */
|
|
36
|
+
accumulatedPaidFunding: bigint | null;
|
|
37
|
+
/** Last funding payment (unix seconds), or `null`. */
|
|
38
|
+
lastFundingPaymentTimestamp: number | null;
|
|
39
|
+
/** Cumulative funding PartyA paid (wei). */
|
|
40
|
+
userPaidFunding: bigint | null;
|
|
41
|
+
/** Cumulative funding PartyA received (wei). */
|
|
42
|
+
userReceivedFunding: bigint | null;
|
|
43
|
+
/** When the quote was sent (unix seconds), or `null`. */
|
|
44
|
+
timestampSendQuote: number | null;
|
|
45
|
+
/** When the position opened (unix seconds), or `null`. */
|
|
46
|
+
timestampOpenPosition: number | null;
|
|
47
|
+
/** When the position fully closed (unix seconds), or `null`. */
|
|
48
|
+
timestampFullyClose: number | null;
|
|
49
|
+
/** Entity timestamp (unix seconds). */
|
|
50
|
+
timestamp: number;
|
|
51
|
+
/** Block number of the last update. */
|
|
52
|
+
blockNumber: bigint;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/quotes/get-subgraph-quotes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAErF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAChB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gCAAgC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gCAAgC;IAChC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uBAAuB;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,8BAA8B;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0BAA0B;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kFAAkF;IAClF,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,sDAAsD;IACtD,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gDAAgD;IAChD,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,0DAA0D;IAC1D,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gEAAgE;IAChE,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/quotes/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './get-quote-history/index.js';
|
|
|
8
8
|
export * from './get-quote-pending-funding/index.js';
|
|
9
9
|
export * from './get-quotes-events-by-type/index.js';
|
|
10
10
|
export * from './get-sub-account-quotes/index.js';
|
|
11
|
+
export * from './get-subgraph-quotes/index.js';
|
|
11
12
|
export * from './grouping/index.js';
|
|
12
13
|
export * from './liquidation/index.js';
|
|
13
14
|
export * from './open-price.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quotes/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quotes/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
@@ -21,6 +21,8 @@ export type GetEstimatedPriceParameters = Compute<ReadSolverParameter & {
|
|
|
21
21
|
* prices the fill relative to it.
|
|
22
22
|
*/
|
|
23
23
|
price: string;
|
|
24
|
+
/** Cancels the underlying HTTP request; no timeout is imposed by default. */
|
|
25
|
+
signal?: AbortSignal;
|
|
24
26
|
}>;
|
|
25
27
|
/**
|
|
26
28
|
* Return type of {@link getEstimatedPrice}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,mBAAmB,GAAG;IACpB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"get-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,mBAAmB,GAAG;IACpB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kFAAkF;IAClF,cAAc,EAAE,MAAM,CAAC;CACxB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,2BAA2B,GACtC,OAAO,CAAC,2BAA2B,CAAC,CA2BtC"}
|
|
@@ -21,7 +21,10 @@ async function c(n, c) {
|
|
|
21
21
|
position_type: s(c.positionType),
|
|
22
22
|
entry: c.entry,
|
|
23
23
|
price: c.price
|
|
24
|
-
}, {
|
|
24
|
+
}, {
|
|
25
|
+
baseURL: l.url,
|
|
26
|
+
signal: c.signal
|
|
27
|
+
})).data);
|
|
25
28
|
} catch (n) {
|
|
26
29
|
throw n instanceof t ? n : o(n) ? e.fromAxios(n, {
|
|
27
30
|
code: "FETCH_ESTIMATED_PRICE_FAILED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, ReadSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { assertSolverKind } from \"../assert-solver-kind\";\nimport { getEstimatedPrice as requestEstimatedPrice } from \"../types/generated/enigma-solver\";\nimport { toEstimatedPrice } from \"./to-estimated-price\";\n\n/** Whether a price estimate is for **opening** or **closing** a position. */\nexport type EstimatedPriceEntry = \"open\" | \"close\";\n\n/**\n * Parameters for {@link getEstimatedPrice}.\n */\nexport type GetEstimatedPriceParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id. */\n symbolId: number;\n /** Order quantity (decimal string). */\n quantity: string;\n /** Long or short. */\n positionType: PositionType;\n /** Whether this estimate is for an open or a close. */\n entry: EstimatedPriceEntry;\n /**\n * The price **sent to the solver** — the slippage-adjusted request price the\n * caller computed for the open/close, **not** the raw mark price. The solver\n * prices the fill relative to it.\n */\n price: string;\n }\n>;\n\n/**\n * Return type of {@link getEstimatedPrice}.\n */\nexport interface GetEstimatedPriceReturnType {\n /** Estimated execution price (decimal string); `\"0\"` when the solver omits it. */\n estimatedPrice: string;\n}\n\n/** Solver wire value for a position side (`\"long\"` / `\"short\"`). */\nfunction positionTypeToWire(positionType: PositionType): string {\n return positionType === PositionType.SHORT ? \"short\" : \"long\";\n}\n\n/**\n * Ask the solver what price an open or close would actually fill at — a\n * read-only simulation of the trade (`GET /estimated-price`; nothing is\n * submitted). Pass the order `quantity`, the side, whether it's an open or\n * close, and the slippage-adjusted request `price`; the solver returns the price\n * it would fill at, from which the UI derives price impact (see\n * {@link calculatePriceImpact}) and — for a close — an estimated PnL.\n *\n * @param config - The SDK config.\n * @param parameters - Market, quantity, side, entry (open/close), and request price.\n * @returns The estimated execution price.\n * @throws {SymmApiError} when the solver request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const { estimatedPrice } = await getEstimatedPrice(config, {\n * symbolId: 1,\n * quantity: \"1000\",\n * positionType: PositionType.LONG,\n * entry: \"open\",\n * price: requestPrice, // slippage-adjusted, from calculateTradeParams\n * });\n * ```\n */\nexport async function getEstimatedPrice(\n config: Config,\n parameters: GetEstimatedPriceParameters,\n): Promise<GetEstimatedPriceReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getEstimatedPrice\");\n try {\n const response = await requestEstimatedPrice(\n {\n symbol_id: parameters.symbolId,\n quantity: parameters.quantity,\n position_type: positionTypeToWire(parameters.positionType),\n entry: parameters.entry,\n price: parameters.price,\n },\n { baseURL: solver.url },\n );\n return toEstimatedPrice(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_ESTIMATED_PRICE_FAILED\", baseURL: solver.url });\n }\n throw new SymmError(\n \"api\",\n \"FETCH_ESTIMATED_PRICE_FAILED\",\n `Failed to fetch estimated price: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"get-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, ReadSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { assertSolverKind } from \"../assert-solver-kind\";\nimport { getEstimatedPrice as requestEstimatedPrice } from \"../types/generated/enigma-solver\";\nimport { toEstimatedPrice } from \"./to-estimated-price\";\n\n/** Whether a price estimate is for **opening** or **closing** a position. */\nexport type EstimatedPriceEntry = \"open\" | \"close\";\n\n/**\n * Parameters for {@link getEstimatedPrice}.\n */\nexport type GetEstimatedPriceParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id. */\n symbolId: number;\n /** Order quantity (decimal string). */\n quantity: string;\n /** Long or short. */\n positionType: PositionType;\n /** Whether this estimate is for an open or a close. */\n entry: EstimatedPriceEntry;\n /**\n * The price **sent to the solver** — the slippage-adjusted request price the\n * caller computed for the open/close, **not** the raw mark price. The solver\n * prices the fill relative to it.\n */\n price: string;\n /** Cancels the underlying HTTP request; no timeout is imposed by default. */\n signal?: AbortSignal;\n }\n>;\n\n/**\n * Return type of {@link getEstimatedPrice}.\n */\nexport interface GetEstimatedPriceReturnType {\n /** Estimated execution price (decimal string); `\"0\"` when the solver omits it. */\n estimatedPrice: string;\n}\n\n/** Solver wire value for a position side (`\"long\"` / `\"short\"`). */\nfunction positionTypeToWire(positionType: PositionType): string {\n return positionType === PositionType.SHORT ? \"short\" : \"long\";\n}\n\n/**\n * Ask the solver what price an open or close would actually fill at — a\n * read-only simulation of the trade (`GET /estimated-price`; nothing is\n * submitted). Pass the order `quantity`, the side, whether it's an open or\n * close, and the slippage-adjusted request `price`; the solver returns the price\n * it would fill at, from which the UI derives price impact (see\n * {@link calculatePriceImpact}) and — for a close — an estimated PnL.\n *\n * @param config - The SDK config.\n * @param parameters - Market, quantity, side, entry (open/close), and request price.\n * @returns The estimated execution price.\n * @throws {SymmApiError} when the solver request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const { estimatedPrice } = await getEstimatedPrice(config, {\n * symbolId: 1,\n * quantity: \"1000\",\n * positionType: PositionType.LONG,\n * entry: \"open\",\n * price: requestPrice, // slippage-adjusted, from calculateTradeParams\n * });\n * ```\n */\nexport async function getEstimatedPrice(\n config: Config,\n parameters: GetEstimatedPriceParameters,\n): Promise<GetEstimatedPriceReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getEstimatedPrice\");\n try {\n const response = await requestEstimatedPrice(\n {\n symbol_id: parameters.symbolId,\n quantity: parameters.quantity,\n position_type: positionTypeToWire(parameters.positionType),\n entry: parameters.entry,\n price: parameters.price,\n },\n { baseURL: solver.url, signal: parameters.signal },\n );\n return toEstimatedPrice(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_ESTIMATED_PRICE_FAILED\", baseURL: solver.url });\n }\n throw new SymmError(\n \"api\",\n \"FETCH_ESTIMATED_PRICE_FAILED\",\n `Failed to fetch estimated price: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;AA6CA,SAAS,EAAmB,GAAoC;CAC9D,OAAO,MAAiB,EAAa,QAAQ,UAAU;AACzD;AA2BA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAC9F,EAAiB,GAAQ,UAAU,mBAAmB;CACtD,IAAI;EAWF,OAAO,GAAiB,MAVD,EACrB;GACE,WAAW,EAAW;GACtB,UAAU,EAAW;GACrB,eAAe,EAAmB,EAAW,YAAY;GACzD,OAAO,EAAW;GAClB,OAAO,EAAW;EACpB,GACA;GAAE,SAAS,EAAO;GAAK,QAAQ,EAAW;EAAO,CACnD,GACiC,IAAI;CACvC,SAAS,GAAK;EAKZ,MAJI,aAAe,IAAiB,IAChC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAgC,SAAS,EAAO;EAAI,CAAC,IAE3F,IAAI,EACR,OACA,gCACA,oCAAoC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KACnF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
|
|
@@ -9,9 +9,13 @@ export declare function getEstimatedPriceQueryKey(options: Compute<GetEstimatedP
|
|
|
9
9
|
/** Query-key type produced by {@link getEstimatedPriceQueryKey}. */
|
|
10
10
|
export type GetEstimatedPriceQueryKey = ReturnType<typeof getEstimatedPriceQueryKey>;
|
|
11
11
|
/** Options accepted by {@link getEstimatedPriceQueryOptions}. */
|
|
12
|
-
export type GetEstimatedPriceOptions = Compute<GetEstimatedPriceParameters & QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>>;
|
|
12
|
+
export type GetEstimatedPriceOptions = Compute<Omit<GetEstimatedPriceParameters, "signal"> & QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>>;
|
|
13
13
|
/** TanStack Query options returned by {@link getEstimatedPriceQueryOptions}. */
|
|
14
|
-
export type GetEstimatedPriceQueryOptions = SymmioQueryOptions<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey
|
|
14
|
+
export type GetEstimatedPriceQueryOptions = Omit<SymmioQueryOptions<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>, "queryFn"> & {
|
|
15
|
+
queryFn: (context?: {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}) => Promise<GetEstimatedPriceData>;
|
|
18
|
+
};
|
|
15
19
|
/**
|
|
16
20
|
* Build TanStack Query options for {@link getEstimatedPrice}. Disabled until
|
|
17
21
|
* `quantity` and `price` are non-empty, so the estimate does not fire on partial
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/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;AAEnF,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,2DAE3G;AAED,oEAAoE;AACpE,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErF,iEAAiE;AACjE,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,2BAA2B,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/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;AAEnF,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,uBAAuB,CAAC;AAE/B,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,2DAE3G;AAED,oEAAoE;AACpE,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErF,iEAAiE;AACjE,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,IAAI,CAAC,2BAA2B,EAAE,QAAQ,CAAC,GACzC,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACjG,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,kBAAkB,CAAC,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,EAClG,SAAS,CACV,GAAG;IACF,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACjF,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,GAChC,6BAA6B,CAoB/B"}
|
|
@@ -12,14 +12,15 @@ function r(e, r) {
|
|
|
12
12
|
configKey: e.getChainConfigKey(r.chainId)
|
|
13
13
|
}),
|
|
14
14
|
enabled: (r.query?.enabled ?? !0) && r.quantity.length > 0 && r.price.length > 0,
|
|
15
|
-
queryFn: () => t(e, {
|
|
15
|
+
queryFn: (n) => t(e, {
|
|
16
16
|
chainId: r.chainId,
|
|
17
17
|
solverId: r.solverId,
|
|
18
18
|
symbolId: r.symbolId,
|
|
19
19
|
quantity: r.quantity,
|
|
20
20
|
positionType: r.positionType,
|
|
21
21
|
entry: r.entry,
|
|
22
|
-
price: r.price
|
|
22
|
+
price: r.price,
|
|
23
|
+
signal: n?.signal
|
|
23
24
|
})
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/estimated-price/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 {\n getEstimatedPrice,\n type GetEstimatedPriceParameters,\n type GetEstimatedPriceReturnType,\n} from \"./get-estimated-price\";\n\n/** Data resolved by the {@link getEstimatedPriceQueryOptions} query. */\nexport type GetEstimatedPriceData = GetEstimatedPriceReturnType;\n\n/** Build the TanStack Query key for {@link getEstimatedPriceQueryOptions}. */\nexport function getEstimatedPriceQueryKey(options: Compute<GetEstimatedPriceParameters & ConfigKeyParameter>) {\n return [\"getEstimatedPrice\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getEstimatedPriceQueryKey}. */\nexport type GetEstimatedPriceQueryKey = ReturnType<typeof getEstimatedPriceQueryKey>;\n\n/** Options accepted by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceOptions = Compute<\n GetEstimatedPriceParameters &\n QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceQueryOptions =
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/solvers/estimated-price/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 {\n getEstimatedPrice,\n type GetEstimatedPriceParameters,\n type GetEstimatedPriceReturnType,\n} from \"./get-estimated-price\";\n\n/** Data resolved by the {@link getEstimatedPriceQueryOptions} query. */\nexport type GetEstimatedPriceData = GetEstimatedPriceReturnType;\n\n/** Build the TanStack Query key for {@link getEstimatedPriceQueryOptions}. */\nexport function getEstimatedPriceQueryKey(options: Compute<GetEstimatedPriceParameters & ConfigKeyParameter>) {\n return [\"getEstimatedPrice\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getEstimatedPriceQueryKey}. */\nexport type GetEstimatedPriceQueryKey = ReturnType<typeof getEstimatedPriceQueryKey>;\n\n/** Options accepted by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceOptions = Compute<\n Omit<GetEstimatedPriceParameters, \"signal\"> &\n QueryParameter<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getEstimatedPriceQueryOptions}. */\nexport type GetEstimatedPriceQueryOptions = Omit<\n SymmioQueryOptions<GetEstimatedPriceData, Error, GetEstimatedPriceData, GetEstimatedPriceQueryKey>,\n \"queryFn\"\n> & {\n queryFn: (context?: { signal?: AbortSignal }) => Promise<GetEstimatedPriceData>;\n};\n\n/**\n * Build TanStack Query options for {@link getEstimatedPrice}. Disabled until\n * `quantity` and `price` are non-empty, so the estimate does not fire on partial\n * input.\n *\n * @example\n * ```ts\n * useQuery(getEstimatedPriceQueryOptions(config, { symbolId, quantity, positionType, entry: \"open\", price }));\n * ```\n */\nexport function getEstimatedPriceQueryOptions(\n config: Config,\n options: GetEstimatedPriceOptions,\n): GetEstimatedPriceQueryOptions {\n return {\n ...options.query,\n queryKey: getEstimatedPriceQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: (options.query?.enabled ?? true) && options.quantity.length > 0 && options.price.length > 0,\n queryFn: (context) =>\n getEstimatedPrice(config, {\n chainId: options.chainId,\n solverId: options.solverId,\n symbolId: options.symbolId,\n quantity: options.quantity,\n positionType: options.positionType,\n entry: options.entry,\n price: options.price,\n signal: context?.signal,\n }),\n };\n}\n"],"mappings":";;;AAcA,SAAgB,EAA0B,GAAoE;CAC5G,OAAO,CAAC,qBAAqB,EAAmB,CAAO,CAAC;AAC1D;AA6BA,SAAgB,EACd,GACA,GAC+B;CAC/B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA0B;GAClC,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,UAAU,EAAQ,OAAO,WAAW,OAAS,EAAQ,SAAS,SAAS,KAAK,EAAQ,MAAM,SAAS;EACnG,UAAU,MACR,EAAkB,GAAQ;GACxB,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,UAAU,EAAQ;GAClB,UAAU,EAAQ;GAClB,cAAc,EAAQ;GACtB,OAAO,EAAQ;GACf,OAAO,EAAQ;GACf,QAAQ,GAAS;EACnB,CAAC;CACL;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EnigmaMarketFundingInfo } from '../types.js';
|
|
2
|
+
/** Fetch Enigma symbol-ID funding through its generated client. @internal */
|
|
3
|
+
export declare function fetchEnigmaFundingInfo(baseURL: string, symbolIds?: readonly number[]): Promise<EnigmaMarketFundingInfo[]>;
|
|
4
|
+
//# sourceMappingURL=enigma-funding-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enigma-funding-info.d.ts","sourceRoot":"","sources":["../../../../src/solvers/funding-info/adapters/enigma-funding-info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACxD,6EAA6E;AAC7E,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAC5B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAWpC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getFundingInfo as e } from "../../types/generated/enigma-solver.js";
|
|
2
|
+
import { toMarketFundingInfo as t } from "../to-funding-info.js";
|
|
3
|
+
//#region src/solvers/funding-info/adapters/enigma-funding-info.ts
|
|
4
|
+
async function n(n, r) {
|
|
5
|
+
let i = await e(r ? { symbol_ids: [...r] } : void 0, {
|
|
6
|
+
baseURL: n,
|
|
7
|
+
paramsSerializer: { indexes: null }
|
|
8
|
+
});
|
|
9
|
+
return Object.entries(i.data).flatMap(([e, n]) => {
|
|
10
|
+
let r = Number(e);
|
|
11
|
+
return !Number.isSafeInteger(r) || r <= 0 || !n || typeof n != "object" ? [] : [t(r, n)];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as fetchEnigmaFundingInfo };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=enigma-funding-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enigma-funding-info.js","names":[],"sources":["../../../../src/solvers/funding-info/adapters/enigma-funding-info.ts"],"sourcesContent":["import { getFundingInfo as requestFundingInfo } from \"../../types/generated/enigma-solver\";\nimport { toMarketFundingInfo } from \"../to-funding-info\";\nimport type { EnigmaMarketFundingInfo } from \"../types\";\n/** Fetch Enigma symbol-ID funding through its generated client. @internal */\nexport async function fetchEnigmaFundingInfo(\n baseURL: string,\n symbolIds?: readonly number[],\n): Promise<EnigmaMarketFundingInfo[]> {\n const response = await requestFundingInfo(symbolIds ? { symbol_ids: [...symbolIds] } : undefined, {\n baseURL,\n // The solver accepts repeated keys, not Axios's default bracketed arrays.\n paramsSerializer: { indexes: null },\n });\n return Object.entries(response.data).flatMap(([key, raw]) => {\n const symbolId = Number(key);\n if (!Number.isSafeInteger(symbolId) || symbolId <= 0 || !raw || typeof raw !== \"object\") return [];\n return [toMarketFundingInfo(symbolId, raw)];\n });\n}\n"],"mappings":";;;AAIA,eAAsB,EACpB,GACA,GACoC;CACpC,IAAM,IAAW,MAAM,EAAmB,IAAY,EAAE,YAAY,CAAC,GAAG,CAAS,EAAE,IAAI,KAAA,GAAW;EAChG;EAEA,kBAAkB,EAAE,SAAS,KAAK;CACpC,CAAC;CACD,OAAO,OAAO,QAAQ,EAAS,IAAI,EAAE,SAAS,CAAC,GAAK,OAAS;EAC3D,IAAM,IAAW,OAAO,CAAG;EAE3B,OADI,CAAC,OAAO,cAAc,CAAQ,KAAK,KAAY,KAAK,CAAC,KAAO,OAAO,KAAQ,WAAiB,CAAC,IAC1F,CAAC,EAAoB,GAAU,CAAG,CAAC;CAC5C,CAAC;AACH"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RasaMarketFundingInfo } from '../types.js';
|
|
2
|
+
/** Fetch Rasa's existing ticker-based funding response. @internal */
|
|
3
|
+
export declare function fetchRasaFundingInfo(baseURL: string, symbols?: readonly string[]): Promise<RasaMarketFundingInfo[]>;
|
|
4
|
+
//# sourceMappingURL=rasa-funding-info.d.ts.map
|