@symmio/trading-react 3.2.0 → 3.4.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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -29
- package/dist/instant-layer/use-instant-open-auto.d.ts +3 -3
- package/dist/instant-layer/use-instant-open-auto.js.map +1 -1
- package/dist/instant-layer/use-instant-open-fees.d.ts +7 -0
- package/dist/instant-layer/use-instant-open-fees.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-open-fees.js +1 -0
- package/dist/instant-layer/use-instant-open-fees.js.map +1 -1
- package/dist/instant-layer/use-instant-open-inputs.d.ts +2 -0
- package/dist/instant-layer/use-instant-open-inputs.d.ts.map +1 -1
- package/dist/instant-layer/use-instant-open-inputs.js +2 -0
- package/dist/instant-layer/use-instant-open-inputs.js.map +1 -1
- package/dist/instant-layer/use-prepare-instant-open-params.d.ts +9 -0
- package/dist/instant-layer/use-prepare-instant-open-params.d.ts.map +1 -1
- package/dist/instant-layer/use-prepare-instant-open-params.js +2 -0
- package/dist/instant-layer/use-prepare-instant-open-params.js.map +1 -1
- package/dist/pools/index.d.ts +1 -0
- package/dist/pools/index.d.ts.map +1 -1
- package/dist/pools/index.js +9 -8
- package/dist/pools/use-pool-transactions.d.ts +13 -5
- package/dist/pools/use-pool-transactions.d.ts.map +1 -1
- package/dist/pools/use-pool-transactions.js +1 -1
- package/dist/pools/use-pool-transactions.js.map +1 -1
- package/dist/pools/use-token-price.d.ts +50 -0
- package/dist/pools/use-token-price.d.ts.map +1 -0
- package/dist/pools/use-token-price.js +28 -0
- package/dist/pools/use-token-price.js.map +1 -0
- package/dist/quotes/use-close-quote-group.d.ts +7 -0
- package/dist/quotes/use-close-quote-group.d.ts.map +1 -1
- package/dist/quotes/use-close-quote-group.js +20 -19
- package/dist/quotes/use-close-quote-group.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -304,7 +304,7 @@ export { useErrorMessage, usePartyAUpnl, useSolverBalanceInfo, useSolverOpenInte
|
|
|
304
304
|
* pagination are all server-side, so every parameter change is a new request
|
|
305
305
|
* rather than a re-view of an already-fetched page.
|
|
306
306
|
*/
|
|
307
|
-
export { useAddMarket, useAuthenticateListing, useCancelWithdraw, useClaimHistory, useClaimProfit, useDepositAddress, useListingConfig, useListingMarketConfig, useListingMarketConfigProjection, useListingMarketDetail, useListingMarkets, useListingStatus, usePoolQuotes, usePoolRewardChart, usePoolTotalReward, usePoolTradeHistory, usePoolTransactions, useRefundMarket, useRetryListing, useRetryListingInfo, useSupportsListingService, useUpdateListingMarketConfig, useUserListingMarkets, useUserProfit, useUserRewardChart, useUserTotalReward, useUserTransactions, useWeeklyListingLimit, useWithdrawLp, type AddMarketVariables, type AuthenticateListingVariables, type CancelWithdrawVariables, type ClaimProfitVariables, type RefundMarketVariables, type RetryListingVariables, type UpdateListingMarketConfigVariables, type UseAddMarketParameters, type UseAddMarketReturnType, type UseAuthenticateListingParameters, type UseAuthenticateListingReturnType, type UseCancelWithdrawParameters, type UseCancelWithdrawReturnType, type UseClaimHistoryParameters, type UseClaimHistoryReturnType, type UseClaimProfitParameters, type UseClaimProfitReturnType, type UseDepositAddressParameters, type UseDepositAddressReturnType, type UseListingConfigParameters, type UseListingConfigReturnType, type UseListingMarketConfigParameters, type UseListingMarketConfigProjectionParameters, type UseListingMarketConfigProjectionReturnType, type UseListingMarketConfigReturnType, type UseListingMarketDetailParameters, type UseListingMarketDetailReturnType, type UseListingMarketsParameters, type UseListingMarketsReturnType, type UseListingStatusParameters, type UseListingStatusReturnType, type UsePoolQuotesParameters, type UsePoolQuotesReturnType, type UsePoolRewardChartParameters, type UsePoolRewardChartReturnType, type UsePoolTotalRewardParameters, type UsePoolTotalRewardReturnType, type UsePoolTradeHistoryParameters, type UsePoolTradeHistoryReturnType, type UsePoolTransactionsParameters, type UsePoolTransactionsReturnType, type UseRefundMarketParameters, type UseRefundMarketReturnType, type UseRetryListingInfoParameters, type UseRetryListingInfoReturnType, type UseRetryListingParameters, type UseRetryListingReturnType, type UseSupportsListingServiceParameters, type UseUpdateListingMarketConfigParameters, type UseUpdateListingMarketConfigReturnType, type UseUserListingMarketsParameters, type UseUserListingMarketsReturnType, type UseUserProfitParameters, type UseUserProfitReturnType, type UseUserRewardChartParameters, type UseUserRewardChartReturnType, type UseUserTotalRewardParameters, type UseUserTotalRewardReturnType, type UseUserTransactionsParameters, type UseUserTransactionsReturnType, type UseWeeklyListingLimitParameters, type UseWeeklyListingLimitReturnType, type UseWithdrawLpParameters, type UseWithdrawLpReturnType, type WithdrawLpVariables, } from './pools/index.js';
|
|
307
|
+
export { useAddMarket, useAuthenticateListing, useCancelWithdraw, useClaimHistory, useClaimProfit, useDepositAddress, useListingConfig, useListingMarketConfig, useListingMarketConfigProjection, useListingMarketDetail, useListingMarkets, useListingStatus, usePoolQuotes, usePoolRewardChart, usePoolTotalReward, usePoolTradeHistory, usePoolTransactions, useRefundMarket, useRetryListing, useRetryListingInfo, useSupportsListingService, useTokenPrice, useUpdateListingMarketConfig, useUserListingMarkets, useUserProfit, useUserRewardChart, useUserTotalReward, useUserTransactions, useWeeklyListingLimit, useWithdrawLp, type AddMarketVariables, type AuthenticateListingVariables, type CancelWithdrawVariables, type ClaimProfitVariables, type RefundMarketVariables, type RetryListingVariables, type UpdateListingMarketConfigVariables, type UseAddMarketParameters, type UseAddMarketReturnType, type UseAuthenticateListingParameters, type UseAuthenticateListingReturnType, type UseCancelWithdrawParameters, type UseCancelWithdrawReturnType, type UseClaimHistoryParameters, type UseClaimHistoryReturnType, type UseClaimProfitParameters, type UseClaimProfitReturnType, type UseDepositAddressParameters, type UseDepositAddressReturnType, type UseListingConfigParameters, type UseListingConfigReturnType, type UseListingMarketConfigParameters, type UseListingMarketConfigProjectionParameters, type UseListingMarketConfigProjectionReturnType, type UseListingMarketConfigReturnType, type UseListingMarketDetailParameters, type UseListingMarketDetailReturnType, type UseListingMarketsParameters, type UseListingMarketsReturnType, type UseListingStatusParameters, type UseListingStatusReturnType, type UsePoolQuotesParameters, type UsePoolQuotesReturnType, type UsePoolRewardChartParameters, type UsePoolRewardChartReturnType, type UsePoolTotalRewardParameters, type UsePoolTotalRewardReturnType, type UsePoolTradeHistoryParameters, type UsePoolTradeHistoryReturnType, type UsePoolTransactionsParameters, type UsePoolTransactionsReturnType, type UseRefundMarketParameters, type UseRefundMarketReturnType, type UseRetryListingInfoParameters, type UseRetryListingInfoReturnType, type UseRetryListingParameters, type UseRetryListingReturnType, type UseSupportsListingServiceParameters, type UseTokenPriceParameters, type UseTokenPriceReturnType, type UseUpdateListingMarketConfigParameters, type UseUpdateListingMarketConfigReturnType, type UseUserListingMarketsParameters, type UseUserListingMarketsReturnType, type UseUserProfitParameters, type UseUserProfitReturnType, type UseUserRewardChartParameters, type UseUserRewardChartReturnType, type UseUserTotalRewardParameters, type UseUserTotalRewardReturnType, type UseUserTransactionsParameters, type UseUserTransactionsReturnType, type UseWeeklyListingLimitParameters, type UseWeeklyListingLimitReturnType, type UseWithdrawLpParameters, type UseWithdrawLpReturnType, type WithdrawLpVariables, } from './pools/index.js';
|
|
308
308
|
/**
|
|
309
309
|
* Inventory service
|
|
310
310
|
* -----------------
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,sCAAsC,EACtC,yBAAyB,EACzB,oBAAoB,EACpB,gCAAgC,EAChC,uCAAuC,EACvC,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,kCAAkC,EAClC,mBAAmB,EACnB,2CAA2C,EAC3C,uBAAuB,EACvB,YAAY,EACZ,SAAS,EACT,8BAA8B,EAC9B,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EACxC,KAAK,gDAAgD,EACrD,KAAK,gDAAgD,EACrD,KAAK,2CAA2C,EAChD,KAAK,2CAA2C,EAChD,KAAK,mCAAmC,GACzC,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -223,32 +223,33 @@ import { useRefundMarket as dr } from "./pools/use-refund-market.js";
|
|
|
223
223
|
import { useRetryListing as fr } from "./pools/use-retry-listing.js";
|
|
224
224
|
import { useRetryListingInfo as pr } from "./pools/use-retry-listing-info.js";
|
|
225
225
|
import { useSupportsListingService as mr } from "./pools/use-supports-listing-service.js";
|
|
226
|
-
import {
|
|
227
|
-
import {
|
|
228
|
-
import {
|
|
229
|
-
import {
|
|
230
|
-
import {
|
|
231
|
-
import {
|
|
232
|
-
import {
|
|
233
|
-
import {
|
|
234
|
-
import {
|
|
235
|
-
import {
|
|
236
|
-
import {
|
|
237
|
-
import {
|
|
238
|
-
import {
|
|
239
|
-
import {
|
|
240
|
-
import {
|
|
241
|
-
import {
|
|
242
|
-
import {
|
|
243
|
-
import {
|
|
244
|
-
import {
|
|
245
|
-
import {
|
|
246
|
-
import {
|
|
247
|
-
import {
|
|
248
|
-
import {
|
|
249
|
-
import {
|
|
250
|
-
import {
|
|
251
|
-
import {
|
|
252
|
-
import {
|
|
253
|
-
import {
|
|
254
|
-
|
|
226
|
+
import { useTokenPrice as hr } from "./pools/use-token-price.js";
|
|
227
|
+
import { useUpdateListingMarketConfig as gr } from "./pools/use-update-listing-market-config.js";
|
|
228
|
+
import { useUserListingMarkets as _r } from "./pools/use-user-listing-markets.js";
|
|
229
|
+
import { useUserRewardChart as vr } from "./pools/use-user-reward-chart.js";
|
|
230
|
+
import { useUserTotalReward as yr } from "./pools/use-user-total-reward.js";
|
|
231
|
+
import { useUserTransactions as br } from "./pools/use-user-transactions.js";
|
|
232
|
+
import { useWeeklyListingLimit as xr } from "./pools/use-weekly-listing-limit.js";
|
|
233
|
+
import { useWithdrawLp as Sr } from "./pools/use-withdraw-lp.js";
|
|
234
|
+
import { useInventoryTvl as Cr } from "./inventory/use-inventory-tvl.js";
|
|
235
|
+
import { useInventoryTvlHistory as wr } from "./inventory/use-inventory-tvl-history.js";
|
|
236
|
+
import { useApproveOperationalFee as Tr } from "./gasless/use-approve-operational-fee.js";
|
|
237
|
+
import { useGaslessBatchFeeQuote as Er } from "./gasless/use-gasless-batch-fee-quote.js";
|
|
238
|
+
import { useGaslessDepositPolicy as Dr } from "./gasless/use-gasless-deposit-policy.js";
|
|
239
|
+
import { useGaslessFeeQuote as Or } from "./gasless/use-gasless-fee-quote.js";
|
|
240
|
+
import { useGaslessRequest as kr } from "./gasless/use-gasless-request.js";
|
|
241
|
+
import { useGaslessRequestTransactions as Ar } from "./gasless/use-gasless-request-transactions.js";
|
|
242
|
+
import { useGaslessWalletAddress as jr } from "./gasless/use-gasless-wallet-address.js";
|
|
243
|
+
import { useGaslessWalletCreationFee as Mr } from "./gasless/use-gasless-wallet-creation-fee.js";
|
|
244
|
+
import { useGaslessWalletExecute as Nr } from "./gasless/use-gasless-wallet-execute.js";
|
|
245
|
+
import { useGaslessWalletExecuteSelectors as Pr } from "./gasless/use-gasless-wallet-execute-selectors.js";
|
|
246
|
+
import { useGaslessWalletNonce as Fr } from "./gasless/use-gasless-wallet-nonce.js";
|
|
247
|
+
import { useOperationalFeeAllowance as Ir } from "./gasless/use-operational-fee-allowance.js";
|
|
248
|
+
import { useRelayGaslessBatch as Lr } from "./gasless/use-relay-gasless-batch.js";
|
|
249
|
+
import { useRelayInstantOperations as Rr } from "./gasless/use-relay-instant-operations.js";
|
|
250
|
+
import { useResubmitGaslessRequest as zr } from "./gasless/use-resubmit-gasless-request.js";
|
|
251
|
+
import { useSettleGaslessDepositExistingAccount as Br } from "./gasless/use-settle-gasless-deposit-existing-account.js";
|
|
252
|
+
import { useSettleGaslessDepositNewAccount as Vr } from "./gasless/use-settle-gasless-deposit-new-account.js";
|
|
253
|
+
import { useSupportsGaslessService as Hr } from "./gasless/use-supports-gasless-service.js";
|
|
254
|
+
import { ADD_MARGIN_TO_NEXT_VA_SELECTOR as Ur, DEFAULT_TPSL_SLIPPAGE_LOWCAPS as Wr, GASLESS_RELAYABLE_FUNCTIONS as Gr, GASLESS_RELAYABLE_SELECTORS as Kr, GASLESS_SESSION_KEY_SELECTORS as qr, GASLESS_SESSION_KEY_WITHDRAW_SELECTORS as Jr, GASLESS_TERMINAL_STATUSES as Yr, GROUP_TPSL_SIDES as Xr, GaslessRequestStatus as Zr, INSTANT_TRADE_REQUIRED_SELECTORS as Qr, LEGACY_INSTANT_TRADE_REQUIRED_SELECTORS as $r, NotificationType as ei, OrderType as ti, PositionType as ni, QuoteStatus as ri, REQUEST_TO_CLOSE_POSITION_SELECTOR as ii, SEND_QUOTE_SELECTOR as ai, SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR as oi, SubAccountIsolationType as si, SymmApiError as ci, SymmError as li, VIRTUAL_ACCOUNT_ISOLATION_TYPE as ui, ZERO_LEG as di, buildConditionalOrderLeg as fi, buildConditionalOrderMessage as pi, buildTpSlDeleteMessage as mi, calculateAvailableForOrder as hi, calculateAvailableInstantOpenMargin as gi, calculateClosePrice as _i, calculatePriceImpact as vi, calculateQuoteLeverage as yi, calculateQuotePnl as bi, calculateSolverCloseFee as xi, calculateTradeParams as Si, childNotional as Ci, clampClosePrecision as wi, classifyGaslessFailure as Ti, decimalPriceToWei as Ei, decodeGaslessOperationFailure as Di, deleteQuoteTpSl as Oi, deleteQuoteTpSlMutationOptions as ki, estimateGroupTpSlReturn as Ai, generateTpSlSalt as ji, getGaslessUnconfirmedSubmit as Mi, getPartyAOpenPositionsQueryKey as Ni, getPartyAOpenPositionsQueryOptions as Pi, getSessionKeySelectors as Fi, isGaslessIdempotencyConflictError as Ii, isGaslessRequestTerminal as Li, isolationTypeForSide as Ri, parseGaslessErrorDetail as zi, parseTpSlFrame as Bi, planGroupTpSl as Vi, planGroupTpSlDelete as Hi, priceSlippageCalculation as Ui, sharePercent as Wi, signTpSlRequest as Gi, summarizeQuoteGroupTpSl as Ki, supportsEstimatedPrice as qi, toGroupTpSlChildren as Ji, toGroupTpSlOrders as Yi, toSignableTpSlMessage as Xi, validateInstantCloseAgainstMarket as Zi, validateInstantOpenAgainstMarket as Qi, validateTpSl as $i, watchTpSlNotifications as ea } from "@symmio/trading-core";
|
|
255
|
+
export { Ur as ADD_MARGIN_TO_NEXT_VA_SELECTOR, zt as DEFAULT_NOTIONAL_CAP_POLLING_MS, Wr as DEFAULT_TPSL_SLIPPAGE_LOWCAPS, Gr as GASLESS_RELAYABLE_FUNCTIONS, Kr as GASLESS_RELAYABLE_SELECTORS, qr as GASLESS_SESSION_KEY_SELECTORS, Jr as GASLESS_SESSION_KEY_WITHDRAW_SELECTORS, Yr as GASLESS_TERMINAL_STATUSES, Xr as GROUP_TPSL_SIDES, Zr as GaslessRequestStatus, Qr as INSTANT_TRADE_REQUIRED_SELECTORS, $r as LEGACY_INSTANT_TRADE_REQUIRED_SELECTORS, ei as NotificationType, ti as OrderType, ni as PositionType, ri as QuoteStatus, ii as REQUEST_TO_CLOSE_POSITION_SELECTOR, ai as SEND_QUOTE_SELECTOR, oi as SEND_QUOTE_WITH_AFFILIATE_AND_DATA_SELECTOR, si as SubAccountIsolationType, ci as SymmApiError, li as SymmError, t as SymmioProvider, i as SymmioRequestError, p as TransactionRevertedError, ui as VIRTUAL_ACCOUNT_ISOLATION_TYPE, di as ZERO_LEG, fi as buildConditionalOrderLeg, pi as buildConditionalOrderMessage, mi as buildTpSlDeleteMessage, hi as calculateAvailableForOrder, gi as calculateAvailableInstantOpenMargin, _i as calculateClosePrice, vi as calculatePriceImpact, yi as calculateQuoteLeverage, bi as calculateQuotePnl, xi as calculateSolverCloseFee, Si as calculateTradeParams, Ci as childNotional, wi as clampClosePrecision, Ti as classifyGaslessFailure, e as createSessionKeyWalletClientResolver, Ei as decimalPriceToWei, Di as decodeGaslessOperationFailure, Oi as deleteQuoteTpSl, ki as deleteQuoteTpSlMutationOptions, Ai as estimateGroupTpSlReturn, ji as generateTpSlSalt, Mi as getGaslessUnconfirmedSubmit, Ni as getPartyAOpenPositionsQueryKey, Pi as getPartyAOpenPositionsQueryOptions, Fi as getSessionKeySelectors, bn as invalidateTpSlReads, Ii as isGaslessIdempotencyConflictError, Li as isGaslessRequestTerminal, Ri as isolationTypeForSide, a as normalizeSymmError, zi as parseGaslessErrorDetail, Bi as parseTpSlFrame, Vi as planGroupTpSl, Hi as planGroupTpSlDelete, h as predicateMatch, Ui as priceSlippageCalculation, Wi as sharePercent, Gi as signTpSlRequest, Ki as summarizeQuoteGroupTpSl, qi as supportsEstimatedPrice, Ji as toGroupTpSlChildren, Yi as toGroupTpSlOrders, be as toQuoteTpSl, Xi as toSignableTpSlMessage, d as useAccountBalanceInfo, f as useAccountBalanceOf, Qe as useAccountLiquidationPrice, bt as useAccountMarginRisk, et as useAccountUpnl, Z as useActiveDelegations, g as useAddMargin, qn as useAddMarket, _ as useAffiliateState, v as useAllocate, q as useApproveCollateral, Tr as useApproveOperationalFee, Q as useAreDelegationsActive, Jn as useAuthenticateListing, Pt as useAvailableInstantOpenMargin, Ft as useBalanceHistory, Nn as useBinanceCandleSource, Yt as useBinanceHealth, Ln as useBinanceOrderbookSource, Xt as useBinancePremiumIndex, Zt as useBinancePrices, Qt as useBinanceSymbolsInfo, y as useCancelRegistration, Yn as useCancelWithdraw, Pn as useCandleStream, Fn as useCandles, Xn as useClaimHistory, Zn as useClaimProfit, tt as useCloseQuoteGroup, J as useCollateralAllowance, Y as useCollateralBalance, o as useConnectWallet, nt as useCoolDownsOfMA, b as useCreateSubAccounts, x as useDeallocate, S as useDeallocateAndInitiateWithdraw, cn as useDeallocateUpnlSig, $ as useDelegationExpiry, xn as useDeleteQuoteGroupTpSl, Sn as useDeleteQuoteTpSl, C as useDeleteSubAccount, w as useDeposit, Qn as useDepositAddress, T as useDepositAndAllocate, It as useDepositHistory, s as useDisconnectWallet, E as useEditAccountName, St as useEnigmaPriceByMarketId, xt as useEnigmaPriceByName, $t as useEnigmaPriceServiceHealth, en as useEnigmaPriceServiceMetadata, tn as useEnigmaPriceServicePricesByAddresses, nn as useEnigmaPriceServicePricesByNames, rn as useEnigmaPriceServiceSymbolsInfo, an as useEnigmaPrices, Vn as useErrorMessage, ge as useEstimatedPrice, se as useFeeForUser, ee as useFinalizeRevokeDelegation, Fe as useFinalizeWithdrawRequest, rt as useForceCancelCloseRequest, it as useForceCancelQuote, at as useForceClose, ut as useForceCloseEligibility, lt as useForceCloseParams, ln as useForceClosePriceSig, Ke as useFundingFeesOfPartyB, Ut as useFundingInfo, Er as useGaslessBatchFeeQuote, Dr as useGaslessDepositPolicy, Or as useGaslessFeeQuote, kr as useGaslessRequest, Ar as useGaslessRequestTransactions, jr as useGaslessWalletAddress, Mr as useGaslessWalletCreationFee, Nr as useGaslessWalletExecute, Pr as useGaslessWalletExecuteSelectors, Fr as useGaslessWalletNonce, D as useGeneratedAccountManagerAddress, te as useGrantDelegation, dt as useGroupedQuotes, ne as useInitiateRevokeDelegation, Ie as useInitiateWithdraw, re as useInstantClose, ie as useInstantCloseAuto, ae as useInstantCloseBulk, oe as useInstantCloseBulkAuto, fe as useInstantCloseFees, pe as useInstantCloses, me as useInstantOpen, he as useInstantOpenAuto, ve as useInstantOpenFees, ye as useInstantOpenQuoteId, we as useInstantOpenWithTpSl, Te as useInstantOpens, Ee as useInstantTradeRequiredSelectors, Cr as useInventoryTvl, wr as useInventoryTvlHistory, De as useIsDelegationActive, Le as useLastWithdrawRequestId, Oe as useLimitCloseAuto, ke as useLimitOpenAuto, ft as useLimitOrders, $n as useListingConfig, er as useListingMarketConfig, rr as useListingMarketConfigProjection, tr as useListingMarketDetail, ir as useListingMarkets, ar as useListingStatus, zn as useLiveOrderbook, _e as useLockedParams, $e as useManagedQuotes, on as useMarkPrices, qt as useMarketInfo, ce as useMarkets, un as useMuonPartyAOverview, dn as useMuonPrice, fn as useMuonPriceRange, pn as useMuonSettleUpnl, mn as useMuonUpnl, hn as useMuonUpnlA, gn as useMuonUpnlAWithSymbolPrice, _n as useMuonUpnlB, vn as useMuonUpnlWithSymbolPrice, u as useNotifications, Vt as useNotionalCapAll, Bt as useNotionalCapBySymbolId, qe as useOnchainContractMarkets, Ht as useOpenInterestBySymbolId, Ir as useOperationalFeeAllowance, Xe as useOptimisticQuotesStore, Bn as useOrderbook, Rn as useOrderbookStream, Ze as usePartyAOpenPositions, pt as usePartyAPendingQuotes, Hn as usePartyAUpnl, Ae as usePendingRevocation, Re as usePendingWithdrawRequests, or as usePoolQuotes, sr as usePoolRewardChart, cr as usePoolTotalReward, lr as usePoolTradeHistory, ur as usePoolTransactions, O as usePredictedNextVirtualAccount, je as usePrepareInstantOpenParams, kt as usePriceByMarketId, ue as usePriceByName, le as usePrices, mt as useQuote, ht as useQuoteEventsByType, _t as useQuoteFunding, vt as useQuoteGroupFunding, yt as useQuoteGroupFundingHistory, Ct as useQuoteGroupMarginRisk, Cn as useQuoteGroupTpSl, wn as useQuoteGroupTpSlEditor, wt as useQuoteHistory, Et as useQuotePendingFunding, Dt as useQuotePlatformFee, Ot as useQuotePriceHistory, En as useQuoteTpSl, At as useQuoteUpnlAndPnl, gt as useQuotesFunding, Tt as useQuotesPendingFunding, dr as useRefundMarket, Lr as useRelayGaslessBatch, Rr as useRelayInstantOperations, k as useRemoveMargin, ze as useRequestCancelWithdraw, jt as useRequestToCancelCloseRequest, Mt as useRequestToCancelQuote, A as useRequestToRegisterAffiliate, zr as useResubmitGaslessRequest, fr as useRetryListing, pr as useRetryListingInfo, Wt as useRevenueRecords, Me as useRevocationCooldown, sn as useSearchNotifications, Dn as useSearchTpSlOrders, yn as useSendQuoteUpnlSig, Ne as useSessionKeySelectors, On as useSetQuoteGroupTpSl, kn as useSetQuoteTpSl, Br as useSettleGaslessDepositExistingAccount, Vr as useSettleGaslessDepositNewAccount, j as useSimulateAddMargin, M as useSimulateAllocate, X as useSimulateApproveCollateral, N as useSimulateCreateSubAccounts, P as useSimulateDeallocate, F as useSimulateDeleteSubAccount, I as useSimulateDeposit, L as useSimulateDepositAndAllocate, R as useSimulateEditAccountName, Be as useSimulateFinalizeWithdrawRequest, Pe as useSimulateGrantDelegation, Ve as useSimulateInitiateWithdraw, z as useSimulateRemoveMargin, He as useSimulateRequestCancelWithdraw, Un as useSolverBalanceInfo, ot as useSolverCapabilities, Je as useSolverErrorCodes, Ye as useSolverErrorMessage, de as useSolverInfo, Wn as useSolverOpenInterest, Gn as useSolverPriceRange, Kn as useSolverReadiness, Jt as useSolverRevenue, B as useSubAccount, V as useSubAccountVirtualNonce, H as useSubAccountsCountOfUser, Nt as useSubgraphQuery, Hr as useSupportsGaslessService, st as useSupportsGroupClose, ct as useSupportsLimitOrder, mr as useSupportsListingService, c as useSwitchToSymmioChain, Gt as useSymbols, n as useSymmioChainId, r as useSymmioConfig, hr as useTokenPrice, An as useTpSlConfig, xe as useTpSlRecord, Se as useTpSlRecords, jn as useTpSlSigningSpec, Ce as useTpSlStore, Mn as useTpSlSupported, Kt as useTradeVolume, In as useTradingViewDatafeed, m as useTransactionsStore, Rt as useTransferHistory, gr as useUpdateListingMarketConfig, _r as useUserListingMarkets, nr as useUserProfit, vr as useUserRewardChart, U as useUserSubAccounts, W as useUserSubAccountsAddresses, yr as useUserTotalReward, br as useUserTransactions, G as useVirtualAccount, K as useVirtualAccountsAddressesOfSubAccount, l as useWalletAccount, Tn as useWatchTpSlNotifications, xr as useWeeklyListingLimit, Ue as useWithdraw, Lt as useWithdrawHistory, Sr as useWithdrawLp, We as useWithdrawRequest, Ge as useWithdrawableTime, Zi as validateInstantCloseAgainstMarket, Qi as validateInstantOpenAgainstMarket, $i as validateTpSl, ea as watchTpSlNotifications };
|
|
@@ -26,9 +26,9 @@ export type UseInstantOpenAutoReturnType = UseMutationResult<InstantOpenReturnTy
|
|
|
26
26
|
* ```tsx
|
|
27
27
|
* const { mutateAsync } = useInstantOpenAuto();
|
|
28
28
|
* await mutateAsync({
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* subAccountAddress, from: sessionKeyAddress,
|
|
30
|
+
* market: { id: 1 }, positionType: PositionType.LONG,
|
|
31
|
+
* fund: { mode: "full-balance", balance: "100" }, leverage: 5, slippage: 1,
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-instant-open-auto.js","names":[],"sources":["../../src/instant-layer/use-instant-open-auto.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantOpensQueryKey,\n instantOpenAutoMutationOptions,\n type ConfigParameter,\n type InstantOpenReturnType,\n type PrepareInstantOpenParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { invalidateAccountBalances, predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useInstantOpenAuto}.\n */\nexport type UseInstantOpenAutoParameters = ConfigParameter;\n\n/** Return type of {@link useInstantOpenAuto}. */\nexport type UseInstantOpenAutoReturnType = UseMutationResult<\n InstantOpenReturnType,\n SymmioRequestError,\n PrepareInstantOpenParameters\n>;\n\n/**\n * Open a lowcap instant position via the wizard `instantOpenAuto` action.\n *\n * Friendly default: accepts the minimal trade intent and lets the SDK fetch\n * market metadata, mark price, locked params, and fee rates. Pre-fill any\n * optional field on the variables (e.g. cache-hot `markPrice`) to skip its\n * fetch. For full control — inspect / mutate resolved params between fetch and\n * submit — use {@link useInstantOpen} after calling\n * `prepareInstantOpenParams(config, …)` directly.\n *\n * Funding is a one-of on the variables: a typed `initialMargin`, or\n * `fund: { mode: \"full-balance\", balance }` (lowcap only) to deploy the whole\n * balance into the position's VA with the quantity sized down to fit it —\n * see `FullBalanceFunding` in `@symmio/trading-core`.\n *\n * @example\n * ```tsx\n * const { mutateAsync } = useInstantOpenAuto();\n * await mutateAsync({\n *
|
|
1
|
+
{"version":3,"file":"use-instant-open-auto.js","names":[],"sources":["../../src/instant-layer/use-instant-open-auto.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantOpensQueryKey,\n instantOpenAutoMutationOptions,\n type ConfigParameter,\n type InstantOpenReturnType,\n type PrepareInstantOpenParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { invalidateAccountBalances, predicateMatch } from \"../utils\";\n\n/**\n * Parameters for {@link useInstantOpenAuto}.\n */\nexport type UseInstantOpenAutoParameters = ConfigParameter;\n\n/** Return type of {@link useInstantOpenAuto}. */\nexport type UseInstantOpenAutoReturnType = UseMutationResult<\n InstantOpenReturnType,\n SymmioRequestError,\n PrepareInstantOpenParameters\n>;\n\n/**\n * Open a lowcap instant position via the wizard `instantOpenAuto` action.\n *\n * Friendly default: accepts the minimal trade intent and lets the SDK fetch\n * market metadata, mark price, locked params, and fee rates. Pre-fill any\n * optional field on the variables (e.g. cache-hot `markPrice`) to skip its\n * fetch. For full control — inspect / mutate resolved params between fetch and\n * submit — use {@link useInstantOpen} after calling\n * `prepareInstantOpenParams(config, …)` directly.\n *\n * Funding is a one-of on the variables: a typed `initialMargin`, or\n * `fund: { mode: \"full-balance\", balance }` (lowcap only) to deploy the whole\n * balance into the position's VA with the quantity sized down to fit it —\n * see `FullBalanceFunding` in `@symmio/trading-core`.\n *\n * @example\n * ```tsx\n * const { mutateAsync } = useInstantOpenAuto();\n * await mutateAsync({\n * subAccountAddress, from: sessionKeyAddress,\n * market: { id: 1 }, positionType: PositionType.LONG,\n * fund: { mode: \"full-balance\", balance: \"100\" }, leverage: 5, slippage: 1,\n * });\n * ```\n */\nexport function useInstantOpenAuto(parameters: UseInstantOpenAutoParameters = {}): UseInstantOpenAutoReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const base = instantOpenAutoMutationOptions(config);\n\n return useMutation<InstantOpenReturnType, SymmioRequestError, PrepareInstantOpenParameters>({\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n try {\n return await base.mutationFn({ ...variables, chainId: variables.chainId ?? chainId });\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n onSuccess: (_result, variables) => {\n /**\n * A freshly submitted instant-open exists on the hedger but not in any\n * cached read yet. Invalidate the instant-opens feed so it refetches and\n * the optimistic row appears immediately — without waiting for a poll.\n */\n const configKey = config.getChainConfigKey(variables.chainId ?? chainId);\n void queryClient.invalidateQueries({ predicate: predicateMatch(getInstantOpensQueryKey, { configKey }) });\n /** The open locks margin and charges a fee — every balance read on this chain is now suspect. */\n invalidateAccountBalances(queryClient, { configKey });\n },\n });\n}\n"],"mappings":";;;;;;;;;AAqDA,SAAgB,EAAmB,IAA2C,CAAC,GAAiC;CAC9G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAO,EAA+B,CAAM;CAElD,OAAO,EAAqF;EAC1F,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI;IACF,OAAO,MAAM,EAAK,WAAW;KAAE,GAAG;KAAW,SAAS,EAAU,WAAW;IAAQ,CAAC;GACtF,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;EACA,YAAY,GAAS,MAAc;GAMjC,IAAM,IAAY,EAAO,kBAAkB,EAAU,WAAW,CAAO;GAGvE,AAFA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAyB,EAAE,aAAU,CAAC,EAAE,CAAC,GAExG,EAA0B,GAAa,EAAE,aAAU,CAAC;EACtD;CACF,CAAC;AACH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConfigParameter, GetInstantOpenFeesOptions, GetInstantOpenFeesReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { UseEstimatedPriceReturnType } from '../estimated-price/use-estimated-price.js';
|
|
4
5
|
/**
|
|
5
6
|
* Parameters for {@link useInstantOpenFees}: the trade intent
|
|
6
7
|
* (`subAccountAddress`, `market`, `positionType`, `initialMargin` **or**
|
|
@@ -10,6 +11,12 @@ import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
|
10
11
|
export type UseInstantOpenFeesParameters = GetInstantOpenFeesOptions & ConfigParameter;
|
|
11
12
|
/** Return type of {@link useInstantOpenFees}. */
|
|
12
13
|
export type UseInstantOpenFeesReturnType = UseQueryResult<GetInstantOpenFeesReturnType, SymmioRequestError> & {
|
|
14
|
+
/**
|
|
15
|
+
* Refetch the SDK-managed estimate on the frontend's schedule. Resolves when
|
|
16
|
+
* the estimate request finishes; use isReady to await fee calculation. A supplied
|
|
17
|
+
* estimatedOpenPrice still takes precedence over the fetched value.
|
|
18
|
+
*/
|
|
19
|
+
refetchEstimatedPrice: UseEstimatedPriceReturnType["refetch"];
|
|
13
20
|
/** Synchronous input error. Display before query.error; dependent queries stay disabled. */
|
|
14
21
|
validationError: SymmioRequestError | undefined;
|
|
15
22
|
/** True when all inputs and the current fee preview have settled successfully. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-instant-open-fees.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-instant-open-fees.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-instant-open-fees.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-instant-open-fees.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAG1F;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,GAAG,eAAe,CAAC;AAEvF,iDAAiD;AACjD,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,GAAG;IAC5G;;;;OAIG;IACH,qBAAqB,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAC9D,4FAA4F;IAC5F,eAAe,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAChD,kFAAkF;IAClF,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,4BAA4B,GAAG,4BAA4B,CA4BzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-instant-open-fees.js","names":[],"sources":["../../src/instant-layer/use-instant-open-fees.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantOpenFeesQueryOptions,\n type ConfigParameter,\n type GetInstantOpenFeesOptions,\n type GetInstantOpenFeesReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useInstantOpenInputs } from \"./use-instant-open-inputs\";\n\n/**\n * Parameters for {@link useInstantOpenFees}: the trade intent\n * (`subAccountAddress`, `market`, `positionType`, `initialMargin` **or**\n * `fund` for a full-balance preview, `leverage`, optional `slippage` /\n * pre-fetched data, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UseInstantOpenFeesParameters = GetInstantOpenFeesOptions & ConfigParameter;\n\n/** Return type of {@link useInstantOpenFees}. */\nexport type UseInstantOpenFeesReturnType = UseQueryResult<GetInstantOpenFeesReturnType, SymmioRequestError> & {\n /** Synchronous input error. Display before query.error; dependent queries stay disabled. */\n validationError: SymmioRequestError | undefined;\n /** True when all inputs and the current fee preview have settled successfully. */\n isReady: boolean;\n};\n\n/**\n * Preview every fee a new instant-open quote pays — separated by leg plus the\n * total — before the user submits. Read-only; nothing is signed.\n *\n * Wraps `getInstantOpenFees`, but **pre-fetches every input through its own\n * cached queries and passes them in as prefills**, so the query function is\n * pure math with zero network hops: market metadata (`useMarkets`) and\n * on-chain fee rates (`useFeeForUser`) and solver info are cached for minutes.\n * The mark price rides the shared price stream; the lowcap dry-run estimate\n * uses `useEstimatedPrice` (debounced internally). Previous data is\n * kept while inputs move, so a mark-price tick updates the numbers in place —\n * it never resets the result to a loading state.\n *\n * The result is a `kind`-discriminated union of the **open-side** legs: both\n * kinds carry `platformOpenFee`, the sized `quantity`, and `totalFee`; an\n * `\"enigma\"` (lowcap) result adds `openSolverFee`, `staticSolverFeeOpen`, and\n * `expectedSettlementLoss`. Close fees are charged at close from the position\n * and are deliberately not part of this preview — price them in the close flow\n * with `useInstantCloseFees`, where the notional and holding time are real.\n * `totalFee` includes the settlement provision by default; pass\n * `includeSettlementInTotalFee: false` to sum the fee legs only.\n *\n * With `fund` (`FullBalanceFunding`) instead of `initialMargin`, the\n * preview runs the same probe-and-rescale sizing as the open, so the legs and\n * `quantity` equal what a full-balance open will actually charge and submit —\n * the extra inputs it needs (locked-param percents, market quote constraints)\n * are prefetched here through the same cached queries.\n *\n * With `initialMargin` and `availableBalance`, core automatically uses full-balance\n * sizing when required funding exceeds the raw balance. `data.fundingMode` reports\n * the effective choice; pass the same inputs to preparation and submission.\n * Display `validationError ?? error` and check `isReady` before using the fees\n * for the current input. Input errors are synchronous, including offline.\n * A disabled hook or empty input remains idle without input validation.\n *\n * @example\n * ```tsx\n * const { data: fees } = useInstantOpenFees({\n * subAccountAddress,\n * market: { id: symbolId },\n * positionType,\n * initialMargin,\n * leverage,\n * });\n * // fees?.totalFee; fees?.kind === \"enigma\" && fees.expectedSettlementLoss\n * ```\n */\nexport function useInstantOpenFees(parameters: UseInstantOpenFeesParameters): UseInstantOpenFeesReturnType {\n const inputs = useInstantOpenInputs(parameters, \"fees\", parameters.query?.enabled !== false);\n const options = getInstantOpenFeesQueryOptions(inputs.config, {\n ...parameters,\n ...inputs.prefills,\n query: {\n ...parameters.query,\n enabled: inputs.ready,\n placeholderData: (previous) => (inputs.validationError === undefined ? previous : undefined),\n },\n });\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseQueryResult<GetInstantOpenFeesReturnType, SymmioRequestError>;\n\n return {\n ...query,\n validationError: inputs.validationError,\n isReady: inputs.ready && query.isSuccess && !query.isFetching && !query.isPlaceholderData,\n };\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"use-instant-open-fees.js","names":[],"sources":["../../src/instant-layer/use-instant-open-fees.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantOpenFeesQueryOptions,\n type ConfigParameter,\n type GetInstantOpenFeesOptions,\n type GetInstantOpenFeesReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport type { UseEstimatedPriceReturnType } from \"../estimated-price/use-estimated-price\";\nimport { useInstantOpenInputs } from \"./use-instant-open-inputs\";\n\n/**\n * Parameters for {@link useInstantOpenFees}: the trade intent\n * (`subAccountAddress`, `market`, `positionType`, `initialMargin` **or**\n * `fund` for a full-balance preview, `leverage`, optional `slippage` /\n * pre-fetched data, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UseInstantOpenFeesParameters = GetInstantOpenFeesOptions & ConfigParameter;\n\n/** Return type of {@link useInstantOpenFees}. */\nexport type UseInstantOpenFeesReturnType = UseQueryResult<GetInstantOpenFeesReturnType, SymmioRequestError> & {\n /**\n * Refetch the SDK-managed estimate on the frontend's schedule. Resolves when\n * the estimate request finishes; use isReady to await fee calculation. A supplied\n * estimatedOpenPrice still takes precedence over the fetched value.\n */\n refetchEstimatedPrice: UseEstimatedPriceReturnType[\"refetch\"];\n /** Synchronous input error. Display before query.error; dependent queries stay disabled. */\n validationError: SymmioRequestError | undefined;\n /** True when all inputs and the current fee preview have settled successfully. */\n isReady: boolean;\n};\n\n/**\n * Preview every fee a new instant-open quote pays — separated by leg plus the\n * total — before the user submits. Read-only; nothing is signed.\n *\n * Wraps `getInstantOpenFees`, but **pre-fetches every input through its own\n * cached queries and passes them in as prefills**, so the query function is\n * pure math with zero network hops: market metadata (`useMarkets`) and\n * on-chain fee rates (`useFeeForUser`) and solver info are cached for minutes.\n * The mark price rides the shared price stream; the lowcap dry-run estimate\n * uses `useEstimatedPrice` (debounced internally). Previous data is\n * kept while inputs move, so a mark-price tick updates the numbers in place —\n * it never resets the result to a loading state.\n *\n * The result is a `kind`-discriminated union of the **open-side** legs: both\n * kinds carry `platformOpenFee`, the sized `quantity`, and `totalFee`; an\n * `\"enigma\"` (lowcap) result adds `openSolverFee`, `staticSolverFeeOpen`, and\n * `expectedSettlementLoss`. Close fees are charged at close from the position\n * and are deliberately not part of this preview — price them in the close flow\n * with `useInstantCloseFees`, where the notional and holding time are real.\n * `totalFee` includes the settlement provision by default; pass\n * `includeSettlementInTotalFee: false` to sum the fee legs only.\n *\n * With `fund` (`FullBalanceFunding`) instead of `initialMargin`, the\n * preview runs the same probe-and-rescale sizing as the open, so the legs and\n * `quantity` equal what a full-balance open will actually charge and submit —\n * the extra inputs it needs (locked-param percents, market quote constraints)\n * are prefetched here through the same cached queries.\n *\n * With `initialMargin` and `availableBalance`, core automatically uses full-balance\n * sizing when required funding exceeds the raw balance. `data.fundingMode` reports\n * the effective choice; pass the same inputs to preparation and submission.\n * Display `validationError ?? error` and check `isReady` before using the fees\n * for the current input. Input errors are synchronous, including offline.\n * A disabled hook or empty input remains idle without input validation.\n *\n * @example\n * ```tsx\n * const { data: fees } = useInstantOpenFees({\n * subAccountAddress,\n * market: { id: symbolId },\n * positionType,\n * initialMargin,\n * leverage,\n * });\n * // fees?.totalFee; fees?.kind === \"enigma\" && fees.expectedSettlementLoss\n * ```\n */\nexport function useInstantOpenFees(parameters: UseInstantOpenFeesParameters): UseInstantOpenFeesReturnType {\n const inputs = useInstantOpenInputs(parameters, \"fees\", parameters.query?.enabled !== false);\n const options = getInstantOpenFeesQueryOptions(inputs.config, {\n ...parameters,\n ...inputs.prefills,\n query: {\n ...parameters.query,\n enabled: inputs.ready,\n placeholderData: (previous) => (inputs.validationError === undefined ? previous : undefined),\n },\n });\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseQueryResult<GetInstantOpenFeesReturnType, SymmioRequestError>;\n\n return {\n ...query,\n refetchEstimatedPrice: inputs.refetchEstimatedPrice,\n validationError: inputs.validationError,\n isReady: inputs.ready && query.isSuccess && !query.isFetching && !query.isPlaceholderData,\n };\n}\n"],"mappings":";;;;;;AAmFA,SAAgB,EAAmB,GAAwE;CACzG,IAAM,IAAS,EAAqB,GAAY,QAAQ,EAAW,OAAO,YAAY,EAAK,GACrF,IAAU,EAA+B,EAAO,QAAQ;EAC5D,GAAG;EACH,GAAG,EAAO;EACV,OAAO;GACL,GAAG,EAAW;GACd,SAAS,EAAO;GAChB,kBAAkB,MAAc,EAAO,oBAAoB,KAAA,IAAY,IAAW,KAAA;EACpF;CACF,CAAC,GACK,IAAQ,EAAS;EACrB,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;CAED,OAAO;EACL,GAAG;EACH,uBAAuB,EAAO;EAC9B,iBAAiB,EAAO;EACxB,SAAS,EAAO,SAAS,EAAM,aAAa,CAAC,EAAM,cAAc,CAAC,EAAM;CAC1E;AACF"}
|
|
@@ -4,6 +4,8 @@ export declare function useInstantOpenInputs(parameters: GetInstantOpenFeesParam
|
|
|
4
4
|
config: import('@symmio/trading-core').Config;
|
|
5
5
|
validationError: import('../index.js').SymmioRequestError | undefined;
|
|
6
6
|
ready: boolean;
|
|
7
|
+
refetchEstimatedPrice: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<import('@symmio/trading-core').GetEstimatedPriceReturnType, import('../index.js').SymmioRequestError>>;
|
|
8
|
+
estimatedOpenPriceTimestamp: number | undefined;
|
|
7
9
|
prefills: {
|
|
8
10
|
chainId: number;
|
|
9
11
|
market: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-instant-open-inputs.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-instant-open-inputs.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAY9B,8FAA8F;AAC9F,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,4BAA4B,GAAG,eAAe,EAC1D,OAAO,EAAE,SAAS,GAAG,MAAM,EAC3B,YAAY,UAAO
|
|
1
|
+
{"version":3,"file":"use-instant-open-inputs.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-instant-open-inputs.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAY9B,8FAA8F;AAC9F,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,4BAA4B,GAAG,eAAe,EAC1D,OAAO,EAAE,SAAS,GAAG,MAAM,EAC3B,YAAY,UAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+NpB"}
|
|
@@ -99,6 +99,8 @@ function o(o, s, c = !0) {
|
|
|
99
99
|
config: l,
|
|
100
100
|
validationError: w,
|
|
101
101
|
ready: T && D !== void 0 && O !== void 0 && k !== void 0 && J !== void 0 && Y !== void 0 && de && (!C || A !== void 0 && j !== void 0) && H && ce && fe && Q,
|
|
102
|
+
refetchEstimatedPrice: Z.refetch,
|
|
103
|
+
estimatedOpenPriceTimestamp: Z.isPlaceholderData ? void 0 : Z.dataUpdatedAt || void 0,
|
|
102
104
|
prefills: {
|
|
103
105
|
chainId: d,
|
|
104
106
|
market: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-instant-open-inputs.js","names":[],"sources":["../../src/instant-layer/use-instant-open-inputs.ts"],"sourcesContent":["\"use client\";\n\nimport {\n calculateTradeParams,\n PositionType,\n type ConfigParameter,\n type GetInstantOpenFeesParameters,\n} from \"@symmio/trading-core\";\nimport { useMemo } from \"react\";\nimport { useEstimatedPrice } from \"../estimated-price/use-estimated-price\";\nimport { useFeeForUser } from \"../fees/use-fee-for-user\";\nimport { useLockedParams } from \"../locked-params/use-locked-params\";\nimport { useMarkets } from \"../markets/use-markets\";\nimport { usePriceByName } from \"../price-service/use-price-by-name\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { useSolverInfo } from \"../solvers/use-solver-info\";\nimport { getInstantOpenFundingError } from \"./get-instant-open-funding-error\";\n\n/** Shared input orchestration for preparation and fee previews; calculations stay in core. */\nexport function useInstantOpenInputs(\n parameters: GetInstantOpenFeesParameters & ConfigParameter,\n purpose: \"prepare\" | \"fees\",\n queryEnabled = true,\n) {\n const config = useSymmioConfig(parameters);\n const contextChainId = useSymmioChainId();\n const chainId = parameters.chainId ?? contextChainId;\n const { subAccountAddress, market, positionType, initialMargin, fund, leverage, solverId } = parameters;\n const isFullBalance = fund !== undefined;\n const canSizeFullBalance = isFullBalance || parameters.availableBalance !== undefined;\n const needsLockedParams = purpose === \"prepare\" || canSizeFullBalance;\n const needsSolverFeeCaps = purpose === \"prepare\" && config.getChainConfig(chainId).contractsVersion === \"0.8.6\";\n /** The amount driving the sizing math — the typed margin, or the whole balance in full-balance mode. */\n const sizingInput = isFullBalance ? fund.balance : (initialMargin ?? \"\");\n const requested = queryEnabled && sizingInput.length > 0;\n\n /** The dry-run estimate exists only on lowcap (Enigma) solvers. */\n const isLowcap = config.getSolver({ chainId, solverId }).id === \"enigma\";\n const validationError = requested ? getInstantOpenFundingError({ ...parameters, isLowcap }) : undefined;\n const enabled = requested && validationError === undefined;\n\n // Market metadata — slow-moving; dedupes with any other useMarkets on the page.\n const marketsQuery = useMarkets({\n config: parameters.config,\n chainId,\n solverId,\n query: { enabled, staleTime: 300_000 },\n });\n const resolvedMarket = marketsQuery.data?.find((entry) => entry.symbolId === market.id);\n const marketName = market.name ?? resolvedMarket?.name;\n const pricePrecision = market.pricePrecision ?? resolvedMarket?.pricePrecision;\n const quantityPrecision = market.quantityPrecision ?? resolvedMarket?.quantityPrecision;\n const hedgerFeeOpen = market.hedgerFeeOpen ?? resolvedMarket?.hedgerFeeOpen;\n const hedgerFeeClose = market.hedgerFeeClose ?? resolvedMarket?.hedgerFeeClose;\n\n const minOpenSolverFeeCap =\n market.minOpenSolverFeeCap ??\n (resolvedMarket ? (resolvedMarket.kind === \"enigma\" ? resolvedMarket.minOpenSolverFeeCap : \"0\") : undefined);\n const minCloseSolverFeeCap =\n market.minCloseSolverFeeCap ??\n (resolvedMarket ? (resolvedMarket.kind === \"enigma\" ? resolvedMarket.minCloseSolverFeeCap : \"0\") : undefined);\n const capsReady = !needsSolverFeeCaps || (minOpenSolverFeeCap !== undefined && minCloseSolverFeeCap !== undefined);\n\n // Time-decaying close-fee rates ride the same `useMarkets` read — Enigma-only\n // fields on `EnigmaMarket`, so narrow on `kind` before reading.\n const resolvedEnigmaMarket = resolvedMarket?.kind === \"enigma\" ? resolvedMarket : undefined;\n const hedgerFeeCloseEarlyRate =\n market.hedgerFeeCloseEarlyRate ?? resolvedEnigmaMarket?.hedgerFeeCloseEarlyRate ?? hedgerFeeClose;\n const hedgerFeeCloseEarlyThreshold =\n market.hedgerFeeCloseEarlyThreshold ?? resolvedEnigmaMarket?.hedgerFeeCloseEarlyThreshold ?? 0;\n const hedgerFeeCloseStandardThreshold =\n market.hedgerFeeCloseStandardThreshold ?? resolvedEnigmaMarket?.hedgerFeeCloseStandardThreshold ?? 0;\n\n // Quote constraints — explicit or automatic full-balance sizing snaps to the lot grid and checks the\n // published floors; they ride the same `useMarkets` read.\n const minAcceptablePortionLf = market.minAcceptablePortionLf ?? resolvedMarket?.minAcceptablePortionLf;\n const minAcceptableQuoteValue = market.minAcceptableQuoteValue ?? resolvedMarket?.minAcceptableQuoteValue;\n const maxNotionalValue = market.maxNotionalValue ?? resolvedMarket?.maxNotionalValue;\n const minNotionalValue = market.minNotionalValue ?? resolvedMarket?.minNotionalValue;\n const maxQuantity = market.maxQuantity ?? resolvedMarket?.maxQuantity;\n const lotSize = market.lotSize ?? resolvedMarket?.lotSize;\n const constraintsReady =\n !canSizeFullBalance ||\n (minAcceptablePortionLf !== undefined &&\n minAcceptableQuoteValue !== undefined &&\n maxNotionalValue !== undefined &&\n minNotionalValue !== undefined &&\n maxQuantity !== undefined &&\n lotSize !== undefined);\n\n // Preparation always needs locks; the fee preview needs them only for balance sizing.\n const locksPrefilled =\n parameters.lockedParamPercent?.cva !== undefined &&\n parameters.lockedParamPercent.lf !== undefined &&\n parameters.lockedParamPercent.partyAmm !== undefined &&\n parameters.lockedParamPercent.partyBmm !== undefined;\n const lockedParamsQuery = useLockedParams({\n config: parameters.config,\n chainId,\n solverId,\n symbol: marketName ?? \"\",\n leverage,\n query: {\n enabled: enabled && needsLockedParams && !locksPrefilled && marketName !== undefined,\n staleTime: 300_000,\n },\n });\n const lockedParamPercent = locksPrefilled\n ? parameters.lockedParamPercent\n : lockedParamsQuery.data\n ? {\n // The resolver skips its fetch only when all four fields are present —\n // mirror its `\"0\"` defaults for fields the solver omits.\n cva: lockedParamsQuery.data.cva ?? \"0\",\n lf: lockedParamsQuery.data.lf ?? \"0\",\n partyAmm: lockedParamsQuery.data.partyAmm ?? \"0\",\n partyBmm: lockedParamsQuery.data.partyBmm ?? \"0\",\n }\n : undefined;\n const lockedParamsReady = !needsLockedParams || lockedParamPercent !== undefined;\n\n // Static solver fees follow the same cached input path as the other prefills.\n // A failed optional /info read keeps core's existing zero-static-fee fallback.\n const solverInfoQuery = useSolverInfo({\n config: parameters.config,\n chainId,\n solverId,\n query: { enabled: enabled && isLowcap && parameters.solverInfo === undefined, staleTime: 300_000, retry: false },\n });\n const solverInfo = parameters.solverInfo ?? solverInfoQuery.data ?? (solverInfoQuery.isError ? {} : undefined);\n const solverInfoReady = !isLowcap || solverInfo !== undefined;\n\n // On-chain platform fee rates — contract state, changes rarely; cached hard.\n const feeQuery = useFeeForUser({\n config: parameters.config,\n chainId,\n user: subAccountAddress,\n symbolId: BigInt(market.id),\n query: { enabled: enabled && parameters.feeRates === undefined, staleTime: 300_000 },\n });\n const feeRates = parameters.feeRates ?? feeQuery.data;\n\n // Mark price — caller's cache-hot value wins; otherwise the shared stream.\n const priceQuery = usePriceByName({\n name: marketName,\n solverId,\n enabled: enabled && parameters.markPrice === undefined,\n });\n const markPrice = parameters.markPrice ?? priceQuery.markPrice ?? undefined;\n\n // Lowcap dry-run estimate: mark-sized quantity, wide fixed request bound so the\n // solver's price gate never rejects the question. Debounced internally.\n const estimateQuantity = useMemo(() => {\n if (!enabled || !isLowcap || markPrice === undefined) return \"\";\n if (pricePrecision === undefined || quantityPrecision === undefined) return \"\";\n const sized = calculateTradeParams({\n markPrice,\n slippage: 0,\n positionType,\n userInput: sizingInput,\n inputField: \"PRICE\",\n leverage,\n pricePrecision,\n quantityPrecision,\n });\n return sized?.quantity ?? \"\";\n }, [enabled, isLowcap, markPrice, pricePrecision, quantityPrecision, positionType, sizingInput, leverage]);\n const estimateRequestPrice =\n markPrice !== undefined ? String(Number(markPrice) * (positionType === PositionType.SHORT ? 0.5 : 1.5)) : \"\";\n const estimateQuery = useEstimatedPrice({\n config: parameters.config,\n chainId,\n solverId,\n symbolId: market.id,\n quantity: estimateQuantity,\n positionType,\n entry: \"open\",\n price: estimateRequestPrice,\n query: {\n enabled: enabled && isLowcap && parameters.estimatedOpenPrice === undefined && estimateQuantity.length > 0,\n staleTime: 30_000,\n },\n });\n // undefined = pending, string = available, null = settled but unavailable.\n // Pass null through to core so a failed cached request is not fetched again.\n const estimateUpdating =\n isLowcap && parameters.estimatedOpenPrice === undefined && (estimateQuery.isDebouncing || estimateQuery.isFetching);\n const estimateSettled =\n !isLowcap ||\n parameters.estimatedOpenPrice !== undefined ||\n (!estimateUpdating && (estimateQuery.isFetched || estimateQuery.isError));\n const resolvedEstimate =\n parameters.estimatedOpenPrice !== undefined ? parameters.estimatedOpenPrice : estimateQuery.data?.estimatedPrice;\n const estimatedOpenPrice =\n !isLowcap || !estimateSettled ? undefined : resolvedEstimate && resolvedEstimate !== \"0\" ? resolvedEstimate : null;\n\n // Every prefill present → the query function is pure, zero fetches.\n const ready =\n enabled &&\n marketName !== undefined &&\n pricePrecision !== undefined &&\n quantityPrecision !== undefined &&\n feeRates !== undefined &&\n markPrice !== undefined &&\n lockedParamsReady &&\n (!isLowcap || (hedgerFeeOpen !== undefined && hedgerFeeClose !== undefined)) &&\n constraintsReady &&\n capsReady &&\n solverInfoReady &&\n estimateSettled;\n\n return {\n config,\n validationError,\n ready,\n prefills: {\n chainId,\n market: {\n id: market.id,\n name: marketName,\n pricePrecision,\n quantityPrecision,\n minOpenSolverFeeCap,\n minCloseSolverFeeCap,\n hedgerFeeOpen,\n hedgerFeeClose,\n hedgerFeeCloseEarlyRate,\n hedgerFeeCloseEarlyThreshold,\n hedgerFeeCloseStandardThreshold,\n minAcceptablePortionLf,\n minAcceptableQuoteValue,\n maxNotionalValue,\n minNotionalValue,\n maxQuantity,\n lotSize,\n },\n markPrice,\n feeRates,\n lockedParamPercent,\n solverInfo,\n estimatedOpenPrice,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,EACd,GACA,GACA,IAAe,IACf;CACA,IAAM,IAAS,GAAgB,CAAU,GACnC,IAAiB,EAAiB,GAClC,IAAU,EAAW,WAAW,GAChC,EAAE,sBAAmB,WAAQ,iBAAc,mBAAe,SAAM,aAAU,gBAAa,GACvF,IAAgB,MAAS,KAAA,GACzB,IAAqB,KAAiB,EAAW,qBAAqB,KAAA,GACtE,IAAoB,MAAY,aAAa,GAC7C,KAAqB,MAAY,aAAa,EAAO,eAAe,CAAO,EAAE,qBAAqB,SAElG,IAAc,IAAgB,EAAK,UAAW,MAAiB,IAC/D,IAAY,KAAgB,EAAY,SAAS,GAGjD,IAAW,EAAO,UAAU;EAAE;EAAS;CAAS,CAAC,EAAE,OAAO,UAC1D,IAAkB,IAAY,EAA2B;EAAE,GAAG;EAAY;CAAS,CAAC,IAAI,KAAA,GACxF,IAAU,KAAa,MAAoB,KAAA,GAS3C,IANe,GAAW;EAC9B,QAAQ,EAAW;EACnB;EACA;EACA,OAAO;GAAE;GAAS,WAAW;EAAQ;CACvC,CACuB,EAAa,MAAM,MAAM,MAAU,EAAM,aAAa,EAAO,EAAE,GAChF,IAAa,EAAO,QAAQ,GAAgB,MAC5C,IAAiB,EAAO,kBAAkB,GAAgB,gBAC1D,IAAoB,EAAO,qBAAqB,GAAgB,mBAChE,IAAgB,EAAO,iBAAiB,GAAgB,eACx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AAuB,KAAA,MAAc,EAAc,gBAAgB,EAAc,aACpG,IACJ,CAAC,KACD,EAAW,uBAAuB,KAAA,KACjC,CAAC,OAAqB,EAAc,aAAa,EAAc,UAC5D,IACJ,EAAW,uBAAuB,KAAA,IAA4C,EAAc,MAAM,iBAApD,EAAW,oBACrD,KACJ,CAAC,KAAY,CAAC,IAAkB,KAAA,IAAY,KAAoB,MAAqB,MAAM,IAAmB;CAiBhH,OAAO;EACL;EACA;EACA,OAhBA,KACA,MAAe,KAAA,KACf,MAAmB,KAAA,KACnB,MAAsB,KAAA,KACtB,MAAa,KAAA,KACb,MAAc,KAAA,KACd,OACC,CAAC,KAAa,MAAkB,KAAA,KAAa,MAAmB,KAAA,MACjE,KACA,MACA,MACA;EAMA,UAAU;GACR;GACA,QAAQ;IACN,IAAI,EAAO;IACX,MAAM;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"use-instant-open-inputs.js","names":[],"sources":["../../src/instant-layer/use-instant-open-inputs.ts"],"sourcesContent":["\"use client\";\n\nimport {\n calculateTradeParams,\n PositionType,\n type ConfigParameter,\n type GetInstantOpenFeesParameters,\n} from \"@symmio/trading-core\";\nimport { useMemo } from \"react\";\nimport { useEstimatedPrice } from \"../estimated-price/use-estimated-price\";\nimport { useFeeForUser } from \"../fees/use-fee-for-user\";\nimport { useLockedParams } from \"../locked-params/use-locked-params\";\nimport { useMarkets } from \"../markets/use-markets\";\nimport { usePriceByName } from \"../price-service/use-price-by-name\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { useSolverInfo } from \"../solvers/use-solver-info\";\nimport { getInstantOpenFundingError } from \"./get-instant-open-funding-error\";\n\n/** Shared input orchestration for preparation and fee previews; calculations stay in core. */\nexport function useInstantOpenInputs(\n parameters: GetInstantOpenFeesParameters & ConfigParameter,\n purpose: \"prepare\" | \"fees\",\n queryEnabled = true,\n) {\n const config = useSymmioConfig(parameters);\n const contextChainId = useSymmioChainId();\n const chainId = parameters.chainId ?? contextChainId;\n const { subAccountAddress, market, positionType, initialMargin, fund, leverage, solverId } = parameters;\n const isFullBalance = fund !== undefined;\n const canSizeFullBalance = isFullBalance || parameters.availableBalance !== undefined;\n const needsLockedParams = purpose === \"prepare\" || canSizeFullBalance;\n const needsSolverFeeCaps = purpose === \"prepare\" && config.getChainConfig(chainId).contractsVersion === \"0.8.6\";\n /** The amount driving the sizing math — the typed margin, or the whole balance in full-balance mode. */\n const sizingInput = isFullBalance ? fund.balance : (initialMargin ?? \"\");\n const requested = queryEnabled && sizingInput.length > 0;\n\n /** The dry-run estimate exists only on lowcap (Enigma) solvers. */\n const isLowcap = config.getSolver({ chainId, solverId }).id === \"enigma\";\n const validationError = requested ? getInstantOpenFundingError({ ...parameters, isLowcap }) : undefined;\n const enabled = requested && validationError === undefined;\n\n // Market metadata — slow-moving; dedupes with any other useMarkets on the page.\n const marketsQuery = useMarkets({\n config: parameters.config,\n chainId,\n solverId,\n query: { enabled, staleTime: 300_000 },\n });\n const resolvedMarket = marketsQuery.data?.find((entry) => entry.symbolId === market.id);\n const marketName = market.name ?? resolvedMarket?.name;\n const pricePrecision = market.pricePrecision ?? resolvedMarket?.pricePrecision;\n const quantityPrecision = market.quantityPrecision ?? resolvedMarket?.quantityPrecision;\n const hedgerFeeOpen = market.hedgerFeeOpen ?? resolvedMarket?.hedgerFeeOpen;\n const hedgerFeeClose = market.hedgerFeeClose ?? resolvedMarket?.hedgerFeeClose;\n\n const minOpenSolverFeeCap =\n market.minOpenSolverFeeCap ??\n (resolvedMarket ? (resolvedMarket.kind === \"enigma\" ? resolvedMarket.minOpenSolverFeeCap : \"0\") : undefined);\n const minCloseSolverFeeCap =\n market.minCloseSolverFeeCap ??\n (resolvedMarket ? (resolvedMarket.kind === \"enigma\" ? resolvedMarket.minCloseSolverFeeCap : \"0\") : undefined);\n const capsReady = !needsSolverFeeCaps || (minOpenSolverFeeCap !== undefined && minCloseSolverFeeCap !== undefined);\n\n // Time-decaying close-fee rates ride the same `useMarkets` read — Enigma-only\n // fields on `EnigmaMarket`, so narrow on `kind` before reading.\n const resolvedEnigmaMarket = resolvedMarket?.kind === \"enigma\" ? resolvedMarket : undefined;\n const hedgerFeeCloseEarlyRate =\n market.hedgerFeeCloseEarlyRate ?? resolvedEnigmaMarket?.hedgerFeeCloseEarlyRate ?? hedgerFeeClose;\n const hedgerFeeCloseEarlyThreshold =\n market.hedgerFeeCloseEarlyThreshold ?? resolvedEnigmaMarket?.hedgerFeeCloseEarlyThreshold ?? 0;\n const hedgerFeeCloseStandardThreshold =\n market.hedgerFeeCloseStandardThreshold ?? resolvedEnigmaMarket?.hedgerFeeCloseStandardThreshold ?? 0;\n\n // Quote constraints — explicit or automatic full-balance sizing snaps to the lot grid and checks the\n // published floors; they ride the same `useMarkets` read.\n const minAcceptablePortionLf = market.minAcceptablePortionLf ?? resolvedMarket?.minAcceptablePortionLf;\n const minAcceptableQuoteValue = market.minAcceptableQuoteValue ?? resolvedMarket?.minAcceptableQuoteValue;\n const maxNotionalValue = market.maxNotionalValue ?? resolvedMarket?.maxNotionalValue;\n const minNotionalValue = market.minNotionalValue ?? resolvedMarket?.minNotionalValue;\n const maxQuantity = market.maxQuantity ?? resolvedMarket?.maxQuantity;\n const lotSize = market.lotSize ?? resolvedMarket?.lotSize;\n const constraintsReady =\n !canSizeFullBalance ||\n (minAcceptablePortionLf !== undefined &&\n minAcceptableQuoteValue !== undefined &&\n maxNotionalValue !== undefined &&\n minNotionalValue !== undefined &&\n maxQuantity !== undefined &&\n lotSize !== undefined);\n\n // Preparation always needs locks; the fee preview needs them only for balance sizing.\n const locksPrefilled =\n parameters.lockedParamPercent?.cva !== undefined &&\n parameters.lockedParamPercent.lf !== undefined &&\n parameters.lockedParamPercent.partyAmm !== undefined &&\n parameters.lockedParamPercent.partyBmm !== undefined;\n const lockedParamsQuery = useLockedParams({\n config: parameters.config,\n chainId,\n solverId,\n symbol: marketName ?? \"\",\n leverage,\n query: {\n enabled: enabled && needsLockedParams && !locksPrefilled && marketName !== undefined,\n staleTime: 300_000,\n },\n });\n const lockedParamPercent = locksPrefilled\n ? parameters.lockedParamPercent\n : lockedParamsQuery.data\n ? {\n // The resolver skips its fetch only when all four fields are present —\n // mirror its `\"0\"` defaults for fields the solver omits.\n cva: lockedParamsQuery.data.cva ?? \"0\",\n lf: lockedParamsQuery.data.lf ?? \"0\",\n partyAmm: lockedParamsQuery.data.partyAmm ?? \"0\",\n partyBmm: lockedParamsQuery.data.partyBmm ?? \"0\",\n }\n : undefined;\n const lockedParamsReady = !needsLockedParams || lockedParamPercent !== undefined;\n\n // Static solver fees follow the same cached input path as the other prefills.\n // A failed optional /info read keeps core's existing zero-static-fee fallback.\n const solverInfoQuery = useSolverInfo({\n config: parameters.config,\n chainId,\n solverId,\n query: { enabled: enabled && isLowcap && parameters.solverInfo === undefined, staleTime: 300_000, retry: false },\n });\n const solverInfo = parameters.solverInfo ?? solverInfoQuery.data ?? (solverInfoQuery.isError ? {} : undefined);\n const solverInfoReady = !isLowcap || solverInfo !== undefined;\n\n // On-chain platform fee rates — contract state, changes rarely; cached hard.\n const feeQuery = useFeeForUser({\n config: parameters.config,\n chainId,\n user: subAccountAddress,\n symbolId: BigInt(market.id),\n query: { enabled: enabled && parameters.feeRates === undefined, staleTime: 300_000 },\n });\n const feeRates = parameters.feeRates ?? feeQuery.data;\n\n // Mark price — caller's cache-hot value wins; otherwise the shared stream.\n const priceQuery = usePriceByName({\n name: marketName,\n solverId,\n enabled: enabled && parameters.markPrice === undefined,\n });\n const markPrice = parameters.markPrice ?? priceQuery.markPrice ?? undefined;\n\n // Lowcap dry-run estimate: mark-sized quantity, wide fixed request bound so the\n // solver's price gate never rejects the question. Debounced internally.\n const estimateQuantity = useMemo(() => {\n if (!enabled || !isLowcap || markPrice === undefined) return \"\";\n if (pricePrecision === undefined || quantityPrecision === undefined) return \"\";\n const sized = calculateTradeParams({\n markPrice,\n slippage: 0,\n positionType,\n userInput: sizingInput,\n inputField: \"PRICE\",\n leverage,\n pricePrecision,\n quantityPrecision,\n });\n return sized?.quantity ?? \"\";\n }, [enabled, isLowcap, markPrice, pricePrecision, quantityPrecision, positionType, sizingInput, leverage]);\n const estimateRequestPrice =\n markPrice !== undefined ? String(Number(markPrice) * (positionType === PositionType.SHORT ? 0.5 : 1.5)) : \"\";\n const estimateQuery = useEstimatedPrice({\n config: parameters.config,\n chainId,\n solverId,\n symbolId: market.id,\n quantity: estimateQuantity,\n positionType,\n entry: \"open\",\n price: estimateRequestPrice,\n query: {\n enabled: enabled && isLowcap && parameters.estimatedOpenPrice === undefined && estimateQuantity.length > 0,\n staleTime: 30_000,\n },\n });\n // undefined = pending, string = available, null = settled but unavailable.\n // Pass null through to core so a failed cached request is not fetched again.\n const estimateUpdating =\n isLowcap && parameters.estimatedOpenPrice === undefined && (estimateQuery.isDebouncing || estimateQuery.isFetching);\n const estimateSettled =\n !isLowcap ||\n parameters.estimatedOpenPrice !== undefined ||\n (!estimateUpdating && (estimateQuery.isFetched || estimateQuery.isError));\n const resolvedEstimate =\n parameters.estimatedOpenPrice !== undefined ? parameters.estimatedOpenPrice : estimateQuery.data?.estimatedPrice;\n const estimatedOpenPrice =\n !isLowcap || !estimateSettled ? undefined : resolvedEstimate && resolvedEstimate !== \"0\" ? resolvedEstimate : null;\n\n // Every prefill present → the query function is pure, zero fetches.\n const ready =\n enabled &&\n marketName !== undefined &&\n pricePrecision !== undefined &&\n quantityPrecision !== undefined &&\n feeRates !== undefined &&\n markPrice !== undefined &&\n lockedParamsReady &&\n (!isLowcap || (hedgerFeeOpen !== undefined && hedgerFeeClose !== undefined)) &&\n constraintsReady &&\n capsReady &&\n solverInfoReady &&\n estimateSettled;\n\n return {\n config,\n validationError,\n ready,\n refetchEstimatedPrice: estimateQuery.refetch,\n estimatedOpenPriceTimestamp: estimateQuery.isPlaceholderData ? undefined : estimateQuery.dataUpdatedAt || undefined,\n prefills: {\n chainId,\n market: {\n id: market.id,\n name: marketName,\n pricePrecision,\n quantityPrecision,\n minOpenSolverFeeCap,\n minCloseSolverFeeCap,\n hedgerFeeOpen,\n hedgerFeeClose,\n hedgerFeeCloseEarlyRate,\n hedgerFeeCloseEarlyThreshold,\n hedgerFeeCloseStandardThreshold,\n minAcceptablePortionLf,\n minAcceptableQuoteValue,\n maxNotionalValue,\n minNotionalValue,\n maxQuantity,\n lotSize,\n },\n markPrice,\n feeRates,\n lockedParamPercent,\n solverInfo,\n estimatedOpenPrice,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,EACd,GACA,GACA,IAAe,IACf;CACA,IAAM,IAAS,GAAgB,CAAU,GACnC,IAAiB,EAAiB,GAClC,IAAU,EAAW,WAAW,GAChC,EAAE,sBAAmB,WAAQ,iBAAc,mBAAe,SAAM,aAAU,gBAAa,GACvF,IAAgB,MAAS,KAAA,GACzB,IAAqB,KAAiB,EAAW,qBAAqB,KAAA,GACtE,IAAoB,MAAY,aAAa,GAC7C,KAAqB,MAAY,aAAa,EAAO,eAAe,CAAO,EAAE,qBAAqB,SAElG,IAAc,IAAgB,EAAK,UAAW,MAAiB,IAC/D,IAAY,KAAgB,EAAY,SAAS,GAGjD,IAAW,EAAO,UAAU;EAAE;EAAS;CAAS,CAAC,EAAE,OAAO,UAC1D,IAAkB,IAAY,EAA2B;EAAE,GAAG;EAAY;CAAS,CAAC,IAAI,KAAA,GACxF,IAAU,KAAa,MAAoB,KAAA,GAS3C,IANe,GAAW;EAC9B,QAAQ,EAAW;EACnB;EACA;EACA,OAAO;GAAE;GAAS,WAAW;EAAQ;CACvC,CACuB,EAAa,MAAM,MAAM,MAAU,EAAM,aAAa,EAAO,EAAE,GAChF,IAAa,EAAO,QAAQ,GAAgB,MAC5C,IAAiB,EAAO,kBAAkB,GAAgB,gBAC1D,IAAoB,EA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AAS;GACzG,WAAW;EACb;CACF,CAAC,GAGK,KACJ,KAAY,EAAW,uBAAuB,KAAA,MAAc,EAAc,gBAAgB,EAAc,aACpG,IACJ,CAAC,KACD,EAAW,uBAAuB,KAAA,KACjC,CAAC,OAAqB,EAAc,aAAa,EAAc,UAC5D,IACJ,EAAW,uBAAuB,KAAA,IAA4C,EAAc,MAAM,iBAApD,EAAW,oBACrD,KACJ,CAAC,KAAY,CAAC,IAAkB,KAAA,IAAY,KAAoB,MAAqB,MAAM,IAAmB;CAiBhH,OAAO;EACL;EACA;EACA,OAhBA,KACA,MAAe,KAAA,KACf,MAAmB,KAAA,KACnB,MAAsB,KAAA,KACtB,MAAa,KAAA,KACb,MAAc,KAAA,KACd,OACC,CAAC,KAAa,MAAkB,KAAA,KAAa,MAAmB,KAAA,MACjE,KACA,MACA,MACA;EAMA,uBAAuB,EAAc;EACrC,6BAA6B,EAAc,oBAAoB,KAAA,IAAY,EAAc,iBAAiB,KAAA;EAC1G,UAAU;GACR;GACA,QAAQ;IACN,IAAI,EAAO;IACX,MAAM;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConfigParameter, PrepareInstantOpenParamsOptions, PrepareInstantOpenParamsReturnType } from '@symmio/trading-core';
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
import { UseEstimatedPriceReturnType } from '../estimated-price/use-estimated-price.js';
|
|
4
5
|
/**
|
|
5
6
|
* Parameters for {@link usePrepareInstantOpenParams}: the same trade intent the
|
|
6
7
|
* submit takes (`subAccountAddress`, `from`, `market`, `positionType`,
|
|
@@ -22,6 +23,14 @@ export type UsePrepareInstantOpenParamsReturnType = UseQueryResult<PrepareInstan
|
|
|
22
23
|
* preview bit-for-bit.
|
|
23
24
|
*/
|
|
24
25
|
estimatedOpenPrice: string | null | undefined;
|
|
26
|
+
/** Arrival time of the fetched estimate in epoch milliseconds. The frontend decides when to refresh or expire it. */
|
|
27
|
+
estimatedOpenPriceTimestamp: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Refetch the SDK-managed estimate on the frontend's schedule. Resolves when
|
|
30
|
+
* the estimate request finishes; use isReady to await preparation. A supplied
|
|
31
|
+
* estimatedOpenPrice still takes precedence over the fetched value.
|
|
32
|
+
*/
|
|
33
|
+
refetchEstimatedPrice: UseEstimatedPriceReturnType["refetch"];
|
|
25
34
|
/** Synchronous input error. Display before query.error; dependent queries stay disabled. */
|
|
26
35
|
validationError: SymmioRequestError | undefined;
|
|
27
36
|
/** True when all inputs and the current preparation have settled; gate submission on this. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-prepare-instant-open-params.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-prepare-instant-open-params.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,kCAAkC,EACxC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"use-prepare-instant-open-params.d.ts","sourceRoot":"","sources":["../../src/instant-layer/use-prepare-instant-open-params.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,kCAAkC,EACxC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAG1F;;;;;;GAMG;AACH,MAAM,MAAM,qCAAqC,GAAG,+BAA+B,GAAG,eAAe,CAAC;AAEtG;;;;GAIG;AACH,MAAM,MAAM,qCAAqC,GAAG,cAAc,CAChE,kCAAkC,EAClC,kBAAkB,CACnB,GAAG;IACF;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,qHAAqH;IACrH,2BAA2B,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD;;;;OAIG;IACH,qBAAqB,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAC9D,4FAA4F;IAC5F,eAAe,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAChD,8FAA8F;IAC9F,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,qCAAqC,GAChD,qCAAqC,CA8BvC"}
|
|
@@ -25,8 +25,10 @@ function i(i) {
|
|
|
25
25
|
});
|
|
26
26
|
return {
|
|
27
27
|
...s,
|
|
28
|
+
refetchEstimatedPrice: a.refetchEstimatedPrice,
|
|
28
29
|
validationError: a.validationError,
|
|
29
30
|
estimatedOpenPrice: a.prefills.estimatedOpenPrice,
|
|
31
|
+
estimatedOpenPriceTimestamp: i.estimatedOpenPriceTimestamp ?? a.estimatedOpenPriceTimestamp,
|
|
30
32
|
isReady: a.ready && s.isSuccess && !s.isFetching && !s.isPlaceholderData
|
|
31
33
|
};
|
|
32
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-prepare-instant-open-params.js","names":[],"sources":["../../src/instant-layer/use-prepare-instant-open-params.ts"],"sourcesContent":["\"use client\";\n\nimport {\n prepareInstantOpenParamsQueryOptions,\n type ConfigParameter,\n type PrepareInstantOpenParamsOptions,\n type PrepareInstantOpenParamsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useInstantOpenInputs } from \"./use-instant-open-inputs\";\n\n/**\n * Parameters for {@link usePrepareInstantOpenParams}: the same trade intent the\n * submit takes (`subAccountAddress`, `from`, `market`, `positionType`,\n * `initialMargin` **or** `fund`, optional `availableBalance` for automatic sizing,\n * `leverage`, optional `slippage` / pre-fetched\n * data, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UsePrepareInstantOpenParamsParameters = PrepareInstantOpenParamsOptions & ConfigParameter;\n\n/**\n * Return type of {@link usePrepareInstantOpenParams}: the query result carrying\n * the prepared {@link PrepareInstantOpenParamsReturnType}, plus the dry-run estimate the\n * params were built with.\n */\nexport type UsePrepareInstantOpenParamsReturnType = UseQueryResult<\n PrepareInstantOpenParamsReturnType,\n SymmioRequestError\n> & {\n /**\n * The dry-run estimate the preview was built with (`null` when unavailable;\n * `undefined` while pending or on a non-lowcap solver). Forward it as\n * `estimatedOpenPrice` to the submit so its `margin.amount` — whose settlement leg tracks the estimate — matches this\n * preview bit-for-bit.\n */\n estimatedOpenPrice: string | null | undefined;\n /** Synchronous input error. Display before query.error; dependent queries stay disabled. */\n validationError: SymmioRequestError | undefined;\n /** True when all inputs and the current preparation have settled; gate submission on this. */\n isReady: boolean;\n};\n\n/**\n * Live-preview the exact {@link PrepareInstantOpenParamsReturnType} an instant-open submit\n * will sign — `order` (price + quantity), `lockedParam`, `margin.amount`, and\n * `solverFeeCaps` — by running `prepareInstantOpenParams` as a read.\n * `prepareInstantOpenParams` neither signs nor submits, so this is safe to run\n * live; drive a \"quote preview\" from it and what the user sees is bit-for-bit\n * what `sendQuote` receives, with no separate local recomputation to drift.\n *\n * Like {@link useInstantOpenFees}, it **pre-fetches every input through its own\n * cached queries** (market metadata, mark price, locked params, on-chain fee\n * rates, solver info, and the lowcap dry-run estimate) and passes them in as\n * prefills, so the query function is pure and does no per-render network. Previous data is kept\n * while inputs move, so a mark-price tick updates the numbers in place.\n *\n * For bit-for-bit parity on `margin.amount`, forward {@link\n * UsePrepareInstantOpenParamsReturnType.estimatedOpenPrice} to the submit call\n * (`useInstantOpenAuto` / `useInstantOpenWithTpSl`) as `estimatedOpenPrice`, so\n * both the preview and the send provision settlement at the same estimate. The\n * full-balance sizing decision and quantity also depend on that estimate.\n * Gate submission on `isReady` while inputs or the estimate are settling.\n * Display `validationError ?? error`; input errors are synchronous, including offline.\n * A disabled hook or empty input remains idle without input validation.\n *\n * @example\n * ```tsx\n * const preview = usePrepareInstantOpenParams({\n * subAccountAddress,\n * from: sessionKey,\n * market: { id: symbolId },\n * positionType,\n * initialMargin,\n * leverage,\n * slippage,\n * });\n * // preview.data?.order.quantity — the exact leveraged quantity (wei) the send signs\n * // submit: mutate({ …, estimatedOpenPrice: preview.estimatedOpenPrice })\n * ```\n */\nexport function usePrepareInstantOpenParams(\n parameters: UsePrepareInstantOpenParamsParameters,\n): UsePrepareInstantOpenParamsReturnType {\n const inputs = useInstantOpenInputs(parameters, \"prepare\", parameters.query?.enabled !== false);\n const options = prepareInstantOpenParamsQueryOptions(inputs.config, {\n ...parameters,\n ...inputs.prefills,\n query: {\n ...parameters.query,\n enabled: inputs.ready,\n placeholderData: (previous) => (inputs.validationError === undefined ? previous : undefined),\n },\n });\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseQueryResult<PrepareInstantOpenParamsReturnType, SymmioRequestError>;\n\n return {\n ...query,\n validationError: inputs.validationError,\n estimatedOpenPrice: inputs.prefills.estimatedOpenPrice,\n isReady: inputs.ready && query.isSuccess && !query.isFetching && !query.isPlaceholderData,\n };\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"use-prepare-instant-open-params.js","names":[],"sources":["../../src/instant-layer/use-prepare-instant-open-params.ts"],"sourcesContent":["\"use client\";\n\nimport {\n prepareInstantOpenParamsQueryOptions,\n type ConfigParameter,\n type PrepareInstantOpenParamsOptions,\n type PrepareInstantOpenParamsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport type { UseEstimatedPriceReturnType } from \"../estimated-price/use-estimated-price\";\nimport { useInstantOpenInputs } from \"./use-instant-open-inputs\";\n\n/**\n * Parameters for {@link usePrepareInstantOpenParams}: the same trade intent the\n * submit takes (`subAccountAddress`, `from`, `market`, `positionType`,\n * `initialMargin` **or** `fund`, optional `availableBalance` for automatic sizing,\n * `leverage`, optional `slippage` / pre-fetched\n * data, TanStack `query` overrides) plus an optional `config`.\n */\nexport type UsePrepareInstantOpenParamsParameters = PrepareInstantOpenParamsOptions & ConfigParameter;\n\n/**\n * Return type of {@link usePrepareInstantOpenParams}: the query result carrying\n * the prepared {@link PrepareInstantOpenParamsReturnType}, plus the dry-run estimate the\n * params were built with.\n */\nexport type UsePrepareInstantOpenParamsReturnType = UseQueryResult<\n PrepareInstantOpenParamsReturnType,\n SymmioRequestError\n> & {\n /**\n * The dry-run estimate the preview was built with (`null` when unavailable;\n * `undefined` while pending or on a non-lowcap solver). Forward it as\n * `estimatedOpenPrice` to the submit so its `margin.amount` — whose settlement leg tracks the estimate — matches this\n * preview bit-for-bit.\n */\n estimatedOpenPrice: string | null | undefined;\n /** Arrival time of the fetched estimate in epoch milliseconds. The frontend decides when to refresh or expire it. */\n estimatedOpenPriceTimestamp: number | undefined;\n /**\n * Refetch the SDK-managed estimate on the frontend's schedule. Resolves when\n * the estimate request finishes; use isReady to await preparation. A supplied\n * estimatedOpenPrice still takes precedence over the fetched value.\n */\n refetchEstimatedPrice: UseEstimatedPriceReturnType[\"refetch\"];\n /** Synchronous input error. Display before query.error; dependent queries stay disabled. */\n validationError: SymmioRequestError | undefined;\n /** True when all inputs and the current preparation have settled; gate submission on this. */\n isReady: boolean;\n};\n\n/**\n * Live-preview the exact {@link PrepareInstantOpenParamsReturnType} an instant-open submit\n * will sign — `order` (price + quantity), `lockedParam`, `margin.amount`, and\n * `solverFeeCaps` — by running `prepareInstantOpenParams` as a read.\n * `prepareInstantOpenParams` neither signs nor submits, so this is safe to run\n * live; drive a \"quote preview\" from it and what the user sees is bit-for-bit\n * what `sendQuote` receives, with no separate local recomputation to drift.\n *\n * Like {@link useInstantOpenFees}, it **pre-fetches every input through its own\n * cached queries** (market metadata, mark price, locked params, on-chain fee\n * rates, solver info, and the lowcap dry-run estimate) and passes them in as\n * prefills, so the query function is pure and does no per-render network. Previous data is kept\n * while inputs move, so a mark-price tick updates the numbers in place.\n *\n * For bit-for-bit parity on `margin.amount`, forward {@link\n * UsePrepareInstantOpenParamsReturnType.estimatedOpenPrice} to the submit call\n * (`useInstantOpenAuto` / `useInstantOpenWithTpSl`) as `estimatedOpenPrice`, so\n * both the preview and the send provision settlement at the same estimate. The\n * full-balance sizing decision and quantity also depend on that estimate.\n * Gate submission on `isReady` while inputs or the estimate are settling.\n * Display `validationError ?? error`; input errors are synchronous, including offline.\n * A disabled hook or empty input remains idle without input validation.\n *\n * @example\n * ```tsx\n * const preview = usePrepareInstantOpenParams({\n * subAccountAddress,\n * from: sessionKey,\n * market: { id: symbolId },\n * positionType,\n * initialMargin,\n * leverage,\n * slippage,\n * });\n * // preview.data?.order.quantity — the exact leveraged quantity (wei) the send signs\n * // submit: mutate({ …, estimatedOpenPrice: preview.estimatedOpenPrice })\n * ```\n */\nexport function usePrepareInstantOpenParams(\n parameters: UsePrepareInstantOpenParamsParameters,\n): UsePrepareInstantOpenParamsReturnType {\n const inputs = useInstantOpenInputs(parameters, \"prepare\", parameters.query?.enabled !== false);\n const options = prepareInstantOpenParamsQueryOptions(inputs.config, {\n ...parameters,\n ...inputs.prefills,\n query: {\n ...parameters.query,\n enabled: inputs.ready,\n placeholderData: (previous) => (inputs.validationError === undefined ? previous : undefined),\n },\n });\n const query = useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseQueryResult<PrepareInstantOpenParamsReturnType, SymmioRequestError>;\n\n return {\n ...query,\n refetchEstimatedPrice: inputs.refetchEstimatedPrice,\n validationError: inputs.validationError,\n estimatedOpenPrice: inputs.prefills.estimatedOpenPrice,\n estimatedOpenPriceTimestamp: parameters.estimatedOpenPriceTimestamp ?? inputs.estimatedOpenPriceTimestamp,\n isReady: inputs.ready && query.isSuccess && !query.isFetching && !query.isPlaceholderData,\n };\n}\n"],"mappings":";;;;;;AA2FA,SAAgB,EACd,GACuC;CACvC,IAAM,IAAS,EAAqB,GAAY,WAAW,EAAW,OAAO,YAAY,EAAK,GACxF,IAAU,EAAqC,EAAO,QAAQ;EAClE,GAAG;EACH,GAAG,EAAO;EACV,OAAO;GACL,GAAG,EAAW;GACd,SAAS,EAAO;GAChB,kBAAkB,MAAc,EAAO,oBAAoB,KAAA,IAAY,IAAW,KAAA;EACpF;CACF,CAAC,GACK,IAAQ,EAAS;EACrB,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;CAED,OAAO;EACL,GAAG;EACH,uBAAuB,EAAO;EAC9B,iBAAiB,EAAO;EACxB,oBAAoB,EAAO,SAAS;EACpC,6BAA6B,EAAW,+BAA+B,EAAO;EAC9E,SAAS,EAAO,SAAS,EAAM,aAAa,CAAC,EAAM,cAAc,CAAC,EAAM;CAC1E;AACF"}
|
package/dist/pools/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './use-refund-market.js';
|
|
|
19
19
|
export * from './use-retry-listing.js';
|
|
20
20
|
export * from './use-retry-listing-info.js';
|
|
21
21
|
export * from './use-supports-listing-service.js';
|
|
22
|
+
export * from './use-token-price.js';
|
|
22
23
|
export * from './use-update-listing-market-config.js';
|
|
23
24
|
export * from './use-user-listing-markets.js';
|
|
24
25
|
export * from './use-user-profit.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pools/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pools/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
package/dist/pools/index.js
CHANGED
|
@@ -20,11 +20,12 @@ import { useRefundMarket as v } from "./use-refund-market.js";
|
|
|
20
20
|
import { useRetryListing as y } from "./use-retry-listing.js";
|
|
21
21
|
import { useRetryListingInfo as b } from "./use-retry-listing-info.js";
|
|
22
22
|
import { useSupportsListingService as x } from "./use-supports-listing-service.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
23
|
+
import { useTokenPrice as S } from "./use-token-price.js";
|
|
24
|
+
import { useUpdateListingMarketConfig as C } from "./use-update-listing-market-config.js";
|
|
25
|
+
import { useUserListingMarkets as w } from "./use-user-listing-markets.js";
|
|
26
|
+
import { useUserRewardChart as T } from "./use-user-reward-chart.js";
|
|
27
|
+
import { useUserTotalReward as E } from "./use-user-total-reward.js";
|
|
28
|
+
import { useUserTransactions as D } from "./use-user-transactions.js";
|
|
29
|
+
import { useWeeklyListingLimit as O } from "./use-weekly-listing-limit.js";
|
|
30
|
+
import { useWithdrawLp as k } from "./use-withdraw-lp.js";
|
|
31
|
+
export { e as useAddMarket, t as useAuthenticateListing, n as useCancelWithdraw, r as useClaimHistory, i as useClaimProfit, a as useDepositAddress, o as useListingConfig, s as useListingMarketConfig, u as useListingMarketConfigProjection, c as useListingMarketDetail, d as useListingMarkets, f as useListingStatus, p as usePoolQuotes, m as usePoolRewardChart, h as usePoolTotalReward, g as usePoolTradeHistory, _ as usePoolTransactions, v as useRefundMarket, y as useRetryListing, b as useRetryListingInfo, x as useSupportsListingService, S as useTokenPrice, C as useUpdateListingMarketConfig, w as useUserListingMarkets, l as useUserProfit, T as useUserRewardChart, E as useUserTotalReward, D as useUserTransactions, O as useWeeklyListingLimit, k as useWithdrawLp };
|
|
@@ -6,18 +6,26 @@ export type UsePoolTransactionsParameters = GetPoolTransactionsOptions & ConfigP
|
|
|
6
6
|
/** Return type of {@link usePoolTransactions}: one page of transaction rows. */
|
|
7
7
|
export type UsePoolTransactionsReturnType = UseQueryResult<GetPoolTransactionsReturnType, SymmioRequestError>;
|
|
8
8
|
/**
|
|
9
|
-
* Read
|
|
9
|
+
* Read pool deposit and withdrawal history — refunded deposits included —
|
|
10
|
+
* newest first.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* Public and unscoped by default: every LP's rows on **every** pool, not just
|
|
13
|
+
* the connected wallet's. Narrow it with `tokenAddress` (one pool),
|
|
14
|
+
* `marketChainId`, `walletAddress`, `transactionType` and `transactionStatus`;
|
|
15
|
+
* each row names its own pool (`tokenAddress`, `chainId`). The service fixes the
|
|
16
|
+
* order newest first and takes no sort parameter.
|
|
13
17
|
*
|
|
14
18
|
* `count` is the total across all pages, so it is what a pager should divide —
|
|
15
19
|
* not `items.length`. Errors are normalized to {@link SymmioRequestError}.
|
|
16
20
|
*
|
|
17
21
|
* @example
|
|
18
22
|
* ```tsx
|
|
19
|
-
*
|
|
23
|
+
* // One pool, 25 rows a page.
|
|
24
|
+
* const { data } = usePoolTransactions({ tokenAddress, size: 25, start: page * 25 });
|
|
25
|
+
*
|
|
26
|
+
* // The latest activity across every pool.
|
|
27
|
+
* const { data: latest } = usePoolTransactions();
|
|
20
28
|
* ```
|
|
21
29
|
*/
|
|
22
|
-
export declare function usePoolTransactions(parameters
|
|
30
|
+
export declare function usePoolTransactions(parameters?: UsePoolTransactionsParameters): UsePoolTransactionsReturnType;
|
|
23
31
|
//# sourceMappingURL=use-pool-transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pool-transactions.d.ts","sourceRoot":"","sources":["../../src/pools/use-pool-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,oGAAoG;AACpG,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,GAAG,eAAe,CAAC;AAEzF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;AAE9G
|
|
1
|
+
{"version":3,"file":"use-pool-transactions.d.ts","sourceRoot":"","sources":["../../src/pools/use-pool-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,oGAAoG;AACpG,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,GAAG,eAAe,CAAC;AAEzF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,6BAAkC,GAAG,6BAA6B,CAkBjH"}
|
|
@@ -5,7 +5,7 @@ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
|
5
5
|
import { getPoolTransactionsQueryOptions as r } from "@symmio/trading-core";
|
|
6
6
|
import { useQuery as i } from "@tanstack/react-query";
|
|
7
7
|
//#region src/pools/use-pool-transactions.ts
|
|
8
|
-
function a(a) {
|
|
8
|
+
function a(a = {}) {
|
|
9
9
|
let o = t(a), s = e(), c = r(o, {
|
|
10
10
|
...a,
|
|
11
11
|
chainId: a.chainId ?? s
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pool-transactions.js","names":[],"sources":["../../src/pools/use-pool-transactions.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getPoolTransactionsQueryOptions,\n type ConfigParameter,\n type GetPoolTransactionsOptions,\n type GetPoolTransactionsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link usePoolTransactions}: the core query options plus an optional `config`. */\nexport type UsePoolTransactionsParameters = GetPoolTransactionsOptions & ConfigParameter;\n\n/** Return type of {@link usePoolTransactions}: one page of transaction rows. */\nexport type UsePoolTransactionsReturnType = UseQueryResult<GetPoolTransactionsReturnType, SymmioRequestError>;\n\n/**\n * Read
|
|
1
|
+
{"version":3,"file":"use-pool-transactions.js","names":[],"sources":["../../src/pools/use-pool-transactions.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getPoolTransactionsQueryOptions,\n type ConfigParameter,\n type GetPoolTransactionsOptions,\n type GetPoolTransactionsReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link usePoolTransactions}: the core query options plus an optional `config`. */\nexport type UsePoolTransactionsParameters = GetPoolTransactionsOptions & ConfigParameter;\n\n/** Return type of {@link usePoolTransactions}: one page of transaction rows. */\nexport type UsePoolTransactionsReturnType = UseQueryResult<GetPoolTransactionsReturnType, SymmioRequestError>;\n\n/**\n * Read pool deposit and withdrawal history — refunded deposits included —\n * newest first.\n *\n * Public and unscoped by default: every LP's rows on **every** pool, not just\n * the connected wallet's. Narrow it with `tokenAddress` (one pool),\n * `marketChainId`, `walletAddress`, `transactionType` and `transactionStatus`;\n * each row names its own pool (`tokenAddress`, `chainId`). The service fixes the\n * order newest first and takes no sort parameter.\n *\n * `count` is the total across all pages, so it is what a pager should divide —\n * not `items.length`. Errors are normalized to {@link SymmioRequestError}.\n *\n * @example\n * ```tsx\n * // One pool, 25 rows a page.\n * const { data } = usePoolTransactions({ tokenAddress, size: 25, start: page * 25 });\n *\n * // The latest activity across every pool.\n * const { data: latest } = usePoolTransactions();\n * ```\n */\nexport function usePoolTransactions(parameters: UsePoolTransactionsParameters = {}): UsePoolTransactionsReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getPoolTransactionsQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UsePoolTransactionsReturnType;\n}\n"],"mappings":";;;;;;;AA0CA,SAAgB,EAAoB,IAA4C,CAAC,GAAkC;CACjH,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAAgC,GAAQ;EACtD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ConfigParameter, GetTokenPriceOptions, GetTokenPriceReturnType } from '@symmio/trading-core';
|
|
2
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { SymmioRequestError } from '../errors/symmio-request-error.js';
|
|
4
|
+
/** Parameters for {@link useTokenPrice}: the core query options plus an optional `config`. */
|
|
5
|
+
export type UseTokenPriceParameters = GetTokenPriceOptions & ConfigParameter;
|
|
6
|
+
/** Return type of {@link useTokenPrice}: the token's pre-listing price estimate. */
|
|
7
|
+
export type UseTokenPriceReturnType = UseQueryResult<GetTokenPriceReturnType, SymmioRequestError>;
|
|
8
|
+
/**
|
|
9
|
+
* Read a pre-listing **price estimate** for a token — what the Price Service
|
|
10
|
+
* thinks one unit is worth in USD, before (or regardless of whether) the token
|
|
11
|
+
* is listed as a pool. The read a create-pool form shows next to the address
|
|
12
|
+
* the user just pasted.
|
|
13
|
+
*
|
|
14
|
+
* This is an authed read: it takes a Bearer `accessToken` from
|
|
15
|
+
* {@link useAuthenticateListing}, the token's `chain` by vendor name
|
|
16
|
+
* (`TokenPriceChain`, not a numeric chain id), and its `tokenAddress`. The
|
|
17
|
+
* token and the address both gate the query: until the `accessToken` **and**
|
|
18
|
+
* the `tokenAddress` are non-empty strings the hook stays idle
|
|
19
|
+
* (`enabled: false`) rather than firing an incomplete or unauthenticated
|
|
20
|
+
* request, so it can be mounted before sign-in or before an address is typed.
|
|
21
|
+
*
|
|
22
|
+
* The figure is an **estimate**, not a mark or trade price: the backend caches
|
|
23
|
+
* it for about five minutes and rate-limits the endpoint, so the query defaults
|
|
24
|
+
* to a five-minute `staleTime` / `gcTime` and the same inputs inside that
|
|
25
|
+
* window are served from the cache with no refetch. Render it with a `~` and
|
|
26
|
+
* do not poll — pass `query.staleTime` only if you really need it fresher.
|
|
27
|
+
* Enigma-only; errors are normalized to {@link SymmioRequestError}, with a
|
|
28
|
+
* `401` meaning the token is bad or expired.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const login = useAuthenticateListing();
|
|
33
|
+
* const [token, setToken] = useState("");
|
|
34
|
+
* const [address, setAddress] = useState("");
|
|
35
|
+
*
|
|
36
|
+
* const { data, isPending } = useTokenPrice({
|
|
37
|
+
* accessToken: token,
|
|
38
|
+
* chain: TokenPriceChain.ARC,
|
|
39
|
+
* tokenAddress: address,
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // sign in first, then feed the token to the hook:
|
|
43
|
+
* login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });
|
|
44
|
+
*
|
|
45
|
+
* // the estimate, once the user has pasted an address:
|
|
46
|
+
* data ? `~$${data.price}` : "—";
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function useTokenPrice(parameters: UseTokenPriceParameters): UseTokenPriceReturnType;
|
|
50
|
+
//# sourceMappingURL=use-token-price.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-token-price.d.ts","sourceRoot":"","sources":["../../src/pools/use-token-price.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,8FAA8F;AAC9F,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAE7E,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,uBAAuB,GAAG,uBAAuB,CAoB1F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
|
|
3
|
+
import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
|
|
4
|
+
import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
|
|
5
|
+
import { getTokenPriceQueryOptions as r } from "@symmio/trading-core";
|
|
6
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
7
|
+
//#region src/pools/use-token-price.ts
|
|
8
|
+
function a(a) {
|
|
9
|
+
let o = t(a), s = e(), c = r(o, {
|
|
10
|
+
...a,
|
|
11
|
+
chainId: a.chainId ?? s
|
|
12
|
+
});
|
|
13
|
+
return i({
|
|
14
|
+
...c,
|
|
15
|
+
enabled: (a.query?.enabled ?? !0) && a.accessToken.length > 0 && a.tokenAddress.length > 0,
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
try {
|
|
18
|
+
return await c.queryFn();
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw n(e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as useTokenPrice };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=use-token-price.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-token-price.js","names":[],"sources":["../../src/pools/use-token-price.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getTokenPriceQueryOptions,\n type ConfigParameter,\n type GetTokenPriceOptions,\n type GetTokenPriceReturnType,\n} from \"@symmio/trading-core\";\nimport { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\n\n/** Parameters for {@link useTokenPrice}: the core query options plus an optional `config`. */\nexport type UseTokenPriceParameters = GetTokenPriceOptions & ConfigParameter;\n\n/** Return type of {@link useTokenPrice}: the token's pre-listing price estimate. */\nexport type UseTokenPriceReturnType = UseQueryResult<GetTokenPriceReturnType, SymmioRequestError>;\n\n/**\n * Read a pre-listing **price estimate** for a token — what the Price Service\n * thinks one unit is worth in USD, before (or regardless of whether) the token\n * is listed as a pool. The read a create-pool form shows next to the address\n * the user just pasted.\n *\n * This is an authed read: it takes a Bearer `accessToken` from\n * {@link useAuthenticateListing}, the token's `chain` by vendor name\n * (`TokenPriceChain`, not a numeric chain id), and its `tokenAddress`. The\n * token and the address both gate the query: until the `accessToken` **and**\n * the `tokenAddress` are non-empty strings the hook stays idle\n * (`enabled: false`) rather than firing an incomplete or unauthenticated\n * request, so it can be mounted before sign-in or before an address is typed.\n *\n * The figure is an **estimate**, not a mark or trade price: the backend caches\n * it for about five minutes and rate-limits the endpoint, so the query defaults\n * to a five-minute `staleTime` / `gcTime` and the same inputs inside that\n * window are served from the cache with no refetch. Render it with a `~` and\n * do not poll — pass `query.staleTime` only if you really need it fresher.\n * Enigma-only; errors are normalized to {@link SymmioRequestError}, with a\n * `401` meaning the token is bad or expired.\n *\n * @example\n * ```tsx\n * const login = useAuthenticateListing();\n * const [token, setToken] = useState(\"\");\n * const [address, setAddress] = useState(\"\");\n *\n * const { data, isPending } = useTokenPrice({\n * accessToken: token,\n * chain: TokenPriceChain.ARC,\n * tokenAddress: address,\n * });\n *\n * // sign in first, then feed the token to the hook:\n * login.mutate({}, { onSuccess: (result) => setToken(result.accessToken) });\n *\n * // the estimate, once the user has pasted an address:\n * data ? `~$${data.price}` : \"—\";\n * ```\n */\nexport function useTokenPrice(parameters: UseTokenPriceParameters): UseTokenPriceReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const options = getTokenPriceQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n\n return useQuery({\n ...options,\n enabled:\n (parameters.query?.enabled ?? true) && parameters.accessToken.length > 0 && parameters.tokenAddress.length > 0,\n queryFn: async () => {\n try {\n return await options.queryFn();\n } catch (err) {\n throw normalizeSymmError(err);\n }\n },\n }) as UseTokenPriceReturnType;\n}\n"],"mappings":";;;;;;;AA6DA,SAAgB,EAAc,GAA8D;CAC1F,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAU,EAA0B,GAAQ;EAChD,GAAG;EACH,SAAS,EAAW,WAAW;CACjC,CAAC;CAED,OAAO,EAAS;EACd,GAAG;EACH,UACG,EAAW,OAAO,WAAW,OAAS,EAAW,YAAY,SAAS,KAAK,EAAW,aAAa,SAAS;EAC/G,SAAS,YAAY;GACnB,IAAI;IACF,OAAO,MAAM,EAAQ,QAAQ;GAC/B,SAAS,GAAK;IACZ,MAAM,EAAmB,CAAG;GAC9B;EACF;CACF,CAAC;AACH"}
|
|
@@ -42,6 +42,13 @@ export interface CloseQuoteGroupParameters {
|
|
|
42
42
|
markPrice?: string;
|
|
43
43
|
/** Delegated session key to submit the closes from, when delegation is active. */
|
|
44
44
|
from?: Address;
|
|
45
|
+
/**
|
|
46
|
+
* Check that the signer holds the `requestToClosePosition` delegation before
|
|
47
|
+
* any close is signed. Defaults to `true`; a run that fails it reports
|
|
48
|
+
* `INSTANT_SIGNER_NOT_DELEGATED` in its summary's `error`. Pass `false` when
|
|
49
|
+
* your UI already gates the close on delegation.
|
|
50
|
+
*/
|
|
51
|
+
preflightDelegation?: boolean;
|
|
45
52
|
/**
|
|
46
53
|
* Account whose live notification stream reports the close fills — pass the
|
|
47
54
|
* **sub-account** when closing Virtual Account quotes (the VA frames arrive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-close-quote-group.d.ts","sourceRoot":"","sources":["../../src/quotes/use-close-quote-group.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,eAAe,EAEpB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAgBzE;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnF,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,mDAAmD;IACnD,MAAM,EAAE,yBAAyB,CAAC;IAClC,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B;AAED,8CAA8C;AAC9C,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9E,qEAAqE;AACrE,MAAM,WAAW,yBAAyB;IACxC,iDAAiD;IACjD,KAAK,EAAE,UAAU,CAAC;IAClB,2DAA2D;IAC3D,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;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|
65
65
|
steps: [],
|
|
66
66
|
error: n(/* @__PURE__ */ Error("A group close is already in flight."))
|
|
67
67
|
};
|
|
68
|
-
let { group: t, targetQuantity: r, minAcceptableQuoteValue: a, slippage: d, markPrice: f, from: p,
|
|
69
|
-
if (!
|
|
68
|
+
let { group: t, targetQuantity: r, minAcceptableQuoteValue: a, slippage: d, markPrice: f, from: p, preflightDelegation: m, notificationsAccount: h } = e, _ = e.chainId ?? x, v = c(l(t.quotes, a), r);
|
|
69
|
+
if (!v.feasible) return A({
|
|
70
70
|
status: "failed",
|
|
71
71
|
steps: [],
|
|
72
72
|
closedQuantity: 0n,
|
|
73
73
|
targetQuantity: r,
|
|
74
|
-
planFailure:
|
|
74
|
+
planFailure: v
|
|
75
75
|
}), {
|
|
76
76
|
ok: !1,
|
|
77
77
|
closedQuantity: 0n,
|
|
78
78
|
steps: [],
|
|
79
|
-
planFailure:
|
|
79
|
+
planFailure: v
|
|
80
80
|
};
|
|
81
|
-
let
|
|
81
|
+
let y = new Map(t.quotes.map((e) => [e.key, e])), C = v.allocations.map((e) => ({
|
|
82
82
|
key: e.key,
|
|
83
|
-
quoteId:
|
|
83
|
+
quoteId: y.get(e.key).quoteId,
|
|
84
84
|
closeQuantity: e.closeQuantity,
|
|
85
85
|
kind: e.kind,
|
|
86
86
|
status: "queued"
|
|
87
87
|
}));
|
|
88
88
|
E.current = !0;
|
|
89
|
-
let
|
|
90
|
-
k.current =
|
|
89
|
+
let w = y.get(C[0].key);
|
|
90
|
+
k.current = _, O(h ?? w.vaAddress ?? w.partyA), A({
|
|
91
91
|
status: "closing",
|
|
92
|
-
steps:
|
|
92
|
+
steps: C.map((e) => ({
|
|
93
93
|
...e,
|
|
94
94
|
status: "closing"
|
|
95
95
|
})),
|
|
96
96
|
closedQuantity: 0n,
|
|
97
97
|
targetQuantity: r
|
|
98
98
|
});
|
|
99
|
-
let
|
|
99
|
+
let D = s(b);
|
|
100
100
|
try {
|
|
101
|
-
await
|
|
102
|
-
orders:
|
|
103
|
-
let t =
|
|
101
|
+
await D.mutationFn({
|
|
102
|
+
orders: C.map((e) => {
|
|
103
|
+
let t = y.get(e.key);
|
|
104
104
|
return {
|
|
105
105
|
partyA: t.vaAddress ?? t.partyA,
|
|
106
106
|
market: { id: Number(t.symbolId) },
|
|
@@ -112,7 +112,8 @@ function y(y = {}) {
|
|
|
112
112
|
};
|
|
113
113
|
}),
|
|
114
114
|
from: p,
|
|
115
|
-
|
|
115
|
+
preflightDelegation: m,
|
|
116
|
+
chainId: _
|
|
116
117
|
});
|
|
117
118
|
} catch (e) {
|
|
118
119
|
let t = n(e), r = T.current;
|
|
@@ -134,11 +135,11 @@ function y(y = {}) {
|
|
|
134
135
|
} finally {
|
|
135
136
|
E.current = !1;
|
|
136
137
|
}
|
|
137
|
-
let
|
|
138
|
-
S.invalidateQueries({ predicate: i(o, { configKey:
|
|
139
|
-
let
|
|
140
|
-
return
|
|
141
|
-
...
|
|
138
|
+
let j = b.getChainConfigKey(_);
|
|
139
|
+
S.invalidateQueries({ predicate: i(o, { configKey: j }) });
|
|
140
|
+
let M = T.current;
|
|
141
|
+
return M.status === "closing" && M.steps.every((e) => e.status === "closed") && A({
|
|
142
|
+
...M,
|
|
142
143
|
status: "success"
|
|
143
144
|
}), {
|
|
144
145
|
ok: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-close-quote-group.js","names":[],"sources":["../../src/quotes/use-close-quote-group.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantClosesQueryKey,\n instantCloseBulkAutoMutationOptions,\n NotificationType,\n planGroupClose,\n toGroupCloseCandidates,\n type ConfigParameter,\n type Notification,\n type PlanGroupCloseFailure,\n type QuoteGroup,\n type UnifiedQuote,\n} from \"@symmio/trading-core\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport type { Address } from \"viem\";\nimport { formatUnits } from \"viem\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { predicateMatch } from \"../utils\";\nimport { useNotifications } from \"../websocket/use-notifications\";\n\n/** Decimal places of an 18-decimal-wei fixed-point value. */\nconst WEI_DECIMALS = 18;\n\n/**\n * Solver `lastSeenAction` values that report a close **fill** — the moment a\n * close is actually done (mirrors the core notification classifier's fill set;\n * the request-stage actions are deliberately not here).\n */\nconst CLOSE_FILL_ACTIONS = new Set([\"FillMarketOrderInstantClose\", \"FillLimitOrderClose\"]);\n\n/**\n * Lifecycle of one child close inside a group close:\n * `queued` → `closing` (submitted in the bulk request, awaiting its close-fill\n * notification) → `closed` (fill notification received), or `failed` (the bulk\n * submit or the close itself errored).\n */\nexport type CloseQuoteGroupStepStatus = \"queued\" | \"closing\" | \"closed\" | \"failed\";\n\n/** Live state of one child close inside a group close run. */\nexport interface CloseQuoteGroupStep {\n /** Child identity (`UnifiedQuote.key`). */\n key: string;\n /** On-chain quote id of the child. */\n quoteId: bigint;\n /** Planned close amount, wei. */\n closeQuantity: bigint;\n /** `full` when the child closes entirely, `partial` otherwise. */\n kind: \"full\" | \"partial\";\n /** Current lifecycle stage of this child close. */\n status: CloseQuoteGroupStepStatus;\n /** Normalized error, when `status` is `failed`. */\n error?: SymmioRequestError;\n}\n\n/** Overall lifecycle of a group close run. */\nexport type CloseQuoteGroupStatus = \"idle\" | \"closing\" | \"success\" | \"failed\";\n\n/** Inputs for one {@link UseCloseQuoteGroupReturnType.close} run. */\nexport interface CloseQuoteGroupParameters {\n /** The group whose children are being closed. */\n group: QuoteGroup;\n /** Exact total quantity to close across the group, wei. */\n targetQuantity: bigint;\n /**\n * The symbol's `minAcceptableQuoteValue` (wei) — the dust floor a partially\n * closed child must keep. Read it from the market info of the group's symbol.\n */\n minAcceptableQuoteValue: bigint;\n /** Slippage tolerance percent forwarded to every child close (e.g. `5`). */\n slippage: number;\n /** Pre-fetched mark price (decimal string) forwarded to every child close. */\n markPrice?: string;\n /** Delegated session key to submit the closes from, when delegation is active. */\n from?: Address;\n /**\n * Account whose live notification stream reports the close fills — pass the\n * **sub-account** when closing Virtual Account quotes (the VA frames arrive\n * on its owning sub-account's stream). Defaults to the first child's\n * `vaAddress ?? partyA`.\n */\n notificationsAccount?: Address;\n /** Chain override; defaults to the connected chain. */\n chainId?: number;\n}\n\n/**\n * Submission outcome of one {@link UseCloseQuoteGroupReturnType.close} run.\n * Resolves when the bulk request carrying every child close has been\n * **submitted** — settlement is confirmed asynchronously per child (its\n * close-fill notification), tracked via `status` / `steps` /\n * `progressPercent` on the hook.\n */\nexport interface CloseQuoteGroupSummary {\n /** `true` when every planned child close was submitted successfully. */\n ok: boolean;\n /** Σ quantity already confirmed closed at resolve time, wei. */\n closedQuantity: bigint;\n /** Per-child final states. Empty when planning already failed. */\n steps: CloseQuoteGroupStep[];\n /** Present when the plan itself was infeasible — nothing was closed. */\n planFailure?: PlanGroupCloseFailure;\n /** The error that stopped the run, when `ok` is `false` and a close failed. */\n error?: SymmioRequestError;\n}\n\n/** Return type of {@link useCloseQuoteGroup}. */\nexport interface UseCloseQuoteGroupReturnType {\n /** Plan and execute a group close. Resolves with the run's summary (never rejects). */\n close: (parameters: CloseQuoteGroupParameters) => Promise<CloseQuoteGroupSummary>;\n /** Clear the run state back to `idle`. No-op while a run is in flight. */\n reset: () => void;\n /** Overall run lifecycle. */\n status: CloseQuoteGroupStatus;\n /** `true` while a run is in flight. */\n isClosing: boolean;\n /** Quantity-weighted completion, `0`–`100` (2-decimal resolution). */\n progressPercent: number;\n /** Σ quantity closed so far in the current/last run, wei. */\n closedQuantity: bigint;\n /** The run's target, wei (`0` while idle). */\n targetQuantity: bigint;\n /** Per-child close states of the current/last run, in execution order. */\n steps: CloseQuoteGroupStep[];\n /** Planning failure of the last run, when the plan was infeasible. */\n planFailure?: PlanGroupCloseFailure;\n /** The error that stopped the last run, when a child close failed. */\n error?: SymmioRequestError;\n}\n\n/** Parameters for {@link useCloseQuoteGroup}. */\nexport type UseCloseQuoteGroupParameters = ConfigParameter;\n\ninterface RunState {\n status: CloseQuoteGroupStatus;\n steps: CloseQuoteGroupStep[];\n closedQuantity: bigint;\n targetQuantity: bigint;\n planFailure?: PlanGroupCloseFailure;\n error?: SymmioRequestError;\n}\n\nconst IDLE: RunState = { status: \"idle\", steps: [], closedQuantity: 0n, targetQuantity: 0n };\n\n/**\n * Close an exact quantity across a grouped position, child by child.\n *\n * The run first plans the allocation with `planGroupClose` (largest child\n * first; every partially closed child keeps at least the symbol's\n * `minAcceptableQuoteValue`; the plan sums to the target exactly or fails\n * without closing anything). It then submits **every allocation in one bulk\n * request** (`instantCloseBulkAuto` — n operations, one endpoint call). A\n * submitted child stays `closing` until its close settles: the hook watches\n * the account's live notifications and flips the child to `closed` — advancing\n * `closedQuantity` / `progressPercent` — when its **close fill** frame arrives\n * (`lastSeenAction: FillMarketOrderInstantClose` / `FillLimitOrderClose` with\n * `success`); `status` becomes `success` once every child confirms, and a\n * `failed` frame fails that step and the run. A rejected bulk submit fails the\n * whole run at once.\n *\n * @example\n * ```tsx\n * const { close, status, progressPercent, steps } = useCloseQuoteGroup();\n * const summary = await close({\n * group, targetQuantity: parseUnits(\"2.8\", 18),\n * minAcceptableQuoteValue: market.minAcceptableQuoteValue, slippage: 5,\n * });\n * if (!summary.ok) showError(summary.planFailure ?? summary.error);\n * ```\n */\nexport function useCloseQuoteGroup(parameters: UseCloseQuoteGroupParameters = {}): UseCloseQuoteGroupReturnType {\n const config = useSymmioConfig(parameters);\n const connectedChainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const [state, setState] = useState<RunState>(IDLE);\n /** Mirror of `state` for the notification callback and the submit loop (single source). */\n const runRef = useRef<RunState>(IDLE);\n const inFlight = useRef(false);\n /** Account whose notification stream confirms the run's closes. */\n const [watchAccount, setWatchAccount] = useState<Address>();\n const watchChainIdRef = useRef<number | undefined>(undefined);\n\n const commit = useCallback((next: RunState) => {\n runRef.current = next;\n setState(next);\n }, []);\n\n /**\n * Settlement tracking: a submitted child is finished when its close **fill**\n * notification arrives — `lastSeenAction` of `FillMarketOrderInstantClose`\n * (or `FillLimitOrderClose`) with a `success` status. That flips the step to\n * `closed` and advances progress; the run finishes (`success`) once every\n * step is closed. A `failed` frame for the quote marks the step (and run)\n * failed instead. Request-stage frames (`InstantRequestToClosePosition`, …)\n * are ignored.\n */\n const onNotification = useCallback(\n (notification: Notification) => {\n const run = runRef.current;\n const index = run.steps.findIndex(\n (step) => step.status === \"closing\" && String(step.quoteId) === notification.quoteId,\n );\n if (index < 0) return;\n\n const isCloseFill =\n notification.type === NotificationType.SUCCESS &&\n notification.lastSeenAction !== null &&\n CLOSE_FILL_ACTIONS.has(notification.lastSeenAction);\n const isFailure = notification.type === NotificationType.FAILED;\n if (!isCloseFill && !isFailure) return;\n\n const steps = [...run.steps];\n let closedQuantity = run.closedQuantity;\n if (isCloseFill) {\n const step = { ...steps[index]!, status: \"closed\" as const };\n closedQuantity += step.closeQuantity;\n steps[index] = step;\n const allClosed = steps.every((entry) => entry.status === \"closed\");\n const status = run.status === \"closing\" && allClosed ? \"success\" : run.status;\n commit({ ...run, steps, closedQuantity, status });\n return;\n }\n const error = normalizeSymmError(new Error(notification.failureMessage ?? \"Close failed on the solver.\"));\n steps[index] = { ...steps[index]!, status: \"failed\", error };\n commit({ ...run, steps, status: \"failed\", error });\n },\n [commit],\n );\n\n useNotifications({\n account: watchAccount,\n chainId: watchChainIdRef.current,\n config: parameters.config,\n // Listen while any submitted child still awaits its settle notifications —\n // even after a later submit failed, the earlier closes keep confirming.\n enabled: Boolean(watchAccount) && state.steps.some((step) => step.status === \"closing\"),\n onNotification,\n });\n\n const close = useCallback(\n async (runParameters: CloseQuoteGroupParameters): Promise<CloseQuoteGroupSummary> => {\n if (inFlight.current || runRef.current.steps.some((step) => step.status === \"closing\")) {\n return {\n ok: false,\n closedQuantity: 0n,\n steps: [],\n error: normalizeSymmError(new Error(\"A group close is already in flight.\")),\n };\n }\n\n const { group, targetQuantity, minAcceptableQuoteValue, slippage, markPrice, from, notificationsAccount } =\n runParameters;\n const chainId = runParameters.chainId ?? connectedChainId;\n\n const candidates = toGroupCloseCandidates(group.quotes, minAcceptableQuoteValue);\n const plan = planGroupClose(candidates, targetQuantity);\n if (!plan.feasible) {\n commit({ status: \"failed\", steps: [], closedQuantity: 0n, targetQuantity, planFailure: plan });\n return { ok: false, closedQuantity: 0n, steps: [], planFailure: plan };\n }\n\n const childByKey = new Map<string, UnifiedQuote>(group.quotes.map((quote) => [quote.key, quote]));\n const steps: CloseQuoteGroupStep[] = plan.allocations.map((allocation) => ({\n key: allocation.key,\n // The planner only emits candidates built from anchored children, so the id is present.\n quoteId: childByKey.get(allocation.key)!.quoteId!,\n closeQuantity: allocation.closeQuantity,\n kind: allocation.kind,\n status: \"queued\",\n }));\n\n inFlight.current = true;\n const firstChild = childByKey.get(steps[0]!.key)!;\n watchChainIdRef.current = chainId;\n setWatchAccount(notificationsAccount ?? firstChild.vaAddress ?? firstChild.partyA);\n\n // Every allocation submits in ONE bulk round-trip, so all steps go `closing` together.\n commit({\n status: \"closing\",\n steps: steps.map((step) => ({ ...step, status: \"closing\" as const })),\n closedQuantity: 0n,\n targetQuantity,\n });\n\n const base = instantCloseBulkAutoMutationOptions(config);\n try {\n await base.mutationFn({\n orders: steps.map((step) => {\n const child = childByKey.get(step.key)!;\n return {\n partyA: child.vaAddress ?? child.partyA,\n market: { id: Number(child.symbolId) },\n positionType: child.positionType,\n quoteId: step.quoteId,\n quantityToClose: formatUnits(step.closeQuantity, WEI_DECIMALS),\n slippage,\n markPrice,\n };\n }),\n from,\n chainId,\n });\n } catch (err) {\n const error = normalizeSymmError(err);\n const run = runRef.current;\n commit({\n ...run,\n status: \"failed\",\n steps: run.steps.map((step) =>\n step.status === \"closing\" ? { ...step, status: \"failed\" as const, error } : step,\n ),\n error,\n });\n return { ok: false, closedQuantity: runRef.current.closedQuantity, steps: [...runRef.current.steps], error };\n } finally {\n inFlight.current = false;\n }\n\n // Surface the fresh closing rows immediately, exactly like the single-close hook.\n const configKey = config.getChainConfigKey(chainId);\n void queryClient.invalidateQueries({ predicate: predicateMatch(getInstantClosesQueryKey, { configKey }) });\n\n // Submitted. Completion is notification-driven; fast fills may already have\n // finished the run while the request was in flight.\n const run = runRef.current;\n if (run.status === \"closing\" && run.steps.every((step) => step.status === \"closed\")) {\n commit({ ...run, status: \"success\" });\n }\n return { ok: true, closedQuantity: runRef.current.closedQuantity, steps: [...runRef.current.steps] };\n },\n [commit, config, connectedChainId, queryClient],\n );\n\n const reset = useCallback(() => {\n if (inFlight.current) return;\n watchChainIdRef.current = undefined;\n setWatchAccount(undefined);\n commit(IDLE);\n }, [commit]);\n\n const progressPercent = useMemo(() => {\n if (state.targetQuantity <= 0n) return 0;\n return Number((state.closedQuantity * 10_000n) / state.targetQuantity) / 100;\n }, [state.closedQuantity, state.targetQuantity]);\n\n return {\n close,\n reset,\n status: state.status,\n isClosing: state.status === \"closing\",\n progressPercent,\n closedQuantity: state.closedQuantity,\n targetQuantity: state.targetQuantity,\n steps: state.steps,\n planFailure: state.planFailure,\n error: state.error,\n };\n}\n"],"mappings":";;;;;;;;;;;AA0BA,IAAM,IAAe,IAOf,IAAqB,IAAI,IAAI,CAAC,+BAA+B,qBAAqB,CAAC,GAiHnF,IAAiB;CAAE,QAAQ;CAAQ,OAAO,CAAC;CAAG,gBAAgB;CAAI,gBAAgB;AAAG;AA4B3F,SAAgB,EAAmB,IAA2C,CAAC,GAAiC;CAC9G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAmB,EAAiB,GACpC,IAAc,EAAe,GAC7B,CAAC,GAAO,KAAY,EAAmB,CAAI,GAE3C,IAAS,EAAiB,CAAI,GAC9B,IAAW,EAAO,EAAK,GAEvB,CAAC,GAAc,KAAmB,EAAkB,GACpD,IAAkB,EAA2B,KAAA,CAAS,GAEtD,IAAS,GAAa,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OAAO,EAAM;EACb,aAAa,EAAM;EACnB,OAAO,EAAM;CACf;AACF"}
|
|
1
|
+
{"version":3,"file":"use-close-quote-group.js","names":[],"sources":["../../src/quotes/use-close-quote-group.ts"],"sourcesContent":["\"use client\";\n\nimport {\n getInstantClosesQueryKey,\n instantCloseBulkAutoMutationOptions,\n NotificationType,\n planGroupClose,\n toGroupCloseCandidates,\n type ConfigParameter,\n type Notification,\n type PlanGroupCloseFailure,\n type QuoteGroup,\n type UnifiedQuote,\n} from \"@symmio/trading-core\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nimport type { Address } from \"viem\";\nimport { formatUnits } from \"viem\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { predicateMatch } from \"../utils\";\nimport { useNotifications } from \"../websocket/use-notifications\";\n\n/** Decimal places of an 18-decimal-wei fixed-point value. */\nconst WEI_DECIMALS = 18;\n\n/**\n * Solver `lastSeenAction` values that report a close **fill** — the moment a\n * close is actually done (mirrors the core notification classifier's fill set;\n * the request-stage actions are deliberately not here).\n */\nconst CLOSE_FILL_ACTIONS = new Set([\"FillMarketOrderInstantClose\", \"FillLimitOrderClose\"]);\n\n/**\n * Lifecycle of one child close inside a group close:\n * `queued` → `closing` (submitted in the bulk request, awaiting its close-fill\n * notification) → `closed` (fill notification received), or `failed` (the bulk\n * submit or the close itself errored).\n */\nexport type CloseQuoteGroupStepStatus = \"queued\" | \"closing\" | \"closed\" | \"failed\";\n\n/** Live state of one child close inside a group close run. */\nexport interface CloseQuoteGroupStep {\n /** Child identity (`UnifiedQuote.key`). */\n key: string;\n /** On-chain quote id of the child. */\n quoteId: bigint;\n /** Planned close amount, wei. */\n closeQuantity: bigint;\n /** `full` when the child closes entirely, `partial` otherwise. */\n kind: \"full\" | \"partial\";\n /** Current lifecycle stage of this child close. */\n status: CloseQuoteGroupStepStatus;\n /** Normalized error, when `status` is `failed`. */\n error?: SymmioRequestError;\n}\n\n/** Overall lifecycle of a group close run. */\nexport type CloseQuoteGroupStatus = \"idle\" | \"closing\" | \"success\" | \"failed\";\n\n/** Inputs for one {@link UseCloseQuoteGroupReturnType.close} run. */\nexport interface CloseQuoteGroupParameters {\n /** The group whose children are being closed. */\n group: QuoteGroup;\n /** Exact total quantity to close across the group, wei. */\n targetQuantity: bigint;\n /**\n * The symbol's `minAcceptableQuoteValue` (wei) — the dust floor a partially\n * closed child must keep. Read it from the market info of the group's symbol.\n */\n minAcceptableQuoteValue: bigint;\n /** Slippage tolerance percent forwarded to every child close (e.g. `5`). */\n slippage: number;\n /** Pre-fetched mark price (decimal string) forwarded to every child close. */\n markPrice?: string;\n /** Delegated session key to submit the closes from, when delegation is active. */\n from?: Address;\n /**\n * Check that the signer holds the `requestToClosePosition` delegation before\n * any close is signed. Defaults to `true`; a run that fails it reports\n * `INSTANT_SIGNER_NOT_DELEGATED` in its summary's `error`. Pass `false` when\n * your UI already gates the close on delegation.\n */\n preflightDelegation?: boolean;\n /**\n * Account whose live notification stream reports the close fills — pass the\n * **sub-account** when closing Virtual Account quotes (the VA frames arrive\n * on its owning sub-account's stream). Defaults to the first child's\n * `vaAddress ?? partyA`.\n */\n notificationsAccount?: Address;\n /** Chain override; defaults to the connected chain. */\n chainId?: number;\n}\n\n/**\n * Submission outcome of one {@link UseCloseQuoteGroupReturnType.close} run.\n * Resolves when the bulk request carrying every child close has been\n * **submitted** — settlement is confirmed asynchronously per child (its\n * close-fill notification), tracked via `status` / `steps` /\n * `progressPercent` on the hook.\n */\nexport interface CloseQuoteGroupSummary {\n /** `true` when every planned child close was submitted successfully. */\n ok: boolean;\n /** Σ quantity already confirmed closed at resolve time, wei. */\n closedQuantity: bigint;\n /** Per-child final states. Empty when planning already failed. */\n steps: CloseQuoteGroupStep[];\n /** Present when the plan itself was infeasible — nothing was closed. */\n planFailure?: PlanGroupCloseFailure;\n /** The error that stopped the run, when `ok` is `false` and a close failed. */\n error?: SymmioRequestError;\n}\n\n/** Return type of {@link useCloseQuoteGroup}. */\nexport interface UseCloseQuoteGroupReturnType {\n /** Plan and execute a group close. Resolves with the run's summary (never rejects). */\n close: (parameters: CloseQuoteGroupParameters) => Promise<CloseQuoteGroupSummary>;\n /** Clear the run state back to `idle`. No-op while a run is in flight. */\n reset: () => void;\n /** Overall run lifecycle. */\n status: CloseQuoteGroupStatus;\n /** `true` while a run is in flight. */\n isClosing: boolean;\n /** Quantity-weighted completion, `0`–`100` (2-decimal resolution). */\n progressPercent: number;\n /** Σ quantity closed so far in the current/last run, wei. */\n closedQuantity: bigint;\n /** The run's target, wei (`0` while idle). */\n targetQuantity: bigint;\n /** Per-child close states of the current/last run, in execution order. */\n steps: CloseQuoteGroupStep[];\n /** Planning failure of the last run, when the plan was infeasible. */\n planFailure?: PlanGroupCloseFailure;\n /** The error that stopped the last run, when a child close failed. */\n error?: SymmioRequestError;\n}\n\n/** Parameters for {@link useCloseQuoteGroup}. */\nexport type UseCloseQuoteGroupParameters = ConfigParameter;\n\ninterface RunState {\n status: CloseQuoteGroupStatus;\n steps: CloseQuoteGroupStep[];\n closedQuantity: bigint;\n targetQuantity: bigint;\n planFailure?: PlanGroupCloseFailure;\n error?: SymmioRequestError;\n}\n\nconst IDLE: RunState = { status: \"idle\", steps: [], closedQuantity: 0n, targetQuantity: 0n };\n\n/**\n * Close an exact quantity across a grouped position, child by child.\n *\n * The run first plans the allocation with `planGroupClose` (largest child\n * first; every partially closed child keeps at least the symbol's\n * `minAcceptableQuoteValue`; the plan sums to the target exactly or fails\n * without closing anything). It then submits **every allocation in one bulk\n * request** (`instantCloseBulkAuto` — n operations, one endpoint call). A\n * submitted child stays `closing` until its close settles: the hook watches\n * the account's live notifications and flips the child to `closed` — advancing\n * `closedQuantity` / `progressPercent` — when its **close fill** frame arrives\n * (`lastSeenAction: FillMarketOrderInstantClose` / `FillLimitOrderClose` with\n * `success`); `status` becomes `success` once every child confirms, and a\n * `failed` frame fails that step and the run. A rejected bulk submit fails the\n * whole run at once.\n *\n * @example\n * ```tsx\n * const { close, status, progressPercent, steps } = useCloseQuoteGroup();\n * const summary = await close({\n * group, targetQuantity: parseUnits(\"2.8\", 18),\n * minAcceptableQuoteValue: market.minAcceptableQuoteValue, slippage: 5,\n * });\n * if (!summary.ok) showError(summary.planFailure ?? summary.error);\n * ```\n */\nexport function useCloseQuoteGroup(parameters: UseCloseQuoteGroupParameters = {}): UseCloseQuoteGroupReturnType {\n const config = useSymmioConfig(parameters);\n const connectedChainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const [state, setState] = useState<RunState>(IDLE);\n /** Mirror of `state` for the notification callback and the submit loop (single source). */\n const runRef = useRef<RunState>(IDLE);\n const inFlight = useRef(false);\n /** Account whose notification stream confirms the run's closes. */\n const [watchAccount, setWatchAccount] = useState<Address>();\n const watchChainIdRef = useRef<number | undefined>(undefined);\n\n const commit = useCallback((next: RunState) => {\n runRef.current = next;\n setState(next);\n }, []);\n\n /**\n * Settlement tracking: a submitted child is finished when its close **fill**\n * notification arrives — `lastSeenAction` of `FillMarketOrderInstantClose`\n * (or `FillLimitOrderClose`) with a `success` status. That flips the step to\n * `closed` and advances progress; the run finishes (`success`) once every\n * step is closed. A `failed` frame for the quote marks the step (and run)\n * failed instead. Request-stage frames (`InstantRequestToClosePosition`, …)\n * are ignored.\n */\n const onNotification = useCallback(\n (notification: Notification) => {\n const run = runRef.current;\n const index = run.steps.findIndex(\n (step) => step.status === \"closing\" && String(step.quoteId) === notification.quoteId,\n );\n if (index < 0) return;\n\n const isCloseFill =\n notification.type === NotificationType.SUCCESS &&\n notification.lastSeenAction !== null &&\n CLOSE_FILL_ACTIONS.has(notification.lastSeenAction);\n const isFailure = notification.type === NotificationType.FAILED;\n if (!isCloseFill && !isFailure) return;\n\n const steps = [...run.steps];\n let closedQuantity = run.closedQuantity;\n if (isCloseFill) {\n const step = { ...steps[index]!, status: \"closed\" as const };\n closedQuantity += step.closeQuantity;\n steps[index] = step;\n const allClosed = steps.every((entry) => entry.status === \"closed\");\n const status = run.status === \"closing\" && allClosed ? \"success\" : run.status;\n commit({ ...run, steps, closedQuantity, status });\n return;\n }\n const error = normalizeSymmError(new Error(notification.failureMessage ?? \"Close failed on the solver.\"));\n steps[index] = { ...steps[index]!, status: \"failed\", error };\n commit({ ...run, steps, status: \"failed\", error });\n },\n [commit],\n );\n\n useNotifications({\n account: watchAccount,\n chainId: watchChainIdRef.current,\n config: parameters.config,\n // Listen while any submitted child still awaits its settle notifications —\n // even after a later submit failed, the earlier closes keep confirming.\n enabled: Boolean(watchAccount) && state.steps.some((step) => step.status === \"closing\"),\n onNotification,\n });\n\n const close = useCallback(\n async (runParameters: CloseQuoteGroupParameters): Promise<CloseQuoteGroupSummary> => {\n if (inFlight.current || runRef.current.steps.some((step) => step.status === \"closing\")) {\n return {\n ok: false,\n closedQuantity: 0n,\n steps: [],\n error: normalizeSymmError(new Error(\"A group close is already in flight.\")),\n };\n }\n\n const {\n group,\n targetQuantity,\n minAcceptableQuoteValue,\n slippage,\n markPrice,\n from,\n preflightDelegation,\n notificationsAccount,\n } = runParameters;\n const chainId = runParameters.chainId ?? connectedChainId;\n\n const candidates = toGroupCloseCandidates(group.quotes, minAcceptableQuoteValue);\n const plan = planGroupClose(candidates, targetQuantity);\n if (!plan.feasible) {\n commit({ status: \"failed\", steps: [], closedQuantity: 0n, targetQuantity, planFailure: plan });\n return { ok: false, closedQuantity: 0n, steps: [], planFailure: plan };\n }\n\n const childByKey = new Map<string, UnifiedQuote>(group.quotes.map((quote) => [quote.key, quote]));\n const steps: CloseQuoteGroupStep[] = plan.allocations.map((allocation) => ({\n key: allocation.key,\n // The planner only emits candidates built from anchored children, so the id is present.\n quoteId: childByKey.get(allocation.key)!.quoteId!,\n closeQuantity: allocation.closeQuantity,\n kind: allocation.kind,\n status: \"queued\",\n }));\n\n inFlight.current = true;\n const firstChild = childByKey.get(steps[0]!.key)!;\n watchChainIdRef.current = chainId;\n setWatchAccount(notificationsAccount ?? firstChild.vaAddress ?? firstChild.partyA);\n\n // Every allocation submits in ONE bulk round-trip, so all steps go `closing` together.\n commit({\n status: \"closing\",\n steps: steps.map((step) => ({ ...step, status: \"closing\" as const })),\n closedQuantity: 0n,\n targetQuantity,\n });\n\n const base = instantCloseBulkAutoMutationOptions(config);\n try {\n await base.mutationFn({\n orders: steps.map((step) => {\n const child = childByKey.get(step.key)!;\n return {\n partyA: child.vaAddress ?? child.partyA,\n market: { id: Number(child.symbolId) },\n positionType: child.positionType,\n quoteId: step.quoteId,\n quantityToClose: formatUnits(step.closeQuantity, WEI_DECIMALS),\n slippage,\n markPrice,\n };\n }),\n from,\n preflightDelegation,\n chainId,\n });\n } catch (err) {\n const error = normalizeSymmError(err);\n const run = runRef.current;\n commit({\n ...run,\n status: \"failed\",\n steps: run.steps.map((step) =>\n step.status === \"closing\" ? { ...step, status: \"failed\" as const, error } : step,\n ),\n error,\n });\n return { ok: false, closedQuantity: runRef.current.closedQuantity, steps: [...runRef.current.steps], error };\n } finally {\n inFlight.current = false;\n }\n\n // Surface the fresh closing rows immediately, exactly like the single-close hook.\n const configKey = config.getChainConfigKey(chainId);\n void queryClient.invalidateQueries({ predicate: predicateMatch(getInstantClosesQueryKey, { configKey }) });\n\n // Submitted. Completion is notification-driven; fast fills may already have\n // finished the run while the request was in flight.\n const run = runRef.current;\n if (run.status === \"closing\" && run.steps.every((step) => step.status === \"closed\")) {\n commit({ ...run, status: \"success\" });\n }\n return { ok: true, closedQuantity: runRef.current.closedQuantity, steps: [...runRef.current.steps] };\n },\n [commit, config, connectedChainId, queryClient],\n );\n\n const reset = useCallback(() => {\n if (inFlight.current) return;\n watchChainIdRef.current = undefined;\n setWatchAccount(undefined);\n commit(IDLE);\n }, [commit]);\n\n const progressPercent = useMemo(() => {\n if (state.targetQuantity <= 0n) return 0;\n return Number((state.closedQuantity * 10_000n) / state.targetQuantity) / 100;\n }, [state.closedQuantity, state.targetQuantity]);\n\n return {\n close,\n reset,\n status: state.status,\n isClosing: state.status === \"closing\",\n progressPercent,\n closedQuantity: state.closedQuantity,\n targetQuantity: state.targetQuantity,\n steps: state.steps,\n planFailure: state.planFailure,\n error: state.error,\n };\n}\n"],"mappings":";;;;;;;;;;;AA0BA,IAAM,IAAe,IAOf,IAAqB,IAAI,IAAI,CAAC,+BAA+B,qBAAqB,CAAC,GAwHnF,IAAiB;CAAE,QAAQ;CAAQ,OAAO,CAAC;CAAG,gBAAgB;CAAI,gBAAgB;AAAG;AA4B3F,SAAgB,EAAmB,IAA2C,CAAC,GAAiC;CAC9G,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAmB,EAAiB,GACpC,IAAc,EAAe,GAC7B,CAAC,GAAO,KAAY,EAAmB,CAAI,GAE3C,IAAS,EAAiB,CAAI,GAC9B,IAAW,EAAO,EAAK,GAEvB,CAAC,GAAc,KAAmB,EAAkB,GACpD,IAAkB,EAA2B,KAAA,CAAS,GAEtD,IAAS,GAAa,MAAmB;EAE7C,AADA,EAAO,UAAU,GACjB,EAAS,CAAI;CACf,GAAG,CAAC,CAAC,GAWC,IAAiB,GACpB,MAA+B;EAC9B,IAAM,IAAM,EAAO,SACb,IAAQ,EAAI,MAAM,WACrB,MAAS,EAAK,WAAW,aAAa,OAAO,EAAK,OAAO,MAAM,EAAa,OAC/E;EACA,IAAI,IAAQ,GAAG;EAEf,IAAM,IACJ,EAAa,SAAS,EAAiB,WACvC,EAAa,mBAAmB,QAChC,EAAmB,IAAI,EAAa,cAAc,GAC9C,IAAY,EAAa,SAAS,EAAiB;EACzD,IAAI,CAAC,KAAe,CAAC,GAAW;EAEhC,IAAM,IAAQ,CAAC,GAAG,EAAI,KAAK,GACvB,IAAiB,EAAI;EACzB,IAAI,GAAa;GACf,IAAM,IAAO;IAAE,GAAG,EAAM;IAAS,QAAQ;GAAkB;GAE3D,AADA,KAAkB,EAAK,eACvB,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IAAM,EAAO;EAInB,OAHI,EAAI,WAAW,aAAa,EAAI,MAAM,OAAO,MAAS,EAAK,WAAW,QAAQ,KAChF,EAAO;GAAE,GAAG;GAAK,QAAQ;EAAU,CAAC,GAE/B;GAAE,IAAI;GAAM,gBAAgB,EAAO,QAAQ;GAAgB,OAAO,CAAC,GAAG,EAAO,QAAQ,KAAK;EAAE;CACrG,GACA;EAAC;EAAQ;EAAQ;EAAkB;CAAW,CAChD,GAEM,IAAQ,QAAkB;EAC1B,EAAS,YACb,EAAgB,UAAU,KAAA,GAC1B,EAAgB,KAAA,CAAS,GACzB,EAAO,CAAI;CACb,GAAG,CAAC,CAAM,CAAC,GAEL,IAAkB,QAClB,EAAM,kBAAkB,KAAW,IAChC,OAAQ,EAAM,iBAAiB,SAAW,EAAM,cAAc,IAAI,KACxE,CAAC,EAAM,gBAAgB,EAAM,cAAc,CAAC;CAE/C,OAAO;EACL;EACA;EACA,QAAQ,EAAM;EACd,WAAW,EAAM,WAAW;EAC5B;EACA,gBAAgB,EAAM;EACtB,gBAAgB,EAAM;EACtB,OAAO,EAAM;EACb,aAAa,EAAM;EACnB,OAAO,EAAM;CACf;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symmio/trading-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "React adapter for the SYMMIO SDK. Hooks, providers, and React-bound ergonomics on top of @symmio/trading-core.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/SYMM-IO/Trading-SDK/tree/main/packages/trading-react#readme",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@tanstack/react-query": "^5.100.0",
|
|
92
92
|
"decimal.js": "^10.4.3",
|
|
93
93
|
"zustand": "^5.0.0",
|
|
94
|
-
"@symmio/trading-core": "^3.
|
|
94
|
+
"@symmio/trading-core": "^3.6.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"react": "^19.0.0",
|