@symmio/trading-core 4.0.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 +46 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +408 -388
- 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/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/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 +1 -1
|
@@ -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"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { Config } from '../../../core/config/index.js';
|
|
3
|
+
import { ChainIdParameter, Compute } from '../../../shared/types/properties.js';
|
|
4
|
+
import { Quote } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* One account to read in {@link getPartyAOpenPositionsBatch}: a bare address
|
|
7
|
+
* (reads from `0n`) or an address with its own pagination offset.
|
|
8
|
+
*/
|
|
9
|
+
export type PartyAOpenPositionsBatchAccount = Address | {
|
|
10
|
+
/** The partyA (virtual account, lowcap; or the sub-account, cross-margin) to read. */
|
|
11
|
+
partyA: Address;
|
|
12
|
+
/**
|
|
13
|
+
* Pagination offset into this partyA's open-positions list. A `start`
|
|
14
|
+
* greater than the account's position count reverts on-chain, so the entry
|
|
15
|
+
* comes back as a `failure`.
|
|
16
|
+
* @default 0n
|
|
17
|
+
*/
|
|
18
|
+
start?: bigint;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Parameters for {@link getPartyAOpenPositionsBatch}.
|
|
22
|
+
*/
|
|
23
|
+
export type GetPartyAOpenPositionsBatchParameters = Compute<ChainIdParameter & {
|
|
24
|
+
/** The accounts to read. Any length; the same address + `start` is read once. */
|
|
25
|
+
partyAs: readonly PartyAOpenPositionsBatchAccount[];
|
|
26
|
+
/**
|
|
27
|
+
* Maximum number of positions to return per account. Clamped on-chain to the
|
|
28
|
+
* number remaining after that account's `start`.
|
|
29
|
+
* @default 200n
|
|
30
|
+
*/
|
|
31
|
+
size?: bigint;
|
|
32
|
+
/**
|
|
33
|
+
* Also read each account's liquidation-in-progress flag (`isPartyALiquidated`)
|
|
34
|
+
* inside the same multicall, reported as `isLiquidated` on each success.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
includeLiquidationStatus?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* How many accounts to bundle into one multicall. Chunks run in parallel. A
|
|
40
|
+
* full 200-position read costs a lot of gas, and one `eth_call` has a gas cap,
|
|
41
|
+
* so keep this modest when accounts may hold many positions.
|
|
42
|
+
* @default 10
|
|
43
|
+
*/
|
|
44
|
+
batchSize?: number;
|
|
45
|
+
}>;
|
|
46
|
+
/** An account whose open positions were read. */
|
|
47
|
+
export interface PartyAOpenPositionsBatchSuccess {
|
|
48
|
+
/** The partyA exactly as passed in (no checksum rewrite). */
|
|
49
|
+
partyA: Address;
|
|
50
|
+
/** The pagination offset that was read. */
|
|
51
|
+
start: bigint;
|
|
52
|
+
status: "success";
|
|
53
|
+
/** The open-position quotes in range — the same structs `getPartyAOpenPositions` returns. */
|
|
54
|
+
quotes: readonly Quote[];
|
|
55
|
+
/**
|
|
56
|
+
* `true` when a full page came back (`quotes.length === size`), so more
|
|
57
|
+
* positions may follow. Read the next page with
|
|
58
|
+
* `{ partyA, start: start + BigInt(quotes.length) }`.
|
|
59
|
+
*/
|
|
60
|
+
hasMore: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the partyA is in liquidation. Present only with
|
|
63
|
+
* `includeLiquidationStatus`; `undefined` when that read failed (unknown,
|
|
64
|
+
* never reported as `false`).
|
|
65
|
+
*/
|
|
66
|
+
isLiquidated?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** An account whose open-positions read reverted. */
|
|
69
|
+
export interface PartyAOpenPositionsBatchFailure {
|
|
70
|
+
/** The partyA exactly as passed in (no checksum rewrite). */
|
|
71
|
+
partyA: Address;
|
|
72
|
+
/** The pagination offset that was attempted. */
|
|
73
|
+
start: bigint;
|
|
74
|
+
status: "failure";
|
|
75
|
+
/** The revert, as reported by the multicall. */
|
|
76
|
+
error: Error;
|
|
77
|
+
}
|
|
78
|
+
/** One entry of {@link getPartyAOpenPositionsBatch}'s result. */
|
|
79
|
+
export type PartyAOpenPositionsBatchResult = PartyAOpenPositionsBatchSuccess | PartyAOpenPositionsBatchFailure;
|
|
80
|
+
/**
|
|
81
|
+
* Return type of {@link getPartyAOpenPositionsBatch}: one result per input
|
|
82
|
+
* account, in input order.
|
|
83
|
+
*/
|
|
84
|
+
export type GetPartyAOpenPositionsBatchReturnType = readonly PartyAOpenPositionsBatchResult[];
|
|
85
|
+
/**
|
|
86
|
+
* Read the open positions of **many** partyAs (e.g. every virtual account of a
|
|
87
|
+
* sub-account) in multicalls of `batchSize` accounts — one `eth_call` per chunk
|
|
88
|
+
* instead of one per account.
|
|
89
|
+
*
|
|
90
|
+
* Each account is isolated: a revert in one account's read marks only that entry
|
|
91
|
+
* `failure`, and the rest still succeed. A transport/RPC error fails the whole
|
|
92
|
+
* call — it is not reported as every account failing. Pass
|
|
93
|
+
* `includeLiquidationStatus` to read each account's
|
|
94
|
+
* liquidation-in-progress flag in the same multicall.
|
|
95
|
+
*
|
|
96
|
+
* Each account pages on its own: a success with `hasMore` is read further by
|
|
97
|
+
* passing `{ partyA, start }` for just that account.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Uses the client's `multicall`, so the client's chain must define a Multicall3
|
|
101
|
+
* address. Ordering inside each account's `quotes` is not stable between calls
|
|
102
|
+
* (swap-and-pop on-chain), as with `getPartyAOpenPositions`.
|
|
103
|
+
*
|
|
104
|
+
* @param config - The SDK config.
|
|
105
|
+
* @param parameters - Accounts (each with an optional `start`), page `size`,
|
|
106
|
+
* `includeLiquidationStatus`, `batchSize`, optional chain id.
|
|
107
|
+
* @returns One result per input account, in input order.
|
|
108
|
+
* @throws {SymmError} `INVALID_BATCH_SIZE` when `batchSize` is not a positive integer.
|
|
109
|
+
* @throws {SymmError} when the chain is not supported.
|
|
110
|
+
* @throws Viem's multicall errors for transport/RPC failures.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* const results = await getPartyAOpenPositionsBatch(config, {
|
|
115
|
+
* partyAs: virtualAccounts,
|
|
116
|
+
* includeLiquidationStatus: true,
|
|
117
|
+
* });
|
|
118
|
+
* const quotes = results.flatMap((r) => (r.status === "success" && !r.isLiquidated ? r.quotes : []));
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare function getPartyAOpenPositionsBatch(config: Config, parameters: GetPartyAOpenPositionsBatchParameters): Promise<GetPartyAOpenPositionsBatchReturnType>;
|
|
122
|
+
//# sourceMappingURL=get-party-a-open-positions-batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-party-a-open-positions-batch.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOtC;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GACvC,OAAO,GACP;IACE,sFAAsF;IACtF,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG,OAAO,CACzD,gBAAgB,GAAG;IACjB,iFAAiF;IACjF,OAAO,EAAE,SAAS,+BAA+B,EAAE,CAAC;IACpD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF,iDAAiD;AACjD,MAAM,WAAW,+BAA+B;IAC9C,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,6FAA6F;IAC7F,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,qDAAqD;AACrD,MAAM,WAAW,+BAA+B;IAC9C,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,gDAAgD;IAChD,KAAK,EAAE,KAAK,CAAC;CACd;AAED,iEAAiE;AACjE,MAAM,MAAM,8BAA8B,GAAG,+BAA+B,GAAG,+BAA+B,CAAC;AAE/G;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG,SAAS,8BAA8B,EAAE,CAAC;AAO9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,qCAAqC,GAChD,OAAO,CAAC,qCAAqC,CAAC,CAqFhD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { symmioAbi as e } from "../../abi/v0.8.6/symmio.js";
|
|
2
|
+
import { SymmError as t } from "../../../shared/errors/symm-error.js";
|
|
3
|
+
//#region src/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.ts
|
|
4
|
+
var n = 200n, r = 10;
|
|
5
|
+
async function i(i, c) {
|
|
6
|
+
let { chainId: l, partyAs: u, size: d = n, includeLiquidationStatus: f = !1, batchSize: p = r } = c;
|
|
7
|
+
if (!Number.isInteger(p) || p < 1) throw new t("validation", "INVALID_BATCH_SIZE", `getPartyAOpenPositionsBatch: \`batchSize\` must be a positive integer, got ${p}.`);
|
|
8
|
+
let m = u.map(o), h = [...new Map(m.map((e) => [s(e), e])).values()];
|
|
9
|
+
if (h.length === 0) return [];
|
|
10
|
+
let { addresses: g } = i.getChainConfig(l), _ = i.getClient({ chainId: l }), v = f ? 2 : 1, y = [];
|
|
11
|
+
for (let e = 0; e < h.length; e += p) y.push(h.slice(e, e + p));
|
|
12
|
+
let b = await Promise.all(y.map(async (t) => {
|
|
13
|
+
let n = await _.multicall({
|
|
14
|
+
allowFailure: !0,
|
|
15
|
+
contracts: t.flatMap(({ partyA: t, start: n }) => {
|
|
16
|
+
let r = {
|
|
17
|
+
address: g.symmioAddress,
|
|
18
|
+
abi: e,
|
|
19
|
+
functionName: "getPartyAOpenPositions",
|
|
20
|
+
args: [
|
|
21
|
+
t,
|
|
22
|
+
n,
|
|
23
|
+
d
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
return f ? [r, {
|
|
27
|
+
address: g.symmioAddress,
|
|
28
|
+
abi: e,
|
|
29
|
+
functionName: "isPartyALiquidated",
|
|
30
|
+
args: [t]
|
|
31
|
+
}] : [r];
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
for (let e of n) if (e.status === "failure" && a(e.error)) throw e.error;
|
|
35
|
+
return t.map(({ partyA: e, start: t }, r) => {
|
|
36
|
+
let i = n[r * v];
|
|
37
|
+
if (!i || i.status === "failure") return {
|
|
38
|
+
partyA: e,
|
|
39
|
+
start: t,
|
|
40
|
+
status: "failure",
|
|
41
|
+
error: i?.error ?? /* @__PURE__ */ Error("getPartyAOpenPositions: missing multicall result.")
|
|
42
|
+
};
|
|
43
|
+
let a = i.result, o = {
|
|
44
|
+
partyA: e,
|
|
45
|
+
start: t,
|
|
46
|
+
status: "success",
|
|
47
|
+
quotes: a,
|
|
48
|
+
hasMore: d > 0n && BigInt(a.length) === d
|
|
49
|
+
};
|
|
50
|
+
if (f) {
|
|
51
|
+
let e = n[r * v + 1];
|
|
52
|
+
o.isLiquidated = e?.status === "success" ? e.result : void 0;
|
|
53
|
+
}
|
|
54
|
+
return o;
|
|
55
|
+
});
|
|
56
|
+
})), x = new Map(b.flat().map((e) => [s(e), e]));
|
|
57
|
+
return m.map((e) => ({
|
|
58
|
+
...x.get(s(e)),
|
|
59
|
+
partyA: e.partyA
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
function a(e) {
|
|
63
|
+
return e.functionName === "aggregate3";
|
|
64
|
+
}
|
|
65
|
+
function o(e) {
|
|
66
|
+
return typeof e == "string" ? {
|
|
67
|
+
partyA: e,
|
|
68
|
+
start: 0n
|
|
69
|
+
} : {
|
|
70
|
+
partyA: e.partyA,
|
|
71
|
+
start: e.start ?? 0n
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function s({ partyA: e, start: t }) {
|
|
75
|
+
return `${e.toLowerCase()}:${t}`;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { i as getPartyAOpenPositionsBatch };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=get-party-a-open-positions-batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-party-a-open-positions-batch.js","names":[],"sources":["../../../../src/symmio-contracts/symmio/get-party-a-open-positions-batch/get-party-a-open-positions-batch.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../../shared/types/properties\";\nimport { symmioAbi } from \"../../abi/v0.8.6/symmio\";\nimport type { Quote } from \"../types\";\n\n/** Default number of positions read per account. */\nconst DEFAULT_SIZE = 200n;\n/** Default number of accounts bundled into one multicall. */\nconst DEFAULT_BATCH_SIZE = 10;\n\n/**\n * One account to read in {@link getPartyAOpenPositionsBatch}: a bare address\n * (reads from `0n`) or an address with its own pagination offset.\n */\nexport type PartyAOpenPositionsBatchAccount =\n | Address\n | {\n /** The partyA (virtual account, lowcap; or the sub-account, cross-margin) to read. */\n partyA: Address;\n /**\n * Pagination offset into this partyA's open-positions list. A `start`\n * greater than the account's position count reverts on-chain, so the entry\n * comes back as a `failure`.\n * @default 0n\n */\n start?: bigint;\n };\n\n/**\n * Parameters for {@link getPartyAOpenPositionsBatch}.\n */\nexport type GetPartyAOpenPositionsBatchParameters = Compute<\n ChainIdParameter & {\n /** The accounts to read. Any length; the same address + `start` is read once. */\n partyAs: readonly PartyAOpenPositionsBatchAccount[];\n /**\n * Maximum number of positions to return per account. Clamped on-chain to the\n * number remaining after that account's `start`.\n * @default 200n\n */\n size?: bigint;\n /**\n * Also read each account's liquidation-in-progress flag (`isPartyALiquidated`)\n * inside the same multicall, reported as `isLiquidated` on each success.\n * @default false\n */\n includeLiquidationStatus?: boolean;\n /**\n * How many accounts to bundle into one multicall. Chunks run in parallel. A\n * full 200-position read costs a lot of gas, and one `eth_call` has a gas cap,\n * so keep this modest when accounts may hold many positions.\n * @default 10\n */\n batchSize?: number;\n }\n>;\n\n/** An account whose open positions were read. */\nexport interface PartyAOpenPositionsBatchSuccess {\n /** The partyA exactly as passed in (no checksum rewrite). */\n partyA: Address;\n /** The pagination offset that was read. */\n start: bigint;\n status: \"success\";\n /** The open-position quotes in range — the same structs `getPartyAOpenPositions` returns. */\n quotes: readonly Quote[];\n /**\n * `true` when a full page came back (`quotes.length === size`), so more\n * positions may follow. Read the next page with\n * `{ partyA, start: start + BigInt(quotes.length) }`.\n */\n hasMore: boolean;\n /**\n * Whether the partyA is in liquidation. Present only with\n * `includeLiquidationStatus`; `undefined` when that read failed (unknown,\n * never reported as `false`).\n */\n isLiquidated?: boolean;\n}\n\n/** An account whose open-positions read reverted. */\nexport interface PartyAOpenPositionsBatchFailure {\n /** The partyA exactly as passed in (no checksum rewrite). */\n partyA: Address;\n /** The pagination offset that was attempted. */\n start: bigint;\n status: \"failure\";\n /** The revert, as reported by the multicall. */\n error: Error;\n}\n\n/** One entry of {@link getPartyAOpenPositionsBatch}'s result. */\nexport type PartyAOpenPositionsBatchResult = PartyAOpenPositionsBatchSuccess | PartyAOpenPositionsBatchFailure;\n\n/**\n * Return type of {@link getPartyAOpenPositionsBatch}: one result per input\n * account, in input order.\n */\nexport type GetPartyAOpenPositionsBatchReturnType = readonly PartyAOpenPositionsBatchResult[];\n\ninterface BatchRead {\n partyA: Address;\n start: bigint;\n}\n\n/**\n * Read the open positions of **many** partyAs (e.g. every virtual account of a\n * sub-account) in multicalls of `batchSize` accounts — one `eth_call` per chunk\n * instead of one per account.\n *\n * Each account is isolated: a revert in one account's read marks only that entry\n * `failure`, and the rest still succeed. A transport/RPC error fails the whole\n * call — it is not reported as every account failing. Pass\n * `includeLiquidationStatus` to read each account's\n * liquidation-in-progress flag in the same multicall.\n *\n * Each account pages on its own: a success with `hasMore` is read further by\n * passing `{ partyA, start }` for just that account.\n *\n * @remarks\n * Uses the client's `multicall`, so the client's chain must define a Multicall3\n * address. Ordering inside each account's `quotes` is not stable between calls\n * (swap-and-pop on-chain), as with `getPartyAOpenPositions`.\n *\n * @param config - The SDK config.\n * @param parameters - Accounts (each with an optional `start`), page `size`,\n * `includeLiquidationStatus`, `batchSize`, optional chain id.\n * @returns One result per input account, in input order.\n * @throws {SymmError} `INVALID_BATCH_SIZE` when `batchSize` is not a positive integer.\n * @throws {SymmError} when the chain is not supported.\n * @throws Viem's multicall errors for transport/RPC failures.\n *\n * @example\n * ```ts\n * const results = await getPartyAOpenPositionsBatch(config, {\n * partyAs: virtualAccounts,\n * includeLiquidationStatus: true,\n * });\n * const quotes = results.flatMap((r) => (r.status === \"success\" && !r.isLiquidated ? r.quotes : []));\n * ```\n */\nexport async function getPartyAOpenPositionsBatch(\n config: Config,\n parameters: GetPartyAOpenPositionsBatchParameters,\n): Promise<GetPartyAOpenPositionsBatchReturnType> {\n const {\n chainId,\n partyAs,\n size = DEFAULT_SIZE,\n includeLiquidationStatus = false,\n batchSize = DEFAULT_BATCH_SIZE,\n } = parameters;\n\n if (!Number.isInteger(batchSize) || batchSize < 1) {\n throw new SymmError(\n \"validation\",\n \"INVALID_BATCH_SIZE\",\n `getPartyAOpenPositionsBatch: \\`batchSize\\` must be a positive integer, got ${batchSize}.`,\n );\n }\n\n const accounts = partyAs.map(toBatchRead);\n // The same address (any casing) + start is read once.\n const reads = [...new Map(accounts.map((account) => [readKey(account), account])).values()];\n if (reads.length === 0) return [];\n\n const { addresses } = config.getChainConfig(chainId);\n const client = config.getClient({ chainId });\n const callsPerAccount = includeLiquidationStatus ? 2 : 1;\n\n const chunks: BatchRead[][] = [];\n for (let start = 0; start < reads.length; start += batchSize) {\n chunks.push(reads.slice(start, start + batchSize));\n }\n\n const chunkResults = await Promise.all(\n chunks.map(async (chunk) => {\n const results = await client.multicall({\n allowFailure: true,\n contracts: chunk.flatMap(({ partyA, start }) => {\n const positions = {\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"getPartyAOpenPositions\",\n args: [partyA, start, size],\n } as const;\n if (!includeLiquidationStatus) return [positions];\n const liquidation = {\n address: addresses.symmioAddress,\n abi: symmioAbi,\n functionName: \"isPartyALiquidated\",\n args: [partyA],\n } as const;\n return [positions, liquidation];\n }),\n });\n // viem reports a failed `aggregate3` call — the transport or RPC, not an\n // account's read — as a failure of every call in it. That fails the read.\n for (const result of results) {\n if (result.status === \"failure\" && isMulticallError(result.error)) throw result.error;\n }\n\n return chunk.map(({ partyA, start }, index): PartyAOpenPositionsBatchResult => {\n const positions = results[index * callsPerAccount];\n if (!positions || positions.status === \"failure\") {\n const error = positions?.error ?? new Error(\"getPartyAOpenPositions: missing multicall result.\");\n return { partyA, start, status: \"failure\", error };\n }\n\n const quotes = positions.result as readonly Quote[];\n const result: PartyAOpenPositionsBatchSuccess = {\n partyA,\n start,\n status: \"success\",\n quotes,\n hasMore: size > 0n && BigInt(quotes.length) === size,\n };\n if (includeLiquidationStatus) {\n const liquidation = results[index * callsPerAccount + 1];\n result.isLiquidated = liquidation?.status === \"success\" ? (liquidation.result as boolean) : undefined;\n }\n return result;\n });\n }),\n );\n\n const resultByKey = new Map(chunkResults.flat().map((result) => [readKey(result), result]));\n // Echo every input's own spelling of the address, even when it shared a read.\n return accounts.map((account) => ({ ...resultByKey.get(readKey(account))!, partyA: account.partyA }));\n}\n\n/** Whether a multicall leg failed because the `aggregate3` call itself failed. */\nfunction isMulticallError(error: Error): boolean {\n return (error as { functionName?: unknown }).functionName === \"aggregate3\";\n}\n\nfunction toBatchRead(account: PartyAOpenPositionsBatchAccount): BatchRead {\n if (typeof account === \"string\") return { partyA: account, start: 0n };\n return { partyA: account.partyA, start: account.start ?? 0n };\n}\n\nfunction readKey({ partyA, start }: BatchRead) {\n return `${partyA.toLowerCase()}:${start}`;\n}\n"],"mappings":";;;AAQA,IAAM,IAAe,MAEf,IAAqB;AAqI3B,eAAsB,EACpB,GACA,GACgD;CAChD,IAAM,EACJ,YACA,YACA,UAAO,GACP,8BAA2B,IAC3B,eAAY,MACV;CAEJ,IAAI,CAAC,OAAO,UAAU,CAAS,KAAK,IAAY,GAC9C,MAAM,IAAI,EACR,cACA,sBACA,8EAA8E,EAAU,EAC1F;CAGF,IAAM,IAAW,EAAQ,IAAI,CAAW,GAElC,IAAQ,CAAC,GAAG,IAAI,IAAI,EAAS,KAAK,MAAY,CAAC,EAAQ,CAAO,GAAG,CAAO,CAAC,CAAC,EAAE,OAAO,CAAC;CAC1F,IAAI,EAAM,WAAW,GAAG,OAAO,CAAC;CAEhC,IAAM,EAAE,iBAAc,EAAO,eAAe,CAAO,GAC7C,IAAS,EAAO,UAAU,EAAE,WAAQ,CAAC,GACrC,IAAkB,IAA2B,IAAI,GAEjD,IAAwB,CAAC;CAC/B,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KAAS,GACjD,EAAO,KAAK,EAAM,MAAM,GAAO,IAAQ,CAAS,CAAC;CAGnD,IAAM,IAAe,MAAM,QAAQ,IACjC,EAAO,IAAI,OAAO,MAAU;EAC1B,IAAM,IAAU,MAAM,EAAO,UAAU;GACrC,cAAc;GACd,WAAW,EAAM,SAAS,EAAE,WAAQ,eAAY;IAC9C,IAAM,IAAY;KAChB,SAAS,EAAU;KACnB,KAAK;KACL,cAAc;KACd,MAAM;MAAC;MAAQ;MAAO;KAAI;IAC5B;IAQA,OAPK,IAOE,CAAC,GAAW;KALjB,SAAS,EAAU;KACnB,KAAK;KACL,cAAc;KACd,MAAM,CAAC,CAAM;IAEI,CAAW,IAPQ,CAAC,CAAS;GAQlD,CAAC;EACH,CAAC;EAGD,KAAK,IAAM,KAAU,GACnB,IAAI,EAAO,WAAW,aAAa,EAAiB,EAAO,KAAK,GAAG,MAAM,EAAO;EAGlF,OAAO,EAAM,KAAK,EAAE,WAAQ,YAAS,MAA0C;GAC7E,IAAM,IAAY,EAAQ,IAAQ;GAClC,IAAI,CAAC,KAAa,EAAU,WAAW,WAErC,OAAO;IAAE;IAAQ;IAAO,QAAQ;IAAW,OAD7B,GAAW,SAAS,gBAAI,MAAM,mDAAmD;GAC9C;GAGnD,IAAM,IAAS,EAAU,QACnB,IAA0C;IAC9C;IACA;IACA,QAAQ;IACR;IACA,SAAS,IAAO,MAAM,OAAO,EAAO,MAAM,MAAM;GAClD;GACA,IAAI,GAA0B;IAC5B,IAAM,IAAc,EAAQ,IAAQ,IAAkB;IACtD,EAAO,eAAe,GAAa,WAAW,YAAa,EAAY,SAAqB,KAAA;GAC9F;GACA,OAAO;EACT,CAAC;CACH,CAAC,CACH,GAEM,IAAc,IAAI,IAAI,EAAa,KAAK,EAAE,KAAK,MAAW,CAAC,EAAQ,CAAM,GAAG,CAAM,CAAC,CAAC;CAE1F,OAAO,EAAS,KAAK,OAAa;EAAE,GAAG,EAAY,IAAI,EAAQ,CAAO,CAAC;EAAI,QAAQ,EAAQ;CAAO,EAAE;AACtG;AAGA,SAAS,EAAiB,GAAuB;CAC/C,OAAQ,EAAqC,iBAAiB;AAChE;AAEA,SAAS,EAAY,GAAqD;CAExE,OADI,OAAO,KAAY,WAAiB;EAAE,QAAQ;EAAS,OAAO;CAAG,IAC9D;EAAE,QAAQ,EAAQ;EAAQ,OAAO,EAAQ,SAAS;CAAG;AAC9D;AAEA,SAAS,EAAQ,EAAE,WAAQ,YAAoB;CAC7C,OAAO,GAAG,EAAO,YAAY,EAAE,GAAG;AACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/symmio/get-party-a-open-positions-batch/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,SAAS,CAAC"}
|