@orderly.network/hooks 1.1.4-rc.8 → 1.1.4
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/esm/configProvider.d.ts +17 -0
- package/esm/configProvider.d.ts.map +1 -0
- package/esm/configProvider.js +54 -0
- package/esm/dataProvider.d.ts +10 -0
- package/esm/dataProvider.d.ts.map +1 -0
- package/esm/dataProvider.js +29 -0
- package/esm/index.d.ts +33 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +30 -0
- package/esm/middleware/signatureMiddleware.d.ts +3 -0
- package/esm/middleware/signatureMiddleware.d.ts.map +1 -0
- package/esm/middleware/signatureMiddleware.js +32 -0
- package/esm/orderly/orderlyHooks.d.ts +30 -0
- package/esm/orderly/orderlyHooks.d.ts.map +1 -0
- package/esm/orderly/orderlyHooks.js +27 -0
- package/esm/orderly/useAccountInfo.d.ts +3 -0
- package/esm/orderly/useAccountInfo.d.ts.map +1 -0
- package/esm/orderly/useAccountInfo.js +4 -0
- package/esm/orderly/useChain.d.ts +6 -0
- package/esm/orderly/useChain.d.ts.map +1 -0
- package/esm/orderly/useChain.js +22 -0
- package/esm/orderly/useChains.d.ts +34 -0
- package/esm/orderly/useChains.d.ts.map +1 -0
- package/esm/orderly/useChains.js +159 -0
- package/esm/orderly/useCollateral.d.ts +16 -0
- package/esm/orderly/useCollateral.d.ts.map +1 -0
- package/esm/orderly/useCollateral.js +72 -0
- package/esm/orderly/useDeposit.d.ts +38 -0
- package/esm/orderly/useDeposit.d.ts.map +1 -0
- package/esm/orderly/useDeposit.js +270 -0
- package/esm/orderly/useFundingRate.d.ts +11 -0
- package/esm/orderly/useFundingRate.d.ts.map +1 -0
- package/esm/orderly/useFundingRate.js +40 -0
- package/esm/orderly/useFundingRates.d.ts +2 -0
- package/esm/orderly/useFundingRates.d.ts.map +1 -0
- package/esm/orderly/useFundingRates.js +21 -0
- package/esm/orderly/useHoldingStream.d.ts +7 -0
- package/esm/orderly/useHoldingStream.d.ts.map +1 -0
- package/esm/orderly/useHoldingStream.js +47 -0
- package/esm/orderly/useIndexPrice.d.ts +2 -0
- package/esm/orderly/useIndexPrice.d.ts.map +1 -0
- package/esm/orderly/useIndexPrice.js +17 -0
- package/esm/orderly/useLeverage.d.ts +2 -0
- package/esm/orderly/useLeverage.d.ts.map +1 -0
- package/esm/orderly/useLeverage.js +34 -0
- package/esm/orderly/useMarginRatio.d.ts +7 -0
- package/esm/orderly/useMarginRatio.d.ts.map +1 -0
- package/esm/orderly/useMarginRatio.js +41 -0
- package/esm/orderly/useMarkPrice.d.ts +4 -0
- package/esm/orderly/useMarkPrice.d.ts.map +1 -0
- package/esm/orderly/useMarkPrice.js +29 -0
- package/esm/orderly/useMarkPricesStream.d.ts +2 -0
- package/esm/orderly/useMarkPricesStream.d.ts.map +1 -0
- package/esm/orderly/useMarkPricesStream.js +26 -0
- package/esm/orderly/useMarketTradeStream.d.ts +9 -0
- package/esm/orderly/useMarketTradeStream.d.ts.map +1 -0
- package/esm/orderly/useMarketTradeStream.js +51 -0
- package/esm/orderly/useMarkets.d.ts +36 -0
- package/esm/orderly/useMarkets.d.ts.map +1 -0
- package/esm/orderly/useMarkets.js +240 -0
- package/esm/orderly/useMarketsStream.d.ts +5 -0
- package/esm/orderly/useMarketsStream.d.ts.map +1 -0
- package/esm/orderly/useMarketsStream.js +57 -0
- package/esm/orderly/useMaxQty.d.ts +3 -0
- package/esm/orderly/useMaxQty.d.ts.map +1 -0
- package/esm/orderly/useMaxQty.js +114 -0
- package/esm/orderly/useOpenInterest.d.ts +2 -0
- package/esm/orderly/useOpenInterest.d.ts.map +1 -0
- package/esm/orderly/useOpenInterest.js +15 -0
- package/esm/orderly/useOrderEntry.d.ts +63 -0
- package/esm/orderly/useOrderEntry.d.ts.map +1 -0
- package/esm/orderly/useOrderEntry.js +504 -0
- package/esm/orderly/useOrderStream.d.ts +38 -0
- package/esm/orderly/useOrderStream.d.ts.map +1 -0
- package/esm/orderly/useOrderStream.js +180 -0
- package/esm/orderly/useOrderbookStream.d.ts +53 -0
- package/esm/orderly/useOrderbookStream.d.ts.map +1 -0
- package/esm/orderly/useOrderbookStream.js +309 -0
- package/esm/orderly/usePositionStream.d.ts +25 -0
- package/esm/orderly/usePositionStream.d.ts.map +1 -0
- package/esm/orderly/usePositionStream.js +232 -0
- package/esm/orderly/usePrivateDataObserver.d.ts +5 -0
- package/esm/orderly/usePrivateDataObserver.d.ts.map +1 -0
- package/esm/orderly/usePrivateDataObserver.js +126 -0
- package/esm/orderly/useSettleSubscription.d.ts +4 -0
- package/esm/orderly/useSettleSubscription.d.ts.map +1 -0
- package/esm/orderly/useSettleSubscription.js +20 -0
- package/esm/orderly/useSymbolPriceRange.d.ts +13 -0
- package/esm/orderly/useSymbolPriceRange.d.ts.map +1 -0
- package/esm/orderly/useSymbolPriceRange.js +39 -0
- package/esm/orderly/useSymbolsInfo.d.ts +2 -0
- package/esm/orderly/useSymbolsInfo.d.ts.map +1 -0
- package/esm/orderly/useSymbolsInfo.js +33 -0
- package/esm/orderly/useTickerStream.d.ts +3 -0
- package/esm/orderly/useTickerStream.d.ts.map +1 -0
- package/esm/orderly/useTickerStream.js +86 -0
- package/esm/orderly/useWalletSubscription.d.ts +4 -0
- package/esm/orderly/useWalletSubscription.d.ts.map +1 -0
- package/esm/orderly/useWalletSubscription.js +20 -0
- package/esm/orderly/useWithdraw.d.ts +14 -0
- package/esm/orderly/useWithdraw.d.ts.map +1 -0
- package/esm/orderly/useWithdraw.js +64 -0
- package/esm/orderlyContext.d.ts +17 -0
- package/esm/orderlyContext.d.ts.map +1 -0
- package/esm/orderlyContext.js +5 -0
- package/esm/services/dataCenter.d.ts +2 -0
- package/esm/services/dataCenter.d.ts.map +1 -0
- package/esm/services/dataCenter.js +13 -0
- package/esm/services/painter/backgroundPaint.d.ts +9 -0
- package/esm/services/painter/backgroundPaint.d.ts.map +1 -0
- package/esm/services/painter/backgroundPaint.js +41 -0
- package/esm/services/painter/basePaint.d.ts +90 -0
- package/esm/services/painter/basePaint.d.ts.map +1 -0
- package/esm/services/painter/basePaint.js +6 -0
- package/esm/services/painter/dataPaint.d.ts +16 -0
- package/esm/services/painter/dataPaint.d.ts.map +1 -0
- package/esm/services/painter/dataPaint.js +195 -0
- package/esm/services/painter/layout.config.d.ts +3 -0
- package/esm/services/painter/layout.config.d.ts.map +1 -0
- package/esm/services/painter/layout.config.js +52 -0
- package/esm/services/painter/painter.d.ts +12 -0
- package/esm/services/painter/painter.d.ts.map +1 -0
- package/esm/services/painter/painter.js +37 -0
- package/esm/services/painter/resource.d.ts +7 -0
- package/esm/services/painter/resource.d.ts.map +1 -0
- package/esm/services/painter/resource.js +15 -0
- package/esm/statusProvider.d.ts +8 -0
- package/esm/statusProvider.d.ts.map +1 -0
- package/esm/statusProvider.js +8 -0
- package/esm/unuse/apiPrefixMiddleware.d.ts +3 -0
- package/esm/unuse/apiPrefixMiddleware.d.ts.map +1 -0
- package/esm/unuse/apiPrefixMiddleware.js +29 -0
- package/esm/unuse/fn.d.ts +2 -0
- package/esm/unuse/fn.d.ts.map +1 -0
- package/esm/unuse/fn.js +6 -0
- package/esm/unuse/useBalance.d.ts +2 -0
- package/esm/unuse/useBalance.d.ts.map +1 -0
- package/esm/unuse/useBalance.js +12 -0
- package/esm/unuse/useFetures.d.ts +11 -0
- package/esm/unuse/useFetures.d.ts.map +1 -0
- package/esm/unuse/useFetures.js +39 -0
- package/esm/unuse/useRunOnce.d.ts +7 -0
- package/esm/unuse/useRunOnce.d.ts.map +1 -0
- package/esm/unuse/useRunOnce.js +17 -0
- package/esm/unuse/useSyncEnd.d.ts +2 -0
- package/esm/unuse/useSyncEnd.d.ts.map +1 -0
- package/esm/unuse/useSyncEnd.js +10 -0
- package/esm/unuse/useTokenInfo.d.ts +2 -0
- package/esm/unuse/useTokenInfo.d.ts.map +1 -0
- package/esm/unuse/useTokenInfo.js +20 -0
- package/esm/unuse/useUnsettlementPnL.d.ts +2 -0
- package/esm/unuse/useUnsettlementPnL.d.ts.map +1 -0
- package/esm/unuse/useUnsettlementPnL.js +20 -0
- package/esm/useAccount.d.ts +8 -0
- package/esm/useAccount.d.ts.map +1 -0
- package/esm/useAccount.js +59 -0
- package/esm/useAccountInstance.d.ts +3 -0
- package/esm/useAccountInstance.d.ts.map +1 -0
- package/esm/useAccountInstance.js +23 -0
- package/esm/useBoolean.d.ts +6 -0
- package/esm/useBoolean.d.ts.map +1 -0
- package/esm/useBoolean.js +8 -0
- package/esm/useConfig.d.ts +3 -0
- package/esm/useConfig.d.ts.map +1 -0
- package/esm/useConfig.js +12 -0
- package/esm/useEventEmitter.d.ts +3 -0
- package/esm/useEventEmitter.d.ts.map +1 -0
- package/esm/useEventEmitter.js +12 -0
- package/esm/useLazyQuery.d.ts +13 -0
- package/esm/useLazyQuery.d.ts.map +1 -0
- package/esm/useLazyQuery.js +35 -0
- package/esm/useLocalStorage.d.ts +2 -0
- package/esm/useLocalStorage.d.ts.map +1 -0
- package/esm/useLocalStorage.js +74 -0
- package/esm/useMediaQuery.d.ts +2 -0
- package/esm/useMediaQuery.d.ts.map +1 -0
- package/esm/useMediaQuery.js +36 -0
- package/esm/useMutation.d.ts +10 -0
- package/esm/useMutation.d.ts.map +1 -0
- package/esm/useMutation.js +64 -0
- package/esm/useObserve.d.ts +6 -0
- package/esm/useObserve.d.ts.map +1 -0
- package/esm/useObserve.js +8 -0
- package/esm/useParamsCheck.d.ts +4 -0
- package/esm/useParamsCheck.d.ts.map +1 -0
- package/esm/useParamsCheck.js +14 -0
- package/esm/usePoster.d.ts +14 -0
- package/esm/usePoster.d.ts.map +1 -0
- package/esm/usePoster.js +52 -0
- package/esm/usePreloadData.d.ts +5 -0
- package/esm/usePreloadData.d.ts.map +1 -0
- package/esm/usePreloadData.js +14 -0
- package/esm/usePrivateInfiniteQuery.d.ts +5 -0
- package/esm/usePrivateInfiniteQuery.d.ts.map +1 -0
- package/esm/usePrivateInfiniteQuery.js +25 -0
- package/esm/usePrivateQuery.d.ts +10 -0
- package/esm/usePrivateQuery.d.ts.map +1 -0
- package/esm/usePrivateQuery.js +26 -0
- package/esm/useQuery.d.ts +10 -0
- package/esm/useQuery.d.ts.map +1 -0
- package/esm/useQuery.js +20 -0
- package/esm/useSessionStorage.d.ts +2 -0
- package/esm/useSessionStorage.d.ts.map +1 -0
- package/esm/useSessionStorage.js +60 -0
- package/esm/useWS.d.ts +3 -0
- package/esm/useWS.d.ts.map +1 -0
- package/esm/useWS.js +51 -0
- package/esm/useWsStatus.d.ts +7 -0
- package/esm/useWsStatus.d.ts.map +1 -0
- package/esm/useWsStatus.js +41 -0
- package/esm/utils/createGetter.d.ts +4 -0
- package/esm/utils/createGetter.d.ts.map +1 -0
- package/esm/utils/createGetter.js +21 -0
- package/esm/utils/createOrder.d.ts +56 -0
- package/esm/utils/createOrder.d.ts.map +1 -0
- package/esm/utils/createOrder.js +324 -0
- package/esm/utils/fetcher.d.ts +6 -0
- package/esm/utils/fetcher.d.ts.map +1 -0
- package/esm/utils/fetcher.js +2 -0
- package/esm/utils/json.d.ts +2 -0
- package/esm/utils/json.d.ts.map +1 -0
- package/esm/utils/json.js +8 -0
- package/esm/utils/orderEntryHelper.d.ts +25 -0
- package/esm/utils/orderEntryHelper.d.ts.map +1 -0
- package/esm/utils/orderEntryHelper.js +242 -0
- package/esm/utils/parseHolding.d.ts +9 -0
- package/esm/utils/parseHolding.d.ts.map +1 -0
- package/esm/utils/parseHolding.js +21 -0
- package/esm/version.d.ts +10 -0
- package/esm/version.d.ts.map +1 -0
- package/esm/version.js +6 -0
- package/esm/walletConnectorContext.d.ts +30 -0
- package/esm/walletConnectorContext.d.ts.map +1 -0
- package/esm/walletConnectorContext.js +5 -0
- package/lib/configProvider.d.ts +17 -0
- package/lib/configProvider.d.ts.map +1 -0
- package/lib/configProvider.js +82 -0
- package/lib/dataProvider.d.ts +10 -0
- package/lib/dataProvider.d.ts.map +1 -0
- package/lib/dataProvider.js +34 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +88 -0
- package/lib/middleware/signatureMiddleware.d.ts +3 -0
- package/lib/middleware/signatureMiddleware.d.ts.map +1 -0
- package/lib/middleware/signatureMiddleware.js +36 -0
- package/lib/orderly/orderlyHooks.d.ts +30 -0
- package/lib/orderly/orderlyHooks.d.ts.map +1 -0
- package/lib/orderly/orderlyHooks.js +58 -0
- package/lib/orderly/useAccountInfo.d.ts +3 -0
- package/lib/orderly/useAccountInfo.d.ts.map +1 -0
- package/lib/orderly/useAccountInfo.js +8 -0
- package/lib/orderly/useChain.d.ts +6 -0
- package/lib/orderly/useChain.d.ts.map +1 -0
- package/lib/orderly/useChain.js +26 -0
- package/lib/orderly/useChains.d.ts +34 -0
- package/lib/orderly/useChains.d.ts.map +1 -0
- package/lib/orderly/useChains.js +166 -0
- package/lib/orderly/useCollateral.d.ts +16 -0
- package/lib/orderly/useCollateral.d.ts.map +1 -0
- package/lib/orderly/useCollateral.js +76 -0
- package/lib/orderly/useDeposit.d.ts +38 -0
- package/lib/orderly/useDeposit.d.ts.map +1 -0
- package/lib/orderly/useDeposit.js +274 -0
- package/lib/orderly/useFundingRate.d.ts +11 -0
- package/lib/orderly/useFundingRate.d.ts.map +1 -0
- package/lib/orderly/useFundingRate.js +44 -0
- package/lib/orderly/useFundingRates.d.ts +2 -0
- package/lib/orderly/useFundingRates.d.ts.map +1 -0
- package/lib/orderly/useFundingRates.js +25 -0
- package/lib/orderly/useHoldingStream.d.ts +7 -0
- package/lib/orderly/useHoldingStream.d.ts.map +1 -0
- package/lib/orderly/useHoldingStream.js +54 -0
- package/lib/orderly/useIndexPrice.d.ts +2 -0
- package/lib/orderly/useIndexPrice.d.ts.map +1 -0
- package/lib/orderly/useIndexPrice.js +24 -0
- package/lib/orderly/useLeverage.d.ts +2 -0
- package/lib/orderly/useLeverage.d.ts.map +1 -0
- package/lib/orderly/useLeverage.js +38 -0
- package/lib/orderly/useMarginRatio.d.ts +7 -0
- package/lib/orderly/useMarginRatio.d.ts.map +1 -0
- package/lib/orderly/useMarginRatio.js +45 -0
- package/lib/orderly/useMarkPrice.d.ts +4 -0
- package/lib/orderly/useMarkPrice.d.ts.map +1 -0
- package/lib/orderly/useMarkPrice.js +33 -0
- package/lib/orderly/useMarkPricesStream.d.ts +2 -0
- package/lib/orderly/useMarkPricesStream.d.ts.map +1 -0
- package/lib/orderly/useMarkPricesStream.js +33 -0
- package/lib/orderly/useMarketTradeStream.d.ts +9 -0
- package/lib/orderly/useMarketTradeStream.d.ts.map +1 -0
- package/lib/orderly/useMarketTradeStream.js +55 -0
- package/lib/orderly/useMarkets.d.ts +36 -0
- package/lib/orderly/useMarkets.d.ts.map +1 -0
- package/lib/orderly/useMarkets.js +244 -0
- package/lib/orderly/useMarketsStream.d.ts +5 -0
- package/lib/orderly/useMarketsStream.d.ts.map +1 -0
- package/lib/orderly/useMarketsStream.js +64 -0
- package/lib/orderly/useMaxQty.d.ts +3 -0
- package/lib/orderly/useMaxQty.d.ts.map +1 -0
- package/lib/orderly/useMaxQty.js +118 -0
- package/lib/orderly/useOpenInterest.d.ts +2 -0
- package/lib/orderly/useOpenInterest.d.ts.map +1 -0
- package/lib/orderly/useOpenInterest.js +22 -0
- package/lib/orderly/useOrderEntry.d.ts +63 -0
- package/lib/orderly/useOrderEntry.d.ts.map +1 -0
- package/lib/orderly/useOrderEntry.js +508 -0
- package/lib/orderly/useOrderStream.d.ts +38 -0
- package/lib/orderly/useOrderStream.d.ts.map +1 -0
- package/lib/orderly/useOrderStream.js +187 -0
- package/lib/orderly/useOrderbookStream.d.ts +53 -0
- package/lib/orderly/useOrderbookStream.d.ts.map +1 -0
- package/lib/orderly/useOrderbookStream.js +315 -0
- package/lib/orderly/usePositionStream.d.ts +25 -0
- package/lib/orderly/usePositionStream.d.ts.map +1 -0
- package/lib/orderly/usePositionStream.js +236 -0
- package/lib/orderly/usePrivateDataObserver.d.ts +5 -0
- package/lib/orderly/usePrivateDataObserver.d.ts.map +1 -0
- package/lib/orderly/usePrivateDataObserver.js +130 -0
- package/lib/orderly/useSettleSubscription.d.ts +4 -0
- package/lib/orderly/useSettleSubscription.d.ts.map +1 -0
- package/lib/orderly/useSettleSubscription.js +27 -0
- package/lib/orderly/useSymbolPriceRange.d.ts +13 -0
- package/lib/orderly/useSymbolPriceRange.d.ts.map +1 -0
- package/lib/orderly/useSymbolPriceRange.js +43 -0
- package/lib/orderly/useSymbolsInfo.d.ts +2 -0
- package/lib/orderly/useSymbolsInfo.d.ts.map +1 -0
- package/lib/orderly/useSymbolsInfo.js +37 -0
- package/lib/orderly/useTickerStream.d.ts +3 -0
- package/lib/orderly/useTickerStream.d.ts.map +1 -0
- package/lib/orderly/useTickerStream.js +90 -0
- package/lib/orderly/useWalletSubscription.d.ts +4 -0
- package/lib/orderly/useWalletSubscription.d.ts.map +1 -0
- package/lib/orderly/useWalletSubscription.js +27 -0
- package/lib/orderly/useWithdraw.d.ts +14 -0
- package/lib/orderly/useWithdraw.d.ts.map +1 -0
- package/lib/orderly/useWithdraw.js +68 -0
- package/lib/orderlyContext.d.ts +17 -0
- package/lib/orderlyContext.d.ts.map +1 -0
- package/lib/orderlyContext.js +8 -0
- package/lib/services/dataCenter.d.ts +2 -0
- package/lib/services/dataCenter.d.ts.map +1 -0
- package/lib/services/dataCenter.js +15 -0
- package/lib/services/painter/backgroundPaint.d.ts +9 -0
- package/lib/services/painter/backgroundPaint.d.ts.map +1 -0
- package/lib/services/painter/backgroundPaint.js +45 -0
- package/lib/services/painter/basePaint.d.ts +90 -0
- package/lib/services/painter/basePaint.d.ts.map +1 -0
- package/lib/services/painter/basePaint.js +10 -0
- package/lib/services/painter/dataPaint.d.ts +16 -0
- package/lib/services/painter/dataPaint.d.ts.map +1 -0
- package/lib/services/painter/dataPaint.js +199 -0
- package/lib/services/painter/layout.config.d.ts +3 -0
- package/lib/services/painter/layout.config.d.ts.map +1 -0
- package/lib/services/painter/layout.config.js +55 -0
- package/lib/services/painter/painter.d.ts +12 -0
- package/lib/services/painter/painter.d.ts.map +1 -0
- package/lib/services/painter/painter.js +41 -0
- package/lib/services/painter/resource.d.ts +7 -0
- package/lib/services/painter/resource.d.ts.map +1 -0
- package/lib/services/painter/resource.js +19 -0
- package/lib/statusProvider.d.ts +8 -0
- package/lib/statusProvider.d.ts.map +1 -0
- package/lib/statusProvider.js +12 -0
- package/lib/unuse/apiPrefixMiddleware.d.ts +3 -0
- package/lib/unuse/apiPrefixMiddleware.d.ts.map +1 -0
- package/lib/unuse/apiPrefixMiddleware.js +33 -0
- package/lib/unuse/fn.d.ts +2 -0
- package/lib/unuse/fn.d.ts.map +1 -0
- package/lib/unuse/fn.js +9 -0
- package/lib/unuse/useBalance.d.ts +2 -0
- package/lib/unuse/useBalance.d.ts.map +1 -0
- package/lib/unuse/useBalance.js +19 -0
- package/lib/unuse/useFetures.d.ts +11 -0
- package/lib/unuse/useFetures.d.ts.map +1 -0
- package/lib/unuse/useFetures.js +43 -0
- package/lib/unuse/useRunOnce.d.ts +7 -0
- package/lib/unuse/useRunOnce.d.ts.map +1 -0
- package/lib/unuse/useRunOnce.js +21 -0
- package/lib/unuse/useSyncEnd.d.ts +2 -0
- package/lib/unuse/useSyncEnd.d.ts.map +1 -0
- package/lib/unuse/useSyncEnd.js +14 -0
- package/lib/unuse/useTokenInfo.d.ts +2 -0
- package/lib/unuse/useTokenInfo.d.ts.map +1 -0
- package/lib/unuse/useTokenInfo.js +24 -0
- package/lib/unuse/useUnsettlementPnL.d.ts +2 -0
- package/lib/unuse/useUnsettlementPnL.d.ts.map +1 -0
- package/lib/unuse/useUnsettlementPnL.js +24 -0
- package/lib/useAccount.d.ts +8 -0
- package/lib/useAccount.d.ts.map +1 -0
- package/lib/useAccount.js +63 -0
- package/lib/useAccountInstance.d.ts +3 -0
- package/lib/useAccountInstance.d.ts.map +1 -0
- package/lib/useAccountInstance.js +30 -0
- package/lib/useBoolean.d.ts +6 -0
- package/lib/useBoolean.d.ts.map +1 -0
- package/lib/useBoolean.js +12 -0
- package/lib/useConfig.d.ts +3 -0
- package/lib/useConfig.d.ts.map +1 -0
- package/lib/useConfig.js +16 -0
- package/lib/useEventEmitter.d.ts +3 -0
- package/lib/useEventEmitter.d.ts.map +1 -0
- package/lib/useEventEmitter.js +19 -0
- package/lib/useLazyQuery.d.ts +13 -0
- package/lib/useLazyQuery.d.ts.map +1 -0
- package/lib/useLazyQuery.js +42 -0
- package/lib/useLocalStorage.d.ts +2 -0
- package/lib/useLocalStorage.d.ts.map +1 -0
- package/lib/useLocalStorage.js +78 -0
- package/lib/useMediaQuery.d.ts +2 -0
- package/lib/useMediaQuery.d.ts.map +1 -0
- package/lib/useMediaQuery.js +40 -0
- package/lib/useMutation.d.ts +10 -0
- package/lib/useMutation.d.ts.map +1 -0
- package/lib/useMutation.js +71 -0
- package/lib/useObserve.d.ts +6 -0
- package/lib/useObserve.d.ts.map +1 -0
- package/lib/useObserve.js +12 -0
- package/lib/useParamsCheck.d.ts +4 -0
- package/lib/useParamsCheck.d.ts.map +1 -0
- package/lib/useParamsCheck.js +18 -0
- package/lib/usePoster.d.ts +14 -0
- package/lib/usePoster.d.ts.map +1 -0
- package/lib/usePoster.js +56 -0
- package/lib/usePreloadData.d.ts +5 -0
- package/lib/usePreloadData.d.ts.map +1 -0
- package/lib/usePreloadData.js +18 -0
- package/lib/usePrivateInfiniteQuery.d.ts +5 -0
- package/lib/usePrivateInfiniteQuery.d.ts.map +1 -0
- package/lib/usePrivateInfiniteQuery.js +32 -0
- package/lib/usePrivateQuery.d.ts +10 -0
- package/lib/usePrivateQuery.d.ts.map +1 -0
- package/lib/usePrivateQuery.js +33 -0
- package/lib/useQuery.d.ts +10 -0
- package/lib/useQuery.d.ts.map +1 -0
- package/lib/useQuery.js +27 -0
- package/lib/useSessionStorage.d.ts +2 -0
- package/lib/useSessionStorage.d.ts.map +1 -0
- package/lib/useSessionStorage.js +64 -0
- package/lib/useWS.d.ts +3 -0
- package/lib/useWS.d.ts.map +1 -0
- package/lib/useWS.js +58 -0
- package/lib/useWsStatus.d.ts +7 -0
- package/lib/useWsStatus.d.ts.map +1 -0
- package/lib/useWsStatus.js +45 -0
- package/lib/utils/createGetter.d.ts +4 -0
- package/lib/utils/createGetter.d.ts.map +1 -0
- package/lib/utils/createGetter.js +25 -0
- package/lib/utils/createOrder.d.ts +56 -0
- package/lib/utils/createOrder.d.ts.map +1 -0
- package/lib/utils/createOrder.js +337 -0
- package/lib/utils/fetcher.d.ts +6 -0
- package/lib/utils/fetcher.d.ts.map +1 -0
- package/lib/utils/fetcher.js +6 -0
- package/lib/utils/json.d.ts +2 -0
- package/lib/utils/json.d.ts.map +1 -0
- package/lib/utils/json.js +12 -0
- package/lib/utils/orderEntryHelper.d.ts +25 -0
- package/lib/utils/orderEntryHelper.d.ts.map +1 -0
- package/lib/utils/orderEntryHelper.js +250 -0
- package/lib/utils/parseHolding.d.ts +9 -0
- package/lib/utils/parseHolding.d.ts.map +1 -0
- package/lib/utils/parseHolding.js +25 -0
- package/lib/version.d.ts +10 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +8 -0
- package/lib/walletConnectorContext.d.ts +30 -0
- package/lib/walletConnectorContext.d.ts.map +1 -0
- package/lib/walletConnectorContext.js +9 -0
- package/package.json +18 -13
- package/dist/index.d.mts +0 -559
- package/dist/index.d.ts +0 -559
- package/dist/index.js +0 -5449
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -5365
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useMarketsStream = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useQuery_1 = require("../useQuery");
|
|
9
|
+
const useWS_1 = require("../useWS");
|
|
10
|
+
const subscription_1 = __importDefault(require("swr/subscription"));
|
|
11
|
+
const utils_1 = require("@orderly.network/utils");
|
|
12
|
+
const useMarketsStream = () => {
|
|
13
|
+
// get listing of all markets from /public/info
|
|
14
|
+
const ws = (0, useWS_1.useWS)();
|
|
15
|
+
const { data: futures } = (0, useQuery_1.useQuery)(`/v1/public/futures`, {
|
|
16
|
+
revalidateOnFocus: false,
|
|
17
|
+
});
|
|
18
|
+
const { data: tickers } = (0, subscription_1.default)("tickers", (_, { next }) => {
|
|
19
|
+
const unsubscribe = ws.subscribe(
|
|
20
|
+
// { event: "subscribe", topic: "markprices" },
|
|
21
|
+
"tickers", {
|
|
22
|
+
onMessage: (message) => {
|
|
23
|
+
next(null, message);
|
|
24
|
+
},
|
|
25
|
+
// onUnsubscribe: () => {
|
|
26
|
+
// return "markprices";
|
|
27
|
+
// },
|
|
28
|
+
// onError: (error: any) => {
|
|
29
|
+
//
|
|
30
|
+
// },
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
unsubscribe?.();
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const value = (0, react_1.useMemo)(() => {
|
|
37
|
+
if (!futures)
|
|
38
|
+
return null;
|
|
39
|
+
if (!tickers)
|
|
40
|
+
return futures;
|
|
41
|
+
return futures.map((item) => {
|
|
42
|
+
const ticker = tickers.find((t) => t.symbol === item.symbol);
|
|
43
|
+
if (ticker) {
|
|
44
|
+
const data = {
|
|
45
|
+
...item,
|
|
46
|
+
["24h_close"]: ticker.close,
|
|
47
|
+
["24h_open"]: ticker.open,
|
|
48
|
+
["24h_volumn"]: ticker.volume,
|
|
49
|
+
change: 0,
|
|
50
|
+
};
|
|
51
|
+
if (ticker.close !== undefined && ticker.open !== undefined) {
|
|
52
|
+
data["change"] = new utils_1.Decimal(ticker.close)
|
|
53
|
+
.minus(ticker.open)
|
|
54
|
+
.div(ticker.open)
|
|
55
|
+
.toNumber();
|
|
56
|
+
}
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
return item;
|
|
60
|
+
});
|
|
61
|
+
}, [futures, tickers]);
|
|
62
|
+
return { data: value };
|
|
63
|
+
};
|
|
64
|
+
exports.useMarketsStream = useMarketsStream;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMaxQty.d.ts","sourceRoot":"","sources":["../../src/orderly/useMaxQty.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAe,MAAM,wBAAwB,CAAC;AAgB1E,eAAO,MAAM,SAAS,WACZ,MAAM,QACR,SAAS,eACH,OAAO,WAuIpB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMaxQty = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const types_1 = require("@orderly.network/types");
|
|
6
|
+
const useSymbolsInfo_1 = require("./useSymbolsInfo");
|
|
7
|
+
const useMarkPricesStream_1 = require("./useMarkPricesStream");
|
|
8
|
+
const perp_1 = require("@orderly.network/perp");
|
|
9
|
+
const useCollateral_1 = require("./useCollateral");
|
|
10
|
+
const usePrivateQuery_1 = require("../usePrivateQuery");
|
|
11
|
+
const usePositionStream_1 = require("./usePositionStream");
|
|
12
|
+
const ramda_1 = require("ramda");
|
|
13
|
+
const useOrderStream_1 = require("./useOrderStream");
|
|
14
|
+
const positionsPath = (0, ramda_1.pathOr)([], [0, "rows"]);
|
|
15
|
+
const useMaxQty = (symbol, side, reduceOnly = false) => {
|
|
16
|
+
const positionsData = (0, usePositionStream_1.usePositionStream)();
|
|
17
|
+
// const [orders] = useOrderStream({ status: OrderStatus.NEW });
|
|
18
|
+
const { data: accountInfo } = (0, usePrivateQuery_1.usePrivateQuery)("/v1/client/info");
|
|
19
|
+
const symbolInfo = (0, useSymbolsInfo_1.useSymbolsInfo)();
|
|
20
|
+
const { totalCollateral } = (0, useCollateral_1.useCollateral)();
|
|
21
|
+
const { data: markPrices } = (0, useMarkPricesStream_1.useMarkPricesStream)();
|
|
22
|
+
const [orders] = (0, useOrderStream_1.useOrderStream)({ status: types_1.OrderStatus.NEW });
|
|
23
|
+
// const {
|
|
24
|
+
// data: orders,
|
|
25
|
+
// error,
|
|
26
|
+
// mutate: updateOrder,
|
|
27
|
+
// } = usePrivateQuery<API.Order[]>(`/v1/orders?status=NEW&size=99`, {
|
|
28
|
+
// formatter: (data) => data.rows,
|
|
29
|
+
// onError: (err) => { },
|
|
30
|
+
// });
|
|
31
|
+
// const ws = useWS();
|
|
32
|
+
// useEffect(() => {
|
|
33
|
+
// const unsubscribe = ws.privateSubscribe(
|
|
34
|
+
// {
|
|
35
|
+
// id: "executionreport_orders",
|
|
36
|
+
// event: "subscribe",
|
|
37
|
+
// topic: "executionreport",
|
|
38
|
+
// ts: Date.now(),
|
|
39
|
+
// },
|
|
40
|
+
// {
|
|
41
|
+
// onMessage: (data: any) => {
|
|
42
|
+
// console.log("refresh orders", data);
|
|
43
|
+
// updateOrder();
|
|
44
|
+
// },
|
|
45
|
+
// }
|
|
46
|
+
// );
|
|
47
|
+
// return () => unsubscribe();
|
|
48
|
+
// }, []);
|
|
49
|
+
const maxQty = (0, react_1.useMemo)(() => {
|
|
50
|
+
if (!symbol)
|
|
51
|
+
return 0;
|
|
52
|
+
const positions = positionsPath(positionsData);
|
|
53
|
+
const positionQty = perp_1.account.getQtyFromPositions(positions, symbol);
|
|
54
|
+
if (reduceOnly) {
|
|
55
|
+
if (positionQty > 0) {
|
|
56
|
+
if (side === types_1.OrderSide.BUY) {
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return Math.abs(positionQty);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (positionQty < 0) {
|
|
64
|
+
if (side === types_1.OrderSide.BUY) {
|
|
65
|
+
return Math.abs(positionQty);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
if (!markPrices || !markPrices[symbol] || !orders || !accountInfo)
|
|
74
|
+
return 0;
|
|
75
|
+
const getSymbolInfo = symbolInfo[symbol];
|
|
76
|
+
const filterAlgoOrders = orders.filter((item) => item.algo_order_id === undefined);
|
|
77
|
+
// current symbol buy order quantity
|
|
78
|
+
const buyOrdersQty = perp_1.account.getQtyFromOrdersBySide(filterAlgoOrders, symbol, types_1.OrderSide.BUY);
|
|
79
|
+
// current symbol sell order quantity
|
|
80
|
+
const sellOrdersQty = perp_1.account.getQtyFromOrdersBySide(filterAlgoOrders, symbol, types_1.OrderSide.SELL);
|
|
81
|
+
const otherPositions = positions.filter((item) => item.symbol !== symbol);
|
|
82
|
+
const otherOrders = filterAlgoOrders.filter((item) => item.symbol !== symbol);
|
|
83
|
+
const otherIMs = perp_1.account.otherIMs({
|
|
84
|
+
orders: otherOrders,
|
|
85
|
+
positions: otherPositions,
|
|
86
|
+
symbolInfo,
|
|
87
|
+
markPrices,
|
|
88
|
+
IMR_Factors: accountInfo.imr_factor,
|
|
89
|
+
maxLeverage: accountInfo.max_leverage,
|
|
90
|
+
});
|
|
91
|
+
return perp_1.account.maxQty(side, {
|
|
92
|
+
markPrice: markPrices[symbol],
|
|
93
|
+
symbol,
|
|
94
|
+
baseMaxQty: getSymbolInfo("base_max"),
|
|
95
|
+
totalCollateral,
|
|
96
|
+
maxLeverage: accountInfo.max_leverage,
|
|
97
|
+
takerFeeRate: accountInfo.taker_fee_rate,
|
|
98
|
+
baseIMR: getSymbolInfo("base_imr"),
|
|
99
|
+
otherIMs,
|
|
100
|
+
positionQty,
|
|
101
|
+
buyOrdersQty,
|
|
102
|
+
sellOrdersQty,
|
|
103
|
+
IMR_Factor: accountInfo.imr_factor[symbol],
|
|
104
|
+
});
|
|
105
|
+
}, [
|
|
106
|
+
orders,
|
|
107
|
+
positionsData,
|
|
108
|
+
markPrices,
|
|
109
|
+
accountInfo,
|
|
110
|
+
symbolInfo,
|
|
111
|
+
symbol,
|
|
112
|
+
side,
|
|
113
|
+
totalCollateral,
|
|
114
|
+
reduceOnly,
|
|
115
|
+
]);
|
|
116
|
+
return Math.max(maxQty, 0);
|
|
117
|
+
};
|
|
118
|
+
exports.useMaxQty = useMaxQty;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenInterest.d.ts","sourceRoot":"","sources":["../../src/orderly/useOpenInterest.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,WAAY,MAAM,iEAa7C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useOpenInterest = void 0;
|
|
7
|
+
const useWS_1 = require("../useWS");
|
|
8
|
+
const subscription_1 = __importDefault(require("swr/subscription"));
|
|
9
|
+
const useOpenInterest = (symbol) => {
|
|
10
|
+
const ws = (0, useWS_1.useWS)();
|
|
11
|
+
return (0, subscription_1.default)(`${symbol}@openinterest`, (key, { next }) => {
|
|
12
|
+
const unsubscribe = ws.subscribe(`${symbol}@openinterest`, {
|
|
13
|
+
onMessage: (message) => {
|
|
14
|
+
next(null, message.openInterest);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
unsubscribe?.();
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.useOpenInterest = useOpenInterest;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { API, OrderEntity, OrderSide } from "@orderly.network/types";
|
|
2
|
+
export type UseOrderEntryOptions = {
|
|
3
|
+
commify?: boolean;
|
|
4
|
+
watchOrderbook?: boolean;
|
|
5
|
+
validate?: (data: OrderEntity) => {
|
|
6
|
+
[P in keyof OrderEntity]?: string;
|
|
7
|
+
} | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type UseOrderEntryMetaState = {
|
|
10
|
+
errors: {
|
|
11
|
+
[P in keyof OrderEntity]?: {
|
|
12
|
+
type: string;
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
} | null | undefined;
|
|
16
|
+
dirty: {
|
|
17
|
+
[P in keyof OrderEntity]?: boolean;
|
|
18
|
+
} | null | undefined;
|
|
19
|
+
submitted: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type UseOrderEntryReturn = {
|
|
22
|
+
maxQty: number;
|
|
23
|
+
freeCollateral: number;
|
|
24
|
+
markPrice: number;
|
|
25
|
+
estLiqPrice?: number | null;
|
|
26
|
+
estLeverage?: number | null;
|
|
27
|
+
onSubmit: (order: OrderEntity) => Promise<any>;
|
|
28
|
+
submit: () => Promise<OrderEntity>;
|
|
29
|
+
submitting: boolean;
|
|
30
|
+
formattedOrder: Partial<OrderEntity>;
|
|
31
|
+
helper: {
|
|
32
|
+
calculate: (values: Partial<OrderEntity>, field: keyof OrderEntity, value: any) => Partial<OrderEntity>;
|
|
33
|
+
validator: (values: Partial<OrderEntity>) => any;
|
|
34
|
+
};
|
|
35
|
+
metaState: UseOrderEntryMetaState;
|
|
36
|
+
symbolConfig: API.SymbolExt;
|
|
37
|
+
};
|
|
38
|
+
export type OrderParams = Required<Pick<OrderEntity, "side" | "order_type" | "symbol">> & Partial<Omit<OrderEntity, "side" | "symbol" | "order_type">>;
|
|
39
|
+
/**
|
|
40
|
+
* Create Order
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { useOrderEntry } from "@orderly.network/hooks";
|
|
44
|
+
* import {OrderSide, OrderType} from '@orderly.network/types';
|
|
45
|
+
*
|
|
46
|
+
* const { formattedOrder, onSubmit, helper } = useOrderEntry({
|
|
47
|
+
* symbol: "PERP_ETH_USDC",
|
|
48
|
+
* side: OrderSide.BUY,
|
|
49
|
+
* order_type: OrderType.LIMIT,
|
|
50
|
+
* order_price: 10000,
|
|
51
|
+
* order_quantity: 1,
|
|
52
|
+
* },{
|
|
53
|
+
* // **Note:** it's required
|
|
54
|
+
* watchOrderbook: true,
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function useOrderEntry(order: OrderParams, options?: UseOrderEntryOptions): UseOrderEntryReturn;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*/
|
|
62
|
+
export declare function useOrderEntry(symbol: string, side: OrderSide, reduceOnly: boolean): UseOrderEntryReturn;
|
|
63
|
+
//# sourceMappingURL=useOrderEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOrderEntry.d.ts","sourceRoot":"","sources":["../../src/orderly/useOrderEntry.ts"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,WAAW,EACX,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAkBhC,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CACT,IAAI,EAAE,WAAW,KACd;SAAG,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,EAAE,MAAM;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EACF;SAAG,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;KAAE,GAChE,IAAI,GACJ,SAAS,CAAC;IACd,KAAK,EAAE;SAAG,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,EAAE,OAAO;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACjE,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,MAAM,EAAE;QACN,SAAS,EAAE,CACT,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,MAAM,WAAW,EACxB,KAAK,EAAE,GAAG,KACP,OAAO,CAAC,WAAW,CAAC,CAAC;QAC1B,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC;KAGlD,CAAC;IAEF,SAAS,EAAE,sBAAsB,CAAC;IAClC,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAChC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC,CACpD,GACC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CAAC;AACvB;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,OAAO,GAClB,mBAAmB,CAAC"}
|