@0xmonaco/react 1.0.72 → 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 +7 -0
- package/dist/coverage.js +7 -0
- 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
|
@@ -51,6 +51,7 @@ export declare const COVERED: {
|
|
|
51
51
|
get_rewards_balance: string;
|
|
52
52
|
get_my_referral_position: string;
|
|
53
53
|
get_my_referral_downline: string;
|
|
54
|
+
get_my_referral_tree: string;
|
|
54
55
|
get_trader_code_info: string;
|
|
55
56
|
get_trades: string;
|
|
56
57
|
get_user_balance_by_asset: string;
|
|
@@ -77,6 +78,7 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
77
78
|
claim_managed_market_lease: string;
|
|
78
79
|
refresh_managed_market_quotes: string;
|
|
79
80
|
claim_buildercode_rewards: string;
|
|
81
|
+
set_builder_fee: string;
|
|
80
82
|
cancel_twap_order: string;
|
|
81
83
|
create_delegated_session: string;
|
|
82
84
|
create_twap_order: string;
|
|
@@ -118,6 +120,7 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
118
120
|
list_application_orders: string;
|
|
119
121
|
list_application_users: string;
|
|
120
122
|
list_buildercode_payouts: string;
|
|
123
|
+
list_builder_fee_changes: string;
|
|
121
124
|
list_delegated_agent_owners: string;
|
|
122
125
|
list_delegated_agents: string;
|
|
123
126
|
list_all_funding_history: string;
|
|
@@ -137,6 +140,10 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
137
140
|
transfer_collateral_to_margin_account: string;
|
|
138
141
|
transfer_collateral_to_parent_margin_account: string;
|
|
139
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;
|
|
140
147
|
update_sub_account_limit: string;
|
|
141
148
|
upsert_delegated_agent: string;
|
|
142
149
|
verify_signature: string;
|
package/dist/coverage.js
CHANGED
|
@@ -51,6 +51,7 @@ export const COVERED = {
|
|
|
51
51
|
get_rewards_balance: "useRewardsBalance",
|
|
52
52
|
get_my_referral_position: "useMyReferralPosition",
|
|
53
53
|
get_my_referral_downline: "useMyReferralDownline",
|
|
54
|
+
get_my_referral_tree: "useMyReferralTree",
|
|
54
55
|
get_trader_code_info: "useTraderCodeInfo",
|
|
55
56
|
get_trades: "useTradeFeed",
|
|
56
57
|
get_user_balance_by_asset: "useProfile",
|
|
@@ -77,6 +78,7 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
77
78
|
claim_managed_market_lease: "Process lease lifecycle belongs to the managed maker driver, not an interactive consumer.",
|
|
78
79
|
refresh_managed_market_quotes: "Cadenced fenced intents belong to the managed maker driver; core SDK exposes the transport.",
|
|
79
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.",
|
|
80
82
|
cancel_twap_order: "TWAP parent orders are an advanced execution-algo surface (covered by @0xmonaco/core); no React hook yet.",
|
|
81
83
|
create_delegated_session: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
82
84
|
create_twap_order: "TWAP parent orders are an advanced execution-algo surface (covered by @0xmonaco/core); no React hook yet.",
|
|
@@ -118,6 +120,7 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
118
120
|
list_application_orders: "Application/backend (server-key) admin endpoint; not a user-wallet React workflow.",
|
|
119
121
|
list_application_users: "Application/backend (server-key) admin endpoint; not a user-wallet React workflow.",
|
|
120
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.",
|
|
121
124
|
list_delegated_agent_owners: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
122
125
|
list_delegated_agents: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
123
126
|
list_all_funding_history: "Bulk market data; useMarket covers per-pair funding; no React hook.",
|
|
@@ -137,6 +140,10 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
137
140
|
transfer_collateral_to_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
138
141
|
transfer_collateral_to_parent_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
139
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.",
|
|
140
147
|
update_sub_account_limit: "Sub-account administration; no React hook.",
|
|
141
148
|
upsert_delegated_agent: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
142
149
|
verify_signature: "Auth verification runs inside login()/authenticate(); useAuth does not expose verifySignature as its own hook method.",
|
|
@@ -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
|
".": {
|