@orderly.network/portfolio 2.0.1-alpha.6 → 2.0.1-alpha.8

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
@@ -1,11 +1,36 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { LayoutProps, SideBarProps, SideMenuItem } from '@orderly.network/ui-scaffold';
1
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
4
  import * as _orderly_network_types from '@orderly.network/types';
3
5
  import { API } from '@orderly.network/types';
4
- import { TableColumn, PaginationMeta } from '@orderly.network/ui';
5
- import * as react from 'react';
6
- import { FC, PropsWithChildren } from 'react';
7
- import { LayoutProps } from '@orderly.network/ui-scaffold';
6
+ import * as _orderly_network_ui from '@orderly.network/ui';
7
+ import { Column } from '@orderly.network/ui';
8
8
  import { PositionsProps } from '@orderly.network/ui-positions';
9
+ import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
10
+
11
+ type PortfolioLayoutProps = LayoutProps & {
12
+ hideSideBar?: boolean;
13
+ /** @deprecated use leftSideProps.items instead */
14
+ items?: SideBarProps["items"];
15
+ };
16
+ declare const PortfolioLayout: FC<PropsWithChildren<PortfolioLayoutProps>>;
17
+
18
+ type PortfolioLayoutWidgetProps = PortfolioLayoutProps;
19
+ declare const PortfolioLayoutWidget: FC<PropsWithChildren<PortfolioLayoutWidgetProps>>;
20
+
21
+ type UseLayoutBuilderOptions = {
22
+ current?: string;
23
+ };
24
+ declare const usePortfolioLayoutScript: (props: UseLayoutBuilderOptions) => {
25
+ items: {
26
+ name: string;
27
+ href: string;
28
+ icon: react_jsx_runtime.JSX.Element;
29
+ }[];
30
+ current: string;
31
+ hideSideBar: boolean;
32
+ onItemSelect: (item: SideMenuItem) => void;
33
+ };
9
34
 
10
35
  type Props = {
11
36
  connected?: boolean;
@@ -68,16 +93,10 @@ declare const useAssetsLineChartScript: () => {
68
93
 
69
94
  declare const HistoryDataGroupWidget: () => react_jsx_runtime.JSX.Element;
70
95
 
71
- declare const useAssetHistoryColumns: () => TableColumn[];
96
+ declare const useAssetHistoryColumns: () => Column[];
72
97
 
73
98
  declare const useAssetHistoryHook: () => {
74
99
  dataSource: _orderly_network_types.API.AssetHistoryRow[];
75
- meta: {
76
- count: number;
77
- page: number;
78
- pageSize: number;
79
- pageTotal: number;
80
- };
81
100
  total: number | undefined;
82
101
  isLoading: boolean;
83
102
  queryParameter: {
@@ -88,9 +107,7 @@ declare const useAssetHistoryHook: () => {
88
107
  name: string;
89
108
  value: any;
90
109
  }) => void;
91
- setPage: react.Dispatch<react.SetStateAction<number>>;
92
- setPageSize: (size: number) => void;
93
- pagination: PaginationMeta;
110
+ pagination: _orderly_network_ui.PaginationMeta;
94
111
  };
95
112
 
96
113
  type UseAssetHistoryReturn = ReturnType<typeof useAssetHistoryHook>;
@@ -142,12 +159,6 @@ declare const useFundingHistoryHook: () => {
142
159
  readonly dataSource: (_orderly_network_types.API.FundingFeeRow & {
143
160
  annual_rate: number;
144
161
  })[] | null;
145
- readonly meta: {
146
- count: number;
147
- page: number;
148
- pageSize: number;
149
- pageTotal: number;
150
- };
151
162
  readonly isLoading: boolean;
152
163
  readonly isValidating: boolean;
153
164
  readonly queryParameter: {
@@ -158,12 +169,10 @@ declare const useFundingHistoryHook: () => {
158
169
  name: string;
159
170
  value: any;
160
171
  }) => void;
161
- readonly setPage: react.Dispatch<react.SetStateAction<number>>;
162
- readonly setPageSize: (size: number) => void;
163
- readonly pagination: PaginationMeta;
172
+ readonly pagination: _orderly_network_ui.PaginationMeta;
164
173
  };
165
174
 
166
- declare const useFundingHistoryColumns: () => TableColumn<API.FundingFeeRow & {
175
+ declare const useFundingHistoryColumns: () => Column<API.FundingFeeRow & {
167
176
  annual_rate: number;
168
177
  }>[];
169
178
 
@@ -173,12 +182,6 @@ declare const useDistributionHistoryHook: () => {
173
182
  readonly dataSource: (_orderly_network_types.API.FundingFeeRow & {
174
183
  annual_rate: number;
175
184
  })[];
176
- readonly meta: {
177
- count: number;
178
- page: number;
179
- pageSize: number;
180
- pageTotal: number;
181
- };
182
185
  readonly isLoading: boolean;
183
186
  readonly isValidating: boolean;
184
187
  readonly queryParameter: {
@@ -189,9 +192,7 @@ declare const useDistributionHistoryHook: () => {
189
192
  name: string;
190
193
  value: any;
191
194
  }) => void;
192
- readonly setPage: react.Dispatch<react.SetStateAction<number>>;
193
- readonly setPageSize: (size: number) => void;
194
- readonly pagination: PaginationMeta;
195
+ readonly pagination: _orderly_network_ui.PaginationMeta;
195
196
  };
196
197
  type useDistributionHistoryHookReturn = ReturnType<typeof useDistributionHistoryHook>;
197
198
 
@@ -227,11 +228,9 @@ declare namespace index$3 {
227
228
  export { index$3_AssetHistory as AssetHistory, index$3_AssetHistoryWidget as AssetHistoryWidget, index$3_AssetWidget as AssetWidget, index$3_AssetsChartWidget as AssetsChartWidget, index$3_AssetsUI as AssetsUI, index$3_DistributionHistoryUI as DistributionHistoryUI, index$3_DistributionHistoryWidget as DistributionHistoryWidget, index$3_FundingHistoryWidget as FundingHistoryWidget, index$3_HistoryDataGroupWidget as HistoryDataGroupWidget, index$3_OverviewContextProvider as OverviewContextProvider, index$3_OverviewPage as OverviewPage, index$3_PerformanceUI as PerformanceUI, index$3_PerformanceWidget as PerformanceWidget, index$3_useAssetHistoryColumns as useAssetHistoryColumns, index$3_useAssetHistoryHook as useAssetHistoryHook, index$3_useAssetsLineChartScript as useAssetsLineChartScript, index$3_useFundingHistoryColumns as useFundingHistoryColumns, index$3_useFundingHistoryHook as useFundingHistoryHook, index$3_usePerformanceScript as usePerformanceScript };
228
229
  }
229
230
 
230
- declare const PortfolioLayoutWidget: (props: PropsWithChildren<LayoutProps>) => react_jsx_runtime.JSX.Element;
231
-
232
231
  type UseFeeTierScriptOptions = {
233
- dataAdapter?: (columns: TableColumn[], dataSource: any[]) => {
234
- columns: TableColumn[];
232
+ dataAdapter?: (columns: Column[], dataSource: any[]) => {
233
+ columns: Column[];
235
234
  dataSource: any[];
236
235
  };
237
236
  onRow?: (record: any, index: number) => {
@@ -257,16 +256,30 @@ declare namespace page$1 {
257
256
  export { page$1_PositionsPage as PositionsPage };
258
257
  }
259
258
 
260
- declare const OrdersPage: () => react_jsx_runtime.JSX.Element;
259
+ declare const OrdersPage: (props: {
260
+ sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
261
+ }) => react_jsx_runtime.JSX.Element;
261
262
 
262
263
  declare const page_OrdersPage: typeof OrdersPage;
263
264
  declare namespace page {
264
265
  export { page_OrdersPage as OrdersPage };
265
266
  }
266
267
 
267
- declare const APIManagerWidget: () => react_jsx_runtime.JSX.Element;
268
+ declare const APIManagerWidget: (props?: {
269
+ filterTags?: [string];
270
+ keyStatus?: string;
271
+ }) => react_jsx_runtime.JSX.Element;
268
272
 
269
- declare const APIManagerPage: () => react_jsx_runtime.JSX.Element;
273
+ /**
274
+ * API key manager page
275
+ * @param filterTags filterTags
276
+ * @param keyStatus filterTags default is "ACTIVE"
277
+ * @returns
278
+ */
279
+ declare const APIManagerPage: (props: {
280
+ filterTags?: [string];
281
+ keyStatus?: string;
282
+ }) => react_jsx_runtime.JSX.Element;
270
283
 
271
284
  declare const index$1_APIManagerPage: typeof APIManagerPage;
272
285
  declare const index$1_APIManagerWidget: typeof APIManagerWidget;
@@ -284,4 +297,4 @@ declare namespace index {
284
297
  export { index_SettingPage as SettingPage, index_SettingWidget as SettingWidget };
285
298
  }
286
299
 
287
- export { index$1 as APIManagerModule, index$2 as FeeTierModule, page as OrdersModule, index$3 as OverviewModule, PortfolioLayoutWidget, page$1 as PositionsModule, index as SettingModule };
300
+ export { index$1 as APIManagerModule, index$2 as FeeTierModule, page as OrdersModule, index$3 as OverviewModule, PortfolioLayout, type PortfolioLayoutProps, PortfolioLayoutWidget, type PortfolioLayoutWidgetProps, page$1 as PositionsModule, index as SettingModule, usePortfolioLayoutScript };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,36 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { LayoutProps, SideBarProps, SideMenuItem } from '@orderly.network/ui-scaffold';
1
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
4
  import * as _orderly_network_types from '@orderly.network/types';
3
5
  import { API } from '@orderly.network/types';
4
- import { TableColumn, PaginationMeta } from '@orderly.network/ui';
5
- import * as react from 'react';
6
- import { FC, PropsWithChildren } from 'react';
7
- import { LayoutProps } from '@orderly.network/ui-scaffold';
6
+ import * as _orderly_network_ui from '@orderly.network/ui';
7
+ import { Column } from '@orderly.network/ui';
8
8
  import { PositionsProps } from '@orderly.network/ui-positions';
9
+ import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
10
+
11
+ type PortfolioLayoutProps = LayoutProps & {
12
+ hideSideBar?: boolean;
13
+ /** @deprecated use leftSideProps.items instead */
14
+ items?: SideBarProps["items"];
15
+ };
16
+ declare const PortfolioLayout: FC<PropsWithChildren<PortfolioLayoutProps>>;
17
+
18
+ type PortfolioLayoutWidgetProps = PortfolioLayoutProps;
19
+ declare const PortfolioLayoutWidget: FC<PropsWithChildren<PortfolioLayoutWidgetProps>>;
20
+
21
+ type UseLayoutBuilderOptions = {
22
+ current?: string;
23
+ };
24
+ declare const usePortfolioLayoutScript: (props: UseLayoutBuilderOptions) => {
25
+ items: {
26
+ name: string;
27
+ href: string;
28
+ icon: react_jsx_runtime.JSX.Element;
29
+ }[];
30
+ current: string;
31
+ hideSideBar: boolean;
32
+ onItemSelect: (item: SideMenuItem) => void;
33
+ };
9
34
 
10
35
  type Props = {
11
36
  connected?: boolean;
@@ -68,16 +93,10 @@ declare const useAssetsLineChartScript: () => {
68
93
 
69
94
  declare const HistoryDataGroupWidget: () => react_jsx_runtime.JSX.Element;
70
95
 
71
- declare const useAssetHistoryColumns: () => TableColumn[];
96
+ declare const useAssetHistoryColumns: () => Column[];
72
97
 
73
98
  declare const useAssetHistoryHook: () => {
74
99
  dataSource: _orderly_network_types.API.AssetHistoryRow[];
75
- meta: {
76
- count: number;
77
- page: number;
78
- pageSize: number;
79
- pageTotal: number;
80
- };
81
100
  total: number | undefined;
82
101
  isLoading: boolean;
83
102
  queryParameter: {
@@ -88,9 +107,7 @@ declare const useAssetHistoryHook: () => {
88
107
  name: string;
89
108
  value: any;
90
109
  }) => void;
91
- setPage: react.Dispatch<react.SetStateAction<number>>;
92
- setPageSize: (size: number) => void;
93
- pagination: PaginationMeta;
110
+ pagination: _orderly_network_ui.PaginationMeta;
94
111
  };
95
112
 
96
113
  type UseAssetHistoryReturn = ReturnType<typeof useAssetHistoryHook>;
@@ -142,12 +159,6 @@ declare const useFundingHistoryHook: () => {
142
159
  readonly dataSource: (_orderly_network_types.API.FundingFeeRow & {
143
160
  annual_rate: number;
144
161
  })[] | null;
145
- readonly meta: {
146
- count: number;
147
- page: number;
148
- pageSize: number;
149
- pageTotal: number;
150
- };
151
162
  readonly isLoading: boolean;
152
163
  readonly isValidating: boolean;
153
164
  readonly queryParameter: {
@@ -158,12 +169,10 @@ declare const useFundingHistoryHook: () => {
158
169
  name: string;
159
170
  value: any;
160
171
  }) => void;
161
- readonly setPage: react.Dispatch<react.SetStateAction<number>>;
162
- readonly setPageSize: (size: number) => void;
163
- readonly pagination: PaginationMeta;
172
+ readonly pagination: _orderly_network_ui.PaginationMeta;
164
173
  };
165
174
 
166
- declare const useFundingHistoryColumns: () => TableColumn<API.FundingFeeRow & {
175
+ declare const useFundingHistoryColumns: () => Column<API.FundingFeeRow & {
167
176
  annual_rate: number;
168
177
  }>[];
169
178
 
@@ -173,12 +182,6 @@ declare const useDistributionHistoryHook: () => {
173
182
  readonly dataSource: (_orderly_network_types.API.FundingFeeRow & {
174
183
  annual_rate: number;
175
184
  })[];
176
- readonly meta: {
177
- count: number;
178
- page: number;
179
- pageSize: number;
180
- pageTotal: number;
181
- };
182
185
  readonly isLoading: boolean;
183
186
  readonly isValidating: boolean;
184
187
  readonly queryParameter: {
@@ -189,9 +192,7 @@ declare const useDistributionHistoryHook: () => {
189
192
  name: string;
190
193
  value: any;
191
194
  }) => void;
192
- readonly setPage: react.Dispatch<react.SetStateAction<number>>;
193
- readonly setPageSize: (size: number) => void;
194
- readonly pagination: PaginationMeta;
195
+ readonly pagination: _orderly_network_ui.PaginationMeta;
195
196
  };
196
197
  type useDistributionHistoryHookReturn = ReturnType<typeof useDistributionHistoryHook>;
197
198
 
@@ -227,11 +228,9 @@ declare namespace index$3 {
227
228
  export { index$3_AssetHistory as AssetHistory, index$3_AssetHistoryWidget as AssetHistoryWidget, index$3_AssetWidget as AssetWidget, index$3_AssetsChartWidget as AssetsChartWidget, index$3_AssetsUI as AssetsUI, index$3_DistributionHistoryUI as DistributionHistoryUI, index$3_DistributionHistoryWidget as DistributionHistoryWidget, index$3_FundingHistoryWidget as FundingHistoryWidget, index$3_HistoryDataGroupWidget as HistoryDataGroupWidget, index$3_OverviewContextProvider as OverviewContextProvider, index$3_OverviewPage as OverviewPage, index$3_PerformanceUI as PerformanceUI, index$3_PerformanceWidget as PerformanceWidget, index$3_useAssetHistoryColumns as useAssetHistoryColumns, index$3_useAssetHistoryHook as useAssetHistoryHook, index$3_useAssetsLineChartScript as useAssetsLineChartScript, index$3_useFundingHistoryColumns as useFundingHistoryColumns, index$3_useFundingHistoryHook as useFundingHistoryHook, index$3_usePerformanceScript as usePerformanceScript };
228
229
  }
229
230
 
230
- declare const PortfolioLayoutWidget: (props: PropsWithChildren<LayoutProps>) => react_jsx_runtime.JSX.Element;
231
-
232
231
  type UseFeeTierScriptOptions = {
233
- dataAdapter?: (columns: TableColumn[], dataSource: any[]) => {
234
- columns: TableColumn[];
232
+ dataAdapter?: (columns: Column[], dataSource: any[]) => {
233
+ columns: Column[];
235
234
  dataSource: any[];
236
235
  };
237
236
  onRow?: (record: any, index: number) => {
@@ -257,16 +256,30 @@ declare namespace page$1 {
257
256
  export { page$1_PositionsPage as PositionsPage };
258
257
  }
259
258
 
260
- declare const OrdersPage: () => react_jsx_runtime.JSX.Element;
259
+ declare const OrdersPage: (props: {
260
+ sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
261
+ }) => react_jsx_runtime.JSX.Element;
261
262
 
262
263
  declare const page_OrdersPage: typeof OrdersPage;
263
264
  declare namespace page {
264
265
  export { page_OrdersPage as OrdersPage };
265
266
  }
266
267
 
267
- declare const APIManagerWidget: () => react_jsx_runtime.JSX.Element;
268
+ declare const APIManagerWidget: (props?: {
269
+ filterTags?: [string];
270
+ keyStatus?: string;
271
+ }) => react_jsx_runtime.JSX.Element;
268
272
 
269
- declare const APIManagerPage: () => react_jsx_runtime.JSX.Element;
273
+ /**
274
+ * API key manager page
275
+ * @param filterTags filterTags
276
+ * @param keyStatus filterTags default is "ACTIVE"
277
+ * @returns
278
+ */
279
+ declare const APIManagerPage: (props: {
280
+ filterTags?: [string];
281
+ keyStatus?: string;
282
+ }) => react_jsx_runtime.JSX.Element;
270
283
 
271
284
  declare const index$1_APIManagerPage: typeof APIManagerPage;
272
285
  declare const index$1_APIManagerWidget: typeof APIManagerWidget;
@@ -284,4 +297,4 @@ declare namespace index {
284
297
  export { index_SettingPage as SettingPage, index_SettingWidget as SettingWidget };
285
298
  }
286
299
 
287
- export { index$1 as APIManagerModule, index$2 as FeeTierModule, page as OrdersModule, index$3 as OverviewModule, PortfolioLayoutWidget, page$1 as PositionsModule, index as SettingModule };
300
+ export { index$1 as APIManagerModule, index$2 as FeeTierModule, page as OrdersModule, index$3 as OverviewModule, PortfolioLayout, type PortfolioLayoutProps, PortfolioLayoutWidget, type PortfolioLayoutWidgetProps, page$1 as PositionsModule, index as SettingModule, usePortfolioLayoutScript };