@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
|
@@ -30,6 +30,8 @@ export * from './actions/simulate-request-cancel-withdraw.js';
|
|
|
30
30
|
export * from './actions/withdraw.js';
|
|
31
31
|
export * from './actions/withdraw-auto.js';
|
|
32
32
|
export * from './get-funding-fees-of-party-b/index.js';
|
|
33
|
+
export * from './get-party-a-open-positions-batch/index.js';
|
|
34
|
+
export * from './is-party-a-liquidated/index.js';
|
|
33
35
|
export * from './parts.js';
|
|
34
36
|
export * from './query/allocate.js';
|
|
35
37
|
export * from './query/approve-operational-fee.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/symmio/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/symmio/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/is-party-a-liquidated/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for {@link isPartyALiquidated}.
|
|
6
|
+
*/
|
|
7
|
+
export type IsPartyALiquidatedParameters = Compute<ChainIdParameter & {
|
|
8
|
+
/** The partyA (virtual account, lowcap; or the sub-account, cross-margin) to check. */
|
|
9
|
+
partyA: Address;
|
|
10
|
+
}>;
|
|
11
|
+
/** Return type of {@link isPartyALiquidated}: `true` while a liquidation is in progress. */
|
|
12
|
+
export type IsPartyALiquidatedReturnType = boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Read whether a partyA is **in liquidation** right now.
|
|
15
|
+
*
|
|
16
|
+
* The flag turns `true` when a liquidator starts the partyA's liquidation (the
|
|
17
|
+
* account was proven insolvent) and back to `false` once that liquidation is
|
|
18
|
+
* settled and finalized. It is not a "was ever liquidated" history flag. While it
|
|
19
|
+
* is `true` the account is frozen: solvers cannot fill or open against it and
|
|
20
|
+
* most partyA actions revert, while its quotes still appear in
|
|
21
|
+
* `getPartyAOpenPositions` (typically as `LIQUIDATED_PENDING`).
|
|
22
|
+
*
|
|
23
|
+
* @param config - The SDK config.
|
|
24
|
+
* @param parameters - PartyA and optional chain id.
|
|
25
|
+
* @returns `true` while the partyA's liquidation is in progress.
|
|
26
|
+
* @throws {SymmError} when the chain is not supported.
|
|
27
|
+
* @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* if (await isPartyALiquidated(config, { partyA: "0xva…" })) {
|
|
32
|
+
* // hide the account's positions: every action on them would revert
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function isPartyALiquidated(config: Config, parameters: IsPartyALiquidatedParameters): Promise<IsPartyALiquidatedReturnType>;
|
|
37
|
+
//# sourceMappingURL=is-party-a-liquidated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-party-a-liquidated.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAGlF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD,gBAAgB,GAAG;IACjB,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAC;CACjB,CACF,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,4BAA4B,GACvC,OAAO,CAAC,4BAA4B,CAAC,CAYvC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
+
//#region src/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.ts
|
|
3
|
+
async function t(t, n) {
|
|
4
|
+
let { chainId: r, partyA: i } = n, { addresses: a } = t.getChainConfig(r);
|
|
5
|
+
return t.getClient({ chainId: r }).readContract({
|
|
6
|
+
address: a.symmioAddress,
|
|
7
|
+
abi: e,
|
|
8
|
+
functionName: "isPartyALiquidated",
|
|
9
|
+
args: [i]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as isPartyALiquidated };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=is-party-a-liquidated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-party-a-liquidated.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/is-party-a-liquidated/is-party-a-liquidated.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\n\n/**\n * Parameters for {@link isPartyALiquidated}.\n */\nexport type IsPartyALiquidatedParameters = Compute<\n ChainIdParameter & {\n /** The partyA (virtual account, lowcap; or the sub-account, cross-margin) to check. */\n partyA: Address;\n }\n>;\n\n/** Return type of {@link isPartyALiquidated}: `true` while a liquidation is in progress. */\nexport type IsPartyALiquidatedReturnType = boolean;\n\n/**\n * Read whether a partyA is **in liquidation** right now.\n *\n * The flag turns `true` when a liquidator starts the partyA's liquidation (the\n * account was proven insolvent) and back to `false` once that liquidation is\n * settled and finalized. It is not a \"was ever liquidated\" history flag. While it\n * is `true` the account is frozen: solvers cannot fill or open against it and\n * most partyA actions revert, while its quotes still appear in\n * `getPartyAOpenPositions` (typically as `LIQUIDATED_PENDING`).\n *\n * @param config - The SDK config.\n * @param parameters - PartyA and optional chain id.\n * @returns `true` while the partyA's liquidation is in progress.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's `ContractFunctionExecutionError` and friends for on-chain failures.\n *\n * @example\n * ```ts\n * if (await isPartyALiquidated(config, { partyA: \"0xva…\" })) {\n * // hide the account's positions: every action on them would revert\n * }\n * ```\n */\nexport async function isPartyALiquidated(\n config: Config,\n parameters: IsPartyALiquidatedParameters,\n): Promise<IsPartyALiquidatedReturnType> {\n const { chainId, partyA } = parameters;\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n\n return client.readContract({\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"isPartyALiquidated\",\n args: [partyA],\n });\n}\n"],"mappings":";;AAyCA,eAAsB,EACpB,GACA,GACuC;CACvC,IAAM,EAAE,YAAS,cAAW,GAEtB,EAAE,iBAAc,EAAO,eAAe,CAAO;CAGnD,OAFe,EAAO,UAAU,EAAE,WAAQ,CAEnC,EAAO,aAAa;EACzB,SAAS,EAAU;EACnB,KAAK;EACL,cAAc;EACd,MAAM,CAAC,CAAM;CACf,CAAC;AACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Config } from '../../../core/config/index.js';
|
|
2
|
+
import { Compute, ConfigKeyParameter, ExactPartial } from '../../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
|
|
4
|
+
import { IsPartyALiquidatedParameters, IsPartyALiquidatedReturnType } from './is-party-a-liquidated.js';
|
|
5
|
+
/** Data resolved by the {@link isPartyALiquidatedQueryOptions} query. */
|
|
6
|
+
export type IsPartyALiquidatedData = IsPartyALiquidatedReturnType;
|
|
7
|
+
/**
|
|
8
|
+
* Build the TanStack Query key for {@link isPartyALiquidatedQueryOptions}.
|
|
9
|
+
*
|
|
10
|
+
* @param options - Partial query parameters (chain id, partyA).
|
|
11
|
+
* @returns A stable, hashable query key.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPartyALiquidatedQueryKey(options?: Compute<ExactPartial<IsPartyALiquidatedParameters> & ConfigKeyParameter>): readonly ["isPartyALiquidated", Record<string, unknown>];
|
|
14
|
+
/** Query-key type produced by {@link isPartyALiquidatedQueryKey}. */
|
|
15
|
+
export type IsPartyALiquidatedQueryKey = ReturnType<typeof isPartyALiquidatedQueryKey>;
|
|
16
|
+
/**
|
|
17
|
+
* Options accepted by {@link isPartyALiquidatedQueryOptions}: the action's
|
|
18
|
+
* parameters (all optional), an optional cache scope, and TanStack overrides.
|
|
19
|
+
*/
|
|
20
|
+
export type IsPartyALiquidatedOptions = Compute<ExactPartial<IsPartyALiquidatedParameters> & QueryParameter<IsPartyALiquidatedData, Error, IsPartyALiquidatedData, IsPartyALiquidatedQueryKey>>;
|
|
21
|
+
/** TanStack Query options returned by {@link isPartyALiquidatedQueryOptions}. */
|
|
22
|
+
export type IsPartyALiquidatedQueryOptions = SymmioQueryOptions<IsPartyALiquidatedData, Error, IsPartyALiquidatedData, IsPartyALiquidatedQueryKey>;
|
|
23
|
+
/**
|
|
24
|
+
* Build TanStack Query options for {@link isPartyALiquidated}. The query is
|
|
25
|
+
* disabled until `partyA` is set. An unsupported chain surfaces a {@link SymmError}
|
|
26
|
+
* from the query function (it is not silently disabled).
|
|
27
|
+
*
|
|
28
|
+
* @param config - The SDK config.
|
|
29
|
+
* @param options - Query parameters and TanStack overrides.
|
|
30
|
+
* @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* useQuery(isPartyALiquidatedQueryOptions(config, { partyA, chainId }));
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function isPartyALiquidatedQueryOptions(config: Config, options?: IsPartyALiquidatedOptions): IsPartyALiquidatedQueryOptions;
|
|
38
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/is-party-a-liquidated/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAClC,MAAM,yBAAyB,CAAC;AAEjC,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,GAAG,kBAAkB,CAAM,4DAGvF;AAED,qEAAqE;AACrE,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,YAAY,CAAC,4BAA4B,CAAC,GACxC,cAAc,CAAC,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE,0BAA0B,CAAC,CACpG,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,8BAA8B,GAAG,kBAAkB,CAC7D,sBAAsB,EACtB,KAAK,EACL,sBAAsB,EACtB,0BAA0B,CAC3B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,yBAA8B,GACtC,8BAA8B,CAahC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SymmError as e } from "../../../shared/errors/symm-error.js";
|
|
2
|
+
import { filterQueryOptions as t } from "../../../shared/utils/query.js";
|
|
3
|
+
import { isPartyALiquidated as n } from "./is-party-a-liquidated.js";
|
|
4
|
+
//#region src/symmio-contracts/symmio/is-party-a-liquidated/query.ts
|
|
5
|
+
function r(e = {}) {
|
|
6
|
+
return ["isPartyALiquidated", t(e)];
|
|
7
|
+
}
|
|
8
|
+
function i(t, i = {}) {
|
|
9
|
+
return {
|
|
10
|
+
...i.query,
|
|
11
|
+
queryKey: r({
|
|
12
|
+
...i,
|
|
13
|
+
configKey: t.getChainConfigKey(i.chainId)
|
|
14
|
+
}),
|
|
15
|
+
enabled: !!i.partyA && (i.query?.enabled ?? !0),
|
|
16
|
+
queryFn: () => {
|
|
17
|
+
let { chainId: r, partyA: a } = i;
|
|
18
|
+
if (!a) throw new e("validation", "MISSING_PARTY_A", "isPartyALiquidated: `partyA` is required.");
|
|
19
|
+
return n(t, {
|
|
20
|
+
chainId: r,
|
|
21
|
+
partyA: a
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { r as isPartyALiquidatedQueryKey, i as isPartyALiquidatedQueryOptions };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/is-party-a-liquidated/query.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../../shared/types/query\";\nimport { filterQueryOptions } from \"../../../shared/utils/query\";\nimport {\n isPartyALiquidated,\n type IsPartyALiquidatedParameters,\n type IsPartyALiquidatedReturnType,\n} from \"./is-party-a-liquidated\";\n\n/** Data resolved by the {@link isPartyALiquidatedQueryOptions} query. */\nexport type IsPartyALiquidatedData = IsPartyALiquidatedReturnType;\n\n/**\n * Build the TanStack Query key for {@link isPartyALiquidatedQueryOptions}.\n *\n * @param options - Partial query parameters (chain id, partyA).\n * @returns A stable, hashable query key.\n */\nexport function isPartyALiquidatedQueryKey(\n options: Compute<ExactPartial<IsPartyALiquidatedParameters> & ConfigKeyParameter> = {},\n) {\n return [\"isPartyALiquidated\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link isPartyALiquidatedQueryKey}. */\nexport type IsPartyALiquidatedQueryKey = ReturnType<typeof isPartyALiquidatedQueryKey>;\n\n/**\n * Options accepted by {@link isPartyALiquidatedQueryOptions}: the action's\n * parameters (all optional), an optional cache scope, and TanStack overrides.\n */\nexport type IsPartyALiquidatedOptions = Compute<\n ExactPartial<IsPartyALiquidatedParameters> &\n QueryParameter<IsPartyALiquidatedData, Error, IsPartyALiquidatedData, IsPartyALiquidatedQueryKey>\n>;\n\n/** TanStack Query options returned by {@link isPartyALiquidatedQueryOptions}. */\nexport type IsPartyALiquidatedQueryOptions = SymmioQueryOptions<\n IsPartyALiquidatedData,\n Error,\n IsPartyALiquidatedData,\n IsPartyALiquidatedQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link isPartyALiquidated}. The query is\n * disabled until `partyA` is set. An unsupported chain surfaces a {@link SymmError}\n * from the query function (it is not silently disabled).\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(isPartyALiquidatedQueryOptions(config, { partyA, chainId }));\n * ```\n */\nexport function isPartyALiquidatedQueryOptions(\n config: Config,\n options: IsPartyALiquidatedOptions = {},\n): IsPartyALiquidatedQueryOptions {\n return {\n ...options.query,\n queryKey: isPartyALiquidatedQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled: Boolean(options.partyA) && (options.query?.enabled ?? true),\n queryFn: () => {\n const { chainId, partyA } = options;\n if (!partyA) {\n throw new SymmError(\"validation\", \"MISSING_PARTY_A\", \"isPartyALiquidated: `partyA` is required.\");\n }\n return isPartyALiquidated(config, { chainId, partyA });\n },\n };\n}\n"],"mappings":";;;;AAoBA,SAAgB,EACd,IAAoF,CAAC,GACrF;CACA,OAAO,CAAC,sBAAsB,EAAmB,CAAO,CAAC;AAC3D;AAoCA,SAAgB,EACd,GACA,IAAqC,CAAC,GACN;CAChC,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA2B;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EACzG,SAAS,EAAQ,EAAQ,WAAY,EAAQ,OAAO,WAAW;EAC/D,eAAe;GACb,IAAM,EAAE,YAAS,cAAW;GAC5B,IAAI,CAAC,GACH,MAAM,IAAI,EAAU,cAAc,mBAAmB,2CAA2C;GAElG,OAAO,EAAmB,GAAQ;IAAE;IAAS;GAAO,CAAC;EACvD;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/symmio-subgraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/symmio-subgraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Decoders for raw subgraph scalars. The Graph returns `BigInt` / `Bytes` as
|
|
4
|
+
* strings and may return `null` for optional fields; a decoder never turns a
|
|
5
|
+
* missing value into zero unless its name says so, because "not indexed" and
|
|
6
|
+
* "zero" mean different things to a consumer.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Parse a `BigInt` string, keeping a missing value missing.
|
|
10
|
+
*
|
|
11
|
+
* @param value - The raw scalar.
|
|
12
|
+
* @returns The value as `bigint`, or `null` when it is `null` / empty.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toBigIntOrNull(value: string | null | undefined): bigint | null;
|
|
15
|
+
/**
|
|
16
|
+
* Parse a `BigInt` string, reading a missing value as `0n`. Only for fields the
|
|
17
|
+
* schema declares non-null.
|
|
18
|
+
*
|
|
19
|
+
* @param value - The raw scalar.
|
|
20
|
+
* @returns The value as `bigint`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toBigIntOrZero(value: string | null | undefined): bigint;
|
|
23
|
+
/**
|
|
24
|
+
* Parse a seconds `BigInt` string (timestamps, epochs) into a `number`.
|
|
25
|
+
*
|
|
26
|
+
* @param value - The raw scalar.
|
|
27
|
+
* @returns The value as `number`, or `null` when it is `null` / empty.
|
|
28
|
+
*/
|
|
29
|
+
export declare function toNumberOrNull(value: string | null | undefined): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Checksum a `Bytes` address.
|
|
32
|
+
*
|
|
33
|
+
* @param value - The raw lowercase address.
|
|
34
|
+
* @returns The checksummed address.
|
|
35
|
+
*/
|
|
36
|
+
export declare function toAddress(value: string): Address;
|
|
37
|
+
/**
|
|
38
|
+
* Checksum a `Bytes` address, keeping a missing value missing.
|
|
39
|
+
*
|
|
40
|
+
* @param value - The raw lowercase address.
|
|
41
|
+
* @returns The checksummed address, or `null`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function toAddressOrNull(value: string | null | undefined): Address | null;
|
|
44
|
+
/**
|
|
45
|
+
* Type a `Bytes` transaction hash.
|
|
46
|
+
*
|
|
47
|
+
* @param value - The raw hash.
|
|
48
|
+
* @returns The hash as `Hex`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function toHex(value: string): Hex;
|
|
51
|
+
//# sourceMappingURL=subgraph-decode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-decode.d.ts","sourceRoot":"","sources":["../../src/symmio-subgraph/subgraph-decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1D;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAExC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getAddress as e } from "viem";
|
|
2
|
+
//#region src/symmio-subgraph/subgraph-decode.ts
|
|
3
|
+
function t(e) {
|
|
4
|
+
return e == null || e === "" ? null : BigInt(e);
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return t(e) ?? 0n;
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
return e == null || e === "" ? null : Number(e);
|
|
11
|
+
}
|
|
12
|
+
function i(t) {
|
|
13
|
+
return e(t);
|
|
14
|
+
}
|
|
15
|
+
function a(t) {
|
|
16
|
+
return t ? e(t) : null;
|
|
17
|
+
}
|
|
18
|
+
function o(e) {
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as toAddress, a as toAddressOrNull, t as toBigIntOrNull, n as toBigIntOrZero, o as toHex, r as toNumberOrNull };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=subgraph-decode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-decode.js","names":[],"sources":["../../src/symmio-subgraph/subgraph-decode.ts"],"sourcesContent":["import { getAddress, type Address, type Hex } from \"viem\";\n\n/**\n * Decoders for raw subgraph scalars. The Graph returns `BigInt` / `Bytes` as\n * strings and may return `null` for optional fields; a decoder never turns a\n * missing value into zero unless its name says so, because \"not indexed\" and\n * \"zero\" mean different things to a consumer.\n */\n\n/**\n * Parse a `BigInt` string, keeping a missing value missing.\n *\n * @param value - The raw scalar.\n * @returns The value as `bigint`, or `null` when it is `null` / empty.\n */\nexport function toBigIntOrNull(value: string | null | undefined): bigint | null {\n return value === null || value === undefined || value === \"\" ? null : BigInt(value);\n}\n\n/**\n * Parse a `BigInt` string, reading a missing value as `0n`. Only for fields the\n * schema declares non-null.\n *\n * @param value - The raw scalar.\n * @returns The value as `bigint`.\n */\nexport function toBigIntOrZero(value: string | null | undefined): bigint {\n return toBigIntOrNull(value) ?? 0n;\n}\n\n/**\n * Parse a seconds `BigInt` string (timestamps, epochs) into a `number`.\n *\n * @param value - The raw scalar.\n * @returns The value as `number`, or `null` when it is `null` / empty.\n */\nexport function toNumberOrNull(value: string | null | undefined): number | null {\n return value === null || value === undefined || value === \"\" ? null : Number(value);\n}\n\n/**\n * Checksum a `Bytes` address.\n *\n * @param value - The raw lowercase address.\n * @returns The checksummed address.\n */\nexport function toAddress(value: string): Address {\n return getAddress(value);\n}\n\n/**\n * Checksum a `Bytes` address, keeping a missing value missing.\n *\n * @param value - The raw lowercase address.\n * @returns The checksummed address, or `null`.\n */\nexport function toAddressOrNull(value: string | null | undefined): Address | null {\n return value ? getAddress(value) : null;\n}\n\n/**\n * Type a `Bytes` transaction hash.\n *\n * @param value - The raw hash.\n * @returns The hash as `Hex`.\n */\nexport function toHex(value: string): Hex {\n return value as Hex;\n}\n"],"mappings":";;AAeA,SAAgB,EAAe,GAAiD;CAC9E,OAAO,KAAU,QAA+B,MAAU,KAAK,OAAO,OAAO,CAAK;AACpF;AASA,SAAgB,EAAe,GAA0C;CACvE,OAAO,EAAe,CAAK,KAAK;AAClC;AAQA,SAAgB,EAAe,GAAiD;CAC9E,OAAO,KAAU,QAA+B,MAAU,KAAK,OAAO,OAAO,CAAK;AACpF;AAQA,SAAgB,EAAU,GAAwB;CAChD,OAAO,EAAW,CAAK;AACzB;AAQA,SAAgB,EAAgB,GAAkD;CAChF,OAAO,IAAQ,EAAW,CAAK,IAAI;AACrC;AAQA,SAAgB,EAAM,GAAoB;CACxC,OAAO;AACT"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Largest page The Graph serves for one entity collection. */
|
|
2
|
+
export declare const SUBGRAPH_MAX_PAGE_SIZE = 1000;
|
|
3
|
+
/**
|
|
4
|
+
* Paging and sort shared by the entity reads (`getMarginTransfers`,
|
|
5
|
+
* `getLiquidationDetails`, `getSubgraphQuotes`, `getQuoteFundingSettlements`,
|
|
6
|
+
* `getFundingIndexCheckpoints`).
|
|
7
|
+
*
|
|
8
|
+
* One call returns one page; the consumer loops. For long reads page by cursor:
|
|
9
|
+
* `orderBy: "id"`, `orderDirection: "asc"`, and pass the last row's `id` as
|
|
10
|
+
* `idGt` — The Graph caps `skip` at 5000, a cursor has no ceiling.
|
|
11
|
+
*/
|
|
12
|
+
export interface SubgraphPageParameters {
|
|
13
|
+
/** Page size, 1–1000. @default 1000 */
|
|
14
|
+
first?: number;
|
|
15
|
+
/** Rows to skip. The Graph rejects values above 5000. @default 0 */
|
|
16
|
+
skip?: number;
|
|
17
|
+
/** Sort field. @default "timestamp", or "id" when `idGt` is set */
|
|
18
|
+
orderBy?: "timestamp" | "id";
|
|
19
|
+
/** Sort direction. @default "desc", or "asc" when `idGt` is set */
|
|
20
|
+
orderDirection?: "asc" | "desc";
|
|
21
|
+
/**
|
|
22
|
+
* Cursor filter (`id_gt`): only entities whose `id` sorts after this one. It
|
|
23
|
+
* pages correctly only in ascending `id` order — ids do not follow time, so
|
|
24
|
+
* under any other sort it drops or repeats rows. Setting it makes the sort
|
|
25
|
+
* default to `id` ascending; passing any other `orderBy` / `orderDirection`
|
|
26
|
+
* with it throws `INVALID_SUBGRAPH_CURSOR`.
|
|
27
|
+
*/
|
|
28
|
+
idGt?: string;
|
|
29
|
+
}
|
|
30
|
+
/** One page of an entity read. */
|
|
31
|
+
export interface SubgraphPage<TRow> {
|
|
32
|
+
/** The decoded rows of this page. */
|
|
33
|
+
rows: TRow[];
|
|
34
|
+
/** `true` when the page is full, so another page may exist. */
|
|
35
|
+
hasMore: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** {@link SubgraphPageParameters} with every default applied. */
|
|
38
|
+
export interface ResolvedSubgraphPage {
|
|
39
|
+
first: number;
|
|
40
|
+
skip: number;
|
|
41
|
+
orderBy: "timestamp" | "id";
|
|
42
|
+
orderDirection: "asc" | "desc";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Apply the paging defaults and validate them. With an `idGt` cursor the sort
|
|
46
|
+
* defaults to `id` ascending, the only order a cursor pages through correctly.
|
|
47
|
+
*
|
|
48
|
+
* @param parameters - The caller's paging parameters.
|
|
49
|
+
* @returns Paging values ready to send as query variables.
|
|
50
|
+
* @throws {SymmError} (`kind: "validation"`) when `first` is not an integer in 1–1000,
|
|
51
|
+
* `skip` is negative, or `idGt` is passed with a sort other than `id` ascending.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveSubgraphPage(parameters: SubgraphPageParameters): ResolvedSubgraphPage;
|
|
54
|
+
/**
|
|
55
|
+
* Wrap decoded rows as a {@link SubgraphPage}.
|
|
56
|
+
*
|
|
57
|
+
* @param rows - The decoded rows.
|
|
58
|
+
* @param first - The page size that was requested.
|
|
59
|
+
* @returns The page, with `hasMore` set when it came back full.
|
|
60
|
+
*/
|
|
61
|
+
export declare function toSubgraphPage<TRow>(rows: TRow[], first: number): SubgraphPage<TRow>;
|
|
62
|
+
/**
|
|
63
|
+
* Drop every `undefined` entry from a `where` object.
|
|
64
|
+
*
|
|
65
|
+
* Graph-node does not ignore a `null` filter (`symbolId_in: null` fails with
|
|
66
|
+
* "Non-list value passed to `_in` filter"), so a filter the caller left out must
|
|
67
|
+
* be absent from the object, not sent empty. This is what makes every filter
|
|
68
|
+
* optional and applied only when passed.
|
|
69
|
+
*
|
|
70
|
+
* @param where - A `where` object whose omitted filters are `undefined`.
|
|
71
|
+
* @returns The same object without its `undefined` keys.
|
|
72
|
+
*/
|
|
73
|
+
export declare function compactWhere<TWhere extends Record<string, unknown>>(where: TWhere): TWhere;
|
|
74
|
+
/**
|
|
75
|
+
* Whether any list filter was passed as an empty array. An empty list matches
|
|
76
|
+
* nothing, so a read short-circuits to an empty page without a request.
|
|
77
|
+
*
|
|
78
|
+
* @param filters - The list filters, `undefined` when omitted.
|
|
79
|
+
* @returns `true` when at least one filter is an empty array.
|
|
80
|
+
*/
|
|
81
|
+
export declare function hasEmptyListFilter(...filters: readonly (readonly unknown[] | undefined)[]): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Lowercase a list of addresses or hashes for a subgraph filter. The subgraph
|
|
84
|
+
* stores `Bytes` lowercase, so a checksummed value would match nothing.
|
|
85
|
+
*
|
|
86
|
+
* @param values - Addresses or hashes, or `undefined` when the filter is omitted.
|
|
87
|
+
* @returns The lowercased list, or `undefined`.
|
|
88
|
+
*/
|
|
89
|
+
export declare function lowercaseList(values: readonly string[] | undefined): string[] | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Stringify a list of numeric ids for a `BigInt` subgraph filter.
|
|
92
|
+
*
|
|
93
|
+
* @param values - Ids, or `undefined` when the filter is omitted.
|
|
94
|
+
* @returns The ids as decimal strings, or `undefined`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function stringList(values: readonly (bigint | number)[] | undefined): string[] | undefined;
|
|
97
|
+
//# sourceMappingURL=subgraph-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-filters.d.ts","sourceRoot":"","sources":["../../src/symmio-subgraph/subgraph-filters.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,mEAAmE;IACnE,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY,CAAC,IAAI;IAChC,qCAAqC;IACrC,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,GAAG,oBAAoB,CA8B5F;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAEpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM1F;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,OAAO,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,GAAG,SAAS,CAAC,EAAE,GAAG,OAAO,CAEnG;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAEjG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/symmio-subgraph/subgraph-filters.ts
|
|
3
|
+
var t = 1e3;
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = n.idGt !== void 0, { first: i = t, skip: a = 0, orderBy: o = r ? "id" : "timestamp", orderDirection: s = r ? "asc" : "desc" } = n;
|
|
6
|
+
if (!Number.isInteger(i) || i < 1 || i > 1e3) throw new e("validation", "INVALID_SUBGRAPH_PAGE_SIZE", `first must be an integer from 1 to ${t}; received ${i}.`);
|
|
7
|
+
if (!Number.isInteger(a) || a < 0) throw new e("validation", "INVALID_SUBGRAPH_SKIP", `skip must be a non-negative integer; received ${a}.`);
|
|
8
|
+
if (r && (o !== "id" || s !== "asc")) throw new e("validation", "INVALID_SUBGRAPH_CURSOR", `idGt pages correctly only with orderBy "id" and orderDirection "asc"; received orderBy "${o}" and orderDirection "${s}". Omit both to sort by id ascending.`);
|
|
9
|
+
return {
|
|
10
|
+
first: i,
|
|
11
|
+
skip: a,
|
|
12
|
+
orderBy: o,
|
|
13
|
+
orderDirection: s
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function r(e, t) {
|
|
17
|
+
return {
|
|
18
|
+
rows: e,
|
|
19
|
+
hasMore: e.length === t
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function i(e) {
|
|
23
|
+
let t = {};
|
|
24
|
+
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
function a(...e) {
|
|
28
|
+
return e.some((e) => e !== void 0 && e.length === 0);
|
|
29
|
+
}
|
|
30
|
+
function o(e) {
|
|
31
|
+
return e?.map((e) => e.toLowerCase());
|
|
32
|
+
}
|
|
33
|
+
function s(e) {
|
|
34
|
+
return e?.map((e) => e.toString());
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { t as SUBGRAPH_MAX_PAGE_SIZE, i as compactWhere, a as hasEmptyListFilter, o as lowercaseList, n as resolveSubgraphPage, s as stringList, r as toSubgraphPage };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=subgraph-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph-filters.js","names":[],"sources":["../../src/symmio-subgraph/subgraph-filters.ts"],"sourcesContent":["import { SymmError } from \"../shared/errors/symm-error\";\n\n/** Largest page The Graph serves for one entity collection. */\nexport const SUBGRAPH_MAX_PAGE_SIZE = 1000;\n\n/**\n * Paging and sort shared by the entity reads (`getMarginTransfers`,\n * `getLiquidationDetails`, `getSubgraphQuotes`, `getQuoteFundingSettlements`,\n * `getFundingIndexCheckpoints`).\n *\n * One call returns one page; the consumer loops. For long reads page by cursor:\n * `orderBy: \"id\"`, `orderDirection: \"asc\"`, and pass the last row's `id` as\n * `idGt` — The Graph caps `skip` at 5000, a cursor has no ceiling.\n */\nexport interface SubgraphPageParameters {\n /** Page size, 1–1000. @default 1000 */\n first?: number;\n /** Rows to skip. The Graph rejects values above 5000. @default 0 */\n skip?: number;\n /** Sort field. @default \"timestamp\", or \"id\" when `idGt` is set */\n orderBy?: \"timestamp\" | \"id\";\n /** Sort direction. @default \"desc\", or \"asc\" when `idGt` is set */\n orderDirection?: \"asc\" | \"desc\";\n /**\n * Cursor filter (`id_gt`): only entities whose `id` sorts after this one. It\n * pages correctly only in ascending `id` order — ids do not follow time, so\n * under any other sort it drops or repeats rows. Setting it makes the sort\n * default to `id` ascending; passing any other `orderBy` / `orderDirection`\n * with it throws `INVALID_SUBGRAPH_CURSOR`.\n */\n idGt?: string;\n}\n\n/** One page of an entity read. */\nexport interface SubgraphPage<TRow> {\n /** The decoded rows of this page. */\n rows: TRow[];\n /** `true` when the page is full, so another page may exist. */\n hasMore: boolean;\n}\n\n/** {@link SubgraphPageParameters} with every default applied. */\nexport interface ResolvedSubgraphPage {\n first: number;\n skip: number;\n orderBy: \"timestamp\" | \"id\";\n orderDirection: \"asc\" | \"desc\";\n}\n\n/**\n * Apply the paging defaults and validate them. With an `idGt` cursor the sort\n * defaults to `id` ascending, the only order a cursor pages through correctly.\n *\n * @param parameters - The caller's paging parameters.\n * @returns Paging values ready to send as query variables.\n * @throws {SymmError} (`kind: \"validation\"`) when `first` is not an integer in 1–1000,\n * `skip` is negative, or `idGt` is passed with a sort other than `id` ascending.\n */\nexport function resolveSubgraphPage(parameters: SubgraphPageParameters): ResolvedSubgraphPage {\n const cursor = parameters.idGt !== undefined;\n const {\n first = SUBGRAPH_MAX_PAGE_SIZE,\n skip = 0,\n orderBy = cursor ? \"id\" : \"timestamp\",\n orderDirection = cursor ? \"asc\" : \"desc\",\n } = parameters;\n if (!Number.isInteger(first) || first < 1 || first > SUBGRAPH_MAX_PAGE_SIZE) {\n throw new SymmError(\n \"validation\",\n \"INVALID_SUBGRAPH_PAGE_SIZE\",\n `first must be an integer from 1 to ${SUBGRAPH_MAX_PAGE_SIZE}; received ${first}.`,\n );\n }\n if (!Number.isInteger(skip) || skip < 0) {\n throw new SymmError(\n \"validation\",\n \"INVALID_SUBGRAPH_SKIP\",\n `skip must be a non-negative integer; received ${skip}.`,\n );\n }\n if (cursor && (orderBy !== \"id\" || orderDirection !== \"asc\")) {\n throw new SymmError(\n \"validation\",\n \"INVALID_SUBGRAPH_CURSOR\",\n `idGt pages correctly only with orderBy \"id\" and orderDirection \"asc\"; received orderBy \"${orderBy}\" and orderDirection \"${orderDirection}\". Omit both to sort by id ascending.`,\n );\n }\n return { first, skip, orderBy, orderDirection };\n}\n\n/**\n * Wrap decoded rows as a {@link SubgraphPage}.\n *\n * @param rows - The decoded rows.\n * @param first - The page size that was requested.\n * @returns The page, with `hasMore` set when it came back full.\n */\nexport function toSubgraphPage<TRow>(rows: TRow[], first: number): SubgraphPage<TRow> {\n return { rows, hasMore: rows.length === first };\n}\n\n/**\n * Drop every `undefined` entry from a `where` object.\n *\n * Graph-node does not ignore a `null` filter (`symbolId_in: null` fails with\n * \"Non-list value passed to `_in` filter\"), so a filter the caller left out must\n * be absent from the object, not sent empty. This is what makes every filter\n * optional and applied only when passed.\n *\n * @param where - A `where` object whose omitted filters are `undefined`.\n * @returns The same object without its `undefined` keys.\n */\nexport function compactWhere<TWhere extends Record<string, unknown>>(where: TWhere): TWhere {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(where)) {\n if (value !== undefined) result[key] = value;\n }\n return result as TWhere;\n}\n\n/**\n * Whether any list filter was passed as an empty array. An empty list matches\n * nothing, so a read short-circuits to an empty page without a request.\n *\n * @param filters - The list filters, `undefined` when omitted.\n * @returns `true` when at least one filter is an empty array.\n */\nexport function hasEmptyListFilter(...filters: readonly (readonly unknown[] | undefined)[]): boolean {\n return filters.some((filter) => filter !== undefined && filter.length === 0);\n}\n\n/**\n * Lowercase a list of addresses or hashes for a subgraph filter. The subgraph\n * stores `Bytes` lowercase, so a checksummed value would match nothing.\n *\n * @param values - Addresses or hashes, or `undefined` when the filter is omitted.\n * @returns The lowercased list, or `undefined`.\n */\nexport function lowercaseList(values: readonly string[] | undefined): string[] | undefined {\n return values?.map((value) => value.toLowerCase());\n}\n\n/**\n * Stringify a list of numeric ids for a `BigInt` subgraph filter.\n *\n * @param values - Ids, or `undefined` when the filter is omitted.\n * @returns The ids as decimal strings, or `undefined`.\n */\nexport function stringList(values: readonly (bigint | number)[] | undefined): string[] | undefined {\n return values?.map((value) => value.toString());\n}\n"],"mappings":";;AAGA,IAAa,IAAyB;AAuDtC,SAAgB,EAAoB,GAA0D;CAC5F,IAAM,IAAS,EAAW,SAAS,KAAA,GAC7B,EACJ,WAAQ,GACR,UAAO,GACP,aAAU,IAAS,OAAO,aAC1B,oBAAiB,IAAS,QAAQ,WAChC;CACJ,IAAI,CAAC,OAAO,UAAU,CAAK,KAAK,IAAQ,KAAK,IAAA,KAC3C,MAAM,IAAI,EACR,cACA,8BACA,sCAAsC,EAAuB,aAAa,EAAM,EAClF;CAEF,IAAI,CAAC,OAAO,UAAU,CAAI,KAAK,IAAO,GACpC,MAAM,IAAI,EACR,cACA,yBACA,iDAAiD,EAAK,EACxD;CAEF,IAAI,MAAW,MAAY,QAAQ,MAAmB,QACpD,MAAM,IAAI,EACR,cACA,2BACA,2FAA2F,EAAQ,wBAAwB,EAAe,sCAC5I;CAEF,OAAO;EAAE;EAAO;EAAM;EAAS;CAAe;AAChD;AASA,SAAgB,EAAqB,GAAc,GAAmC;CACpF,OAAO;EAAE;EAAM,SAAS,EAAK,WAAW;CAAM;AAChD;AAaA,SAAgB,EAAqD,GAAuB;CAC1F,IAAM,IAAkC,CAAC;CACzC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAK,GAC7C,AAAI,MAAU,KAAA,MAAW,EAAO,KAAO;CAEzC,OAAO;AACT;AASA,SAAgB,EAAmB,GAAG,GAA+D;CACnG,OAAO,EAAQ,MAAM,MAAW,MAAW,KAAA,KAAa,EAAO,WAAW,CAAC;AAC7E;AASA,SAAgB,EAAc,GAA6D;CACzF,OAAO,GAAQ,KAAK,MAAU,EAAM,YAAY,CAAC;AACnD;AAQA,SAAgB,EAAW,GAAwE;CACjG,OAAO,GAAQ,KAAK,MAAU,EAAM,SAAS,CAAC;AAChD"}
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
3
3
|
*/
|
|
4
4
|
export declare function graphql(source: "\n query BalanceChanges(\n $accounts: [Bytes!]!\n $typeIn: [String!]!\n $isMarginTransferSideEffectIn: [Boolean!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n $startDate: BigInt!\n $endDate: BigInt!\n ) {\n balanceChanges(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: {\n account_in: $accounts\n type_in: $typeIn\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n ) {\n id\n type\n amount\n account\n timestamp\n transaction\n isMarginTransferSideEffect\n marginTransferType\n }\n }\n"): typeof import('./graphql.js').BalanceChangesDocument;
|
|
5
|
+
/**
|
|
6
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
7
|
+
*/
|
|
8
|
+
export declare function graphql(source: "\n query FundingIndexCheckpoints(\n $where: FundingIndexCheckpoint_filter!\n $first: Int!\n $skip: Int!\n $orderBy: FundingIndexCheckpoint_orderBy!\n $orderDirection: OrderDirection!\n ) {\n fundingIndexCheckpoints(\n first: $first\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n where: $where\n ) {\n id\n source\n symbolId\n partyB\n eventType\n rawLongRate\n rawShortRate\n marketPrice\n currentLongRate\n currentShortRate\n accumulatedLongRate\n accumulatedShortRate\n epochDuration\n lastUpdatedEpoch\n startEpoch\n startEpochTimestamp\n snapshotLongFee\n snapshotShortFee\n timestamp\n blockNumber\n transaction\n }\n }\n"): typeof import('./graphql.js').FundingIndexCheckpointsDocument;
|
|
9
|
+
/**
|
|
10
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
11
|
+
*/
|
|
12
|
+
export declare function graphql(source: "\n query QuoteFundingSettlements(\n $where: QuoteFundingSettlement_filter!\n $first: Int!\n $skip: Int!\n $orderBy: QuoteFundingSettlement_orderBy!\n $orderDirection: OrderDirection!\n ) {\n quoteFundingSettlements(\n first: $first\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n where: $where\n ) {\n id\n source\n quoteId\n partyA\n partyB\n symbolId\n positionType\n trigger\n openAmount\n signedAmount\n paidByPartyA\n receivedByPartyA\n previousAccumulatedPaidFunding\n newAccumulatedPaidFunding\n fundingDeltaPerUnit\n previousLastFundingPaymentTimestamp\n newLastFundingPaymentTimestamp\n previousPaidThroughEpoch\n newPaidThroughEpoch\n balanceChanged\n timestamp\n blockNumber\n transaction\n }\n }\n"): typeof import('./graphql.js').QuoteFundingSettlementsDocument;
|
|
13
|
+
/**
|
|
14
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
15
|
+
*/
|
|
16
|
+
export declare function graphql(source: "\n query LiquidationDetails(\n $where: LiquidationDetail_filter!\n $first: Int!\n $skip: Int!\n $orderBy: LiquidationDetail_orderBy!\n $orderDirection: OrderDirection!\n ) {\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n source\n partyA\n liquidationId\n liquidationType\n liquidationTimestamp\n timestamp\n lockedCva\n lockedLf\n lockedPartyAmm\n paidCva\n paidLf\n upnl\n deficit\n liquidationFee\n settled\n fullyLiquidated\n settlementExpectedAmounts\n settlementActualAmounts\n }\n }\n"): typeof import('./graphql.js').LiquidationDetailsDocument;
|
|
17
|
+
/**
|
|
18
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
19
|
+
*/
|
|
20
|
+
export declare function graphql(source: "\n query MarginTransfers(\n $where: MarginTransfer_filter!\n $first: Int!\n $skip: Int!\n $orderBy: MarginTransfer_orderBy!\n $orderDirection: OrderDirection!\n ) {\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n type\n amount\n source\n timestamp\n blockNumber\n transaction\n virtualAccount {\n id\n }\n subAccount {\n id\n }\n }\n }\n"): typeof import('./graphql.js').MarginTransfersDocument;
|
|
5
21
|
/**
|
|
6
22
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
7
23
|
*/
|
|
@@ -9,21 +25,25 @@ export declare function graphql(source: "\n query PoolQuotes(\n $symbolId: B
|
|
|
9
25
|
/**
|
|
10
26
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
11
27
|
*/
|
|
12
|
-
export declare function graphql(source:
|
|
28
|
+
export declare function graphql(source: '\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\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'): typeof import('./graphql.js').PoolQuoteEventsDocument;
|
|
29
|
+
/**
|
|
30
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
31
|
+
*/
|
|
32
|
+
export declare function graphql(source: "\n query QuoteEventsForQuoteByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n"): typeof import('./graphql.js').QuoteEventsForQuoteByTypeDocument;
|
|
13
33
|
/**
|
|
14
34
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
15
35
|
*/
|
|
16
|
-
export declare function graphql(source: "\n query
|
|
36
|
+
export declare function graphql(source: "\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\n quotes(first: $first, where: $where) {\n quoteId\n userPaidFunding\n userReceivedFunding\n }\n }\n"): typeof import('./graphql.js').QuotesFundingDocument;
|
|
17
37
|
/**
|
|
18
38
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
19
39
|
*/
|
|
20
|
-
export declare function graphql(source:
|
|
40
|
+
export declare function graphql(source: '\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'): typeof import('./graphql.js').QuoteEventsForHistoryDocument;
|
|
21
41
|
/**
|
|
22
42
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
23
43
|
*/
|
|
24
|
-
export declare function graphql(source: "\n query
|
|
44
|
+
export declare function graphql(source: "\n query QuoteEventsForQuotesByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n"): typeof import('./graphql.js').QuoteEventsForQuotesByTypeDocument;
|
|
25
45
|
/**
|
|
26
46
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
27
47
|
*/
|
|
28
|
-
export declare function graphql(source: "\n query
|
|
48
|
+
export declare function graphql(source: "\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"): typeof import('./graphql.js').SubgraphQuotesDocument;
|
|
29
49
|
//# sourceMappingURL=gql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../../../src/symmio-subgraph/types/generated/analytics/gql.ts"],"names":[],"mappings":"AAuDA;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,kwBAAkwB,GACzwB,cAAc,WAAW,EAAE,sBAAsB,CAAC;AACrD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,wyBAAwyB,GAC/yB,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,o4BAAo4B,GAC34B,cAAc,WAAW,EAAE,+BAA+B,CAAC;AAC9D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,irBAAirB,GACxrB,cAAc,WAAW,EAAE,0BAA0B,CAAC;AACzD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,0fAA0f,GACjgB,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,myBAAmyB,GAC1yB,cAAc,WAAW,EAAE,kBAAkB,CAAC;AACjD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,i9CAAi9C,GACx9C,cAAc,WAAW,EAAE,uBAAuB,CAAC;AACtD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,mYAAmY,GAC1Y,cAAc,WAAW,EAAE,iCAAiC,CAAC;AAChE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,2LAA2L,GAClM,cAAc,WAAW,EAAE,qBAAqB,CAAC;AACpD;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,qzCAAqzC,GAC5zC,cAAc,WAAW,EAAE,6BAA6B,CAAC;AAC5D;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,oYAAoY,GAC3Y,cAAc,WAAW,EAAE,kCAAkC,CAAC;AACjE;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,ytBAAytB,GAChuB,cAAc,WAAW,EAAE,sBAAsB,CAAC"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { BalanceChangesDocument as e,
|
|
1
|
+
import { BalanceChangesDocument as e, FundingIndexCheckpointsDocument as t, LiquidationDetailsDocument as n, MarginTransfersDocument as r, PoolQuoteEventsDocument as i, PoolQuotesDocument as a, QuoteEventsForHistoryDocument as o, QuoteEventsForQuoteByTypeDocument as s, QuoteEventsForQuotesByTypeDocument as c, QuoteFundingSettlementsDocument as l, QuotesFundingDocument as u, SubgraphQuotesDocument as d } from "./graphql.js";
|
|
2
2
|
//#region src/symmio-subgraph/types/generated/analytics/gql.ts
|
|
3
|
-
var
|
|
3
|
+
var f = {
|
|
4
4
|
"\n query BalanceChanges(\n $accounts: [Bytes!]!\n $typeIn: [String!]!\n $isMarginTransferSideEffectIn: [Boolean!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n $startDate: BigInt!\n $endDate: BigInt!\n ) {\n balanceChanges(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: {\n account_in: $accounts\n type_in: $typeIn\n isMarginTransferSideEffect_in: $isMarginTransferSideEffectIn\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n ) {\n id\n type\n amount\n account\n timestamp\n transaction\n isMarginTransferSideEffect\n marginTransferType\n }\n }\n": e,
|
|
5
|
-
"\n query
|
|
6
|
-
"\n query
|
|
7
|
-
"\n query
|
|
8
|
-
"\n query
|
|
9
|
-
"\n query
|
|
10
|
-
"\n query
|
|
5
|
+
"\n query FundingIndexCheckpoints(\n $where: FundingIndexCheckpoint_filter!\n $first: Int!\n $skip: Int!\n $orderBy: FundingIndexCheckpoint_orderBy!\n $orderDirection: OrderDirection!\n ) {\n fundingIndexCheckpoints(\n first: $first\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n where: $where\n ) {\n id\n source\n symbolId\n partyB\n eventType\n rawLongRate\n rawShortRate\n marketPrice\n currentLongRate\n currentShortRate\n accumulatedLongRate\n accumulatedShortRate\n epochDuration\n lastUpdatedEpoch\n startEpoch\n startEpochTimestamp\n snapshotLongFee\n snapshotShortFee\n timestamp\n blockNumber\n transaction\n }\n }\n": t,
|
|
6
|
+
"\n query QuoteFundingSettlements(\n $where: QuoteFundingSettlement_filter!\n $first: Int!\n $skip: Int!\n $orderBy: QuoteFundingSettlement_orderBy!\n $orderDirection: OrderDirection!\n ) {\n quoteFundingSettlements(\n first: $first\n skip: $skip\n orderBy: $orderBy\n orderDirection: $orderDirection\n where: $where\n ) {\n id\n source\n quoteId\n partyA\n partyB\n symbolId\n positionType\n trigger\n openAmount\n signedAmount\n paidByPartyA\n receivedByPartyA\n previousAccumulatedPaidFunding\n newAccumulatedPaidFunding\n fundingDeltaPerUnit\n previousLastFundingPaymentTimestamp\n newLastFundingPaymentTimestamp\n previousPaidThroughEpoch\n newPaidThroughEpoch\n balanceChanged\n timestamp\n blockNumber\n transaction\n }\n }\n": l,
|
|
7
|
+
"\n query LiquidationDetails(\n $where: LiquidationDetail_filter!\n $first: Int!\n $skip: Int!\n $orderBy: LiquidationDetail_orderBy!\n $orderDirection: OrderDirection!\n ) {\n liquidationDetails(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n source\n partyA\n liquidationId\n liquidationType\n liquidationTimestamp\n timestamp\n lockedCva\n lockedLf\n lockedPartyAmm\n paidCva\n paidLf\n upnl\n deficit\n liquidationFee\n settled\n fullyLiquidated\n settlementExpectedAmounts\n settlementActualAmounts\n }\n }\n": n,
|
|
8
|
+
"\n query MarginTransfers(\n $where: MarginTransfer_filter!\n $first: Int!\n $skip: Int!\n $orderBy: MarginTransfer_orderBy!\n $orderDirection: OrderDirection!\n ) {\n marginTransfers(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) {\n id\n type\n amount\n source\n timestamp\n blockNumber\n transaction\n virtualAccount {\n id\n }\n subAccount {\n id\n }\n }\n }\n": r,
|
|
9
|
+
"\n query PoolQuotes(\n $symbolId: BigInt!\n $source: Bytes!\n $quoteStatuses: [Int!]!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quotes(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { symbolId: $symbolId, source: $source, quoteStatus_in: $quoteStatuses }\n ) {\n id\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n quantity\n closedAmount\n quantityToClose\n openedPrice\n requestedOpenPrice\n averageClosedPrice\n closePrice\n initialOpenedPrice\n liquidateAmount\n liquidatePrice\n timestamp\n blockNumber\n }\n }\n": a,
|
|
10
|
+
"\n query PoolQuoteEvents(\n $typeIn: [String!]!\n $symbolId: BigInt!\n $source: Bytes!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(\n first: $first\n skip: $skip\n orderBy: timestamp\n orderDirection: $orderDirection\n where: { type_in: $typeIn, quote_: { symbolId: $symbolId, source: $source } }\n ) {\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": i,
|
|
11
|
+
"\n query QuoteEventsForQuoteByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n": s,
|
|
12
|
+
"\n query QuotesFunding($where: Quote_filter!, $first: Int!) {\n quotes(first: $first, where: $where) {\n quoteId\n userPaidFunding\n userReceivedFunding\n }\n }\n": u,
|
|
13
|
+
"\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": o,
|
|
14
|
+
"\n query QuoteEventsForQuotesByType(\n $where: QuoteEvent_filter!\n $first: Int!\n $skip: Int!\n $orderDirection: OrderDirection!\n ) {\n quoteEvents(first: $first, skip: $skip, orderBy: timestamp, orderDirection: $orderDirection, where: $where) {\n id\n type\n metadata\n timestamp\n blockNumber\n transaction\n quoteId\n }\n }\n": c,
|
|
15
|
+
"\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": d
|
|
11
16
|
};
|
|
12
|
-
function
|
|
13
|
-
return
|
|
17
|
+
function p(e) {
|
|
18
|
+
return f[e] ?? {};
|
|
14
19
|
}
|
|
15
20
|
//#endregion
|
|
16
|
-
export {
|
|
21
|
+
export { p as graphql };
|
|
17
22
|
|
|
18
23
|
//# sourceMappingURL=gql.js.map
|