@symmio/trading-react 0.1.1 → 0.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/account-layer/index.d.ts +28 -28
- package/dist/account-layer/index.js +29 -0
- package/dist/account-layer/use-account-balance-info.d.ts +1 -1
- package/dist/account-layer/use-account-balance-of.d.ts +1 -1
- package/dist/account-layer/use-add-margin.d.ts +2 -2
- package/dist/account-layer/use-allocate.d.ts +2 -2
- package/dist/account-layer/use-create-sub-accounts.d.ts +2 -2
- package/dist/account-layer/use-deallocate.d.ts +2 -2
- package/dist/account-layer/use-delete-sub-account.d.ts +2 -2
- package/dist/account-layer/use-deposit-and-allocate.d.ts +2 -2
- package/dist/account-layer/use-deposit.d.ts +2 -2
- package/dist/account-layer/use-edit-account-name.d.ts +2 -2
- package/dist/account-layer/use-predicted-next-virtual-account.d.ts +1 -1
- package/dist/account-layer/use-remove-margin.d.ts +2 -2
- package/dist/account-layer/use-simulate-add-margin.d.ts +1 -1
- package/dist/account-layer/use-simulate-allocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-create-sub-accounts.d.ts +1 -1
- package/dist/account-layer/use-simulate-deallocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-delete-sub-account.d.ts +1 -1
- package/dist/account-layer/use-simulate-deposit-and-allocate.d.ts +1 -1
- package/dist/account-layer/use-simulate-deposit.d.ts +1 -1
- package/dist/account-layer/use-simulate-edit-account-name.d.ts +1 -1
- package/dist/account-layer/use-simulate-remove-margin.d.ts +1 -1
- package/dist/account-layer/use-sub-account-virtual-nonce.d.ts +1 -1
- package/dist/account-layer/use-sub-account.d.ts +1 -1
- package/dist/account-layer/use-sub-accounts-count-of-user.d.ts +1 -1
- package/dist/account-layer/use-user-sub-accounts-addresses.d.ts +1 -1
- package/dist/account-layer/use-user-sub-accounts.d.ts +1 -1
- package/dist/account-layer/use-virtual-account.d.ts +1 -1
- package/dist/account-layer/use-virtual-accounts-addresses-of-sub-account.d.ts +1 -1
- package/dist/balance-history/index.d.ts +3 -3
- package/dist/balance-history/use-balance-history.d.ts +1 -1
- package/dist/balance-history/use-deposit-history.d.ts +1 -1
- package/dist/balance-history/use-withdraw-history.d.ts +1 -1
- package/dist/collateral/index.d.ts +4 -4
- package/dist/collateral/use-approve-collateral.d.ts +2 -2
- package/dist/collateral/use-collateral-allowance.d.ts +1 -1
- package/dist/collateral/use-collateral-balance.d.ts +1 -1
- package/dist/collateral/use-simulate-approve-collateral.d.ts +1 -1
- package/dist/error-codes/index.d.ts +2 -2
- package/dist/error-codes/use-solver-error-codes.d.ts +1 -1
- package/dist/error-codes/use-solver-error-message.d.ts +1 -1
- package/dist/errors/index.d.ts +3 -3
- package/dist/errors/index.js +3 -0
- package/dist/errors/normalize-symm-error.d.ts +1 -1
- package/dist/errors/symmio-request-error.d.ts +1 -1
- package/dist/fees/index.d.ts +1 -1
- package/dist/fees/index.js +2 -0
- package/dist/fees/use-fee-for-user.d.ts +1 -1
- package/dist/funding-info/index.d.ts +2 -0
- package/dist/funding-info/index.d.ts.map +1 -0
- package/dist/funding-info/use-funding-info.d.ts +25 -0
- package/dist/funding-info/use-funding-info.d.ts.map +1 -0
- package/dist/funding-info/use-funding-info.js +27 -0
- package/dist/funding-info/use-funding-info.js.map +1 -0
- package/dist/index.d.ts +40 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -69
- package/dist/instant-layer/index.d.ts +14 -13
- package/dist/instant-layer/index.d.ts.map +1 -1
- package/dist/instant-layer/index.js +15 -0
- package/dist/instant-layer/use-delegation-expiry.d.ts +1 -1
- package/dist/instant-layer/use-grant-delegation.d.ts +2 -2
- package/dist/instant-layer/use-instant-close-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-close-bulk-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-close-bulk.d.ts +1 -1
- package/dist/instant-layer/use-instant-close.d.ts +1 -1
- package/dist/instant-layer/use-instant-closes.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-auto.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-quote-id.d.ts +1 -1
- package/dist/instant-layer/use-instant-open-with-tpsl.d.ts +55 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.d.ts.map +1 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.js +56 -0
- package/dist/instant-layer/use-instant-open-with-tpsl.js.map +1 -0
- package/dist/instant-layer/use-instant-open.d.ts +1 -1
- package/dist/instant-layer/use-instant-opens.d.ts +1 -1
- package/dist/instant-layer/use-is-delegation-active.d.ts +1 -1
- package/dist/instant-layer/use-simulate-grant-delegation.d.ts +1 -1
- package/dist/locked-params/index.d.ts +1 -1
- package/dist/locked-params/use-locked-params.d.ts +1 -1
- package/dist/market-info/index.d.ts +2 -0
- package/dist/market-info/index.d.ts.map +1 -0
- package/dist/market-info/use-market-info.d.ts +28 -0
- package/dist/market-info/use-market-info.d.ts.map +1 -0
- package/dist/market-info/use-market-info.js +27 -0
- package/dist/market-info/use-market-info.js.map +1 -0
- package/dist/markets/index.d.ts +2 -2
- package/dist/markets/index.js +3 -0
- package/dist/markets/use-markets.d.ts +1 -1
- package/dist/markets/use-onchain-contract-markets.d.ts +1 -1
- package/dist/muon/index.d.ts +10 -10
- package/dist/muon/use-deallocate-upnl-sig.d.ts +1 -1
- package/dist/muon/use-muon-party-a-overview.d.ts +1 -1
- package/dist/muon/use-muon-price-range.d.ts +1 -1
- package/dist/muon/use-muon-price.d.ts +1 -1
- package/dist/muon/use-muon-settle-upnl.d.ts +1 -1
- package/dist/muon/use-muon-upnl-a-with-symbol-price.d.ts +1 -1
- package/dist/muon/use-muon-upnl-a.d.ts +1 -1
- package/dist/muon/use-muon-upnl-b.d.ts +1 -1
- package/dist/muon/use-muon-upnl-with-symbol-price.d.ts +1 -1
- package/dist/muon/use-muon-upnl.d.ts +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/use-search-notifications.d.ts +1 -1
- package/dist/notional-cap/index.d.ts +3 -3
- package/dist/notional-cap/use-notional-cap-all.d.ts +1 -1
- package/dist/notional-cap/use-notional-cap-by-symbol-id.d.ts +1 -1
- package/dist/notional-cap/use-open-interest-by-symbol-id.d.ts +1 -1
- package/dist/price-service/index.d.ts +8 -8
- package/dist/price-service/index.js +9 -0
- package/dist/price-service/use-enigma-price-by-market-id.d.ts +1 -1
- package/dist/price-service/use-enigma-price-by-name.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-health.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-metadata.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-prices-by-addresses.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-prices-by-names.d.ts +1 -1
- package/dist/price-service/use-enigma-price-service-symbols-info.d.ts +1 -1
- package/dist/price-service/use-enigma-prices.d.ts +1 -1
- package/dist/provider/index.d.ts +3 -3
- package/dist/provider/index.js +4 -0
- package/dist/quotes/index.d.ts +15 -15
- package/dist/quotes/use-account-liquidation-price.d.ts +4 -7
- package/dist/quotes/use-account-liquidation-price.d.ts.map +1 -1
- package/dist/quotes/use-account-liquidation-price.js.map +1 -1
- package/dist/quotes/use-grouped-quotes.d.ts +1 -1
- package/dist/quotes/use-managed-quotes.d.ts +1 -1
- package/dist/quotes/use-managed-quotes.d.ts.map +1 -1
- package/dist/quotes/use-managed-quotes.js +125 -122
- package/dist/quotes/use-managed-quotes.js.map +1 -1
- package/dist/quotes/use-party-a-open-positions.d.ts +4 -4
- package/dist/quotes/use-party-a-open-positions.js.map +1 -1
- package/dist/quotes/use-party-a-pending-quotes.d.ts +1 -1
- package/dist/quotes/use-quote-events-by-type.d.ts +1 -1
- package/dist/quotes/use-quote-funding.d.ts +1 -1
- package/dist/quotes/use-quote-history.d.ts +1 -1
- package/dist/quotes/use-quote-price-history.d.ts +1 -1
- package/dist/quotes/use-quote.d.ts +1 -1
- package/dist/quotes/use-quotes-funding.d.ts +1 -1
- package/dist/quotes/use-subgraph-query.d.ts +1 -1
- package/dist/tpsl/index.d.ts +8 -7
- package/dist/tpsl/index.d.ts.map +1 -1
- package/dist/tpsl/tpsl-store.d.ts +84 -0
- package/dist/tpsl/tpsl-store.d.ts.map +1 -0
- package/dist/tpsl/tpsl-store.js +154 -0
- package/dist/tpsl/tpsl-store.js.map +1 -0
- package/dist/tpsl/use-delete-quote-tpsl.d.ts +15 -0
- package/dist/tpsl/use-delete-quote-tpsl.d.ts.map +1 -0
- package/dist/tpsl/use-delete-quote-tpsl.js +31 -0
- package/dist/tpsl/use-delete-quote-tpsl.js.map +1 -0
- package/dist/tpsl/use-quote-tpsl.d.ts +19 -20
- package/dist/tpsl/use-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-quote-tpsl.js +24 -53
- package/dist/tpsl/use-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-set-quote-tpsl.d.ts +11 -10
- package/dist/tpsl/use-set-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/use-set-quote-tpsl.js +18 -22
- package/dist/tpsl/use-set-quote-tpsl.js.map +1 -1
- package/dist/tpsl/use-tpsl-config.d.ts +1 -1
- package/dist/tpsl/use-tpsl-signing-spec.d.ts +1 -1
- package/dist/tpsl/use-watch-tpsl-notifications.d.ts +1 -1
- package/dist/transactions/index.d.ts +3 -3
- package/dist/transactions/index.js +3 -0
- package/dist/transactions/resolve-write-result.d.ts +1 -1
- package/dist/transfers/index.d.ts +1 -1
- package/dist/transfers/use-transfer-history.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/wallet/index.d.ts +4 -4
- package/dist/wallet/index.js +5 -0
- package/dist/wallet/use-connect-wallet.d.ts +1 -1
- package/dist/wallet/use-switch-to-symmio-chain.d.ts +1 -1
- package/dist/websocket/index.d.ts +1 -1
- package/dist/websocket/use-notifications.d.ts +1 -1
- package/dist/withdraw/index.d.ts +10 -10
- package/dist/withdraw/use-finalize-withdraw-request.d.ts +2 -2
- package/dist/withdraw/use-initiate-withdraw.d.ts +2 -2
- package/dist/withdraw/use-last-withdraw-request-id.d.ts +1 -1
- package/dist/withdraw/use-pending-withdraw-requests.d.ts +1 -1
- package/dist/withdraw/use-request-cancel-withdraw.d.ts +2 -2
- package/dist/withdraw/use-simulate-finalize-withdraw-request.d.ts +1 -1
- package/dist/withdraw/use-simulate-initiate-withdraw.d.ts +1 -1
- package/dist/withdraw/use-simulate-request-cancel-withdraw.d.ts +1 -1
- package/dist/withdraw/use-withdraw-requests.d.ts +1 -1
- package/dist/withdraw/use-withdrawable-time.d.ts +1 -1
- package/package.json +7 -5
- package/dist/tpsl/tpsl-confirming.d.ts +0 -36
- package/dist/tpsl/tpsl-confirming.d.ts.map +0 -1
- package/dist/tpsl/tpsl-confirming.js +0 -28
- package/dist/tpsl/tpsl-confirming.js.map +0 -1
package/dist/quotes/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './optimistic-quotes-store';
|
|
2
|
-
export * from './use-account-liquidation-price';
|
|
3
|
-
export * from './use-grouped-quotes';
|
|
4
|
-
export * from './use-managed-quotes';
|
|
5
|
-
export * from './use-party-a-open-positions';
|
|
6
|
-
export * from './use-party-a-pending-quotes';
|
|
7
|
-
export * from './use-quote';
|
|
8
|
-
export * from './use-quote-events-by-type';
|
|
9
|
-
export * from './use-quote-funding';
|
|
10
|
-
export * from './use-quote-history';
|
|
11
|
-
export * from './use-quote-platform-fee';
|
|
12
|
-
export * from './use-quote-price-history';
|
|
13
|
-
export * from './use-quote-upnl-and-pnl';
|
|
14
|
-
export * from './use-quotes-funding';
|
|
15
|
-
export * from './use-subgraph-query';
|
|
1
|
+
export * from './optimistic-quotes-store.js';
|
|
2
|
+
export * from './use-account-liquidation-price.js';
|
|
3
|
+
export * from './use-grouped-quotes.js';
|
|
4
|
+
export * from './use-managed-quotes.js';
|
|
5
|
+
export * from './use-party-a-open-positions.js';
|
|
6
|
+
export * from './use-party-a-pending-quotes.js';
|
|
7
|
+
export * from './use-quote.js';
|
|
8
|
+
export * from './use-quote-events-by-type.js';
|
|
9
|
+
export * from './use-quote-funding.js';
|
|
10
|
+
export * from './use-quote-history.js';
|
|
11
|
+
export * from './use-quote-platform-fee.js';
|
|
12
|
+
export * from './use-quote-price-history.js';
|
|
13
|
+
export * from './use-quote-upnl-and-pnl.js';
|
|
14
|
+
export * from './use-quotes-funding.js';
|
|
15
|
+
export * from './use-subgraph-query.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { Address } from 'viem';
|
|
|
4
4
|
* Parameters for {@link useAccountLiquidationPrice}.
|
|
5
5
|
*/
|
|
6
6
|
export interface UseAccountLiquidationPriceParameters extends ConfigParameter {
|
|
7
|
-
/** Account address (
|
|
7
|
+
/** Account address (virtual account for lowcap). */
|
|
8
8
|
account?: Address;
|
|
9
9
|
/** Optional override; defaults to the connected chain. */
|
|
10
10
|
chainId?: number;
|
|
@@ -23,12 +23,9 @@ export interface UseAccountLiquidationPriceReturnType {
|
|
|
23
23
|
* info and its open positions from the SYMMIO core and feeding them into
|
|
24
24
|
* {@link calculateLiquidationPrice}.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Net position direction is taken from the first active position. lowcap VAs are
|
|
30
|
-
* single-direction by design; for a mixed-direction account the result reflects
|
|
31
|
-
* the first position's side only.
|
|
26
|
+
* Net position direction is taken from the first active position. Lowcap virtual
|
|
27
|
+
* accounts are single-direction by design; for a mixed-direction account the
|
|
28
|
+
* result reflects the first position's side only.
|
|
32
29
|
*
|
|
33
30
|
* @example
|
|
34
31
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-liquidation-price.d.ts","sourceRoot":"","sources":["../../src/quotes/use-account-liquidation-price.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC;;GAEG;AACH,MAAM,WAAW,oCAAqC,SAAQ,eAAe;IAC3E,
|
|
1
|
+
{"version":3,"file":"use-account-liquidation-price.d.ts","sourceRoot":"","sources":["../../src/quotes/use-account-liquidation-price.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC;;GAEG;AACH,MAAM,WAAW,oCAAqC,SAAQ,eAAe;IAC3E,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,SAAS,EAAE,OAAO,CAAC;CACpB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,GAAE,oCAAyC,GACpD,oCAAoC,CAiCtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-liquidation-price.js","names":[],"sources":["../../src/quotes/use-account-liquidation-price.ts"],"sourcesContent":["\"use client\";\n\nimport {\n calculateLiquidationPrice,\n PositionType,\n type AccountPosition,\n type ConfigParameter,\n} from \"@symmio/trading-core\";\nimport { useMemo } from \"react\";\nimport type { Address } from \"viem\";\nimport { useAccountBalanceInfo } from \"../account-layer/use-account-balance-info\";\nimport { usePartyAOpenPositions } from \"./use-party-a-open-positions\";\n\n/**\n * Parameters for {@link useAccountLiquidationPrice}.\n */\nexport interface UseAccountLiquidationPriceParameters extends ConfigParameter {\n /** Account address (
|
|
1
|
+
{"version":3,"file":"use-account-liquidation-price.js","names":[],"sources":["../../src/quotes/use-account-liquidation-price.ts"],"sourcesContent":["\"use client\";\n\nimport {\n calculateLiquidationPrice,\n PositionType,\n type AccountPosition,\n type ConfigParameter,\n} from \"@symmio/trading-core\";\nimport { useMemo } from \"react\";\nimport type { Address } from \"viem\";\nimport { useAccountBalanceInfo } from \"../account-layer/use-account-balance-info\";\nimport { usePartyAOpenPositions } from \"./use-party-a-open-positions\";\n\n/**\n * Parameters for {@link useAccountLiquidationPrice}.\n */\nexport interface UseAccountLiquidationPriceParameters extends ConfigParameter {\n /** Account address (virtual account for lowcap). */\n account?: Address;\n /** Optional override; defaults to the connected chain. */\n chainId?: number;\n}\n\n/**\n * Return type of {@link useAccountLiquidationPrice}.\n */\nexport interface UseAccountLiquidationPriceReturnType {\n /** Liquidation price in 18-decimal-wei collateral units. `0n` when unavailable. */\n liquidationPrice: bigint;\n /** `true` while the underlying balance / positions queries are loading. */\n isLoading: boolean;\n}\n\nconst EMPTY: UseAccountLiquidationPriceReturnType = { liquidationPrice: 0n, isLoading: false };\n\n/**\n * Compute the on-chain liquidation price for an account by reading its balance\n * info and its open positions from the SYMMIO core and feeding them into\n * {@link calculateLiquidationPrice}.\n *\n * Net position direction is taken from the first active position. Lowcap virtual\n * accounts are single-direction by design; for a mixed-direction account the\n * result reflects the first position's side only.\n *\n * @example\n * ```tsx\n * const { liquidationPrice, isLoading } = useAccountLiquidationPrice({ account: quote.partyA });\n * ```\n */\nexport function useAccountLiquidationPrice(\n parameters: UseAccountLiquidationPriceParameters = {},\n): UseAccountLiquidationPriceReturnType {\n const { account, chainId, config } = parameters;\n\n const balanceQuery = useAccountBalanceInfo({ account, chainId, config });\n const positionsQuery = usePartyAOpenPositions({ partyA: account, chainId, config });\n\n return useMemo(() => {\n if (!account) return EMPTY;\n const balance = balanceQuery.data;\n const positions = positionsQuery.data;\n if (!balance || !positions || positions.length === 0) {\n return { liquidationPrice: 0n, isLoading: balanceQuery.isLoading || positionsQuery.isLoading };\n }\n\n const firstPosition = positions[0];\n if (!firstPosition) return { liquidationPrice: 0n, isLoading: false };\n\n const accountPositions: AccountPosition[] = positions.map((quote) => ({\n quantity: quote.quantity,\n closedAmount: quote.closedAmount,\n openedPrice: quote.openedPrice,\n }));\n\n const liquidationPrice = calculateLiquidationPrice({\n positions: accountPositions,\n positionType: firstPosition.positionType ?? PositionType.LONG,\n allocatedBalance: balance.allocatedBalance,\n lockedCVA: balance.lockedCVA,\n lockedLF: balance.lockedLF,\n });\n\n return { liquidationPrice, isLoading: false };\n }, [account, balanceQuery.data, balanceQuery.isLoading, positionsQuery.data, positionsQuery.isLoading]);\n}\n"],"mappings":";;;;;;AAiCA,IAAM,IAA8C;CAAE,kBAAkB;CAAI,WAAW;AAAM;AAgB7F,SAAgB,EACd,IAAmD,CAAC,GACd;CACtC,IAAM,EAAE,YAAS,YAAS,cAAW,GAE/B,IAAe,EAAsB;EAAE;EAAS;EAAS;CAAO,CAAC,GACjE,IAAiB,EAAuB;EAAE,QAAQ;EAAS;EAAS;CAAO,CAAC;CAElF,OAAO,QAAc;EACnB,IAAI,CAAC,GAAS,OAAO;EACrB,IAAM,IAAU,EAAa,MACvB,IAAY,EAAe;EACjC,IAAI,CAAC,KAAW,CAAC,KAAa,EAAU,WAAW,GACjD,OAAO;GAAE,kBAAkB;GAAI,WAAW,EAAa,aAAa,EAAe;EAAU;EAG/F,IAAM,IAAgB,EAAU;EAiBhC,OAhBK,IAgBE;GAAE,kBARgB,EAA0B;IACjD,WAP0C,EAAU,KAAK,OAAW;KACpE,UAAU,EAAM;KAChB,cAAc,EAAM;KACpB,aAAa,EAAM;IACrB,EAGa;IACX,cAAc,EAAc,gBAAgB,EAAa;IACzD,kBAAkB,EAAQ;IAC1B,WAAW,EAAQ;IACnB,UAAU,EAAQ;GACpB,CAES;GAAkB,WAAW;EAAM,IAhBjB;GAAE,kBAAkB;GAAI,WAAW;EAAM;CAiBtE,GAAG;EAAC;EAAS,EAAa;EAAM,EAAa;EAAW,EAAe;EAAM,EAAe;CAAS,CAAC;AACxG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GroupQuotesOptions, QuoteGroup, QuoteGroupingStrategy, UnifiedQuote } from '@symmio/trading-core';
|
|
2
|
-
import { UseManagedQuotesParameters, UseManagedQuotesResult } from './use-managed-quotes';
|
|
2
|
+
import { UseManagedQuotesParameters, UseManagedQuotesResult } from './use-managed-quotes.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parameters for {@link useGroupedQuotes}. Everything {@link useManagedQuotes}
|
|
5
5
|
* accepts, plus how to fold the resulting positions into groups.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SocketStatus, UnifiedQuote } from '@symmio/trading-core';
|
|
2
2
|
import { Address } from 'viem';
|
|
3
|
-
import { SymmioRequestError } from '../errors/symmio-request-error';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
4
|
/**
|
|
5
5
|
* Which underlying quote sources {@link useManagedQuotes} should read. Every
|
|
6
6
|
* source defaults to `true`; set one to `false` to skip its query/subscription
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-managed-quotes.d.ts","sourceRoot":"","sources":["../../src/quotes/use-managed-quotes.ts"],"names":[],"mappings":"AAEA,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-managed-quotes.d.ts","sourceRoot":"","sources":["../../src/quotes/use-managed-quotes.ts"],"names":[],"mappings":"AAEA,OAAO,EAkBL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAsDzE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sGAAsG;IACtG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wFAAwF;IACxF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,qFAAqF;IACrF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gGAAgG;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qFAAqF;IACrF,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,qDAAqD;IACrD,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpC,2GAA2G;IAC3G,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,yEAAyE;IACzE,SAAS,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,UAAU,EAAE,OAAO,CAAC;IACpB,0FAA0F;IAC1F,YAAY,EAAE,YAAY,CAAC;IAC3B,qEAAqE;IACrE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,0BAA0B,GAAG,sBAAsB,CA4hB/F"}
|
|
@@ -5,160 +5,163 @@ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
|
5
5
|
import { predicateMatch as r } from "../utils/predicate-match.js";
|
|
6
6
|
import { useVirtualAccountsAddressesOfSubAccount as i } from "../account-layer/use-virtual-accounts-addresses-of-sub-account.js";
|
|
7
7
|
import { useInstantCloses as a } from "../instant-layer/use-instant-closes.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useTpSlStore as ee } from "../tpsl/tpsl-store.js";
|
|
9
|
+
import { useInstantOpens as te } from "../instant-layer/use-instant-opens.js";
|
|
10
|
+
import { useOptimisticQuotesStore as o } from "./optimistic-quotes-store.js";
|
|
10
11
|
import { useNotifications as ne } from "../websocket/use-notifications.js";
|
|
11
|
-
import { QuoteLifecycle as
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { getAddress as
|
|
14
|
-
import { useQueries as
|
|
12
|
+
import { QuoteLifecycle as s, classifyQuoteNotificationAction as re, getInstantClosesQueryKey as c, getInstantOpensQueryKey as l, getPartyAOpenPositionsQueryKey as u, getPartyAOpenPositionsQueryOptions as ie, getPartyAPendingQuotesQueryKey as ae, getPartyAPendingQuotesQueryOptions as oe, getPredictedNextVirtualAccountQueryOptions as se, getQuoteQueryKey as ce, getQuoteQueryOptions as le, isolationTypeForSide as ue, reconcileQuotes as de, shouldAccelerateOnchainReads as fe } from "@symmio/trading-core";
|
|
13
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
14
|
+
import { getAddress as g } from "viem";
|
|
15
|
+
import { useQueries as _, useQueryClient as pe } from "@tanstack/react-query";
|
|
15
16
|
//#region src/quotes/use-managed-quotes.ts
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]),
|
|
21
|
-
function
|
|
22
|
-
let { partyA:
|
|
23
|
-
|
|
24
|
-
let Oe =
|
|
25
|
-
|
|
26
|
-
let
|
|
17
|
+
var me = 5e3, he = 1500, ge = 100, _e = [], ve = 250, ye = new Set([
|
|
18
|
+
s.OPTIMISTIC,
|
|
19
|
+
s.PRICE_FILLED,
|
|
20
|
+
s.WRITE_ONCHAIN
|
|
21
|
+
]), be = new Set([s.WRITE_ONCHAIN_CLOSE, s.CLOSING]);
|
|
22
|
+
function v(s) {
|
|
23
|
+
let { partyA: v, chainId: xe, pollingInterval: y, live: b = !0, enabled: Se = !0 } = s, x = t(), Ce = e(), S = xe ?? Ce, C = s.includeVirtualAccounts ?? !0, w = s.extraAccounts, T = s.sources, E = T?.openPositions ?? !0, D = T?.pendingQuotes ?? !0, O = T?.instantOpens ?? !0, k = T?.instantCloses ?? !0, A = Se && !!v, j = A && v ? `${S}:${v.toLowerCase()}` : void 0, [we, Te] = h({ vas: [] }), Ee = we.owner === j ? we.vas : _e, De = pe(), M = m(De);
|
|
24
|
+
M.current = De;
|
|
25
|
+
let Oe = x.getChainConfigKey(S), N = m(Oe);
|
|
26
|
+
N.current = Oe;
|
|
27
|
+
let P = m(void 0), F = m({
|
|
27
28
|
opens: !1,
|
|
28
29
|
closes: !1
|
|
29
|
-
}),
|
|
30
|
-
partyA:
|
|
31
|
-
chainId:
|
|
30
|
+
}), I = m(void 0), L = m([]), ke = m("closed"), R = o((e) => e.entries), Ae = o((e) => e.clearSettled), je = b && ke.current === "open", z = y && y > 0 ? y : !1, Me = I.current ? fe(I.current) : !1, B = A ? Me ? he : je ? z : z || me : !1, Ne = I.current?.quotes, Pe = Ne?.some((e) => ye.has(e.lifecycle)) ?? !1, Fe = Ne?.some((e) => be.has(e.lifecycle)) ?? !1, Ie = (e) => !je && e ? he : z, Le = A && O ? Ie(Pe) : !1, Re = A && k ? Ie(Fe) : !1, V = te({
|
|
31
|
+
partyA: v,
|
|
32
|
+
chainId: S,
|
|
32
33
|
query: {
|
|
33
|
-
enabled:
|
|
34
|
-
refetchInterval:
|
|
34
|
+
enabled: A && O,
|
|
35
|
+
refetchInterval: Le
|
|
35
36
|
}
|
|
36
37
|
}), H = a({
|
|
37
|
-
partyA:
|
|
38
|
-
chainId:
|
|
38
|
+
partyA: v,
|
|
39
|
+
chainId: S,
|
|
39
40
|
query: {
|
|
40
|
-
enabled:
|
|
41
|
-
refetchInterval:
|
|
41
|
+
enabled: A && k,
|
|
42
|
+
refetchInterval: Re
|
|
42
43
|
}
|
|
43
44
|
}), U = i({
|
|
44
|
-
subAccount:
|
|
45
|
-
chainId:
|
|
45
|
+
subAccount: v,
|
|
46
|
+
chainId: S,
|
|
46
47
|
query: {
|
|
47
|
-
enabled:
|
|
48
|
+
enabled: A && C,
|
|
48
49
|
refetchInterval: B
|
|
49
50
|
}
|
|
50
|
-
}),
|
|
51
|
-
queries:
|
|
52
|
-
subAccount:
|
|
53
|
-
chainId:
|
|
51
|
+
}), ze = O ? V.data ?? [] : [], W = _({
|
|
52
|
+
queries: ze.map((e) => ({ ...se(x, {
|
|
53
|
+
subAccount: v,
|
|
54
|
+
chainId: S,
|
|
54
55
|
isolationType: ue(e.positionType),
|
|
55
56
|
symbolId: BigInt(e.marketId),
|
|
56
57
|
query: {
|
|
57
|
-
enabled:
|
|
58
|
+
enabled: A && C,
|
|
58
59
|
refetchInterval: B
|
|
59
60
|
}
|
|
60
61
|
}) })),
|
|
61
62
|
combine: (e) => ({
|
|
62
|
-
byTempId:
|
|
63
|
+
byTempId: ze.reduce((t, n, r) => {
|
|
63
64
|
let i = e[r]?.data;
|
|
64
|
-
return i && (t[n.tempQuoteId] =
|
|
65
|
+
return i && (t[n.tempQuoteId] = g(i)), t;
|
|
65
66
|
}, {}),
|
|
66
67
|
addresses: e.map((e) => e.data).filter((e) => !!e),
|
|
67
68
|
isLoading: e.some((e) => e.isLoading),
|
|
68
69
|
isFetching: e.some((e) => e.isFetching)
|
|
69
70
|
})
|
|
70
|
-
}), [G,
|
|
71
|
-
account:
|
|
72
|
-
chainId:
|
|
73
|
-
enabled:
|
|
74
|
-
onNotification:
|
|
75
|
-
|
|
76
|
-
let t =
|
|
77
|
-
t
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
}), [G, Be] = h([]), { status: K } = ne({
|
|
72
|
+
account: v,
|
|
73
|
+
chainId: S,
|
|
74
|
+
enabled: A && b,
|
|
75
|
+
onNotification: d((e) => {
|
|
76
|
+
Be((t) => [...t, e].slice(-ge));
|
|
77
|
+
let t = e.tempQuoteId, n = e.quoteId;
|
|
78
|
+
t && n && n !== `${t}` && ee.getState().link(BigInt(t), BigInt(n));
|
|
79
|
+
let i = re(e.lastSeenAction), a = F.current;
|
|
80
|
+
i === "open" ? a.opens = !0 : (i === "close" || (a.opens = !0), a.closes = !0), P.current && clearTimeout(P.current), P.current = setTimeout(() => {
|
|
81
|
+
let e = M.current, t = { configKey: N.current }, { opens: n, closes: i } = F.current;
|
|
82
|
+
F.current = {
|
|
80
83
|
opens: !1,
|
|
81
84
|
closes: !1
|
|
82
|
-
}, e.invalidateQueries({ predicate: r(
|
|
83
|
-
},
|
|
85
|
+
}, e.invalidateQueries({ predicate: r(u, t) }), e.invalidateQueries({ predicate: r(ae, t) }), e.invalidateQueries({ predicate: r(ce, t) }), n && e.invalidateQueries({ predicate: r(l, t) }), i && e.invalidateQueries({ predicate: r(c, t) });
|
|
86
|
+
}, ve);
|
|
84
87
|
}, [])
|
|
85
88
|
});
|
|
86
|
-
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
if (!(!
|
|
90
|
-
if (
|
|
91
|
-
let e =
|
|
92
|
-
e.invalidateQueries({ predicate: r(
|
|
89
|
+
ke.current = K;
|
|
90
|
+
let Ve = m(!1);
|
|
91
|
+
f(() => {
|
|
92
|
+
if (!(!b || K !== "open")) {
|
|
93
|
+
if (Ve.current) {
|
|
94
|
+
let e = M.current, t = { configKey: N.current };
|
|
95
|
+
e.invalidateQueries({ predicate: r(u, t) }), e.invalidateQueries({ predicate: r(ae, t) }), e.invalidateQueries({ predicate: r(ce, t) }), e.invalidateQueries({ predicate: r(l, t) }), e.invalidateQueries({ predicate: r(c, t) });
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
Ve.current = !0;
|
|
95
98
|
}
|
|
96
|
-
}, [K,
|
|
97
|
-
|
|
99
|
+
}, [K, b]), f(() => () => {
|
|
100
|
+
P.current && clearTimeout(P.current);
|
|
98
101
|
}, []);
|
|
99
|
-
let q =
|
|
102
|
+
let q = p(() => {
|
|
100
103
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
101
104
|
for (let n of G) {
|
|
102
105
|
if (!n.vaAddress) continue;
|
|
103
|
-
let r =
|
|
106
|
+
let r = g(n.vaAddress), i = r.toLowerCase();
|
|
104
107
|
e.has(i) || (e.add(i), t.push(r));
|
|
105
108
|
}
|
|
106
109
|
return t;
|
|
107
|
-
}, [G]), J =
|
|
108
|
-
if (!
|
|
110
|
+
}, [G]), J = p(() => {
|
|
111
|
+
if (!A || !v) return [];
|
|
109
112
|
let e = /* @__PURE__ */ new Set(), t = [], n = (n) => {
|
|
110
|
-
let r =
|
|
113
|
+
let r = g(n), i = r.toLowerCase();
|
|
111
114
|
e.has(i) || (e.add(i), t.push(r));
|
|
112
115
|
};
|
|
113
|
-
if (n(
|
|
116
|
+
if (n(v), C) {
|
|
114
117
|
for (let e of U.data ?? []) n(e);
|
|
115
118
|
for (let e of W.addresses) n(e);
|
|
116
119
|
for (let e of q) n(e);
|
|
117
|
-
for (let e of
|
|
120
|
+
for (let e of Ee) n(e);
|
|
118
121
|
}
|
|
119
|
-
for (let e of
|
|
122
|
+
for (let e of w ?? []) n(e);
|
|
120
123
|
return t;
|
|
121
124
|
}, [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
A,
|
|
126
|
+
v,
|
|
127
|
+
C,
|
|
125
128
|
U.data,
|
|
126
129
|
W.addresses,
|
|
127
130
|
q,
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
Ee,
|
|
132
|
+
w
|
|
130
133
|
]);
|
|
131
|
-
|
|
132
|
-
if (!
|
|
134
|
+
f(() => {
|
|
135
|
+
if (!j) return;
|
|
133
136
|
let e = [
|
|
134
137
|
...U.data ?? [],
|
|
135
138
|
...W.addresses,
|
|
136
139
|
...q
|
|
137
140
|
];
|
|
138
|
-
|
|
139
|
-
let n = t.owner ===
|
|
141
|
+
Te((t) => {
|
|
142
|
+
let n = t.owner === j ? t.vas : [], r = new Set(n.map((e) => e.toLowerCase())), i = [...n], a = t.owner !== j;
|
|
140
143
|
for (let t of e) {
|
|
141
|
-
let e =
|
|
144
|
+
let e = g(t), n = e.toLowerCase();
|
|
142
145
|
r.has(n) || (r.add(n), i.push(e), a = !0);
|
|
143
146
|
}
|
|
144
147
|
return a ? {
|
|
145
|
-
owner:
|
|
148
|
+
owner: j,
|
|
146
149
|
vas: i
|
|
147
150
|
} : t;
|
|
148
151
|
});
|
|
149
152
|
}, [
|
|
150
|
-
|
|
153
|
+
j,
|
|
151
154
|
U.data,
|
|
152
155
|
W.addresses,
|
|
153
156
|
q
|
|
154
157
|
]);
|
|
155
|
-
let Y =
|
|
158
|
+
let Y = _({
|
|
156
159
|
queries: J.map((e) => {
|
|
157
|
-
let t =
|
|
160
|
+
let t = ie(x, {
|
|
158
161
|
partyA: e,
|
|
159
|
-
chainId:
|
|
162
|
+
chainId: S,
|
|
160
163
|
query: {
|
|
161
|
-
enabled:
|
|
164
|
+
enabled: A && E,
|
|
162
165
|
refetchInterval: B
|
|
163
166
|
}
|
|
164
167
|
});
|
|
@@ -180,13 +183,13 @@ function h(o) {
|
|
|
180
183
|
error: e.find((e) => e.error)?.error ?? null,
|
|
181
184
|
refetch: () => e.forEach((e) => e.refetch())
|
|
182
185
|
})
|
|
183
|
-
}), X =
|
|
186
|
+
}), X = _({
|
|
184
187
|
queries: J.map((e) => {
|
|
185
|
-
let t = oe(
|
|
188
|
+
let t = oe(x, {
|
|
186
189
|
partyA: e,
|
|
187
|
-
chainId:
|
|
190
|
+
chainId: S,
|
|
188
191
|
query: {
|
|
189
|
-
enabled:
|
|
192
|
+
enabled: A && D,
|
|
190
193
|
refetchInterval: B
|
|
191
194
|
}
|
|
192
195
|
});
|
|
@@ -208,13 +211,13 @@ function h(o) {
|
|
|
208
211
|
error: e.find((e) => e.error)?.error ?? null,
|
|
209
212
|
refetch: () => e.forEach((e) => e.refetch())
|
|
210
213
|
})
|
|
211
|
-
}), Z =
|
|
214
|
+
}), Z = _({
|
|
212
215
|
queries: X.ids.map((e) => {
|
|
213
|
-
let t = le(
|
|
216
|
+
let t = le(x, {
|
|
214
217
|
quoteId: e,
|
|
215
|
-
chainId:
|
|
218
|
+
chainId: S,
|
|
216
219
|
query: {
|
|
217
|
-
enabled:
|
|
220
|
+
enabled: A && D,
|
|
218
221
|
refetchInterval: B
|
|
219
222
|
}
|
|
220
223
|
});
|
|
@@ -235,26 +238,26 @@ function h(o) {
|
|
|
235
238
|
isFetching: e.some((e) => e.isFetching),
|
|
236
239
|
error: e.find((e) => e.error)?.error ?? null
|
|
237
240
|
})
|
|
238
|
-
}), Q =
|
|
239
|
-
if (!
|
|
241
|
+
}), Q = p(() => {
|
|
242
|
+
if (!A || !v) return I.current = void 0, L.current = [], {
|
|
240
243
|
quotes: [],
|
|
241
244
|
links: {},
|
|
242
245
|
pendingAnchors: []
|
|
243
246
|
};
|
|
244
247
|
let e = [...V.data ?? [], ...Object.values(R)], t = de({
|
|
245
|
-
partyA:
|
|
246
|
-
onchainPositions:
|
|
247
|
-
onchainPendingQuotes:
|
|
248
|
-
instantOpens:
|
|
249
|
-
instantCloses:
|
|
248
|
+
partyA: v,
|
|
249
|
+
onchainPositions: E ? Y.quotes : [],
|
|
250
|
+
onchainPendingQuotes: D ? Z.quotes : [],
|
|
251
|
+
instantOpens: O ? e : [],
|
|
252
|
+
instantCloses: k ? H.data ?? [] : [],
|
|
250
253
|
instantOpenVaByTempId: W.byTempId,
|
|
251
254
|
notifications: G,
|
|
252
|
-
retainedAnchors:
|
|
255
|
+
retainedAnchors: L.current
|
|
253
256
|
});
|
|
254
|
-
return
|
|
257
|
+
return I.current = t, L.current = t.pendingAnchors, t;
|
|
255
258
|
}, [
|
|
256
|
-
|
|
257
|
-
|
|
259
|
+
A,
|
|
260
|
+
v,
|
|
258
261
|
Y.quotes,
|
|
259
262
|
Z.quotes,
|
|
260
263
|
V.data,
|
|
@@ -262,38 +265,38 @@ function h(o) {
|
|
|
262
265
|
W.byTempId,
|
|
263
266
|
R,
|
|
264
267
|
G,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]), $ =
|
|
268
|
+
E,
|
|
269
|
+
D,
|
|
270
|
+
O,
|
|
271
|
+
k
|
|
272
|
+
]), $ = p(() => {
|
|
270
273
|
let e = {};
|
|
271
274
|
for (let t of Q.quotes) e[t.key] = t;
|
|
272
275
|
return e;
|
|
273
276
|
}, [Q.quotes]);
|
|
274
|
-
|
|
277
|
+
f(() => {
|
|
275
278
|
let e = Object.keys(R).map(Number).filter((e) => {
|
|
276
279
|
let t = Q.links[e];
|
|
277
280
|
return t !== void 0 && $[t]?.raw.onchain !== void 0;
|
|
278
281
|
});
|
|
279
|
-
e.length > 0 &&
|
|
282
|
+
e.length > 0 && Ae(e);
|
|
280
283
|
}, [
|
|
281
284
|
Q,
|
|
282
285
|
$,
|
|
283
286
|
R,
|
|
284
|
-
|
|
287
|
+
Ae
|
|
285
288
|
]);
|
|
286
|
-
let
|
|
287
|
-
|
|
289
|
+
let He = A && C && U.isLoading || A && C && W.isLoading || A && E && Y.isLoading || A && D && (X.isLoading || Z.isLoading) || A && O && V.isLoading || A && k && H.isLoading, Ue = C && (U.isFetching || W.isFetching) || E && Y.isFetching || D && (X.isFetching || Z.isFetching) || O && V.isFetching || k && H.isFetching, We = Y.error ?? X.error ?? Z.error ?? U.error ?? V.error ?? H.error ?? null, Ge = Y.refetch, Ke = X.refetch, qe = d(() => {
|
|
290
|
+
C && U.refetch(), E && Ge(), D && Ke(), O && V.refetch(), k && H.refetch();
|
|
288
291
|
}, [
|
|
289
|
-
b,
|
|
290
|
-
S,
|
|
291
292
|
C,
|
|
292
|
-
|
|
293
|
-
|
|
293
|
+
E,
|
|
294
|
+
D,
|
|
295
|
+
O,
|
|
296
|
+
k,
|
|
294
297
|
U,
|
|
295
|
-
We,
|
|
296
298
|
Ge,
|
|
299
|
+
Ke,
|
|
297
300
|
V,
|
|
298
301
|
H
|
|
299
302
|
]);
|
|
@@ -301,14 +304,14 @@ function h(o) {
|
|
|
301
304
|
quotes: Q.quotes,
|
|
302
305
|
byKey: $,
|
|
303
306
|
accounts: J,
|
|
304
|
-
isLoading: !!
|
|
305
|
-
isFetching: !!
|
|
306
|
-
socketStatus:
|
|
307
|
-
error:
|
|
308
|
-
refetch:
|
|
307
|
+
isLoading: !!He,
|
|
308
|
+
isFetching: !!Ue,
|
|
309
|
+
socketStatus: b ? K : "closed",
|
|
310
|
+
error: We,
|
|
311
|
+
refetch: qe
|
|
309
312
|
};
|
|
310
313
|
}
|
|
311
314
|
//#endregion
|
|
312
|
-
export {
|
|
315
|
+
export { v as useManagedQuotes };
|
|
313
316
|
|
|
314
317
|
//# sourceMappingURL=use-managed-quotes.js.map
|