@kodiak-finance/orderly-hooks 2.8.10-rc.1 → 2.8.10-rc.11
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.mts +2 -46
- package/dist/index.d.ts +2 -46
- package/dist/index.js +105 -183
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -182
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -22,9 +22,9 @@ import { SolanaWalletProvider } from '@kodiak-finance/orderly-default-solana-ada
|
|
|
22
22
|
import * as swr_subscription from 'swr/subscription';
|
|
23
23
|
import * as _kodiak_finance_orderly_utils from '@kodiak-finance/orderly-utils';
|
|
24
24
|
import { Decimal } from '@kodiak-finance/orderly-utils';
|
|
25
|
+
export * from 'use-debounce';
|
|
25
26
|
import * as immer from 'immer';
|
|
26
27
|
import * as zustand from 'zustand';
|
|
27
|
-
export * from 'use-debounce';
|
|
28
28
|
|
|
29
29
|
declare global {
|
|
30
30
|
interface Window {
|
|
@@ -1498,30 +1498,6 @@ declare const useSymbolLeverage: (symbol?: string) => {
|
|
|
1498
1498
|
*/
|
|
1499
1499
|
declare const useLeverageBySymbol: (symbol?: string) => number | undefined;
|
|
1500
1500
|
|
|
1501
|
-
type UseEffectiveLeverageInputs = {
|
|
1502
|
-
symbol: string;
|
|
1503
|
-
positionQty?: number;
|
|
1504
|
-
positionPrice?: number;
|
|
1505
|
-
orderQty?: number;
|
|
1506
|
-
orderPrice?: number;
|
|
1507
|
-
selectedLeverage?: number;
|
|
1508
|
-
};
|
|
1509
|
-
type EffectiveLeverageResult = {
|
|
1510
|
-
selectedLeverage: number;
|
|
1511
|
-
effectiveLeverage: number;
|
|
1512
|
-
displayLeverage: number;
|
|
1513
|
-
imr: number;
|
|
1514
|
-
isConstrained: boolean;
|
|
1515
|
-
constraintMessage?: string;
|
|
1516
|
-
};
|
|
1517
|
-
/**
|
|
1518
|
-
* Calculates effective leverage based on position/order size and margin requirements.
|
|
1519
|
-
* Returns selected, effective, and display leverage values.
|
|
1520
|
-
*
|
|
1521
|
-
* Formula: EffectiveLeverage = 1 / IMR where IMR constrains based on notional size
|
|
1522
|
-
*/
|
|
1523
|
-
declare const useEffectiveLeverage: (inputs: UseEffectiveLeverageInputs) => EffectiveLeverageResult;
|
|
1524
|
-
|
|
1525
1501
|
type AssetHistoryOptions = {
|
|
1526
1502
|
/** token name you want to search */
|
|
1527
1503
|
token?: string;
|
|
@@ -1657,31 +1633,11 @@ declare const useMaintenanceStatus: () => {
|
|
|
1657
1633
|
|
|
1658
1634
|
declare const useMarkPriceBySymbol: (symbol: string) => number;
|
|
1659
1635
|
|
|
1660
|
-
type EmptyPosition = Omit<API.PositionsTPSLExt, "rows"> & {
|
|
1661
|
-
rows: API.PositionsTPSLExt["rows"] | null;
|
|
1662
|
-
};
|
|
1663
|
-
type PositionState = {
|
|
1664
|
-
positions: {
|
|
1665
|
-
all: EmptyPosition;
|
|
1666
|
-
[key: string]: EmptyPosition;
|
|
1667
|
-
};
|
|
1668
|
-
};
|
|
1669
1636
|
type PositionActions = {
|
|
1670
1637
|
setPositions: (key: string, positions: API.PositionsTPSLExt) => void;
|
|
1671
1638
|
clearAll: () => void;
|
|
1672
1639
|
closePosition: (symbol: string) => void;
|
|
1673
1640
|
};
|
|
1674
|
-
declare const usePositionStore: zustand.UseBoundStore<Omit<zustand.StoreApi<PositionState & {
|
|
1675
|
-
actions: PositionActions;
|
|
1676
|
-
}>, "setState"> & {
|
|
1677
|
-
setState(nextStateOrUpdater: (PositionState & {
|
|
1678
|
-
actions: PositionActions;
|
|
1679
|
-
}) | Partial<PositionState & {
|
|
1680
|
-
actions: PositionActions;
|
|
1681
|
-
}> | ((state: immer.WritableDraft<PositionState & {
|
|
1682
|
-
actions: PositionActions;
|
|
1683
|
-
}>) => void), shouldReplace?: boolean | undefined): void;
|
|
1684
|
-
}>;
|
|
1685
1641
|
declare const usePositionActions: () => PositionActions;
|
|
1686
1642
|
|
|
1687
1643
|
declare const useStorageLedgerAddress: () => {
|
|
@@ -2468,4 +2424,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2468
2424
|
declare const useMarketList: () => API.MarketInfoExt[];
|
|
2469
2425
|
declare const useMarketMap: () => Record<string, API.MarketInfoExt> | null;
|
|
2470
2426
|
|
|
2471
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type
|
|
2427
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, MarketsType, type NewListing, ORDERLY_ORDERBOOK_DEPTH_KEY, type OrderBookItem, type OrderEntryReturn, type OrderMetadata, type OrderMetadataConfig, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, type StatusInfo, StatusProvider, type SymbolsInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, getPriceKey, noCacheConfig, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChainInfo, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFeeState, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useInternalTransfer, useKeyStore, useLazyQuery, useLeverage, useLeverageBySymbol, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxLeverage, useMaxQty, useMaxWithdrawal, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePortfolio, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, type useQueryOptions, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolInfo, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useVaultsHistory, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ import { SolanaWalletProvider } from '@kodiak-finance/orderly-default-solana-ada
|
|
|
22
22
|
import * as swr_subscription from 'swr/subscription';
|
|
23
23
|
import * as _kodiak_finance_orderly_utils from '@kodiak-finance/orderly-utils';
|
|
24
24
|
import { Decimal } from '@kodiak-finance/orderly-utils';
|
|
25
|
+
export * from 'use-debounce';
|
|
25
26
|
import * as immer from 'immer';
|
|
26
27
|
import * as zustand from 'zustand';
|
|
27
|
-
export * from 'use-debounce';
|
|
28
28
|
|
|
29
29
|
declare global {
|
|
30
30
|
interface Window {
|
|
@@ -1498,30 +1498,6 @@ declare const useSymbolLeverage: (symbol?: string) => {
|
|
|
1498
1498
|
*/
|
|
1499
1499
|
declare const useLeverageBySymbol: (symbol?: string) => number | undefined;
|
|
1500
1500
|
|
|
1501
|
-
type UseEffectiveLeverageInputs = {
|
|
1502
|
-
symbol: string;
|
|
1503
|
-
positionQty?: number;
|
|
1504
|
-
positionPrice?: number;
|
|
1505
|
-
orderQty?: number;
|
|
1506
|
-
orderPrice?: number;
|
|
1507
|
-
selectedLeverage?: number;
|
|
1508
|
-
};
|
|
1509
|
-
type EffectiveLeverageResult = {
|
|
1510
|
-
selectedLeverage: number;
|
|
1511
|
-
effectiveLeverage: number;
|
|
1512
|
-
displayLeverage: number;
|
|
1513
|
-
imr: number;
|
|
1514
|
-
isConstrained: boolean;
|
|
1515
|
-
constraintMessage?: string;
|
|
1516
|
-
};
|
|
1517
|
-
/**
|
|
1518
|
-
* Calculates effective leverage based on position/order size and margin requirements.
|
|
1519
|
-
* Returns selected, effective, and display leverage values.
|
|
1520
|
-
*
|
|
1521
|
-
* Formula: EffectiveLeverage = 1 / IMR where IMR constrains based on notional size
|
|
1522
|
-
*/
|
|
1523
|
-
declare const useEffectiveLeverage: (inputs: UseEffectiveLeverageInputs) => EffectiveLeverageResult;
|
|
1524
|
-
|
|
1525
1501
|
type AssetHistoryOptions = {
|
|
1526
1502
|
/** token name you want to search */
|
|
1527
1503
|
token?: string;
|
|
@@ -1657,31 +1633,11 @@ declare const useMaintenanceStatus: () => {
|
|
|
1657
1633
|
|
|
1658
1634
|
declare const useMarkPriceBySymbol: (symbol: string) => number;
|
|
1659
1635
|
|
|
1660
|
-
type EmptyPosition = Omit<API.PositionsTPSLExt, "rows"> & {
|
|
1661
|
-
rows: API.PositionsTPSLExt["rows"] | null;
|
|
1662
|
-
};
|
|
1663
|
-
type PositionState = {
|
|
1664
|
-
positions: {
|
|
1665
|
-
all: EmptyPosition;
|
|
1666
|
-
[key: string]: EmptyPosition;
|
|
1667
|
-
};
|
|
1668
|
-
};
|
|
1669
1636
|
type PositionActions = {
|
|
1670
1637
|
setPositions: (key: string, positions: API.PositionsTPSLExt) => void;
|
|
1671
1638
|
clearAll: () => void;
|
|
1672
1639
|
closePosition: (symbol: string) => void;
|
|
1673
1640
|
};
|
|
1674
|
-
declare const usePositionStore: zustand.UseBoundStore<Omit<zustand.StoreApi<PositionState & {
|
|
1675
|
-
actions: PositionActions;
|
|
1676
|
-
}>, "setState"> & {
|
|
1677
|
-
setState(nextStateOrUpdater: (PositionState & {
|
|
1678
|
-
actions: PositionActions;
|
|
1679
|
-
}) | Partial<PositionState & {
|
|
1680
|
-
actions: PositionActions;
|
|
1681
|
-
}> | ((state: immer.WritableDraft<PositionState & {
|
|
1682
|
-
actions: PositionActions;
|
|
1683
|
-
}>) => void), shouldReplace?: boolean | undefined): void;
|
|
1684
|
-
}>;
|
|
1685
1641
|
declare const usePositionActions: () => PositionActions;
|
|
1686
1642
|
|
|
1687
1643
|
declare const useStorageLedgerAddress: () => {
|
|
@@ -2468,4 +2424,4 @@ declare const usePositionClose: (options: PositionCloseOptions) => {
|
|
|
2468
2424
|
declare const useMarketList: () => API.MarketInfoExt[];
|
|
2469
2425
|
declare const useMarketMap: () => Record<string, API.MarketInfoExt> | null;
|
|
2470
2426
|
|
|
2471
|
-
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type
|
|
2427
|
+
export { type APIKeyItem, type AccountRewardsHistory, type AccountRewardsHistoryRow, type Brokers, type Chain, type Chains, type CheckReferralCodeReturns, type CollateralOutputs, type ComputedAlgoOrder, type ConfigProviderProps, type ConnectedChain, type CurrentEpochEstimate, DefaultLayoutConfig, DistributionId, type DrawOptions, ENVType, type EpochInfoItem, type EpochInfoType, EpochStatus, type ExclusiveConfigProviderProps, ExtendedConfigStore, type Favorite, type FavoriteTab, type FundingRates, MaintenanceStatus, type MarginRatioReturn, type MarketsItem, MarketsStorageKey, type MarketsStore, MarketsType, type NewListing, ORDERLY_ORDERBOOK_DEPTH_KEY, type OrderBookItem, type OrderEntryReturn, type OrderMetadata, type OrderMetadataConfig, type OrderParams, type OrderValidationItem, type OrderValidationResult, type OrderbookData, type OrderbookOptions, type OrderlyConfigContextState, OrderlyConfigProvider, OrderlyContext, OrderlyProvider, type PosterLayoutConfig, type PriceMode, type Recent, RefferalAPI, type RestrictedInfoOptions, type RestrictedInfoReturns, ScopeType, type StatusInfo, StatusProvider, type SymbolsInfo, TWType, type UseChainsOptions, type UseChainsReturnObject, type UseOrderEntryMetaState, WalletConnectorContext, type WalletConnectorContextState, type WalletRewards, type WalletRewardsHistoryReturns, type WalletRewardsItem, type WalletState, WsNetworkStatus, type chainFilter, type chainFilterFunc, checkNotional, cleanStringStyle, fetcher, type filteredChains$1 as filteredChains, findPositionTPSLFromOrders, findTPSLFromOrder, findTPSLOrderPriceFromOrder, getMinNotional, getPriceKey, noCacheConfig, parseJSON, useAccount, useAccountInfo, useAccountInstance, useAccountRewardsHistory, useAllBrokers, useApiKeyManager, useAssetsHistory, useAudioPlayer, useBalanceSubscription, useBalanceTopic, useBoolean, useChain, useChainInfo, useChains, useCheckReferralCode, useCollateral, useCommission, useComputedLTV, useConfig, useConvert, useCurEpochEstimate, useDaily, useDeposit, useDistribution, useDistributionHistory, useEpochInfo, useEventEmitter, useFeeState, useFundingDetails, useFundingFeeHistory, useFundingRate, useFundingRateHistory, useFundingRates, useFundingRatesStore, useGetClaimed, useGetEnv, useGetReferralCode, useHoldingStream, useIndexPrice, useIndexPricesStream, useInfiniteQuery, useInternalTransfer, useKeyStore, useLazyQuery, useLeverage, useLeverageBySymbol, useLocalStorage, useMaintenanceStatus, useMarginRatio, useMarkPrice, useMarkPriceBySymbol, useMarkPricesStream, useMarket, useMarketList, useMarketMap, useMarketTradeStream, useMarkets, useMarketsStore, useMarketsStream, useMaxLeverage, useMaxQty, useMaxWithdrawal, useMediaQuery, useMemoizedFn, useMutation, useNetworkInfo, useOdosQuote, useOrderEntity, useOrderEntry, useOrderEntry$1 as useOrderEntry_deprecated, useOrderStore, useOrderStream, useOrderbookStream, useOrderlyContext, usePortfolio, usePositionActions, usePositionClose, usePositionStream, usePoster, usePreLoadData, usePrivateDataObserver, usePrivateInfiniteQuery, usePrivateQuery, useQuery, type useQueryOptions, useRefereeHistory, useRefereeInfo, useRefereeRebateSummary, useReferralInfo, useReferralRebateSummary, useRestrictedInfo, useSessionStorage, useSettleSubscription, useSimpleDI, useStatisticsDaily, useStorageChain, useStorageLedgerAddress, useSubAccountDataObserver, useSubAccountMaxWithdrawal, useSubAccountMutation, useSubAccountQuery, useSubAccountWS, useSymbolInfo, useSymbolLeverage, useSymbolPriceRange, useSymbolsInfo, useSymbolsInfoStore, useTPSLOrder, useTickerStream, useTokenInfo, useTokensInfo, useTrack, useTrackingInstance, useTradingRewardsStatus, useTransfer, useTransferHistory, useUpdatedRef, useVaultsHistory, useWS, useWalletConnector, useWalletRewardsHistory, useWalletSubscription, useWalletTopic, useWithdraw, useWsStatus, index as utils, _default as version };
|