@0xmonaco/react 1.0.39 → 1.0.40
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/coverage.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** operationId → the @0xmonaco/react hook that covers it. */
|
|
2
2
|
export declare const COVERED: {
|
|
3
|
-
add_position_margin: string;
|
|
4
3
|
attach_position_tp_sl: string;
|
|
5
4
|
batch_cancel_all: string;
|
|
6
5
|
batch_cancel_all_by_pair: string;
|
|
@@ -48,7 +47,6 @@ export declare const COVERED: {
|
|
|
48
47
|
list_position_history: string;
|
|
49
48
|
list_positions: string;
|
|
50
49
|
list_trading_pairs: string;
|
|
51
|
-
reduce_position_margin: string;
|
|
52
50
|
refresh_session: string;
|
|
53
51
|
replace_order: string;
|
|
54
52
|
revoke_session: string;
|
package/dist/coverage.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/** operationId → the @0xmonaco/react hook that covers it. */
|
|
2
2
|
export const COVERED = {
|
|
3
|
-
add_position_margin: "usePositions",
|
|
4
3
|
attach_position_tp_sl: "usePositions",
|
|
5
4
|
batch_cancel_all: "useTrade",
|
|
6
5
|
batch_cancel_all_by_pair: "useTrade",
|
|
@@ -48,7 +47,6 @@ export const COVERED = {
|
|
|
48
47
|
list_position_history: "usePositions",
|
|
49
48
|
list_positions: "usePositions",
|
|
50
49
|
list_trading_pairs: "useMarket",
|
|
51
|
-
reduce_position_margin: "usePositions",
|
|
52
50
|
refresh_session: "useAuth",
|
|
53
51
|
replace_order: "useTrade",
|
|
54
52
|
revoke_session: "useAuth",
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AttachPositionTpSlRequest, AttachPositionTpSlResponse, BatchCloseAllRequest, BatchCloseAllResponse, ClosePositionRequest, ClosePositionResponse, GetPositionResponse, ListPositionHistoryParams, ListPositionHistoryResponse, ListPositionsParams, ListPositionsResponse, PositionRisk } from "@0xmonaco/types";
|
|
2
2
|
export interface UsePositionsReturn {
|
|
3
3
|
listPositions: (params?: ListPositionsParams) => Promise<ListPositionsResponse>;
|
|
4
4
|
getPosition: (positionId: string) => Promise<GetPositionResponse>;
|
|
5
5
|
closePosition: (positionId: string, request: ClosePositionRequest) => Promise<ClosePositionResponse>;
|
|
6
6
|
batchCloseAllPositions: (request?: BatchCloseAllRequest) => Promise<BatchCloseAllResponse>;
|
|
7
7
|
getPositionRisk: (positionId: string) => Promise<PositionRisk>;
|
|
8
|
-
addPositionMargin: (positionId: string, request: AddPositionMarginRequest) => Promise<PositionMarginResponse>;
|
|
9
|
-
reducePositionMargin: (positionId: string, request: ReducePositionMarginRequest) => Promise<PositionMarginResponse>;
|
|
10
8
|
attachPositionTpSl: (positionId: string, request: AttachPositionTpSlRequest) => Promise<AttachPositionTpSlResponse>;
|
|
11
9
|
listPositionHistory: (params?: ListPositionHistoryParams) => Promise<ListPositionHistoryResponse>;
|
|
12
10
|
}
|
|
@@ -34,18 +34,6 @@ export const usePositions = () => {
|
|
|
34
34
|
requirePositionId(positionId);
|
|
35
35
|
return await sdk.positions.getPositionRisk(positionId);
|
|
36
36
|
}, [sdk]);
|
|
37
|
-
const addPositionMargin = useCallback(async (positionId, request) => {
|
|
38
|
-
if (!sdk)
|
|
39
|
-
throw new Error("SDK not available");
|
|
40
|
-
requirePositionId(positionId);
|
|
41
|
-
return await sdk.positions.addPositionMargin(positionId, request);
|
|
42
|
-
}, [sdk]);
|
|
43
|
-
const reducePositionMargin = useCallback(async (positionId, request) => {
|
|
44
|
-
if (!sdk)
|
|
45
|
-
throw new Error("SDK not available");
|
|
46
|
-
requirePositionId(positionId);
|
|
47
|
-
return await sdk.positions.reducePositionMargin(positionId, request);
|
|
48
|
-
}, [sdk]);
|
|
49
37
|
const attachPositionTpSl = useCallback(async (positionId, request) => {
|
|
50
38
|
if (!sdk)
|
|
51
39
|
throw new Error("SDK not available");
|
|
@@ -63,8 +51,6 @@ export const usePositions = () => {
|
|
|
63
51
|
closePosition,
|
|
64
52
|
batchCloseAllPositions,
|
|
65
53
|
getPositionRisk,
|
|
66
|
-
addPositionMargin,
|
|
67
|
-
reducePositionMargin,
|
|
68
54
|
attachPositionTpSl,
|
|
69
55
|
listPositionHistory,
|
|
70
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"lint": "biome lint ."
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@0xmonaco/core": "1.0.
|
|
24
|
-
"@0xmonaco/types": "1.0.
|
|
23
|
+
"@0xmonaco/core": "1.0.40",
|
|
24
|
+
"@0xmonaco/types": "1.0.40"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react": "^19.1.12",
|