@symmio/trading-core 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -87
- package/dist/pools/add-market/to-created-pool.d.ts.map +1 -1
- package/dist/pools/add-market/to-created-pool.js +4 -0
- package/dist/pools/add-market/to-created-pool.js.map +1 -1
- package/dist/pools/add-market/types.d.ts +8 -0
- package/dist/pools/add-market/types.d.ts.map +1 -1
- package/dist/pools/auth/authenticate-listing.d.ts +3 -1
- package/dist/pools/auth/authenticate-listing.d.ts.map +1 -1
- package/dist/pools/auth/authenticate-listing.js +28 -23
- package/dist/pools/auth/authenticate-listing.js.map +1 -1
- package/dist/pools/auth/can-reuse-listing-challenge.d.ts +5 -0
- package/dist/pools/auth/can-reuse-listing-challenge.d.ts.map +1 -0
- package/dist/pools/auth/can-reuse-listing-challenge.js +9 -0
- package/dist/pools/auth/can-reuse-listing-challenge.js.map +1 -0
- package/dist/pools/auth/query.d.ts +15 -0
- package/dist/pools/auth/query.d.ts.map +1 -1
- package/dist/pools/auth/query.js +28 -4
- package/dist/pools/auth/query.js.map +1 -1
- package/dist/pools/auth/to-siwe.d.ts +5 -1
- package/dist/pools/auth/to-siwe.d.ts.map +1 -1
- package/dist/pools/auth/to-siwe.js +4 -2
- package/dist/pools/auth/to-siwe.js.map +1 -1
- package/dist/pools/auth/types.d.ts +2 -0
- package/dist/pools/auth/types.d.ts.map +1 -1
- package/dist/pools/cancel-withdraw/cancel-withdraw.js +1 -1
- package/dist/pools/cancel-withdraw/cancel-withdraw.js.map +1 -1
- package/dist/pools/claim-history/get-pool-claim.d.ts +11 -0
- package/dist/pools/claim-history/get-pool-claim.d.ts.map +1 -0
- package/dist/pools/claim-history/get-pool-claim.js +25 -0
- package/dist/pools/claim-history/get-pool-claim.js.map +1 -0
- package/dist/pools/claim-history/index.d.ts +1 -0
- package/dist/pools/claim-history/index.d.ts.map +1 -1
- package/dist/pools/claim-history/to-pool-claim.d.ts.map +1 -1
- package/dist/pools/claim-history/to-pool-claim.js +2 -0
- package/dist/pools/claim-history/to-pool-claim.js.map +1 -1
- package/dist/pools/composition.d.ts +16 -0
- package/dist/pools/composition.d.ts.map +1 -0
- package/dist/pools/composition.js +39 -0
- package/dist/pools/composition.js.map +1 -0
- package/dist/pools/empty-pool-profit.d.ts +4 -0
- package/dist/pools/empty-pool-profit.d.ts.map +1 -0
- package/dist/pools/empty-pool-profit.js +17 -0
- package/dist/pools/empty-pool-profit.js.map +1 -0
- package/dist/pools/index.d.ts +8 -0
- package/dist/pools/index.d.ts.map +1 -1
- package/dist/pools/listing-config/to-listing-config.d.ts +5 -1
- package/dist/pools/listing-config/to-listing-config.d.ts.map +1 -1
- package/dist/pools/listing-config/to-listing-config.js +19 -8
- package/dist/pools/listing-config/to-listing-config.js.map +1 -1
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts +37 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js +35 -0
- package/dist/pools/maintenance-fees/get-pool-maintenance-fees.js.map +1 -0
- package/dist/pools/maintenance-fees/index.d.ts +3 -0
- package/dist/pools/maintenance-fees/index.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/query.d.ts +11 -0
- package/dist/pools/maintenance-fees/query.d.ts.map +1 -0
- package/dist/pools/maintenance-fees/query.js +21 -0
- package/dist/pools/maintenance-fees/query.js.map +1 -0
- package/dist/pools/market-config/to-listing-market-config.d.ts +6 -1
- package/dist/pools/market-config/to-listing-market-config.d.ts.map +1 -1
- package/dist/pools/market-config/to-listing-market-config.js +1 -0
- package/dist/pools/market-config/to-listing-market-config.js.map +1 -1
- package/dist/pools/market-config/types.d.ts +5 -0
- package/dist/pools/market-config/types.d.ts.map +1 -1
- package/dist/pools/market-config/types.js.map +1 -1
- package/dist/pools/market-data/get-pool-market-data.d.ts +14 -0
- package/dist/pools/market-data/get-pool-market-data.d.ts.map +1 -0
- package/dist/pools/market-data/get-pool-market-data.js +25 -0
- package/dist/pools/market-data/get-pool-market-data.js.map +1 -0
- package/dist/pools/market-data/index.d.ts +2 -0
- package/dist/pools/market-data/index.d.ts.map +1 -0
- package/dist/pools/market-detail/to-listing-market-detail.d.ts +5 -1
- package/dist/pools/market-detail/to-listing-market-detail.d.ts.map +1 -1
- package/dist/pools/market-detail/to-listing-market-detail.js +45 -33
- package/dist/pools/market-detail/to-listing-market-detail.js.map +1 -1
- package/dist/pools/markets/to-listing-market.d.ts +13 -1
- package/dist/pools/markets/to-listing-market.d.ts.map +1 -1
- package/dist/pools/markets/to-listing-market.js +24 -12
- package/dist/pools/markets/to-listing-market.js.map +1 -1
- package/dist/pools/open-positions/calculate-pool-open-positions.d.ts +39 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.d.ts.map +1 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.js +83 -0
- package/dist/pools/open-positions/calculate-pool-open-positions.js.map +1 -0
- package/dist/pools/open-positions/get-pool-open-positions.d.ts +17 -0
- package/dist/pools/open-positions/get-pool-open-positions.d.ts.map +1 -0
- package/dist/pools/open-positions/get-pool-open-positions.js +39 -0
- package/dist/pools/open-positions/get-pool-open-positions.js.map +1 -0
- package/dist/pools/open-positions/index.d.ts +4 -0
- package/dist/pools/open-positions/index.d.ts.map +1 -0
- package/dist/pools/open-positions/query.d.ts +17 -0
- package/dist/pools/open-positions/query.d.ts.map +1 -0
- package/dist/pools/open-positions/query.js +21 -0
- package/dist/pools/open-positions/query.js.map +1 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.d.ts +66 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.d.ts.map +1 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.js +96 -0
- package/dist/pools/portfolio/calculate-pool-portfolio.js.map +1 -0
- package/dist/pools/portfolio/get-pool-portfolio.d.ts +19 -0
- package/dist/pools/portfolio/get-pool-portfolio.d.ts.map +1 -0
- package/dist/pools/portfolio/get-pool-portfolio.js +88 -0
- package/dist/pools/portfolio/get-pool-portfolio.js.map +1 -0
- package/dist/pools/portfolio/index.d.ts +4 -0
- package/dist/pools/portfolio/index.d.ts.map +1 -0
- package/dist/pools/portfolio/query.d.ts +17 -0
- package/dist/pools/portfolio/query.d.ts.map +1 -0
- package/dist/pools/portfolio/query.js +21 -0
- package/dist/pools/portfolio/query.js.map +1 -0
- package/dist/pools/portfolio/read-positions.d.ts +4 -0
- package/dist/pools/portfolio/read-positions.d.ts.map +1 -0
- package/dist/pools/portfolio/read-positions.js +31 -0
- package/dist/pools/portfolio/read-positions.js.map +1 -0
- package/dist/pools/position/calculate-pool-position.d.ts +85 -0
- package/dist/pools/position/calculate-pool-position.d.ts.map +1 -0
- package/dist/pools/position/calculate-pool-position.js +59 -0
- package/dist/pools/position/calculate-pool-position.js.map +1 -0
- package/dist/pools/position/get-pool-position.d.ts +22 -0
- package/dist/pools/position/get-pool-position.d.ts.map +1 -0
- package/dist/pools/position/get-pool-position.js +47 -0
- package/dist/pools/position/get-pool-position.js.map +1 -0
- package/dist/pools/position/index.d.ts +4 -0
- package/dist/pools/position/index.d.ts.map +1 -0
- package/dist/pools/position/query.d.ts +17 -0
- package/dist/pools/position/query.d.ts.map +1 -0
- package/dist/pools/position/query.js +21 -0
- package/dist/pools/position/query.js.map +1 -0
- package/dist/pools/position/sum-deposits.d.ts +10 -0
- package/dist/pools/position/sum-deposits.d.ts.map +1 -0
- package/dist/pools/position/sum-deposits.js +35 -0
- package/dist/pools/position/sum-deposits.js.map +1 -0
- package/dist/pools/profit/get-user-profit.d.ts +4 -0
- package/dist/pools/profit/get-user-profit.d.ts.map +1 -1
- package/dist/pools/profit/get-user-profit.js +18 -12
- package/dist/pools/profit/get-user-profit.js.map +1 -1
- package/dist/pools/profit/to-user-pool-profit.d.ts +22 -4
- package/dist/pools/profit/to-user-pool-profit.d.ts.map +1 -1
- package/dist/pools/profit/to-user-pool-profit.js +28 -12
- package/dist/pools/profit/to-user-pool-profit.js.map +1 -1
- package/dist/pools/quotes/get-pool-quotes.d.ts +8 -1
- package/dist/pools/quotes/get-pool-quotes.d.ts.map +1 -1
- package/dist/pools/quotes/get-pool-quotes.js +8 -1
- package/dist/pools/quotes/get-pool-quotes.js.map +1 -1
- package/dist/pools/quotes/query-document.d.ts.map +1 -1
- package/dist/pools/quotes/query-document.js +1 -1
- package/dist/pools/quotes/query-document.js.map +1 -1
- package/dist/pools/quotes/to-pool-quote.d.ts.map +1 -1
- package/dist/pools/quotes/to-pool-quote.js +13 -0
- package/dist/pools/quotes/to-pool-quote.js.map +1 -1
- package/dist/pools/rewards/query.js +25 -25
- package/dist/pools/statistics/calculate-pool-statistics.d.ts +69 -0
- package/dist/pools/statistics/calculate-pool-statistics.d.ts.map +1 -0
- package/dist/pools/statistics/calculate-pool-statistics.js +42 -0
- package/dist/pools/statistics/calculate-pool-statistics.js.map +1 -0
- package/dist/pools/statistics/get-pool-statistics.d.ts +29 -0
- package/dist/pools/statistics/get-pool-statistics.d.ts.map +1 -0
- package/dist/pools/statistics/get-pool-statistics.js +61 -0
- package/dist/pools/statistics/get-pool-statistics.js.map +1 -0
- package/dist/pools/statistics/index.d.ts +4 -0
- package/dist/pools/statistics/index.d.ts.map +1 -0
- package/dist/pools/statistics/query.d.ts +17 -0
- package/dist/pools/statistics/query.d.ts.map +1 -0
- package/dist/pools/statistics/query.js +21 -0
- package/dist/pools/statistics/query.js.map +1 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.d.ts +32 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.d.ts.map +1 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.js +43 -0
- package/dist/pools/token-metadata/get-listing-token-metadata.js.map +1 -0
- package/dist/pools/token-metadata/index.d.ts +3 -0
- package/dist/pools/token-metadata/index.d.ts.map +1 -0
- package/dist/pools/token-metadata/query.d.ts +11 -0
- package/dist/pools/token-metadata/query.d.ts.map +1 -0
- package/dist/pools/token-metadata/query.js +21 -0
- package/dist/pools/token-metadata/query.js.map +1 -0
- package/dist/pools/token-support/check-listing-token-support.d.ts +23 -0
- package/dist/pools/token-support/check-listing-token-support.d.ts.map +1 -0
- package/dist/pools/token-support/check-listing-token-support.js +36 -0
- package/dist/pools/token-support/check-listing-token-support.js.map +1 -0
- package/dist/pools/token-support/index.d.ts +3 -0
- package/dist/pools/token-support/index.d.ts.map +1 -0
- package/dist/pools/token-support/query.d.ts +11 -0
- package/dist/pools/token-support/query.d.ts.map +1 -0
- package/dist/pools/token-support/query.js +21 -0
- package/dist/pools/token-support/query.js.map +1 -0
- package/dist/pools/trade-history/calculate-history-metrics.d.ts +12 -0
- package/dist/pools/trade-history/calculate-history-metrics.d.ts.map +1 -0
- package/dist/pools/trade-history/calculate-history-metrics.js +36 -0
- package/dist/pools/trade-history/calculate-history-metrics.js.map +1 -0
- package/dist/pools/trade-history/get-pool-trade-history.d.ts +21 -1
- package/dist/pools/trade-history/get-pool-trade-history.d.ts.map +1 -1
- package/dist/pools/trade-history/get-pool-trade-history.js +57 -18
- package/dist/pools/trade-history/get-pool-trade-history.js.map +1 -1
- package/dist/pools/trade-history/query-document.d.ts.map +1 -1
- package/dist/pools/trade-history/query-document.js +1 -1
- package/dist/pools/trade-history/query-document.js.map +1 -1
- package/dist/pools/transactions/get-pool-transaction-range.d.ts +6 -0
- package/dist/pools/transactions/get-pool-transaction-range.d.ts.map +1 -0
- package/dist/pools/transactions/get-pool-transaction-range.js +26 -0
- package/dist/pools/transactions/get-pool-transaction-range.js.map +1 -0
- package/dist/pools/transactions/index.d.ts +1 -0
- package/dist/pools/transactions/index.d.ts.map +1 -1
- package/dist/pools/types/generated/listing-backend.js +34 -10
- package/dist/pools/types/generated/listing-backend.js.map +1 -1
- package/dist/pools/types.d.ts +129 -6
- package/dist/pools/types.d.ts.map +1 -1
- package/dist/pools/types.js.map +1 -1
- package/dist/pools/user-markets/get-user-listing-markets.d.ts +2 -0
- package/dist/pools/user-markets/get-user-listing-markets.d.ts.map +1 -1
- package/dist/pools/user-markets/get-user-listing-markets.js.map +1 -1
- package/dist/pools/user-markets/to-user-listing-market.js +1 -1
- package/dist/pools/user-markets/to-user-listing-market.js.map +1 -1
- package/dist/pools/user-transactions/get-user-transactions.d.ts +2 -0
- package/dist/pools/user-transactions/get-user-transactions.d.ts.map +1 -1
- package/dist/pools/user-transactions/get-user-transactions.js.map +1 -1
- package/dist/pools/user-transactions/to-user-transaction.d.ts +5 -1
- package/dist/pools/user-transactions/to-user-transaction.d.ts.map +1 -1
- package/dist/pools/user-transactions/to-user-transaction.js +3 -0
- package/dist/pools/user-transactions/to-user-transaction.js.map +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.d.ts +5 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.d.ts.map +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.js +1 -1
- package/dist/quotes/liquidation/calculate-liquidation-price.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-pnl.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-pnl.js +8 -8
- package/dist/quotes/upnl/calculate-quote-pnl.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-upnl.d.ts +2 -2
- package/dist/quotes/upnl/calculate-quote-upnl.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-upnl.js +16 -15
- package/dist/quotes/upnl/calculate-quote-upnl.js.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts +2 -2
- package/dist/symmio-subgraph/types/generated/analytics/gql.d.ts.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/gql.js +2 -2
- package/dist/symmio-subgraph/types/generated/analytics/gql.js.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts +21 -0
- package/dist/symmio-subgraph/types/generated/analytics/graphql.d.ts.map +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/graphql.js +1 -1
- package/dist/symmio-subgraph/types/generated/analytics/graphql.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { getPoolStatistics as t } from "./get-pool-statistics.js";
|
|
3
|
+
//#region src/pools/statistics/query.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
return ["getPoolStatistics", e(t)];
|
|
6
|
+
}
|
|
7
|
+
function r(e, r) {
|
|
8
|
+
return {
|
|
9
|
+
...r.query,
|
|
10
|
+
queryKey: n({
|
|
11
|
+
...r,
|
|
12
|
+
configKey: e.getChainConfigKey(r.chainId)
|
|
13
|
+
}),
|
|
14
|
+
enabled: (r.query?.enabled ?? !0) && (r.scope !== "user" || r.accessToken.length > 0 && r.userAddress.length > 0),
|
|
15
|
+
queryFn: () => t(e, r)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as getPoolStatisticsQueryKey, r as getPoolStatisticsQueryOptions };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/statistics/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { Compute, ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getPoolStatistics,\n type GetPoolStatisticsParameters,\n type GetPoolStatisticsReturnType,\n} from \"./get-pool-statistics\";\n/** Stable key for the composed core read. Credentials are excluded. */\nexport function getPoolStatisticsQueryKey(options: Compute<GetPoolStatisticsParameters & ConfigKeyParameter>) {\n return [\"getPoolStatistics\", filterQueryOptions(options)] as const;\n}\n/** Composed query key type. */\nexport type GetPoolStatisticsQueryKey = ReturnType<typeof getPoolStatisticsQueryKey>;\n/** Query controls plus all required read inputs. */\nexport type GetPoolStatisticsOptions = GetPoolStatisticsParameters &\n QueryParameter<GetPoolStatisticsReturnType, Error, GetPoolStatisticsReturnType, GetPoolStatisticsQueryKey>;\n/** Build options for non-React consumers; React composition uses the underlying primitive queries instead.\n * @param config - SDK configuration.\n * @param options - Required read inputs and optional query controls.\n * @returns Typed query options with a credential-free key.\n */\nexport function getPoolStatisticsQueryOptions(\n config: Config,\n options: GetPoolStatisticsOptions,\n): SymmioQueryOptions<GetPoolStatisticsReturnType, Error, GetPoolStatisticsReturnType, GetPoolStatisticsQueryKey> {\n return {\n ...options.query,\n queryKey: getPoolStatisticsQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled:\n (options.query?.enabled ?? true) &&\n (options.scope !== \"user\" || (options.accessToken.length > 0 && options.userAddress.length > 0)),\n queryFn: () => getPoolStatistics(config, options),\n };\n}\n"],"mappings":";;;AAUA,SAAgB,EAA0B,GAAoE;CAC5G,OAAO,CAAC,qBAAqB,EAAmB,CAAO,CAAC;AAC1D;AAWA,SAAgB,EACd,GACA,GACgH;CAChH,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA0B;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EACxG,UACG,EAAQ,OAAO,WAAW,QAC1B,EAAQ,UAAU,UAAW,EAAQ,YAAY,SAAS,KAAK,EAAQ,YAAY,SAAS;EAC/F,eAAe,EAAkB,GAAQ,CAAO;CAClD;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter } from '../../shared/types/properties.js';
|
|
3
|
+
/** Listing token metadata; price retains the service's decimal string without rounding. */
|
|
4
|
+
export interface ListingTokenMetadata {
|
|
5
|
+
/** Token address, preserving Solana case. */ tokenContractAddress: string;
|
|
6
|
+
/** Chain the token lives on. */ depositChain: number;
|
|
7
|
+
/** Display name. */ tokenName: string;
|
|
8
|
+
/** Ticker when known. */ tokenTicker: string | null;
|
|
9
|
+
/** Token's own decimals. */ decimals: number | null;
|
|
10
|
+
/** Service price, not a selected display price. */ price: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** Inputs for {@link getListingTokenMetadata}. Deployment chainId is separate from depositChain. */
|
|
13
|
+
export type GetListingTokenMetadataParameters = ChainIdParameter & {
|
|
14
|
+
/** Token address on the deposit chain. */
|
|
15
|
+
tokenContractAddress: string;
|
|
16
|
+
/** Token's chain, including Solana's zero sentinel. */
|
|
17
|
+
depositChain: number;
|
|
18
|
+
/** Listing bearer token. */
|
|
19
|
+
accessToken: string;
|
|
20
|
+
};
|
|
21
|
+
/** Result of {@link getListingTokenMetadata}. */
|
|
22
|
+
export type GetListingTokenMetadataReturnType = ListingTokenMetadata;
|
|
23
|
+
/**
|
|
24
|
+
* Read token metadata from the configured listing service.
|
|
25
|
+
* @param config - SDK configuration.
|
|
26
|
+
* @param parameters - Token identity and request parameters.
|
|
27
|
+
* @returns The normalized service result.
|
|
28
|
+
* @example
|
|
29
|
+
* await getListingTokenMetadata(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint, accessToken: token });
|
|
30
|
+
*/
|
|
31
|
+
export declare function getListingTokenMetadata(config: Config, parameters: GetListingTokenMetadataParameters): Promise<GetListingTokenMetadataReturnType>;
|
|
32
|
+
//# sourceMappingURL=get-listing-token-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-listing-token-metadata.d.ts","sourceRoot":"","sources":["../../../src/pools/token-metadata/get-listing-token-metadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAItE,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,6CAA6C,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC3E,gCAAgC,CAAC,YAAY,EAAE,MAAM,CAAC;IACtD,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC;IACvC,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,mDAAmD,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1E;AACD,oGAAoG;AACpG,MAAM,MAAM,iCAAiC,GAAG,gBAAgB,GAAG;IACjE,0CAA0C;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,iDAAiD;AACjD,MAAM,MAAM,iCAAiC,GAAG,oBAAoB,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,iCAAiC,GAC5C,OAAO,CAAC,iCAAiC,CAAC,CAmC5C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { resolveListingService as n } from "../resolve-listing.js";
|
|
3
|
+
import { getTokenMetaDataV2MarketTokenMetaDataGet as r } from "../types/generated/listing-backend.js";
|
|
4
|
+
import { isAxiosError as i } from "axios";
|
|
5
|
+
//#region src/pools/token-metadata/get-listing-token-metadata.ts
|
|
6
|
+
async function a(a, o) {
|
|
7
|
+
let { url: s } = n(a, { chainId: o.chainId });
|
|
8
|
+
try {
|
|
9
|
+
let { data: t } = await r({
|
|
10
|
+
contract_address: o.tokenContractAddress,
|
|
11
|
+
chain: o.depositChain
|
|
12
|
+
}, {
|
|
13
|
+
baseURL: s,
|
|
14
|
+
headers: { Authorization: `Bearer ${o.accessToken}` }
|
|
15
|
+
});
|
|
16
|
+
if (typeof t == "object" && t && "error_code" in t && typeof t.error_code == "number") throw new e({
|
|
17
|
+
code: "GET_LISTING_TOKEN_METADATA_FAILED",
|
|
18
|
+
message: "error_message" in t && typeof t.error_message == "string" ? t.error_message : "Token metadata lookup failed",
|
|
19
|
+
status: 200,
|
|
20
|
+
statusText: "OK",
|
|
21
|
+
responseData: t,
|
|
22
|
+
url: s + "/v2/market/token-meta-data",
|
|
23
|
+
method: "GET"
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
tokenContractAddress: t.token_contract_address,
|
|
27
|
+
depositChain: t.chain,
|
|
28
|
+
tokenName: t.token_name,
|
|
29
|
+
tokenTicker: t.token_ticker,
|
|
30
|
+
decimals: t.decimals ?? null,
|
|
31
|
+
price: t.price ?? null
|
|
32
|
+
};
|
|
33
|
+
} catch (n) {
|
|
34
|
+
throw n instanceof t ? n : i(n) ? e.fromAxios(n, {
|
|
35
|
+
code: "GET_LISTING_TOKEN_METADATA_FAILED",
|
|
36
|
+
baseURL: s
|
|
37
|
+
}) : new t("api", "GET_LISTING_TOKEN_METADATA_FAILED", "Listing request failed", { cause: n });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { a as getListingTokenMetadata };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=get-listing-token-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-listing-token-metadata.js","names":[],"sources":["../../../src/pools/token-metadata/get-listing-token-metadata.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { getTokenMetaDataV2MarketTokenMetaDataGet } from \"../types/generated/listing-backend\";\n\n/** Listing token metadata; price retains the service's decimal string without rounding. */\nexport interface ListingTokenMetadata {\n /** Token address, preserving Solana case. */ tokenContractAddress: string;\n /** Chain the token lives on. */ depositChain: number;\n /** Display name. */ tokenName: string;\n /** Ticker when known. */ tokenTicker: string | null;\n /** Token's own decimals. */ decimals: number | null;\n /** Service price, not a selected display price. */ price: string | null;\n}\n/** Inputs for {@link getListingTokenMetadata}. Deployment chainId is separate from depositChain. */\nexport type GetListingTokenMetadataParameters = ChainIdParameter & {\n /** Token address on the deposit chain. */\n tokenContractAddress: string;\n /** Token's chain, including Solana's zero sentinel. */\n depositChain: number;\n /** Listing bearer token. */\n accessToken: string;\n};\n/** Result of {@link getListingTokenMetadata}. */\nexport type GetListingTokenMetadataReturnType = ListingTokenMetadata;\n\n/**\n * Read token metadata from the configured listing service.\n * @param config - SDK configuration.\n * @param parameters - Token identity and request parameters.\n * @returns The normalized service result.\n * @example\n * await getListingTokenMetadata(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint, accessToken: token });\n */\nexport async function getListingTokenMetadata(\n config: Config,\n parameters: GetListingTokenMetadataParameters,\n): Promise<GetListingTokenMetadataReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n try {\n const { data } = await getTokenMetaDataV2MarketTokenMetaDataGet(\n { contract_address: parameters.tokenContractAddress, chain: parameters.depositChain },\n { baseURL, headers: { Authorization: `Bearer ${parameters.accessToken}` } },\n );\n if (typeof data === \"object\" && data !== null && \"error_code\" in data && typeof data.error_code === \"number\") {\n throw new SymmApiError({\n code: \"GET_LISTING_TOKEN_METADATA_FAILED\",\n message:\n \"error_message\" in data && typeof data.error_message === \"string\"\n ? data.error_message\n : \"Token metadata lookup failed\",\n status: 200,\n statusText: \"OK\",\n responseData: data,\n url: baseURL + \"/v2/market/token-meta-data\",\n method: \"GET\",\n });\n }\n return {\n tokenContractAddress: data.token_contract_address,\n depositChain: data.chain,\n tokenName: data.token_name,\n tokenTicker: data.token_ticker,\n decimals: data.decimals ?? null,\n price: data.price ?? null,\n };\n } catch (error) {\n if (error instanceof SymmError) throw error;\n if (isAxiosError(error))\n throw SymmApiError.fromAxios(error, { code: \"GET_LISTING_TOKEN_METADATA_FAILED\", baseURL });\n throw new SymmError(\"api\", \"GET_LISTING_TOKEN_METADATA_FAILED\", \"Listing request failed\", { cause: error });\n }\n}\n"],"mappings":";;;;;AAoCA,eAAsB,EACpB,GACA,GAC4C;CAC5C,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;CACtF,IAAI;EACF,IAAM,EAAE,YAAS,MAAM,EACrB;GAAE,kBAAkB,EAAW;GAAsB,OAAO,EAAW;EAAa,GACpF;GAAE;GAAS,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAAE,CAC5E;EACA,IAAI,OAAO,KAAS,YAAY,KAAiB,gBAAgB,KAAQ,OAAO,EAAK,cAAe,UAClG,MAAM,IAAI,EAAa;GACrB,MAAM;GACN,SACE,mBAAmB,KAAQ,OAAO,EAAK,iBAAkB,WACrD,EAAK,gBACL;GACN,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,KAAK,IAAU;GACf,QAAQ;EACV,CAAC;EAEH,OAAO;GACL,sBAAsB,EAAK;GAC3B,cAAc,EAAK;GACnB,WAAW,EAAK;GAChB,aAAa,EAAK;GAClB,UAAU,EAAK,YAAY;GAC3B,OAAO,EAAK,SAAS;EACvB;CACF,SAAS,GAAO;EAId,MAHI,aAAiB,IAAiB,IAClC,EAAa,CAAK,IACd,EAAa,UAAU,GAAO;GAAE,MAAM;GAAqC;EAAQ,CAAC,IACtF,IAAI,EAAU,OAAO,qCAAqC,0BAA0B,EAAE,OAAO,EAAM,CAAC;CAC5G;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/token-metadata/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { GetListingTokenMetadataParameters, GetListingTokenMetadataReturnType } from './get-listing-token-metadata.js';
|
|
5
|
+
/** Query options for {@link getListingTokenMetadata}. */
|
|
6
|
+
export type GetListingTokenMetadataOptions = GetListingTokenMetadataParameters & QueryParameter<GetListingTokenMetadataReturnType>;
|
|
7
|
+
/** Stable cache identity, including deployment configuration. */
|
|
8
|
+
export declare function getListingTokenMetadataQueryKey(options: GetListingTokenMetadataParameters & ConfigKeyParameter): readonly ["getListingTokenMetadata", Record<string, unknown>];
|
|
9
|
+
/** Build options for the listing read. Required identity/auth inputs gate execution. */
|
|
10
|
+
export declare function getListingTokenMetadataQueryOptions(config: Config, options: GetListingTokenMetadataOptions): SymmioQueryOptions<GetListingTokenMetadataReturnType>;
|
|
11
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/pools/token-metadata/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EACvC,MAAM,8BAA8B,CAAC;AAEtC,yDAAyD;AACzD,MAAM,MAAM,8BAA8B,GAAG,iCAAiC,GAC5E,cAAc,CAAC,iCAAiC,CAAC,CAAC;AACpD,iEAAiE;AACjE,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,iCAAiC,GAAG,kBAAkB,iEAE9G;AACD,wFAAwF;AACxF,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,8BAA8B,GACtC,kBAAkB,CAAC,iCAAiC,CAAC,CAOvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { getListingTokenMetadata as t } from "./get-listing-token-metadata.js";
|
|
3
|
+
//#region src/pools/token-metadata/query.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
return ["getListingTokenMetadata", e({ ...t })];
|
|
6
|
+
}
|
|
7
|
+
function r(e, r) {
|
|
8
|
+
return {
|
|
9
|
+
...r.query,
|
|
10
|
+
queryKey: n({
|
|
11
|
+
...r,
|
|
12
|
+
configKey: e.getChainConfigKey(r.chainId)
|
|
13
|
+
}),
|
|
14
|
+
enabled: (r.query?.enabled ?? !0) && !!r.tokenContractAddress && !!r.accessToken,
|
|
15
|
+
queryFn: () => t(e, r)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as getListingTokenMetadataQueryKey, r as getListingTokenMetadataQueryOptions };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/token-metadata/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n getListingTokenMetadata,\n type GetListingTokenMetadataParameters,\n type GetListingTokenMetadataReturnType,\n} from \"./get-listing-token-metadata\";\n\n/** Query options for {@link getListingTokenMetadata}. */\nexport type GetListingTokenMetadataOptions = GetListingTokenMetadataParameters &\n QueryParameter<GetListingTokenMetadataReturnType>;\n/** Stable cache identity, including deployment configuration. */\nexport function getListingTokenMetadataQueryKey(options: GetListingTokenMetadataParameters & ConfigKeyParameter) {\n return [\"getListingTokenMetadata\", filterQueryOptions({ ...options })] as const;\n}\n/** Build options for the listing read. Required identity/auth inputs gate execution. */\nexport function getListingTokenMetadataQueryOptions(\n config: Config,\n options: GetListingTokenMetadataOptions,\n): SymmioQueryOptions<GetListingTokenMetadataReturnType> {\n return {\n ...options.query,\n queryKey: getListingTokenMetadataQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled: (options.query?.enabled ?? true) && !!options.tokenContractAddress && !!options.accessToken,\n queryFn: () => getListingTokenMetadata(config, options),\n };\n}\n"],"mappings":";;;AAcA,SAAgB,EAAgC,GAAiE;CAC/G,OAAO,CAAC,2BAA2B,EAAmB,EAAE,GAAG,EAAQ,CAAC,CAAC;AACvE;AAEA,SAAgB,EACd,GACA,GACuD;CACvD,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAgC;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EAC9G,UAAU,EAAQ,OAAO,WAAW,OAAS,CAAC,CAAC,EAAQ,wBAAwB,CAAC,CAAC,EAAQ;EACzF,eAAe,EAAwB,GAAQ,CAAO;CACxD;AACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ChainIdParameter } from '../../shared/types/properties.js';
|
|
3
|
+
/** Inputs for {@link checkListingTokenSupport}. Deployment chainId is separate from depositChain. */
|
|
4
|
+
export type CheckListingTokenSupportParameters = ChainIdParameter & {
|
|
5
|
+
/** Token address on the deposit chain. */
|
|
6
|
+
tokenContractAddress: string;
|
|
7
|
+
/** Token's chain, including Solana's zero sentinel. */
|
|
8
|
+
depositChain: number;
|
|
9
|
+
/** Listing bearer token. */
|
|
10
|
+
accessToken: string;
|
|
11
|
+
};
|
|
12
|
+
/** Result of {@link checkListingTokenSupport}. */
|
|
13
|
+
export type CheckListingTokenSupportReturnType = boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check whether the listing service accepts a token, including errors returned with HTTP 200.
|
|
16
|
+
* @param config - SDK configuration.
|
|
17
|
+
* @param parameters - Token identity and request parameters.
|
|
18
|
+
* @returns The normalized service result.
|
|
19
|
+
* @example
|
|
20
|
+
* await checkListingTokenSupport(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint, accessToken: token });
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkListingTokenSupport(config: Config, parameters: CheckListingTokenSupportParameters): Promise<CheckListingTokenSupportReturnType>;
|
|
23
|
+
//# sourceMappingURL=check-listing-token-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-listing-token-support.d.ts","sourceRoot":"","sources":["../../../src/pools/token-support/check-listing-token-support.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAItE,qGAAqG;AACrG,MAAM,MAAM,kCAAkC,GAAG,gBAAgB,GAAG;IAClE,0CAA0C;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,kDAAkD;AAClD,MAAM,MAAM,kCAAkC,GAAG,OAAO,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kCAAkC,GAC7C,OAAO,CAAC,kCAAkC,CAAC,CA4B7C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SymmApiError as e, SymmError as t } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { resolveListingService as n } from "../resolve-listing.js";
|
|
3
|
+
import { checkTokenSupportV2MarketTokenSupportGet as r } from "../types/generated/listing-backend.js";
|
|
4
|
+
import { isAxiosError as i } from "axios";
|
|
5
|
+
//#region src/pools/token-support/check-listing-token-support.ts
|
|
6
|
+
async function a(a, o) {
|
|
7
|
+
let { url: s } = n(a, { chainId: o.chainId });
|
|
8
|
+
try {
|
|
9
|
+
let { data: t } = await r({
|
|
10
|
+
contract_address: o.tokenContractAddress,
|
|
11
|
+
chain: o.depositChain
|
|
12
|
+
}, {
|
|
13
|
+
baseURL: s,
|
|
14
|
+
headers: { Authorization: `Bearer ${o.accessToken}` }
|
|
15
|
+
});
|
|
16
|
+
if (typeof t == "object" && t && "error_code" in t && typeof t.error_code == "number") throw new e({
|
|
17
|
+
code: "LISTING_TOKEN_SUPPORT_FAILED",
|
|
18
|
+
message: "error_message" in t && typeof t.error_message == "string" ? t.error_message : "Token support check failed",
|
|
19
|
+
status: 200,
|
|
20
|
+
statusText: "OK",
|
|
21
|
+
responseData: t,
|
|
22
|
+
url: s + "/v2/market/token-support",
|
|
23
|
+
method: "GET"
|
|
24
|
+
});
|
|
25
|
+
return !0;
|
|
26
|
+
} catch (n) {
|
|
27
|
+
throw n instanceof t ? n : i(n) ? e.fromAxios(n, {
|
|
28
|
+
code: "CHECK_LISTING_TOKEN_SUPPORT_FAILED",
|
|
29
|
+
baseURL: s
|
|
30
|
+
}) : new t("api", "CHECK_LISTING_TOKEN_SUPPORT_FAILED", "Listing request failed", { cause: n });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { a as checkListingTokenSupport };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=check-listing-token-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-listing-token-support.js","names":[],"sources":["../../../src/pools/token-support/check-listing-token-support.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter } from \"../../shared/types/properties\";\nimport { resolveListingService } from \"../resolve-listing\";\nimport { checkTokenSupportV2MarketTokenSupportGet } from \"../types/generated/listing-backend\";\n\n/** Inputs for {@link checkListingTokenSupport}. Deployment chainId is separate from depositChain. */\nexport type CheckListingTokenSupportParameters = ChainIdParameter & {\n /** Token address on the deposit chain. */\n tokenContractAddress: string;\n /** Token's chain, including Solana's zero sentinel. */\n depositChain: number;\n /** Listing bearer token. */\n accessToken: string;\n};\n/** Result of {@link checkListingTokenSupport}. */\nexport type CheckListingTokenSupportReturnType = boolean;\n\n/**\n * Check whether the listing service accepts a token, including errors returned with HTTP 200.\n * @param config - SDK configuration.\n * @param parameters - Token identity and request parameters.\n * @returns The normalized service result.\n * @example\n * await checkListingTokenSupport(config, { chainId: 42161, depositChain: 0, tokenContractAddress: mint, accessToken: token });\n */\nexport async function checkListingTokenSupport(\n config: Config,\n parameters: CheckListingTokenSupportParameters,\n): Promise<CheckListingTokenSupportReturnType> {\n const { url: baseURL } = resolveListingService(config, { chainId: parameters.chainId });\n try {\n const { data } = await checkTokenSupportV2MarketTokenSupportGet(\n { contract_address: parameters.tokenContractAddress, chain: parameters.depositChain },\n { baseURL, headers: { Authorization: `Bearer ${parameters.accessToken}` } },\n );\n if (typeof data === \"object\" && data !== null && \"error_code\" in data && typeof data.error_code === \"number\") {\n throw new SymmApiError({\n code: \"LISTING_TOKEN_SUPPORT_FAILED\",\n message:\n \"error_message\" in data && typeof data.error_message === \"string\"\n ? data.error_message\n : \"Token support check failed\",\n status: 200,\n statusText: \"OK\",\n responseData: data,\n url: baseURL + \"/v2/market/token-support\",\n method: \"GET\",\n });\n }\n return true;\n } catch (error) {\n if (error instanceof SymmError) throw error;\n if (isAxiosError(error))\n throw SymmApiError.fromAxios(error, { code: \"CHECK_LISTING_TOKEN_SUPPORT_FAILED\", baseURL });\n throw new SymmError(\"api\", \"CHECK_LISTING_TOKEN_SUPPORT_FAILED\", \"Listing request failed\", { cause: error });\n }\n}\n"],"mappings":";;;;;AA2BA,eAAsB,EACpB,GACA,GAC6C;CAC7C,IAAM,EAAE,KAAK,MAAY,EAAsB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;CACtF,IAAI;EACF,IAAM,EAAE,YAAS,MAAM,EACrB;GAAE,kBAAkB,EAAW;GAAsB,OAAO,EAAW;EAAa,GACpF;GAAE;GAAS,SAAS,EAAE,eAAe,UAAU,EAAW,cAAc;EAAE,CAC5E;EACA,IAAI,OAAO,KAAS,YAAY,KAAiB,gBAAgB,KAAQ,OAAO,EAAK,cAAe,UAClG,MAAM,IAAI,EAAa;GACrB,MAAM;GACN,SACE,mBAAmB,KAAQ,OAAO,EAAK,iBAAkB,WACrD,EAAK,gBACL;GACN,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,KAAK,IAAU;GACf,QAAQ;EACV,CAAC;EAEH,OAAO;CACT,SAAS,GAAO;EAId,MAHI,aAAiB,IAAiB,IAClC,EAAa,CAAK,IACd,EAAa,UAAU,GAAO;GAAE,MAAM;GAAsC;EAAQ,CAAC,IACvF,IAAI,EAAU,OAAO,sCAAsC,0BAA0B,EAAE,OAAO,EAAM,CAAC;CAC7G;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pools/token-support/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { ConfigKeyParameter } from '../../shared/types/properties.js';
|
|
3
|
+
import { QueryParameter, SymmioQueryOptions } from '../../shared/types/query.js';
|
|
4
|
+
import { CheckListingTokenSupportParameters, CheckListingTokenSupportReturnType } from './check-listing-token-support.js';
|
|
5
|
+
/** Query options for {@link checkListingTokenSupport}. */
|
|
6
|
+
export type CheckListingTokenSupportOptions = CheckListingTokenSupportParameters & QueryParameter<CheckListingTokenSupportReturnType>;
|
|
7
|
+
/** Stable cache identity, including deployment configuration. */
|
|
8
|
+
export declare function checkListingTokenSupportQueryKey(options: CheckListingTokenSupportParameters & ConfigKeyParameter): readonly ["checkListingTokenSupport", Record<string, unknown>];
|
|
9
|
+
/** Build options for the listing read. Required identity/auth inputs gate execution. */
|
|
10
|
+
export declare function checkListingTokenSupportQueryOptions(config: Config, options: CheckListingTokenSupportOptions): SymmioQueryOptions<CheckListingTokenSupportReturnType>;
|
|
11
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/pools/token-support/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACxC,MAAM,+BAA+B,CAAC;AAEvC,0DAA0D;AAC1D,MAAM,MAAM,+BAA+B,GAAG,kCAAkC,GAC9E,cAAc,CAAC,kCAAkC,CAAC,CAAC;AACrD,iEAAiE;AACjE,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,kCAAkC,GAAG,kBAAkB,kEAEhH;AACD,wFAAwF;AACxF,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,+BAA+B,GACvC,kBAAkB,CAAC,kCAAkC,CAAC,CAOxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { filterQueryOptions as e } from "../../shared/utils/query.js";
|
|
2
|
+
import { checkListingTokenSupport as t } from "./check-listing-token-support.js";
|
|
3
|
+
//#region src/pools/token-support/query.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
return ["checkListingTokenSupport", e({ ...t })];
|
|
6
|
+
}
|
|
7
|
+
function r(e, r) {
|
|
8
|
+
return {
|
|
9
|
+
...r.query,
|
|
10
|
+
queryKey: n({
|
|
11
|
+
...r,
|
|
12
|
+
configKey: e.getChainConfigKey(r.chainId)
|
|
13
|
+
}),
|
|
14
|
+
enabled: (r.query?.enabled ?? !0) && !!r.tokenContractAddress && !!r.accessToken,
|
|
15
|
+
queryFn: () => t(e, r)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as checkListingTokenSupportQueryKey, r as checkListingTokenSupportQueryOptions };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/pools/token-support/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport type { ConfigKeyParameter } from \"../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../shared/types/query\";\nimport { filterQueryOptions } from \"../../shared/utils/query\";\nimport {\n checkListingTokenSupport,\n type CheckListingTokenSupportParameters,\n type CheckListingTokenSupportReturnType,\n} from \"./check-listing-token-support\";\n\n/** Query options for {@link checkListingTokenSupport}. */\nexport type CheckListingTokenSupportOptions = CheckListingTokenSupportParameters &\n QueryParameter<CheckListingTokenSupportReturnType>;\n/** Stable cache identity, including deployment configuration. */\nexport function checkListingTokenSupportQueryKey(options: CheckListingTokenSupportParameters & ConfigKeyParameter) {\n return [\"checkListingTokenSupport\", filterQueryOptions({ ...options })] as const;\n}\n/** Build options for the listing read. Required identity/auth inputs gate execution. */\nexport function checkListingTokenSupportQueryOptions(\n config: Config,\n options: CheckListingTokenSupportOptions,\n): SymmioQueryOptions<CheckListingTokenSupportReturnType> {\n return {\n ...options.query,\n queryKey: checkListingTokenSupportQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled: (options.query?.enabled ?? true) && !!options.tokenContractAddress && !!options.accessToken,\n queryFn: () => checkListingTokenSupport(config, options),\n };\n}\n"],"mappings":";;;AAcA,SAAgB,EAAiC,GAAkE;CACjH,OAAO,CAAC,4BAA4B,EAAmB,EAAE,GAAG,EAAQ,CAAC,CAAC;AACxE;AAEA,SAAgB,EACd,GACA,GACwD;CACxD,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAiC;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EAC/G,UAAU,EAAQ,OAAO,WAAW,OAAS,CAAC,CAAC,EAAQ,wBAAwB,CAAC,CAAC,EAAQ;EACzF,eAAe,EAAyB,GAAQ,CAAO;CACzD;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PoolQuote } from '../types.js';
|
|
2
|
+
/** Internal projection of an already snapshot-applied history quote. Unknown source amounts remain null. */
|
|
3
|
+
export declare function calculateHistoryMetrics(quote: PoolQuote): {
|
|
4
|
+
closeQuantity: bigint | null;
|
|
5
|
+
closePrice: bigint | null;
|
|
6
|
+
tradeValue: bigint | null;
|
|
7
|
+
openFee: bigint | null;
|
|
8
|
+
closeFee: bigint | null;
|
|
9
|
+
platformFee: bigint | null;
|
|
10
|
+
realizedPnl: bigint | null;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=calculate-history-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculate-history-metrics.d.ts","sourceRoot":"","sources":["../../../src/pools/trade-history/calculate-history-metrics.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,4GAA4G;AAC5G,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS;;;;;;;;EA2CvD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PositionType as e, QuoteStatus as t } from "../../symmio-contracts/symmio/types.js";
|
|
2
|
+
import { calculateClosePlatformFee as n } from "../../quotes/fees/calculate-close-platform-fee.js";
|
|
3
|
+
import { calculateOpenPlatformFee as r } from "../../quotes/fees/calculate-open-platform-fee.js";
|
|
4
|
+
import { calculateQuotePnl as i } from "../../quotes/upnl/calculate-quote-pnl.js";
|
|
5
|
+
import { parseUnits as a } from "viem";
|
|
6
|
+
//#region src/pools/trade-history/calculate-history-metrics.ts
|
|
7
|
+
function o(o) {
|
|
8
|
+
let s = o.quoteStatus === t.LIQUIDATED, c = s ? o.liquidateAmount ?? o.closedAmount ?? o.quantity : o.closedAmount ?? o.quantity, l = s ? o.liquidatePrice : o.averageClosedPrice ?? o.closedPrice ?? null, u = o.initialOpenedPrice != null && o.initialOpenedPrice > 0n ? o.initialOpenedPrice : o.openedPrice, d = c == null || u == null || o.tradingFee == null ? null : r({
|
|
9
|
+
quantity: c,
|
|
10
|
+
openedPrice: u,
|
|
11
|
+
openFeeRate: o.tradingFee
|
|
12
|
+
}), f = s ? 0n : c == null || l == null || o.closeFee == null ? null : n({
|
|
13
|
+
quantity: c,
|
|
14
|
+
closePrice: l,
|
|
15
|
+
closeFeeRate: o.closeFee
|
|
16
|
+
}), p = o.positionType, m = c == null || l == null || o.openedPrice == null || p !== e.LONG && p !== e.SHORT ? null : a(i({
|
|
17
|
+
positionType: p,
|
|
18
|
+
closedAmount: c,
|
|
19
|
+
closedPrice: l,
|
|
20
|
+
openedPrice: o.openedPrice,
|
|
21
|
+
leverage: "1"
|
|
22
|
+
}).pnl, 18);
|
|
23
|
+
return {
|
|
24
|
+
closeQuantity: c,
|
|
25
|
+
closePrice: l,
|
|
26
|
+
tradeValue: c == null || l == null ? null : c * l / 10n ** 18n,
|
|
27
|
+
openFee: d,
|
|
28
|
+
closeFee: f,
|
|
29
|
+
platformFee: d == null || f == null ? null : d + f,
|
|
30
|
+
realizedPnl: m
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { o as calculateHistoryMetrics };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=calculate-history-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculate-history-metrics.js","names":[],"sources":["../../../src/pools/trade-history/calculate-history-metrics.ts"],"sourcesContent":["import { parseUnits } from \"viem\";\nimport { calculateClosePlatformFee } from \"../../quotes/fees/calculate-close-platform-fee\";\nimport { calculateOpenPlatformFee } from \"../../quotes/fees/calculate-open-platform-fee\";\nimport { calculateQuotePnl } from \"../../quotes/upnl/calculate-quote-pnl\";\nimport { PositionType, QuoteStatus } from \"../../symmio-contracts/symmio/types\";\nimport type { PoolQuote } from \"../types\";\n\n/** Internal projection of an already snapshot-applied history quote. Unknown source amounts remain null. */\nexport function calculateHistoryMetrics(quote: PoolQuote) {\n const liquidated = quote.quoteStatus === QuoteStatus.LIQUIDATED;\n const closeQuantity = liquidated\n ? (quote.liquidateAmount ?? quote.closedAmount ?? quote.quantity)\n : (quote.closedAmount ?? quote.quantity);\n const closePrice = liquidated ? quote.liquidatePrice : (quote.averageClosedPrice ?? quote.closedPrice ?? null);\n const fillPrice =\n quote.initialOpenedPrice != null && quote.initialOpenedPrice > 0n ? quote.initialOpenedPrice : quote.openedPrice;\n const openFee =\n closeQuantity == null || fillPrice == null || quote.tradingFee == null\n ? null\n : calculateOpenPlatformFee({ quantity: closeQuantity, openedPrice: fillPrice, openFeeRate: quote.tradingFee });\n const closeFee = liquidated\n ? 0n\n : closeQuantity == null || closePrice == null || quote.closeFee == null\n ? null\n : calculateClosePlatformFee({ quantity: closeQuantity, closePrice, closeFeeRate: quote.closeFee });\n const positionType = quote.positionType;\n const realizedPnl =\n closeQuantity == null ||\n closePrice == null ||\n quote.openedPrice == null ||\n (positionType !== PositionType.LONG && positionType !== PositionType.SHORT)\n ? null\n : parseUnits(\n calculateQuotePnl({\n positionType,\n closedAmount: closeQuantity,\n closedPrice: closePrice,\n openedPrice: quote.openedPrice,\n leverage: \"1\",\n }).pnl,\n 18,\n );\n return {\n closeQuantity,\n closePrice,\n tradeValue: closeQuantity == null || closePrice == null ? null : (closeQuantity * closePrice) / 10n ** 18n,\n openFee,\n closeFee,\n platformFee: openFee == null || closeFee == null ? null : openFee + closeFee,\n realizedPnl,\n };\n}\n"],"mappings":";;;;;;AAQA,SAAgB,EAAwB,GAAkB;CACxD,IAAM,IAAa,EAAM,gBAAgB,EAAY,YAC/C,IAAgB,IACjB,EAAM,mBAAmB,EAAM,gBAAgB,EAAM,WACrD,EAAM,gBAAgB,EAAM,UAC3B,IAAa,IAAa,EAAM,iBAAkB,EAAM,sBAAsB,EAAM,eAAe,MACnG,IACJ,EAAM,sBAAsB,QAAQ,EAAM,qBAAqB,KAAK,EAAM,qBAAqB,EAAM,aACjG,IACJ,KAAiB,QAAQ,KAAa,QAAQ,EAAM,cAAc,OAC9D,OACA,EAAyB;EAAE,UAAU;EAAe,aAAa;EAAW,aAAa,EAAM;CAAW,CAAC,GAC3G,IAAW,IACb,KACA,KAAiB,QAAQ,KAAc,QAAQ,EAAM,YAAY,OAC/D,OACA,EAA0B;EAAE,UAAU;EAAe;EAAY,cAAc,EAAM;CAAS,CAAC,GAC/F,IAAe,EAAM,cACrB,IACJ,KAAiB,QACjB,KAAc,QACd,EAAM,eAAe,QACpB,MAAiB,EAAa,QAAQ,MAAiB,EAAa,QACjE,OACA,EACE,EAAkB;EAChB;EACA,cAAc;EACd,aAAa;EACb,aAAa,EAAM;EACnB,UAAU;CACZ,CAAC,EAAE,KACH,EACF;CACN,OAAO;EACL;EACA;EACA,YAAY,KAAiB,QAAQ,KAAc,OAAO,OAAQ,IAAgB,IAAc,OAAO;EACvG;EACA;EACA,aAAa,KAAW,QAAQ,KAAY,OAAO,OAAO,IAAU;EACpE;CACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Config } from '../../core/config/index.js';
|
|
2
2
|
import { QuoteCloseType, QuoteHistoryRow } from '../../quotes/get-quote-history/types.js';
|
|
3
3
|
import { ChainIdParameter, Compute } from '../../shared/types/properties.js';
|
|
4
|
+
import { PoolQuote } from '../types.js';
|
|
4
5
|
/**
|
|
5
6
|
* Parameters for {@link getPoolTradeHistory}.
|
|
6
7
|
*/
|
|
@@ -22,7 +23,26 @@ export type GetPoolTradeHistoryParameters = Compute<ChainIdParameter & {
|
|
|
22
23
|
/** Return type of {@link getPoolTradeHistory}. */
|
|
23
24
|
export interface GetPoolTradeHistoryReturnType {
|
|
24
25
|
/** The decoded, snapshot-applied history rows (one per close/liquidation event). */
|
|
25
|
-
rows:
|
|
26
|
+
rows: PoolTradeHistoryRow[];
|
|
27
|
+
/** Full quote fields with each event snapshot applied, aligned with rows. */
|
|
28
|
+
quotes: PoolQuote[];
|
|
29
|
+
}
|
|
30
|
+
/** One immutable close event with derived 18-decimal amounts. Missing calculation inputs yield null. */
|
|
31
|
+
export interface PoolTradeHistoryRow extends Omit<QuoteHistoryRow, "closeFee"> {
|
|
32
|
+
/** This event's closed/liquidated quantity, otherwise the available quote quantity. */
|
|
33
|
+
closeQuantity: bigint | null;
|
|
34
|
+
/** Event execution price; liquidation uses its own price rather than an earlier average close. */
|
|
35
|
+
closePrice: bigint | null;
|
|
36
|
+
/** Event quantity times execution price, in collateral units. */
|
|
37
|
+
tradeValue: bigint | null;
|
|
38
|
+
/** Opening-fee share attributed to this event's quantity, floored independently per row. */
|
|
39
|
+
openFee: bigint | null;
|
|
40
|
+
/** Event closing fee; zero for liquidation, charged for normal, force, emergency and ADL closes. */
|
|
41
|
+
closeFee: bigint | null;
|
|
42
|
+
/** openFee + closeFee; excludes solver, funding and liquidation fees. */
|
|
43
|
+
platformFee: bigint | null;
|
|
44
|
+
/** Gross realized PnL before fees, from the shared quote primitive. */
|
|
45
|
+
realizedPnl: bigint | null;
|
|
26
46
|
}
|
|
27
47
|
/**
|
|
28
48
|
* Read a **pool's** realized trade history from the analytics subgraph.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-pool-trade-history.d.ts","sourceRoot":"","sources":["../../../src/pools/trade-history/get-pool-trade-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-pool-trade-history.d.ts","sourceRoot":"","sources":["../../../src/pools/trade-history/get-pool-trade-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAQ/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO1C;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,gBAAgB,GAAG;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,qDAAqD;IACrD,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC,CACF,CAAC;AAEF,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,oFAAoF;IACpF,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,wGAAwG;AACxG,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IAC5E,uFAAuF;IACvF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kGAAkG;IAClG,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iEAAiE;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4FAA4F;IAC5F,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oGAAoG;IACpG,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uEAAuE;IACvE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,6BAA6B,CAAC,CAmDxC"}
|
|
@@ -1,27 +1,66 @@
|
|
|
1
1
|
import { querySubgraph as e } from "../../symmio-subgraph/query-subgraph/query-subgraph.js";
|
|
2
2
|
import { QuoteCloseType as t } from "../../quotes/get-quote-history/types.js";
|
|
3
|
-
import {
|
|
4
|
-
import { toQuoteHistoryRow as
|
|
5
|
-
import { resolvePoolSource as
|
|
6
|
-
import {
|
|
3
|
+
import { LIQUIDATION_EVENT_TYPES as n, closeTypeToEventTypes as r } from "../../quotes/get-quote-history/close-type.js";
|
|
4
|
+
import { toQuoteHistoryRow as i } from "../../quotes/get-quote-history/to-history-row.js";
|
|
5
|
+
import { resolvePoolSource as a } from "../resolve-pool-source.js";
|
|
6
|
+
import { toPoolQuote as o } from "../quotes/to-pool-quote.js";
|
|
7
|
+
import { calculateHistoryMetrics as s } from "./calculate-history-metrics.js";
|
|
8
|
+
import { PoolQuoteEventsDocument as c } from "./query-document.js";
|
|
7
9
|
//#region src/pools/trade-history/get-pool-trade-history.ts
|
|
8
|
-
var
|
|
9
|
-
async function
|
|
10
|
-
let { chainId:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var l = 50;
|
|
11
|
+
async function u(u, f) {
|
|
12
|
+
let { chainId: p, symbolId: m, closeType: h = t.All, first: g = l, skip: _ = 0, orderDirection: v = "desc" } = f;
|
|
13
|
+
if (m == null) return {
|
|
14
|
+
rows: [],
|
|
15
|
+
quotes: []
|
|
16
|
+
};
|
|
17
|
+
let y = await e(u, {
|
|
18
|
+
chainId: p,
|
|
19
|
+
document: c,
|
|
14
20
|
variables: {
|
|
15
|
-
typeIn:
|
|
16
|
-
symbolId: String(
|
|
17
|
-
source:
|
|
18
|
-
first:
|
|
19
|
-
skip:
|
|
20
|
-
orderDirection:
|
|
21
|
+
typeIn: r[h],
|
|
22
|
+
symbolId: String(m),
|
|
23
|
+
source: a(u, p),
|
|
24
|
+
first: g,
|
|
25
|
+
skip: _,
|
|
26
|
+
orderDirection: v
|
|
21
27
|
}
|
|
22
|
-
})).quoteEvents ?? []).map(
|
|
28
|
+
}), b = (y.quoteEvents ?? []).map(i), x = (y.quoteEvents ?? []).map((e, t) => {
|
|
29
|
+
let r = b[t], i = o(e.quote), a = {};
|
|
30
|
+
try {
|
|
31
|
+
let t = JSON.parse(e.metadata ?? "{}");
|
|
32
|
+
t && typeof t == "object" && (a = t);
|
|
33
|
+
} catch {}
|
|
34
|
+
let s = d(a.amount), c = d(a.closePrice), l = n.has(r.closeEventType);
|
|
35
|
+
return {
|
|
36
|
+
...i,
|
|
37
|
+
quoteStatus: r.quoteStatus,
|
|
38
|
+
openedPrice: d(a.openedPrice) ?? i.openedPrice,
|
|
39
|
+
closedAmount: s ?? i.closedAmount,
|
|
40
|
+
quantityToClose: s ?? i.quantityToClose,
|
|
41
|
+
averageClosedPrice: c ?? i.averageClosedPrice,
|
|
42
|
+
liquidateAmount: (l ? s : null) ?? i.liquidateAmount,
|
|
43
|
+
liquidatePrice: (l ? c : null) ?? i.liquidatePrice
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
rows: b.map((e, t) => ({
|
|
48
|
+
...e,
|
|
49
|
+
...s(x[t])
|
|
50
|
+
})),
|
|
51
|
+
quotes: x
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function d(e) {
|
|
55
|
+
if (typeof e != "string" && typeof e != "number" || typeof e == "string" && e.trim() === "") return null;
|
|
56
|
+
try {
|
|
57
|
+
let t = BigInt(e);
|
|
58
|
+
return t >= 0n ? t : null;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
23
62
|
}
|
|
24
63
|
//#endregion
|
|
25
|
-
export {
|
|
64
|
+
export { u as getPoolTradeHistory };
|
|
26
65
|
|
|
27
66
|
//# sourceMappingURL=get-pool-trade-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-pool-trade-history.js","names":[],"sources":["../../../src/pools/trade-history/get-pool-trade-history.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { closeTypeToEventTypes } from \"../../quotes/get-quote-history/close-type\";\nimport { toQuoteHistoryRow } from \"../../quotes/get-quote-history/to-history-row\";\nimport { QuoteCloseType, type QuoteHistoryRow } from \"../../quotes/get-quote-history/types\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport type {\n PoolQuoteEventsQuery,\n PoolQuoteEventsQueryVariables,\n} from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { resolvePoolSource } from \"../resolve-pool-source\";\nimport { PoolQuoteEventsDocument } from \"./query-document\";\n\n/** Page size when the caller does not specify one. */\nconst DEFAULT_PAGE_SIZE = 50;\n\n/**\n * Parameters for {@link getPoolTradeHistory}.\n */\nexport type GetPoolTradeHistoryParameters = Compute<\n ChainIdParameter & {\n /**\n * The pool's solver market id. A pool with no `symbolId` is not tradable and\n * has no history — the action short-circuits to an empty result.\n */\n symbolId: number | null | undefined;\n /** Close-type filter. @default QuoteCloseType.All */\n closeType?: QuoteCloseType;\n /** Page size. @default 50 */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Sort direction on the event timestamp. @default \"desc\" */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getPoolTradeHistory}. */\nexport interface GetPoolTradeHistoryReturnType {\n /** The decoded, snapshot-applied history rows (one per close/liquidation event). */\n rows:
|
|
1
|
+
{"version":3,"file":"get-pool-trade-history.js","names":[],"sources":["../../../src/pools/trade-history/get-pool-trade-history.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { closeTypeToEventTypes, LIQUIDATION_EVENT_TYPES } from \"../../quotes/get-quote-history/close-type\";\nimport { toQuoteHistoryRow } from \"../../quotes/get-quote-history/to-history-row\";\nimport { QuoteCloseType, type QuoteHistoryRow } from \"../../quotes/get-quote-history/types\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport { querySubgraph } from \"../../symmio-subgraph/query-subgraph\";\nimport type {\n PoolQuoteEventsQuery,\n PoolQuoteEventsQueryVariables,\n} from \"../../symmio-subgraph/types/generated/analytics/graphql\";\nimport { toPoolQuote } from \"../quotes/to-pool-quote\";\nimport { resolvePoolSource } from \"../resolve-pool-source\";\nimport type { PoolQuote } from \"../types\";\nimport { calculateHistoryMetrics } from \"./calculate-history-metrics\";\nimport { PoolQuoteEventsDocument } from \"./query-document\";\n\n/** Page size when the caller does not specify one. */\nconst DEFAULT_PAGE_SIZE = 50;\n\n/**\n * Parameters for {@link getPoolTradeHistory}.\n */\nexport type GetPoolTradeHistoryParameters = Compute<\n ChainIdParameter & {\n /**\n * The pool's solver market id. A pool with no `symbolId` is not tradable and\n * has no history — the action short-circuits to an empty result.\n */\n symbolId: number | null | undefined;\n /** Close-type filter. @default QuoteCloseType.All */\n closeType?: QuoteCloseType;\n /** Page size. @default 50 */\n first?: number;\n /** Page offset. @default 0 */\n skip?: number;\n /** Sort direction on the event timestamp. @default \"desc\" */\n orderDirection?: \"asc\" | \"desc\";\n }\n>;\n\n/** Return type of {@link getPoolTradeHistory}. */\nexport interface GetPoolTradeHistoryReturnType {\n /** The decoded, snapshot-applied history rows (one per close/liquidation event). */\n rows: PoolTradeHistoryRow[];\n /** Full quote fields with each event snapshot applied, aligned with rows. */\n quotes: PoolQuote[];\n}\n\n/** One immutable close event with derived 18-decimal amounts. Missing calculation inputs yield null. */\nexport interface PoolTradeHistoryRow extends Omit<QuoteHistoryRow, \"closeFee\"> {\n /** This event's closed/liquidated quantity, otherwise the available quote quantity. */\n closeQuantity: bigint | null;\n /** Event execution price; liquidation uses its own price rather than an earlier average close. */\n closePrice: bigint | null;\n /** Event quantity times execution price, in collateral units. */\n tradeValue: bigint | null;\n /** Opening-fee share attributed to this event's quantity, floored independently per row. */\n openFee: bigint | null;\n /** Event closing fee; zero for liquidation, charged for normal, force, emergency and ADL closes. */\n closeFee: bigint | null;\n /** openFee + closeFee; excludes solver, funding and liquidation fees. */\n platformFee: bigint | null;\n /** Gross realized PnL before fees, from the shared quote primitive. */\n realizedPnl: bigint | null;\n}\n\n/**\n * Read a **pool's** realized trade history from the analytics subgraph.\n *\n * The pool-scoped counterpart to `getQuoteHistory`: that one filters by the\n * accounts you pass, this one filters by the market and the SYMMIO diamond the\n * quotes were opened against, with no account clause at all. The result is every\n * trader's closes on this pool, which is what a pool page shows.\n *\n * Rows come from the immutable `quoteEvents` collection with each event's frozen\n * `metadata` snapshot overlaid, so a quote closed across several partial closes\n * yields several individually-accurate rows rather than repeating its final\n * state.\n *\n * @param config - The SDK config.\n * @param parameters - The pool's `symbolId`, optional close-type filter, paging and sort.\n * @returns The history rows; empty when `symbolId` is absent.\n * @throws {SymmError} when the chain is unsupported or has no analytics subgraph.\n * @throws {SymmApiError} when the subgraph request fails.\n *\n * @example\n * ```ts\n * const { rows } = await getPoolTradeHistory(config, { symbolId: 1, first: 25 });\n * ```\n */\nexport async function getPoolTradeHistory(\n config: Config,\n parameters: GetPoolTradeHistoryParameters,\n): Promise<GetPoolTradeHistoryReturnType> {\n const {\n chainId,\n symbolId,\n closeType = QuoteCloseType.All,\n first = DEFAULT_PAGE_SIZE,\n skip = 0,\n orderDirection = \"desc\",\n } = parameters;\n\n if (symbolId === null || symbolId === undefined) return { rows: [], quotes: [] };\n\n const data = await querySubgraph<PoolQuoteEventsQuery, PoolQuoteEventsQueryVariables>(config, {\n chainId,\n document: PoolQuoteEventsDocument,\n variables: {\n typeIn: closeTypeToEventTypes[closeType] as string[],\n symbolId: String(symbolId),\n source: resolvePoolSource(config, chainId),\n first,\n skip,\n orderDirection,\n },\n });\n\n const rows = (data.quoteEvents ?? []).map(toQuoteHistoryRow);\n const quotes = (data.quoteEvents ?? []).map((event, index) => {\n const snapshot = rows[index]!;\n const quote = toPoolQuote(event.quote);\n let metadata: Record<string, unknown> = {};\n try {\n const parsed: unknown = JSON.parse(event.metadata ?? \"{}\");\n if (parsed && typeof parsed === \"object\") metadata = parsed as Record<string, unknown>;\n } catch {\n /* Missing snapshot keeps the nullable quote fields. */\n }\n const amount = snapshotWei(metadata.amount);\n const closePrice = snapshotWei(metadata.closePrice);\n const isLiquidation = LIQUIDATION_EVENT_TYPES.has(snapshot.closeEventType);\n return {\n ...quote,\n quoteStatus: snapshot.quoteStatus,\n openedPrice: snapshotWei(metadata.openedPrice) ?? quote.openedPrice,\n closedAmount: amount ?? quote.closedAmount,\n quantityToClose: amount ?? quote.quantityToClose,\n averageClosedPrice: closePrice ?? quote.averageClosedPrice,\n liquidateAmount: (isLiquidation ? amount : null) ?? quote.liquidateAmount,\n liquidatePrice: (isLiquidation ? closePrice : null) ?? quote.liquidatePrice,\n };\n });\n return { rows: rows.map((row, index) => ({ ...row, ...calculateHistoryMetrics(quotes[index]!) })), quotes };\n}\n\nfunction snapshotWei(value: unknown): bigint | null {\n if (typeof value !== \"string\" && typeof value !== \"number\") return null;\n if (typeof value === \"string\" && value.trim() === \"\") return null;\n try {\n const amount = BigInt(value);\n return amount >= 0n ? amount : null;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;;;AAiBA,IAAM,IAAoB;AAyE1B,eAAsB,EACpB,GACA,GACwC;CACxC,IAAM,EACJ,YACA,aACA,eAAY,EAAe,KAC3B,WAAQ,GACR,UAAO,GACP,oBAAiB,WACf;CAEJ,IAAI,KAAa,MAAgC,OAAO;EAAE,MAAM,CAAC;EAAG,QAAQ,CAAC;CAAE;CAE/E,IAAM,IAAO,MAAM,EAAmE,GAAQ;EAC5F;EACA,UAAU;EACV,WAAW;GACT,QAAQ,EAAsB;GAC9B,UAAU,OAAO,CAAQ;GACzB,QAAQ,EAAkB,GAAQ,CAAO;GACzC;GACA;GACA;EACF;CACF,CAAC,GAEK,KAAQ,EAAK,eAAe,CAAC,GAAG,IAAI,CAAiB,GACrD,KAAU,EAAK,eAAe,CAAC,GAAG,KAAK,GAAO,MAAU;EAC5D,IAAM,IAAW,EAAK,IAChB,IAAQ,EAAY,EAAM,KAAK,GACjC,IAAoC,CAAC;EACzC,IAAI;GACF,IAAM,IAAkB,KAAK,MAAM,EAAM,YAAY,IAAI;GACzD,AAAI,KAAU,OAAO,KAAW,aAAU,IAAW;EACvD,QAAQ,CAER;EACA,IAAM,IAAS,EAAY,EAAS,MAAM,GACpC,IAAa,EAAY,EAAS,UAAU,GAC5C,IAAgB,EAAwB,IAAI,EAAS,cAAc;EACzE,OAAO;GACL,GAAG;GACH,aAAa,EAAS;GACtB,aAAa,EAAY,EAAS,WAAW,KAAK,EAAM;GACxD,cAAc,KAAU,EAAM;GAC9B,iBAAiB,KAAU,EAAM;GACjC,oBAAoB,KAAc,EAAM;GACxC,kBAAkB,IAAgB,IAAS,SAAS,EAAM;GAC1D,iBAAiB,IAAgB,IAAa,SAAS,EAAM;EAC/D;CACF,CAAC;CACD,OAAO;EAAE,MAAM,EAAK,KAAK,GAAK,OAAW;GAAE,GAAG;GAAK,GAAG,EAAwB,EAAO,EAAO;EAAE,EAAE;EAAG;CAAO;AAC5G;AAEA,SAAS,EAAY,GAA+B;CAElD,IADI,OAAO,KAAU,YAAY,OAAO,KAAU,YAC9C,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,IAAI,OAAO;CAC7D,IAAI;EACF,IAAM,IAAS,OAAO,CAAK;EAC3B,OAAO,KAAU,KAAK,IAAS;CACjC,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/pools/trade-history/query-document.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB;;;;;;;
|
|
1
|
+
{"version":3,"file":"query-document.d.ts","sourceRoot":"","sources":["../../../src/pools/trade-history/query-document.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB;;;;;;;EAyElC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { graphql as e } from "../../symmio-subgraph/types/generated/analytics/gql.js";
|
|
2
2
|
//#region src/pools/trade-history/query-document.ts
|
|
3
|
-
var t = e("\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");
|
|
3
|
+
var t = e("\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 id\n timestamp\n blockNumber\n userPaidFunding\n userReceivedFunding\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n");
|
|
4
4
|
//#endregion
|
|
5
5
|
export { t as PoolQuoteEventsDocument };
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-document.js","names":[],"sources":["../../../src/pools/trade-history/query-document.ts"],"sourcesContent":["import { graphql } from \"../../symmio-subgraph/types/generated/analytics\";\n\n/**\n * A pool's realized trade history, from the analytics subgraph.\n *\n * Reads the immutable `quoteEvents` collection rather than `quotes`, so a quote\n * closed across several partial closes yields one row per close — each with the\n * frozen `metadata` snapshot of that close, which is what makes the rows\n * distinct. Scoped to the pool by the quote's `symbolId` and `source`, with no\n * account filter: this is the whole pool's history.\n *\n * The selection matches `QuoteEventsForHistoryDocument` field for field, because\n * both decode through `toQuoteHistoryRow` into the same `QuoteHistoryRow`.\n *\n * The document compiles to a typed query string via graphql-codegen.\n */\nexport const PoolQuoteEventsDocument = graphql(`\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`);\n"],"mappings":";;AAgBA,IAAa,IAA0B,EAAQ
|
|
1
|
+
{"version":3,"file":"query-document.js","names":[],"sources":["../../../src/pools/trade-history/query-document.ts"],"sourcesContent":["import { graphql } from \"../../symmio-subgraph/types/generated/analytics\";\n\n/**\n * A pool's realized trade history, from the analytics subgraph.\n *\n * Reads the immutable `quoteEvents` collection rather than `quotes`, so a quote\n * closed across several partial closes yields one row per close — each with the\n * frozen `metadata` snapshot of that close, which is what makes the rows\n * distinct. Scoped to the pool by the quote's `symbolId` and `source`, with no\n * account filter: this is the whole pool's history.\n *\n * The selection matches `QuoteEventsForHistoryDocument` field for field, because\n * both decode through `toQuoteHistoryRow` into the same `QuoteHistoryRow`.\n *\n * The document compiles to a typed query string via graphql-codegen.\n */\nexport const PoolQuoteEventsDocument = graphql(`\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 id\n timestamp\n blockNumber\n userPaidFunding\n userReceivedFunding\n quoteId\n quoteStatus\n positionType\n orderTypeOpen\n symbol\n symbolId\n partyA\n partyB\n subAccount {\n id\n owner\n }\n quantity\n openedPrice\n initialOpenedPrice\n requestedOpenPrice\n marketPrice\n averageClosedPrice\n closePrice\n closedPrice\n closedAmount\n quantityToClose\n liquidateAmount\n liquidatePrice\n tradingFee\n closeFee\n leverage\n cva\n lf\n initialCva\n initialLf\n initialPartyAmm\n timestampSendQuote\n timestampOpenPosition\n sendQuoteEvents: quoteEvents(where: { type: \"SEND_QUOTE\" }, first: 1) {\n transaction\n }\n openPositionEvents: quoteEvents(where: { type: \"OPEN_POSITION\" }, first: 1000) {\n metadata\n }\n }\n }\n }\n`);\n"],"mappings":";;AAgBA,IAAa,IAA0B,EAAQ,+jDAyE9C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Config } from '../../core/config/index.js';
|
|
2
|
+
import { PoolTransactionPage } from '../types.js';
|
|
3
|
+
import { GetPoolTransactionsParameters } from './get-pool-transactions.js';
|
|
4
|
+
/** Read a requested history range through the service's 50-row page cap. Stop on a short page or the reported total. */
|
|
5
|
+
export declare function getPoolTransactionRange(config: Config, parameters: GetPoolTransactionsParameters): Promise<PoolTransactionPage>;
|
|
6
|
+
//# sourceMappingURL=get-pool-transaction-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pool-transaction-range.d.ts","sourceRoot":"","sources":["../../../src/pools/transactions/get-pool-transaction-range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAuB,KAAK,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAElG,wHAAwH;AACxH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,6BAA6B,GACxC,OAAO,CAAC,mBAAmB,CAAC,CAkB9B"}
|