@0xmonaco/react 1.0.32-develop.522174b → 1.0.33-develop.c485f61
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 +6 -3
- package/dist/coverage.js +7 -4
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/usePitpass/index.d.ts +5 -0
- package/dist/hooks/usePitpass/index.js +4 -0
- package/dist/hooks/usePitpass/types.d.ts +17 -0
- package/dist/hooks/usePitpass/types.js +0 -0
- package/dist/hooks/usePitpass/useClearTraderCode.d.ts +7 -0
- package/dist/hooks/usePitpass/useClearTraderCode.js +16 -0
- package/dist/hooks/usePitpass/useMyTraderCode.d.ts +8 -0
- package/dist/hooks/usePitpass/useMyTraderCode.js +17 -0
- package/dist/hooks/usePitpass/useSetTraderCode.d.ts +8 -0
- package/dist/hooks/usePitpass/useSetTraderCode.js +18 -0
- package/dist/hooks/usePitpass/useTraderCodeAvailability.d.ts +9 -0
- package/dist/hooks/usePitpass/useTraderCodeAvailability.js +18 -0
- package/package.json +3 -3
package/dist/coverage.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export declare const COVERED: {
|
|
|
21
21
|
get_market_metadata: string;
|
|
22
22
|
get_my_fee_tier: string;
|
|
23
23
|
get_my_trader_code: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
set_trader_code: string;
|
|
25
|
+
clear_trader_code: string;
|
|
26
|
+
check_trader_code_availability: string;
|
|
27
27
|
get_open_interest: string;
|
|
28
28
|
get_order_by_id: string;
|
|
29
29
|
get_orderbook_snapshot: string;
|
|
@@ -74,9 +74,11 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
74
74
|
get_portfolio_realized_pnl: string;
|
|
75
75
|
get_portfolio_stats: string;
|
|
76
76
|
get_portfolio_summary: string;
|
|
77
|
+
get_rewards_balance: string;
|
|
77
78
|
get_screener: string;
|
|
78
79
|
get_sub_account_limits: string;
|
|
79
80
|
get_trade_by_id: string;
|
|
81
|
+
get_trader_code_info: string;
|
|
80
82
|
get_trading_pair_by_id: string;
|
|
81
83
|
get_user_trades: string;
|
|
82
84
|
health_check: string;
|
|
@@ -101,6 +103,7 @@ export declare const INTENTIONALLY_EXCLUDED: {
|
|
|
101
103
|
transfer_collateral_to_margin_account: string;
|
|
102
104
|
transfer_collateral_to_parent_margin_account: string;
|
|
103
105
|
transfer_collateral_to_risk_bucket: string;
|
|
106
|
+
transfer_rewards: string;
|
|
104
107
|
update_sub_account_limit: string;
|
|
105
108
|
upsert_delegated_agent: string;
|
|
106
109
|
verify_signature: string;
|
package/dist/coverage.js
CHANGED
|
@@ -20,10 +20,10 @@ export const COVERED = {
|
|
|
20
20
|
get_mark_price: "useMarket",
|
|
21
21
|
get_market_metadata: "useMarket",
|
|
22
22
|
get_my_fee_tier: "useFees",
|
|
23
|
-
get_my_trader_code: "
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
get_my_trader_code: "useMyTraderCode",
|
|
24
|
+
set_trader_code: "useSetTraderCode",
|
|
25
|
+
clear_trader_code: "useClearTraderCode",
|
|
26
|
+
check_trader_code_availability: "useTraderCodeAvailability",
|
|
27
27
|
get_open_interest: "useMarket",
|
|
28
28
|
get_order_by_id: "useTrade",
|
|
29
29
|
get_orderbook_snapshot: "useOrderbook",
|
|
@@ -74,9 +74,11 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
74
74
|
get_portfolio_realized_pnl: "Authoritative portfolio analytics is available through @0xmonaco/core; no dedicated React hook in this release.",
|
|
75
75
|
get_portfolio_stats: "Portfolio analytics endpoint; no React hook yet.",
|
|
76
76
|
get_portfolio_summary: "Authoritative portfolio analytics is available through @0xmonaco/core; no dedicated React hook in this release.",
|
|
77
|
+
get_rewards_balance: "PitPass rewards-balance read is available via @0xmonaco/core; no dedicated React hook.",
|
|
77
78
|
get_screener: "Market lookup available via the core client / list+symbol hooks; no dedicated React hook.",
|
|
78
79
|
get_sub_account_limits: "Sub-account administration; no React hook.",
|
|
79
80
|
get_trade_by_id: "Trade-history lookup with a core client method but no dedicated React hook yet.",
|
|
81
|
+
get_trader_code_info: "Public PitPass TraderCode lookup is available via @0xmonaco/core; no dedicated React hook.",
|
|
80
82
|
get_trading_pair_by_id: "Market lookup available via the core client / list+symbol hooks; no dedicated React hook.",
|
|
81
83
|
get_user_trades: "Trade-history lookup with a core client method but no dedicated React hook yet.",
|
|
82
84
|
health_check: "Infrastructure liveness probe (GET /health); not part of the data SDK surface.",
|
|
@@ -101,6 +103,7 @@ export const INTENTIONALLY_EXCLUDED = {
|
|
|
101
103
|
transfer_collateral_to_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
102
104
|
transfer_collateral_to_parent_margin_account: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
103
105
|
transfer_collateral_to_risk_bucket: "Margin-account management/collateral/simulation endpoint; no React hook yet.",
|
|
106
|
+
transfer_rewards: "PitPass rewards transfer is available via @0xmonaco/core; no dedicated React hook.",
|
|
104
107
|
update_sub_account_limit: "Sub-account administration; no React hook.",
|
|
105
108
|
upsert_delegated_agent: "Delegated-agent management is an automation/agent surface, not a UI workflow; no React hook.",
|
|
106
109
|
verify_signature: "Auth verification runs inside login()/authenticate(); useAuth does not expose verifySignature as its own hook method.",
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { UseClearTraderCodeReturn, UseMyTraderCodeReturn, UseSetTraderCodeReturn, UseTraderCodeAvailabilityReturn } from "./types";
|
|
2
|
+
export { useClearTraderCode } from "./useClearTraderCode";
|
|
3
|
+
export { useMyTraderCode } from "./useMyTraderCode";
|
|
4
|
+
export { useSetTraderCode } from "./useSetTraderCode";
|
|
5
|
+
export { useTraderCodeAvailability } from "./useTraderCodeAvailability";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TraderCodeAvailabilityResponse, TraderCodeResponse } from "@0xmonaco/types";
|
|
2
|
+
export interface UseMyTraderCodeReturn {
|
|
3
|
+
/** Read the caller's TraderCode identity (wallet-derived `code` plus the custom-handle fields). */
|
|
4
|
+
getMyTraderCode: () => Promise<TraderCodeResponse>;
|
|
5
|
+
}
|
|
6
|
+
export interface UseSetTraderCodeReturn {
|
|
7
|
+
/** Claim or edit the caller's custom (vanity) TraderCode handle. Casing is preserved. */
|
|
8
|
+
setTraderCode: (code: string) => Promise<TraderCodeResponse>;
|
|
9
|
+
}
|
|
10
|
+
export interface UseClearTraderCodeReturn {
|
|
11
|
+
/** Clear the caller's custom TraderCode handle, reverting to the wallet-derived default. */
|
|
12
|
+
clearTraderCode: () => Promise<TraderCodeResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface UseTraderCodeAvailabilityReturn {
|
|
15
|
+
/** Public advisory check of whether a custom TraderCode handle is available. */
|
|
16
|
+
checkTraderCodeAvailability: (code: string) => Promise<TraderCodeAvailabilityResponse>;
|
|
17
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UseClearTraderCodeReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Clear the authenticated caller's custom TraderCode handle, reverting to the
|
|
4
|
+
* wallet-derived default. The freed handle enters a cooldown before it can be
|
|
5
|
+
* reclaimed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useClearTraderCode: () => UseClearTraderCodeReturn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
|
+
/**
|
|
4
|
+
* Clear the authenticated caller's custom TraderCode handle, reverting to the
|
|
5
|
+
* wallet-derived default. The freed handle enters a cooldown before it can be
|
|
6
|
+
* reclaimed.
|
|
7
|
+
*/
|
|
8
|
+
export const useClearTraderCode = () => {
|
|
9
|
+
const { sdk } = useMonacoSDK();
|
|
10
|
+
const clearTraderCode = useCallback(async () => {
|
|
11
|
+
if (!sdk)
|
|
12
|
+
throw new Error("SDK not available");
|
|
13
|
+
return await sdk.pitpass.clearTraderCode();
|
|
14
|
+
}, [sdk]);
|
|
15
|
+
return { clearTraderCode };
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseMyTraderCodeReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Read the authenticated caller's PitPass TraderCode identity.
|
|
4
|
+
*
|
|
5
|
+
* The response carries both the permanent wallet-derived `code` and the
|
|
6
|
+
* custom-handle fields (`customCode`, `isCustom`, `display`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const useMyTraderCode: () => UseMyTraderCodeReturn;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
|
+
/**
|
|
4
|
+
* Read the authenticated caller's PitPass TraderCode identity.
|
|
5
|
+
*
|
|
6
|
+
* The response carries both the permanent wallet-derived `code` and the
|
|
7
|
+
* custom-handle fields (`customCode`, `isCustom`, `display`).
|
|
8
|
+
*/
|
|
9
|
+
export const useMyTraderCode = () => {
|
|
10
|
+
const { sdk } = useMonacoSDK();
|
|
11
|
+
const getMyTraderCode = useCallback(async () => {
|
|
12
|
+
if (!sdk)
|
|
13
|
+
throw new Error("SDK not available");
|
|
14
|
+
return await sdk.pitpass.getMyTraderCode();
|
|
15
|
+
}, [sdk]);
|
|
16
|
+
return { getMyTraderCode };
|
|
17
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UseSetTraderCodeReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Claim or edit the authenticated caller's custom (vanity) TraderCode handle.
|
|
4
|
+
*
|
|
5
|
+
* The handle is validated client-side (letter-first `[A-Za-z0-9_]`, length 5–20)
|
|
6
|
+
* by the SDK core and sent exactly as entered — casing is preserved.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useSetTraderCode: () => UseSetTraderCodeReturn;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
|
+
/**
|
|
4
|
+
* Claim or edit the authenticated caller's custom (vanity) TraderCode handle.
|
|
5
|
+
*
|
|
6
|
+
* The handle is validated client-side (letter-first `[A-Za-z0-9_]`, length 5–20)
|
|
7
|
+
* by the SDK core and sent exactly as entered — casing is preserved.
|
|
8
|
+
*/
|
|
9
|
+
export const useSetTraderCode = () => {
|
|
10
|
+
const { sdk } = useMonacoSDK();
|
|
11
|
+
const setTraderCode = useCallback(async (code) => {
|
|
12
|
+
if (!sdk)
|
|
13
|
+
throw new Error("SDK not available");
|
|
14
|
+
// Parameter validation is handled by the SDK core using Zod
|
|
15
|
+
return await sdk.pitpass.setTraderCode(code);
|
|
16
|
+
}, [sdk]);
|
|
17
|
+
return { setTraderCode };
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UseTraderCodeAvailabilityReturn } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Public, unauthenticated advisory check of whether a custom TraderCode handle
|
|
4
|
+
* is available (as-you-type UX).
|
|
5
|
+
*
|
|
6
|
+
* Advisory only — the authoritative gate is the atomic claim in
|
|
7
|
+
* {@link useSetTraderCode}, so a positive result is not a reservation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useTraderCodeAvailability: () => UseTraderCodeAvailabilityReturn;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
|
+
/**
|
|
4
|
+
* Public, unauthenticated advisory check of whether a custom TraderCode handle
|
|
5
|
+
* is available (as-you-type UX).
|
|
6
|
+
*
|
|
7
|
+
* Advisory only — the authoritative gate is the atomic claim in
|
|
8
|
+
* {@link useSetTraderCode}, so a positive result is not a reservation.
|
|
9
|
+
*/
|
|
10
|
+
export const useTraderCodeAvailability = () => {
|
|
11
|
+
const { sdk } = useMonacoSDK();
|
|
12
|
+
const checkTraderCodeAvailability = useCallback(async (code) => {
|
|
13
|
+
if (!sdk)
|
|
14
|
+
throw new Error("SDK not available");
|
|
15
|
+
return await sdk.pitpass.checkTraderCodeAvailability(code);
|
|
16
|
+
}, [sdk]);
|
|
17
|
+
return { checkTraderCodeAvailability };
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33-develop.c485f61",
|
|
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.33-develop.c485f61",
|
|
24
|
+
"@0xmonaco/types": "1.0.33-develop.c485f61"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react": "^19.1.12",
|