@orderly.network/ui-positions
Version:
149 lines (135 loc) • 4.83 kB
TypeScript
import { OrderType, OrderSide, API } from '@orderly.network/types';
import React, { FC } from 'react';
import { PriceMode } from '@orderly.network/hooks';
import { SharePnLConfig } from '@orderly.network/ui-share';
import * as _orderly_network_ui from '@orderly.network/ui';
import * as react_jsx_runtime from 'react/jsx-runtime';
interface PositionsRowContextState {
quantity: string;
price: string;
type: OrderType;
side: OrderSide;
position: API.PositionExt | API.PositionTPSLExt;
updateQuantity: (value: string) => void;
updatePriceChange: (value: string) => void;
updateOrderType: (value: OrderType) => void;
closeOrderData: any;
onSubmit: () => Promise<any>;
submitting: boolean;
tpslOrder?: API.AlgoOrder;
partialTPSLOrder?: API.AlgoOrder;
quoteDp?: number;
baseDp?: number;
baseTick?: number;
errors: any | undefined;
}
declare const usePositionsRowContext: () => PositionsRowContextState;
declare const FundingFeeHistoryUI: FC<{
total: number;
symbol: string;
start_t: string;
end_t: string;
}>;
declare const FundingFeeButton: FC<{
fee: number;
symbol: string;
start_t: string;
end_t: string;
}>;
type PositionsProps = {
pnlNotionalDecimalPrecision?: number;
sharePnLConfig?: SharePnLConfig;
symbol?: string;
calcMode?: PriceMode;
includedPendingOrder?: boolean;
selectedAccount?: string;
onSymbolChange?: (symbol: API.Symbol) => void;
};
declare const PositionsWidget: React.FC<PositionsProps>;
declare const MobilePositionsWidget: React.FC<PositionsProps>;
declare const CombinePositionsWidget: React.FC<PositionsProps>;
type PositionHistoryProps$1 = {
onSymbolChange?: (symbol: API.Symbol) => void;
symbol?: string;
pnlNotionalDecimalPrecision?: number;
sharePnLConfig?: SharePnLConfig;
};
declare const PositionHistoryWidget: (props: PositionHistoryProps$1) => react_jsx_runtime.JSX.Element;
declare const MobilePositionHistoryWidget: (props: PositionHistoryProps$1 & {
classNames?: {
root?: string;
content?: string;
cell?: string;
};
}) => react_jsx_runtime.JSX.Element;
type PositionHistoryExt = API.PositionHistory & {
netPnL?: number;
};
declare const usePositionHistoryScript: (props: PositionHistoryProps$1) => {
dataSource: PositionHistoryExt[] | null | undefined;
isLoading: boolean;
onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
pagination: _orderly_network_ui.PaginationMeta;
filterItems: any[];
onFilter: (filter: {
name: string;
value: any;
}) => void;
symbol: string | undefined;
filterDays: 1 | 7 | 30 | 90 | null;
updateFilterDays: (days: 1 | 7 | 30 | 90) => void;
pnlNotionalDecimalPrecision: number | undefined;
};
type PositionHistoryState = ReturnType<typeof usePositionHistoryScript>;
type PositionHistoryProps = PositionHistoryState & {
sharePnLConfig?: SharePnLConfig;
};
declare const PositionHistory: FC<PositionHistoryProps>;
declare const MobilePositionHistory: FC<PositionHistoryState & {
classNames?: {
root?: string;
content?: string;
cell?: string;
};
sharePnLConfig?: SharePnLConfig;
}>;
type LiquidationProps = {
symbol?: string;
enableLoadMore?: boolean;
};
declare const LiquidationWidget: (props: LiquidationProps) => react_jsx_runtime.JSX.Element;
declare const MobileLiquidationWidget: (props: LiquidationProps & {
classNames?: {
root?: string;
content?: string;
cell?: string;
};
}) => react_jsx_runtime.JSX.Element;
declare const useLiquidationScript: (props: LiquidationProps) => {
dataSource: any[] | null | undefined;
isLoading: boolean;
loadMore: () => void;
pagination: _orderly_network_ui.PaginationMeta;
dateRange: {
from?: Date;
to?: Date;
};
filterDays: 1 | 7 | 30 | 90 | null;
updateFilterDays: (days: 1 | 7 | 30 | 90) => void;
filterItems: any[];
onFilter: (filter: {
name: string;
value: any;
}) => void;
};
type LiquidationState = ReturnType<typeof useLiquidationScript>;
declare const Liquidation: FC<LiquidationState>;
declare const MobileLiquidation: FC<LiquidationState & {
classNames?: {
root?: string;
content?: string;
cell?: string;
};
}>;
declare const MarketCloseConfirmID = "MarketCloseConfirmID";
export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, PositionHistoryWidget, type PositionsProps, PositionsWidget, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext };