@0xmonaco/react 1.0.70 → 1.0.73-develop.af0f5d0
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 +10 -0
- package/dist/coverage.js +10 -0
- package/dist/hooks/useCopyTrading/types.d.ts +1 -1
- package/dist/hooks/useCopyTrading/useCopyTrading.d.ts +2 -1
- package/dist/hooks/useCopyTrading/useCopyTrading.js +8 -1
- package/dist/hooks/usePitpass/index.d.ts +2 -1
- package/dist/hooks/usePitpass/index.js +1 -0
- package/dist/hooks/usePitpass/types.d.ts +6 -2
- package/dist/hooks/usePitpass/useMyReferralTree.d.ts +10 -0
- package/dist/hooks/usePitpass/useMyReferralTree.js +19 -0
- package/package.json +5 -5
package/dist/coverage.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export declare const COVERED: {
|
|
|
18
18
|
list_lead_trader_open_positions: string;
|
|
19
19
|
upsert_follow: string;
|
|
20
20
|
stop_follow: string;
|
|
21
|
+
close_follow_positions: string;
|
|
22
|
+
close_all_copy_positions: string;
|
|
23
|
+
add_follow_position_margin: string;
|
|
21
24
|
list_my_follows: string;
|
|
22
25
|
get_follow: string;
|
|
23
26
|
list_follow_leader_positions: string;
|
|
@@ -48,6 +51,7 @@ export declare const COVERED: {
|
|
|
48
51
|
get_rewards_balance: string;
|
|
49
52
|
get_my_referral_position: string;
|
|
50
53
|
get_my_referral_downline: string;
|
|
54
|
+
get_my_referral_tree: string;
|
|
51
55
|
get_trader_code_info: string;
|
|
52
56
|
get_trades: string;
|
|
53
57
|
get_user_balance_by_asset: string;
|
|
@@ -74,6 +78,7 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
74
78
|
claim_managed_market_lease: string;
|
|
75
79
|
refresh_managed_market_quotes: string;
|
|
76
80
|
claim_buildercode_rewards: string;
|
|
81
|
+
set_builder_fee: string;
|
|
77
82
|
cancel_twap_order: string;
|
|
78
83
|
create_delegated_session: string;
|
|
79
84
|
create_twap_order: string;
|
|
@@ -115,6 +120,7 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
115
120
|
list_application_orders: string;
|
|
116
121
|
list_application_users: string;
|
|
117
122
|
list_buildercode_payouts: string;
|
|
123
|
+
list_builder_fee_changes: string;
|
|
118
124
|
list_delegated_agent_owners: string;
|
|
119
125
|
list_delegated_agents: string;
|
|
120
126
|
list_all_funding_history: string;
|
|
@@ -134,6 +140,10 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
134
140
|
transfer_collateral_to_margin_account: string;
|
|
135
141
|
transfer_collateral_to_parent_margin_account: string;
|
|
136
142
|
transfer_collateral_to_risk_bucket: string;
|
|
143
|
+
create_sub_account: string;
|
|
144
|
+
close_sub_account: string;
|
|
145
|
+
get_margin_account_pnl: string;
|
|
146
|
+
transfer_collateral: string;
|
|
137
147
|
update_sub_account_limit: string;
|
|
138
148
|
upsert_delegated_agent: string;
|
|
139
149
|
verify_signature: string;
|
package/dist/coverage.js
CHANGED
|
@@ -18,6 +18,9 @@ export const COVERED = {
|
|
|
18
18
|
list_lead_trader_open_positions: "useCopyTrading",
|
|
19
19
|
upsert_follow: "useCopyTrading",
|
|
20
20
|
stop_follow: "useCopyTrading",
|
|
21
|
+
close_follow_positions: "useCopyTrading",
|
|
22
|
+
close_all_copy_positions: "useCopyTrading",
|
|
23
|
+
add_follow_position_margin: "useCopyTrading",
|
|
21
24
|
list_my_follows: "useCopyTrading",
|
|
22
25
|
get_follow: "useCopyTrading",
|
|
23
26
|
list_follow_leader_positions: "useCopyTrading",
|
|
@@ -48,6 +51,7 @@ export const COVERED = {
|
|
|
48
51
|
get_rewards_balance: "useRewardsBalance",
|
|
49
52
|
get_my_referral_position: "useMyReferralPosition",
|
|
50
53
|
get_my_referral_downline: "useMyReferralDownline",
|
|
54
|
+
get_my_referral_tree: "useMyReferralTree",
|
|
51
55
|
get_trader_code_info: "useTraderCodeInfo",
|
|
52
56
|
get_trades: "useTradeFeed",
|
|
53
57
|
get_user_balance_by_asset: "useProfile",
|
|
@@ -74,6 +78,7 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
74
78
|
claim_managed_market_lease: "Process lease lifecycle belongs to the managed maker driver, not an interactive consumer.",
|
|
75
79
|
refresh_managed_market_quotes: "Cadenced fenced intents belong to the managed maker driver; core SDK exposes the transport.",
|
|
76
80
|
claim_buildercode_rewards: "BuilderCodes payout claim is a frontend-operator workflow, not an end-user trading action; covered by @0xmonaco/core.",
|
|
81
|
+
set_builder_fee: "BuilderCodes fee administration is a frontend-operator workflow covered by @0xmonaco/core; no React hook.",
|
|
77
82
|
cancel_twap_order: "TWAP parent orders are an advanced execution-algo surface (covered by @0xmonaco/core); no React hook yet.",
|
|
78
83
|
create_delegated_session: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
79
84
|
create_twap_order: "TWAP parent orders are an advanced execution-algo surface (covered by @0xmonaco/core); no React hook yet.",
|
|
@@ -115,6 +120,7 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
115
120
|
list_application_orders: "Application/backend (server-key) admin endpoint; not a user-wallet React workflow.",
|
|
116
121
|
list_application_users: "Application/backend (server-key) admin endpoint; not a user-wallet React workflow.",
|
|
117
122
|
list_buildercode_payouts: "BuilderCodes frontend-operator reporting is covered by @0xmonaco/core; no React hook.",
|
|
123
|
+
list_builder_fee_changes: "BuilderCodes frontend-operator audit reporting is covered by @0xmonaco/core; no React hook.",
|
|
118
124
|
list_delegated_agent_owners: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
119
125
|
list_delegated_agents: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
120
126
|
list_all_funding_history: "Bulk market data; useMarket covers per-pair funding; no React hook.",
|
|
@@ -134,6 +140,10 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
134
140
|
transfer_collateral_to_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
135
141
|
transfer_collateral_to_parent_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
136
142
|
transfer_collateral_to_risk_bucket: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
143
|
+
create_sub_account: "Margin sub-account management; no React hook yet.",
|
|
144
|
+
close_sub_account: "Margin sub-account management; no React hook yet.",
|
|
145
|
+
get_margin_account_pnl: "Margin sub-account read; no React hook yet.",
|
|
146
|
+
transfer_collateral: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
137
147
|
update_sub_account_limit: "Sub-account administration; no React hook.",
|
|
138
148
|
upsert_delegated_agent: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
139
149
|
verify_signature: "Auth verification runs inside login()/authenticate(); useAuth does not expose verifySignature as its own hook method.",
|
|
@@ -3,4 +3,4 @@ import type { CopyTradingAPI } from "@0xmonaco/types";
|
|
|
3
3
|
* Return type of {@link useCopyTrading}: the copy trading client methods, each
|
|
4
4
|
* with the same signature and documentation as `sdk.copyTrading`.
|
|
5
5
|
*/
|
|
6
|
-
export type UseCopyTradingReturn = Pick<CopyTradingAPI, "listLeadTraders" | "getLeadTrader" | "listLeadTraderClosedTrades" | "listLeadTraderOpenPositions" | "upsertLeadTrader" | "getMyLeadTrader" | "listMyFollowers" | "upsertFollow" | "stopFollow" | "listMyFollows" | "getFollow" | "listFollowLeaderPositions" | "previewFollow">;
|
|
6
|
+
export type UseCopyTradingReturn = Pick<CopyTradingAPI, "listLeadTraders" | "getLeadTrader" | "listLeadTraderClosedTrades" | "listLeadTraderOpenPositions" | "upsertLeadTrader" | "getMyLeadTrader" | "listMyFollowers" | "upsertFollow" | "stopFollow" | "closeFollowPositions" | "closeAllCopyPositions" | "listMyFollows" | "getFollow" | "listFollowLeaderPositions" | "previewFollow" | "addFollowPositionMargin">;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { UseCopyTradingReturn } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Copy trading: the public leaderboard and lead trader profiles, your own lead
|
|
4
|
-
* trader profile and followers, and your follows
|
|
4
|
+
* trader profile and followers, and your follows (including adding margin to
|
|
5
|
+
* a copy position).
|
|
5
6
|
*
|
|
6
7
|
* Every method delegates to `sdk.copyTrading` (see `@0xmonaco/core` for the
|
|
7
8
|
* request contract). The leaderboard, `getLeadTrader` and
|
|
@@ -2,7 +2,8 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { useMonacoSDK } from "../useMonaco";
|
|
3
3
|
/**
|
|
4
4
|
* Copy trading: the public leaderboard and lead trader profiles, your own lead
|
|
5
|
-
* trader profile and followers, and your follows
|
|
5
|
+
* trader profile and followers, and your follows (including adding margin to
|
|
6
|
+
* a copy position).
|
|
6
7
|
*
|
|
7
8
|
* Every method delegates to `sdk.copyTrading` (see `@0xmonaco/core` for the
|
|
8
9
|
* request contract). The leaderboard, `getLeadTrader` and
|
|
@@ -36,10 +37,13 @@ export const useCopyTrading = () => {
|
|
|
36
37
|
const listMyFollowers = useCallback(async (params) => await client().listMyFollowers(params), [client]);
|
|
37
38
|
const upsertFollow = useCallback(async (params) => await client().upsertFollow(params), [client]);
|
|
38
39
|
const stopFollow = useCallback(async (followId) => await client().stopFollow(followId), [client]);
|
|
40
|
+
const closeFollowPositions = useCallback(async (followId) => await client().closeFollowPositions(followId), [client]);
|
|
41
|
+
const closeAllCopyPositions = useCallback(async () => await client().closeAllCopyPositions(), [client]);
|
|
39
42
|
const listMyFollows = useCallback(async (params) => await client().listMyFollows(params), [client]);
|
|
40
43
|
const getFollow = useCallback(async (followId) => await client().getFollow(followId), [client]);
|
|
41
44
|
const previewFollow = useCallback(async (params) => await client().previewFollow(params), [client]);
|
|
42
45
|
const listFollowLeaderPositions = useCallback(async (followId) => await client().listFollowLeaderPositions(followId), [client]);
|
|
46
|
+
const addFollowPositionMargin = useCallback(async (params) => await client().addFollowPositionMargin(params), [client]);
|
|
43
47
|
return {
|
|
44
48
|
listLeadTraders,
|
|
45
49
|
getLeadTrader,
|
|
@@ -50,9 +54,12 @@ export const useCopyTrading = () => {
|
|
|
50
54
|
listMyFollowers,
|
|
51
55
|
upsertFollow,
|
|
52
56
|
stopFollow,
|
|
57
|
+
closeFollowPositions,
|
|
58
|
+
closeAllCopyPositions,
|
|
53
59
|
listMyFollows,
|
|
54
60
|
getFollow,
|
|
55
61
|
listFollowLeaderPositions,
|
|
56
62
|
previewFollow,
|
|
63
|
+
addFollowPositionMargin,
|
|
57
64
|
};
|
|
58
65
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type { UseClearTraderCodeReturn, UseMyReferralDownlineReturn, UseMyReferralPositionReturn, UseMyTraderCodeReturn, UseRewardsBalanceReturn, UseSetTraderCodeReturn, UseTraderCodeAvailabilityReturn, UseTraderCodeInfoReturn, UseTransferRewardsReturn, } from "./types";
|
|
1
|
+
export type { UseClearTraderCodeReturn, UseMyReferralDownlineReturn, UseMyReferralPositionReturn, UseMyReferralTreeReturn, UseMyTraderCodeReturn, UseRewardsBalanceReturn, UseSetTraderCodeReturn, UseTraderCodeAvailabilityReturn, UseTraderCodeInfoReturn, UseTransferRewardsReturn, } from "./types";
|
|
2
2
|
export { useClearTraderCode } from "./useClearTraderCode";
|
|
3
3
|
export { useMyReferralDownline } from "./useMyReferralDownline";
|
|
4
4
|
export { useMyReferralPosition } from "./useMyReferralPosition";
|
|
5
|
+
export { useMyReferralTree } from "./useMyReferralTree";
|
|
5
6
|
export { useMyTraderCode } from "./useMyTraderCode";
|
|
6
7
|
export { useRewardsBalance } from "./useRewardsBalance";
|
|
7
8
|
export { useSetTraderCode } from "./useSetTraderCode";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { useClearTraderCode } from "./useClearTraderCode";
|
|
2
2
|
export { useMyReferralDownline } from "./useMyReferralDownline";
|
|
3
3
|
export { useMyReferralPosition } from "./useMyReferralPosition";
|
|
4
|
+
export { useMyReferralTree } from "./useMyReferralTree";
|
|
4
5
|
export { useMyTraderCode } from "./useMyTraderCode";
|
|
5
6
|
export { useRewardsBalance } from "./useRewardsBalance";
|
|
6
7
|
export { useSetTraderCode } from "./useSetTraderCode";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "@0xmonaco/types";
|
|
1
|
+
import type { GetMyReferralDownlineResponse, GetMyReferralPositionResponse, GetMyReferralTreeParams, GetMyReferralTreeResponse, GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "@0xmonaco/types";
|
|
2
2
|
export interface UseMyTraderCodeReturn {
|
|
3
3
|
/** Read the caller's TraderCode identity (wallet-derived `code` plus the custom-handle fields). */
|
|
4
4
|
getMyTraderCode: () => Promise<TraderCodeResponse>;
|
|
@@ -28,10 +28,14 @@ export interface UseTransferRewardsReturn {
|
|
|
28
28
|
transferRewards: (params: TransferRewardsParams) => Promise<TransferRewardsResponse>;
|
|
29
29
|
}
|
|
30
30
|
export interface UseMyReferralPositionReturn {
|
|
31
|
-
/** Read the caller's own referral position: L1 referrer, total earned, and recent rewards. */
|
|
31
|
+
/** Read the caller's own referral position: upline (L1/L2/L3), L1 referrer, total earned, and recent rewards. */
|
|
32
32
|
getMyReferralPosition: () => Promise<GetMyReferralPositionResponse>;
|
|
33
33
|
}
|
|
34
34
|
export interface UseMyReferralDownlineReturn {
|
|
35
35
|
/** Read the caller's own downline: earnings by source (L1/L2/L3), L1 roster, and per-level summary. */
|
|
36
36
|
getMyReferralDownline: () => Promise<GetMyReferralDownlineResponse>;
|
|
37
37
|
}
|
|
38
|
+
export interface UseMyReferralTreeReturn {
|
|
39
|
+
/** Read one level of the caller's own referral tree: `parent`'s direct referees (the caller when omitted), paginated. */
|
|
40
|
+
getMyReferralTree: (params?: GetMyReferralTreeParams) => Promise<GetMyReferralTreeResponse>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { UseMyReferralTreeReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Read one level of the authenticated caller's own referral tree: the wallets
|
|
4
|
+
* `parent` directly referred (the caller when omitted), a page at a time,
|
|
5
|
+
* newest first. Expand a node by calling again with `parent` set to its wallet.
|
|
6
|
+
*
|
|
7
|
+
* Self-scoped and read-only: `parent` must be the caller or one of their own
|
|
8
|
+
* L1/L2 referees, otherwise the request fails with a 404.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useMyReferralTree: () => UseMyReferralTreeReturn;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
|
+
/**
|
|
4
|
+
* Read one level of the authenticated caller's own referral tree: the wallets
|
|
5
|
+
* `parent` directly referred (the caller when omitted), a page at a time,
|
|
6
|
+
* newest first. Expand a node by calling again with `parent` set to its wallet.
|
|
7
|
+
*
|
|
8
|
+
* Self-scoped and read-only: `parent` must be the caller or one of their own
|
|
9
|
+
* L1/L2 referees, otherwise the request fails with a 404.
|
|
10
|
+
*/
|
|
11
|
+
export const useMyReferralTree = () => {
|
|
12
|
+
const { sdk } = useMonacoSDK();
|
|
13
|
+
const getMyReferralTree = useCallback(async (params) => {
|
|
14
|
+
if (!sdk)
|
|
15
|
+
throw new Error("SDK not available");
|
|
16
|
+
return await sdk.pitpass.getMyReferralTree(params);
|
|
17
|
+
}, [sdk]);
|
|
18
|
+
return { getMyReferralTree };
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.73-develop.af0f5d0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"lint": "biome lint ."
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@0xmonaco/core": "1.0.
|
|
20
|
-
"@0xmonaco/types": "1.0.
|
|
19
|
+
"@0xmonaco/core": "1.0.73-develop.af0f5d0",
|
|
20
|
+
"@0xmonaco/types": "1.0.73-develop.af0f5d0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "^19.2.18",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"viem": "^2.45.2",
|
|
29
|
+
"wagmi": "^2.0.0 || ^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|