@orderly.network/portfolio 2.6.1 → 2.6.2-alpha.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.mts CHANGED
@@ -2,7 +2,7 @@ import React$1, { FC, PropsWithChildren } from 'react';
2
2
  import { ScaffoldProps, SideBarProps, SideMenuItem } from '@orderly.network/ui-scaffold';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as _orderly_network_types from '@orderly.network/types';
5
- import { AssetHistorySideEnum, API } from '@orderly.network/types';
5
+ import { API, AssetHistorySideEnum } from '@orderly.network/types';
6
6
  import * as _orderly_network_hooks from '@orderly.network/hooks';
7
7
  import { TWType } from '@orderly.network/hooks';
8
8
  import * as _orderly_network_ui from '@orderly.network/ui';
@@ -78,13 +78,38 @@ declare const AssetWidget: () => react_jsx_runtime.JSX.Element;
78
78
 
79
79
  declare const HistoryDataGroupWidget: React.FC;
80
80
 
81
- declare const AssetsChartWidget: () => react_jsx_runtime.JSX.Element;
81
+ declare const AssetsChartWidget: React$1.FC;
82
82
 
83
83
  declare enum PeriodType {
84
84
  WEEK = "7D",
85
85
  MONTH = "30D",
86
86
  QUARTER = "90D"
87
87
  }
88
+ declare const useAssetsHistoryData: (localKey: string, options?: {
89
+ isRealtime?: boolean;
90
+ }) => {
91
+ readonly periodTypes: PeriodType[];
92
+ readonly period: PeriodType;
93
+ readonly onPeriodChange: (value: PeriodType) => void;
94
+ readonly periodLabel: Record<PeriodType, string>;
95
+ readonly curPeriod: string;
96
+ readonly data: API.DailyRow[];
97
+ readonly aggregateValue: {
98
+ vol: number;
99
+ pnl: number;
100
+ roi: number;
101
+ };
102
+ readonly createFakeData: (start: Partial<API.DailyRow>, end: Partial<API.DailyRow>) => {
103
+ account_value?: number | undefined;
104
+ broker_id?: string | undefined;
105
+ date: string;
106
+ perp_volume?: number | undefined;
107
+ pnl?: number | undefined;
108
+ snapshot_time?: number | undefined;
109
+ }[];
110
+ readonly volumeUpdateDate: any;
111
+ };
112
+ type useAssetsHistoryDataReturn = ReturnType<typeof useAssetsHistoryData>;
88
113
 
89
114
  declare const useAssetsChartScript: () => {
90
115
  readonly data: {
@@ -94,12 +119,14 @@ declare const useAssetsChartScript: () => {
94
119
  perp_volume?: number | undefined;
95
120
  pnl?: number | undefined;
96
121
  snapshot_time?: number | undefined;
97
- }[] | null;
122
+ }[];
98
123
  readonly invisible: boolean;
99
124
  readonly type?: _orderly_network_hooks.TWType;
100
125
  readonly periodTypes: PeriodType[];
101
- readonly period: any;
126
+ readonly period: PeriodType;
102
127
  readonly onPeriodChange: (value: PeriodType) => void;
128
+ readonly periodLabel: Record<PeriodType, string>;
129
+ readonly curPeriod: string;
103
130
  readonly aggregateValue: {
104
131
  vol: number;
105
132
  pnl: number;
@@ -125,7 +152,7 @@ declare const useAssetsChartScript: () => {
125
152
  type useAssetsChartScriptReturn = ReturnType<typeof useAssetsChartScript>;
126
153
 
127
154
  type AssetsLineChartProps = {} & useAssetsChartScriptReturn;
128
- declare const AssetsChart: (props: AssetsLineChartProps) => react_jsx_runtime.JSX.Element;
155
+ declare const AssetsChart: React$1.FC<AssetsLineChartProps>;
129
156
 
130
157
  type Options = {
131
158
  chainsInfo: any[];
@@ -170,20 +197,16 @@ type AssetHistoryWidgetProps = {
170
197
  declare const AssetHistoryWidget: (props: AssetHistoryWidgetProps) => react_jsx_runtime.JSX.Element;
171
198
 
172
199
  declare const usePerformanceScript: () => {
173
- data: {
174
- account_value?: number | undefined;
175
- broker_id?: string | undefined;
176
- date: string;
177
- perp_volume?: number | undefined;
178
- pnl?: number | undefined;
179
- snapshot_time?: number | undefined;
180
- }[] | null;
200
+ data: ReadonlyArray<any>;
181
201
  invisible: boolean;
182
- visible: any;
202
+ visible: boolean;
203
+ setVisible: (value: boolean) => void;
183
204
  type?: _orderly_network_hooks.TWType;
184
205
  periodTypes: PeriodType[];
185
- period: any;
206
+ period: PeriodType;
186
207
  onPeriodChange: (value: PeriodType) => void;
208
+ periodLabel: Record<PeriodType, string>;
209
+ curPeriod: string;
187
210
  aggregateValue: {
188
211
  vol: number;
189
212
  pnl: number;
@@ -209,9 +232,15 @@ declare const usePerformanceScript: () => {
209
232
  type UsePerformanceScriptReturn = ReturnType<typeof usePerformanceScript>;
210
233
 
211
234
  type PerformanceUIProps = {} & UsePerformanceScriptReturn;
212
- declare const PerformanceUI: (props: PerformanceUIProps) => react_jsx_runtime.JSX.Element;
235
+ declare const PerformanceUI: React$1.FC<PerformanceUIProps>;
236
+
237
+ declare const PerformanceWidget: React$1.FC;
238
+
239
+ declare const PerformanceMobileUI: React$1.FC<Pick<useAssetsHistoryDataReturn & UsePerformanceScriptReturn, "data" | "curPeriod" | "aggregateValue" | "onPeriodChange" | "invisible" | "visible" | "createFakeData">>;
213
240
 
214
- declare const PerformanceWidget: () => react_jsx_runtime.JSX.Element;
241
+ declare const PerformanceMobileWidget: React$1.FC;
242
+ declare const PerformanceMobileSheetId = "PerformanceMobileSheetId";
243
+ declare const PerformanceMobileDialogId = "PerformanceMobileDialogId";
215
244
 
216
245
  declare const FundingHistoryWidget: () => react_jsx_runtime.JSX.Element;
217
246
 
@@ -262,7 +291,7 @@ declare const DistributionHistoryMobile: FC<FundingHistoryProps$1>;
262
291
  type FundingHistoryProps = {} & useDistributionHistoryHookReturn;
263
292
  declare const DistributionHistoryDesktop: FC<FundingHistoryProps>;
264
293
 
265
- declare const OverviewPage: () => react_jsx_runtime.JSX.Element;
294
+ declare const OverviewPage: React$1.FC;
266
295
 
267
296
  declare const OverviewProvider: FC<PropsWithChildren<{
268
297
  type?: TWType;
@@ -281,6 +310,10 @@ declare const index$5_FundingHistoryWidget: typeof FundingHistoryWidget;
281
310
  declare const index$5_HistoryDataGroupWidget: typeof HistoryDataGroupWidget;
282
311
  declare const index$5_OverviewPage: typeof OverviewPage;
283
312
  declare const index$5_OverviewProvider: typeof OverviewProvider;
313
+ declare const index$5_PerformanceMobileDialogId: typeof PerformanceMobileDialogId;
314
+ declare const index$5_PerformanceMobileSheetId: typeof PerformanceMobileSheetId;
315
+ declare const index$5_PerformanceMobileUI: typeof PerformanceMobileUI;
316
+ declare const index$5_PerformanceMobileWidget: typeof PerformanceMobileWidget;
284
317
  declare const index$5_PerformanceUI: typeof PerformanceUI;
285
318
  declare const index$5_PerformanceWidget: typeof PerformanceWidget;
286
319
  declare const index$5_useAssetHistoryColumns: typeof useAssetHistoryColumns;
@@ -290,7 +323,7 @@ declare const index$5_useFundingHistoryColumns: typeof useFundingHistoryColumns;
290
323
  declare const index$5_useFundingHistoryHook: typeof useFundingHistoryHook;
291
324
  declare const index$5_usePerformanceScript: typeof usePerformanceScript;
292
325
  declare namespace index$5 {
293
- export { index$5_AssetHistory as AssetHistory, index$5_AssetHistoryWidget as AssetHistoryWidget, index$5_AssetWidget as AssetWidget, index$5_AssetsChart as AssetsChart, index$5_AssetsChartWidget as AssetsChartWidget, index$5_AssetsUI as AssetsUI, index$5_DistributionHistoryDesktop as DistributionHistoryDesktop, index$5_DistributionHistoryMobile as DistributionHistoryMobile, index$5_DistributionHistoryWidget as DistributionHistoryWidget, index$5_FundingHistoryWidget as FundingHistoryWidget, index$5_HistoryDataGroupWidget as HistoryDataGroupWidget, index$5_OverviewPage as OverviewPage, index$5_OverviewProvider as OverviewProvider, index$5_PerformanceUI as PerformanceUI, index$5_PerformanceWidget as PerformanceWidget, index$5_useAssetHistoryColumns as useAssetHistoryColumns, index$5_useAssetHistoryScript as useAssetHistoryScript, index$5_useAssetsChartScript as useAssetsChartScript, index$5_useFundingHistoryColumns as useFundingHistoryColumns, index$5_useFundingHistoryHook as useFundingHistoryHook, index$5_usePerformanceScript as usePerformanceScript };
326
+ export { index$5_AssetHistory as AssetHistory, index$5_AssetHistoryWidget as AssetHistoryWidget, index$5_AssetWidget as AssetWidget, index$5_AssetsChart as AssetsChart, index$5_AssetsChartWidget as AssetsChartWidget, index$5_AssetsUI as AssetsUI, index$5_DistributionHistoryDesktop as DistributionHistoryDesktop, index$5_DistributionHistoryMobile as DistributionHistoryMobile, index$5_DistributionHistoryWidget as DistributionHistoryWidget, index$5_FundingHistoryWidget as FundingHistoryWidget, index$5_HistoryDataGroupWidget as HistoryDataGroupWidget, index$5_OverviewPage as OverviewPage, index$5_OverviewProvider as OverviewProvider, index$5_PerformanceMobileDialogId as PerformanceMobileDialogId, index$5_PerformanceMobileSheetId as PerformanceMobileSheetId, index$5_PerformanceMobileUI as PerformanceMobileUI, index$5_PerformanceMobileWidget as PerformanceMobileWidget, index$5_PerformanceUI as PerformanceUI, index$5_PerformanceWidget as PerformanceWidget, index$5_useAssetHistoryColumns as useAssetHistoryColumns, index$5_useAssetHistoryScript as useAssetHistoryScript, index$5_useAssetsChartScript as useAssetsChartScript, index$5_useFundingHistoryColumns as useFundingHistoryColumns, index$5_useFundingHistoryHook as useFundingHistoryHook, index$5_usePerformanceScript as usePerformanceScript };
294
327
  }
295
328
 
296
329
  type UseFeeTierScriptOptions = {
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import React$1, { FC, PropsWithChildren } from 'react';
2
2
  import { ScaffoldProps, SideBarProps, SideMenuItem } from '@orderly.network/ui-scaffold';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as _orderly_network_types from '@orderly.network/types';
5
- import { AssetHistorySideEnum, API } from '@orderly.network/types';
5
+ import { API, AssetHistorySideEnum } from '@orderly.network/types';
6
6
  import * as _orderly_network_hooks from '@orderly.network/hooks';
7
7
  import { TWType } from '@orderly.network/hooks';
8
8
  import * as _orderly_network_ui from '@orderly.network/ui';
@@ -78,13 +78,38 @@ declare const AssetWidget: () => react_jsx_runtime.JSX.Element;
78
78
 
79
79
  declare const HistoryDataGroupWidget: React.FC;
80
80
 
81
- declare const AssetsChartWidget: () => react_jsx_runtime.JSX.Element;
81
+ declare const AssetsChartWidget: React$1.FC;
82
82
 
83
83
  declare enum PeriodType {
84
84
  WEEK = "7D",
85
85
  MONTH = "30D",
86
86
  QUARTER = "90D"
87
87
  }
88
+ declare const useAssetsHistoryData: (localKey: string, options?: {
89
+ isRealtime?: boolean;
90
+ }) => {
91
+ readonly periodTypes: PeriodType[];
92
+ readonly period: PeriodType;
93
+ readonly onPeriodChange: (value: PeriodType) => void;
94
+ readonly periodLabel: Record<PeriodType, string>;
95
+ readonly curPeriod: string;
96
+ readonly data: API.DailyRow[];
97
+ readonly aggregateValue: {
98
+ vol: number;
99
+ pnl: number;
100
+ roi: number;
101
+ };
102
+ readonly createFakeData: (start: Partial<API.DailyRow>, end: Partial<API.DailyRow>) => {
103
+ account_value?: number | undefined;
104
+ broker_id?: string | undefined;
105
+ date: string;
106
+ perp_volume?: number | undefined;
107
+ pnl?: number | undefined;
108
+ snapshot_time?: number | undefined;
109
+ }[];
110
+ readonly volumeUpdateDate: any;
111
+ };
112
+ type useAssetsHistoryDataReturn = ReturnType<typeof useAssetsHistoryData>;
88
113
 
89
114
  declare const useAssetsChartScript: () => {
90
115
  readonly data: {
@@ -94,12 +119,14 @@ declare const useAssetsChartScript: () => {
94
119
  perp_volume?: number | undefined;
95
120
  pnl?: number | undefined;
96
121
  snapshot_time?: number | undefined;
97
- }[] | null;
122
+ }[];
98
123
  readonly invisible: boolean;
99
124
  readonly type?: _orderly_network_hooks.TWType;
100
125
  readonly periodTypes: PeriodType[];
101
- readonly period: any;
126
+ readonly period: PeriodType;
102
127
  readonly onPeriodChange: (value: PeriodType) => void;
128
+ readonly periodLabel: Record<PeriodType, string>;
129
+ readonly curPeriod: string;
103
130
  readonly aggregateValue: {
104
131
  vol: number;
105
132
  pnl: number;
@@ -125,7 +152,7 @@ declare const useAssetsChartScript: () => {
125
152
  type useAssetsChartScriptReturn = ReturnType<typeof useAssetsChartScript>;
126
153
 
127
154
  type AssetsLineChartProps = {} & useAssetsChartScriptReturn;
128
- declare const AssetsChart: (props: AssetsLineChartProps) => react_jsx_runtime.JSX.Element;
155
+ declare const AssetsChart: React$1.FC<AssetsLineChartProps>;
129
156
 
130
157
  type Options = {
131
158
  chainsInfo: any[];
@@ -170,20 +197,16 @@ type AssetHistoryWidgetProps = {
170
197
  declare const AssetHistoryWidget: (props: AssetHistoryWidgetProps) => react_jsx_runtime.JSX.Element;
171
198
 
172
199
  declare const usePerformanceScript: () => {
173
- data: {
174
- account_value?: number | undefined;
175
- broker_id?: string | undefined;
176
- date: string;
177
- perp_volume?: number | undefined;
178
- pnl?: number | undefined;
179
- snapshot_time?: number | undefined;
180
- }[] | null;
200
+ data: ReadonlyArray<any>;
181
201
  invisible: boolean;
182
- visible: any;
202
+ visible: boolean;
203
+ setVisible: (value: boolean) => void;
183
204
  type?: _orderly_network_hooks.TWType;
184
205
  periodTypes: PeriodType[];
185
- period: any;
206
+ period: PeriodType;
186
207
  onPeriodChange: (value: PeriodType) => void;
208
+ periodLabel: Record<PeriodType, string>;
209
+ curPeriod: string;
187
210
  aggregateValue: {
188
211
  vol: number;
189
212
  pnl: number;
@@ -209,9 +232,15 @@ declare const usePerformanceScript: () => {
209
232
  type UsePerformanceScriptReturn = ReturnType<typeof usePerformanceScript>;
210
233
 
211
234
  type PerformanceUIProps = {} & UsePerformanceScriptReturn;
212
- declare const PerformanceUI: (props: PerformanceUIProps) => react_jsx_runtime.JSX.Element;
235
+ declare const PerformanceUI: React$1.FC<PerformanceUIProps>;
236
+
237
+ declare const PerformanceWidget: React$1.FC;
238
+
239
+ declare const PerformanceMobileUI: React$1.FC<Pick<useAssetsHistoryDataReturn & UsePerformanceScriptReturn, "data" | "curPeriod" | "aggregateValue" | "onPeriodChange" | "invisible" | "visible" | "createFakeData">>;
213
240
 
214
- declare const PerformanceWidget: () => react_jsx_runtime.JSX.Element;
241
+ declare const PerformanceMobileWidget: React$1.FC;
242
+ declare const PerformanceMobileSheetId = "PerformanceMobileSheetId";
243
+ declare const PerformanceMobileDialogId = "PerformanceMobileDialogId";
215
244
 
216
245
  declare const FundingHistoryWidget: () => react_jsx_runtime.JSX.Element;
217
246
 
@@ -262,7 +291,7 @@ declare const DistributionHistoryMobile: FC<FundingHistoryProps$1>;
262
291
  type FundingHistoryProps = {} & useDistributionHistoryHookReturn;
263
292
  declare const DistributionHistoryDesktop: FC<FundingHistoryProps>;
264
293
 
265
- declare const OverviewPage: () => react_jsx_runtime.JSX.Element;
294
+ declare const OverviewPage: React$1.FC;
266
295
 
267
296
  declare const OverviewProvider: FC<PropsWithChildren<{
268
297
  type?: TWType;
@@ -281,6 +310,10 @@ declare const index$5_FundingHistoryWidget: typeof FundingHistoryWidget;
281
310
  declare const index$5_HistoryDataGroupWidget: typeof HistoryDataGroupWidget;
282
311
  declare const index$5_OverviewPage: typeof OverviewPage;
283
312
  declare const index$5_OverviewProvider: typeof OverviewProvider;
313
+ declare const index$5_PerformanceMobileDialogId: typeof PerformanceMobileDialogId;
314
+ declare const index$5_PerformanceMobileSheetId: typeof PerformanceMobileSheetId;
315
+ declare const index$5_PerformanceMobileUI: typeof PerformanceMobileUI;
316
+ declare const index$5_PerformanceMobileWidget: typeof PerformanceMobileWidget;
284
317
  declare const index$5_PerformanceUI: typeof PerformanceUI;
285
318
  declare const index$5_PerformanceWidget: typeof PerformanceWidget;
286
319
  declare const index$5_useAssetHistoryColumns: typeof useAssetHistoryColumns;
@@ -290,7 +323,7 @@ declare const index$5_useFundingHistoryColumns: typeof useFundingHistoryColumns;
290
323
  declare const index$5_useFundingHistoryHook: typeof useFundingHistoryHook;
291
324
  declare const index$5_usePerformanceScript: typeof usePerformanceScript;
292
325
  declare namespace index$5 {
293
- export { index$5_AssetHistory as AssetHistory, index$5_AssetHistoryWidget as AssetHistoryWidget, index$5_AssetWidget as AssetWidget, index$5_AssetsChart as AssetsChart, index$5_AssetsChartWidget as AssetsChartWidget, index$5_AssetsUI as AssetsUI, index$5_DistributionHistoryDesktop as DistributionHistoryDesktop, index$5_DistributionHistoryMobile as DistributionHistoryMobile, index$5_DistributionHistoryWidget as DistributionHistoryWidget, index$5_FundingHistoryWidget as FundingHistoryWidget, index$5_HistoryDataGroupWidget as HistoryDataGroupWidget, index$5_OverviewPage as OverviewPage, index$5_OverviewProvider as OverviewProvider, index$5_PerformanceUI as PerformanceUI, index$5_PerformanceWidget as PerformanceWidget, index$5_useAssetHistoryColumns as useAssetHistoryColumns, index$5_useAssetHistoryScript as useAssetHistoryScript, index$5_useAssetsChartScript as useAssetsChartScript, index$5_useFundingHistoryColumns as useFundingHistoryColumns, index$5_useFundingHistoryHook as useFundingHistoryHook, index$5_usePerformanceScript as usePerformanceScript };
326
+ export { index$5_AssetHistory as AssetHistory, index$5_AssetHistoryWidget as AssetHistoryWidget, index$5_AssetWidget as AssetWidget, index$5_AssetsChart as AssetsChart, index$5_AssetsChartWidget as AssetsChartWidget, index$5_AssetsUI as AssetsUI, index$5_DistributionHistoryDesktop as DistributionHistoryDesktop, index$5_DistributionHistoryMobile as DistributionHistoryMobile, index$5_DistributionHistoryWidget as DistributionHistoryWidget, index$5_FundingHistoryWidget as FundingHistoryWidget, index$5_HistoryDataGroupWidget as HistoryDataGroupWidget, index$5_OverviewPage as OverviewPage, index$5_OverviewProvider as OverviewProvider, index$5_PerformanceMobileDialogId as PerformanceMobileDialogId, index$5_PerformanceMobileSheetId as PerformanceMobileSheetId, index$5_PerformanceMobileUI as PerformanceMobileUI, index$5_PerformanceMobileWidget as PerformanceMobileWidget, index$5_PerformanceUI as PerformanceUI, index$5_PerformanceWidget as PerformanceWidget, index$5_useAssetHistoryColumns as useAssetHistoryColumns, index$5_useAssetHistoryScript as useAssetHistoryScript, index$5_useAssetsChartScript as useAssetsChartScript, index$5_useFundingHistoryColumns as useFundingHistoryColumns, index$5_useFundingHistoryHook as useFundingHistoryHook, index$5_usePerformanceScript as usePerformanceScript };
294
327
  }
295
328
 
296
329
  type UseFeeTierScriptOptions = {