@0xmonaco/types 1.0.32 → 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.
@@ -4,7 +4,7 @@
4
4
  * Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
5
5
  */
6
6
  import type { BaseAPI } from "../api";
7
- import type { GetRewardsBalanceResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
7
+ import type { GetRewardsBalanceResponse, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
8
8
  /**
9
9
  * PitPass TraderCode API interface.
10
10
  *
@@ -14,14 +14,50 @@ import type { GetRewardsBalanceResponse, TraderCodeInfoResponse, TraderCodeRespo
14
14
  */
15
15
  export interface PitpassAPI extends BaseAPI {
16
16
  /**
17
- * Return the authenticated caller's TraderCode (their normalized wallet address).
17
+ * Return the authenticated caller's TraderCode.
18
18
  *
19
19
  * Never 404s — every signed-in wallet has a derivable code. Ensures the
20
20
  * backing row so referrals attributed to this wallet have a code to link.
21
+ * The response carries both the permanent wallet-derived `code` and the
22
+ * custom-handle fields (`customCode`, `isCustom`, `display`).
21
23
  *
22
- * @returns Promise resolving to the caller's TraderCode and its creation timestamp
24
+ * @returns Promise resolving to the caller's TraderCode identity and its creation timestamp
23
25
  */
24
26
  getMyTraderCode(): Promise<TraderCodeResponse>;
27
+ /**
28
+ * Claim or edit the authenticated caller's custom (vanity) TraderCode handle.
29
+ *
30
+ * The handle is stored exactly as entered (case preserved); uniqueness is
31
+ * enforced case-insensitively by the server. The client validates the handle
32
+ * (letter-first `[A-Za-z0-9_]`, length 5–20) before sending. The server is
33
+ * the authoritative gate: it returns 409 when the handle is taken, 422 with a
34
+ * reason on validation failure, 429 when the per-hour edit limit is hit, and
35
+ * 403 when the feature is disabled.
36
+ *
37
+ * @param code - The custom handle to claim or edit to, exactly as entered
38
+ * @returns Promise resolving to the caller's updated TraderCode identity
39
+ */
40
+ setTraderCode(code: string): Promise<TraderCodeResponse>;
41
+ /**
42
+ * Clear the caller's custom TraderCode handle, reverting to the
43
+ * wallet-derived default. The freed handle enters a cooldown before anyone
44
+ * else can claim it.
45
+ *
46
+ * @returns Promise resolving to the caller's TraderCode identity after the revert
47
+ */
48
+ clearTraderCode(): Promise<TraderCodeResponse>;
49
+ /**
50
+ * Public, unauthenticated advisory check of whether a custom TraderCode
51
+ * handle is available (as-you-type UX).
52
+ *
53
+ * Advisory only — the authoritative gate is the atomic claim in
54
+ * {@link setTraderCode}, so a positive result here is not a reservation.
55
+ * Returns `available` plus, when unavailable, a `reason` code.
56
+ *
57
+ * @param code - The custom handle to check
58
+ * @returns Promise resolving to availability and, when unavailable, the reason
59
+ */
60
+ checkTraderCodeAvailability(code: string): Promise<TraderCodeAvailabilityResponse>;
25
61
  /**
26
62
  * Public, unauthenticated lookup of a TraderCode.
27
63
  *
@@ -56,5 +92,5 @@ export interface PitpassAPI extends BaseAPI {
56
92
  */
57
93
  transferRewards(params: TransferRewardsParams): Promise<TransferRewardsResponse>;
58
94
  }
59
- export type { GetRewardsBalanceResponse, RewardsBalanceEntry, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
60
- export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
95
+ export type { GetRewardsBalanceResponse, RewardsBalanceEntry, SetTraderCodeParams, TraderCodeAvailabilityReason, TraderCodeAvailabilityResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
96
+ export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
5
5
  */
6
- export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
6
+ export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, SetTraderCodeParamsSchema, TraderCodeAvailabilityReasonSchema, TraderCodeAvailabilityResponseSchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
@@ -21,6 +21,37 @@ export declare const GetRewardsBalanceResponseSchema: z.ZodObject<{
21
21
  export declare const TraderCodeResponseSchema: z.ZodObject<{
22
22
  code: z.ZodString;
23
23
  createdAt: z.ZodString;
24
+ customCode: z.ZodString;
25
+ isCustom: z.ZodBoolean;
26
+ display: z.ZodString;
27
+ }, z.core.$strip>;
28
+ /**
29
+ * The reason a custom TraderCode handle is unavailable, as reported by the
30
+ * advisory availability check. Empty/absent when the handle is available.
31
+ */
32
+ export declare const TraderCodeAvailabilityReasonSchema: z.ZodEnum<{
33
+ taken: "taken";
34
+ too_short: "too_short";
35
+ too_long: "too_long";
36
+ reserved: "reserved";
37
+ invalid_char: "invalid_char";
38
+ looks_like_address: "looks_like_address";
39
+ }>;
40
+ /** Schema for the custom TraderCode availability check response. */
41
+ export declare const TraderCodeAvailabilityResponseSchema: z.ZodObject<{
42
+ available: z.ZodBoolean;
43
+ reason: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
44
+ taken: "taken";
45
+ too_short: "too_short";
46
+ too_long: "too_long";
47
+ reserved: "reserved";
48
+ invalid_char: "invalid_char";
49
+ looks_like_address: "looks_like_address";
50
+ }>>>;
51
+ }, z.core.$strip>;
52
+ /** Schema for the set-custom-TraderCode request params (claim or edit). */
53
+ export declare const SetTraderCodeParamsSchema: z.ZodObject<{
54
+ code: z.ZodString;
24
55
  }, z.core.$strip>;
25
56
  /** Schema for the public TraderCode info response. */
26
57
  export declare const TraderCodeInfoResponseSchema: z.ZodObject<{
@@ -39,6 +70,9 @@ export declare const TransferRewardsResponseSchema: z.ZodObject<{
39
70
  export type RewardsBalanceEntry = z.infer<typeof RewardsBalanceEntrySchema>;
40
71
  export type GetRewardsBalanceResponse = z.infer<typeof GetRewardsBalanceResponseSchema>;
41
72
  export type TraderCodeResponse = z.infer<typeof TraderCodeResponseSchema>;
73
+ export type TraderCodeAvailabilityReason = z.infer<typeof TraderCodeAvailabilityReasonSchema>;
74
+ export type TraderCodeAvailabilityResponse = z.infer<typeof TraderCodeAvailabilityResponseSchema>;
75
+ export type SetTraderCodeParams = z.infer<typeof SetTraderCodeParamsSchema>;
42
76
  export type TraderCodeInfoResponse = z.infer<typeof TraderCodeInfoResponseSchema>;
43
77
  export type TransferRewardsParams = z.infer<typeof TransferRewardsParamsSchema>;
44
78
  export type TransferRewardsResponse = z.infer<typeof TransferRewardsResponseSchema>;
@@ -19,10 +19,60 @@ export const GetRewardsBalanceResponseSchema = z.object({
19
19
  });
20
20
  /** Schema for a TraderCode response. */
21
21
  export const TraderCodeResponseSchema = z.object({
22
- /** The caller's TraderCode — their normalized wallet address. */
22
+ /**
23
+ * The caller's TraderCode — their normalized wallet address. Always present;
24
+ * the permanent reward identity and a public alias even when a custom handle
25
+ * is set.
26
+ */
23
27
  code: z.string(),
24
28
  /** RFC 3339 timestamp when the code row was first derived. */
25
29
  createdAt: z.string(),
30
+ /**
31
+ * The caller's custom vanity handle, exactly as entered (case preserved), or
32
+ * an empty string when the wallet-derived default is kept. Use {@link isCustom}
33
+ * to disambiguate.
34
+ */
35
+ customCode: z.string(),
36
+ /** True when a custom handle is set; false when the wallet-derived default is in effect. */
37
+ isCustom: z.boolean(),
38
+ /**
39
+ * The single human-facing string to render: the custom handle when set,
40
+ * otherwise the `Monaco - <address>` default form.
41
+ */
42
+ display: z.string(),
43
+ });
44
+ /**
45
+ * The reason a custom TraderCode handle is unavailable, as reported by the
46
+ * advisory availability check. Empty/absent when the handle is available.
47
+ */
48
+ export const TraderCodeAvailabilityReasonSchema = z.enum(["taken", "too_short", "too_long", "reserved", "invalid_char", "looks_like_address"]);
49
+ /** Schema for the custom TraderCode availability check response. */
50
+ export const TraderCodeAvailabilityResponseSchema = z.object({
51
+ /** True when the handle passes validation and is neither live nor cooling down. */
52
+ available: z.boolean(),
53
+ /**
54
+ * When unavailable, the reason code; omitted when the handle is available.
55
+ *
56
+ * The API always serializes `reason`, sending the empty string `""` (proto3
57
+ * string default) when the handle is available. Normalize that sentinel (and
58
+ * `null`) to `undefined` so an available response parses cleanly and consumers
59
+ * can treat `reason` as absent.
60
+ */
61
+ reason: z.preprocess((value) => (value === "" || value === null ? undefined : value), TraderCodeAvailabilityReasonSchema.optional()),
62
+ });
63
+ /** Schema for the set-custom-TraderCode request params (claim or edit). */
64
+ export const SetTraderCodeParamsSchema = z.object({
65
+ /**
66
+ * The custom handle to claim or edit to. Case is preserved on store;
67
+ * uniqueness is enforced case-insensitively by the server. Client-side
68
+ * validation is case-preserving: a letter-first `[A-Za-z0-9_]` handle of
69
+ * length 5–20.
70
+ */
71
+ code: z
72
+ .string()
73
+ .trim()
74
+ .min(1, "code is required")
75
+ .regex(/^[A-Za-z][A-Za-z0-9_]{4,19}$/, "code must start with a letter and be 5–20 chars of letters, digits, or underscores"),
26
76
  });
27
77
  /** Schema for the public TraderCode info response. */
28
78
  export const TraderCodeInfoResponseSchema = z.object({
@@ -70,6 +70,25 @@ export interface Position {
70
70
  * percentage. Terminal rows only; absent when unavailable.
71
71
  */
72
72
  realizedRoe?: string;
73
+ /**
74
+ * Volume-weighted average price across the position's reducing executions.
75
+ * Positions closed in several fills exit at this price, not at the final
76
+ * fill or the mark at close. Terminal rows only; absent when the position's
77
+ * reducing executions do not account for its whole lifetime.
78
+ */
79
+ exitPrice?: string;
80
+ /**
81
+ * Lifetime funding paid (signed; negative means received), summed over the
82
+ * position's reducing executions. Terminal rows only; absent when
83
+ * unavailable.
84
+ */
85
+ fundingPaid?: string;
86
+ /**
87
+ * Trading fees paid on the position's reducing executions (signed; negative
88
+ * means rebated). Closing-side fees only — fees on opening fills are not
89
+ * included. Terminal rows only; absent when unavailable.
90
+ */
91
+ feesPaid?: string;
73
92
  }
74
93
  export interface ListPositionsParams {
75
94
  marginAccountId?: string;
@@ -2,7 +2,7 @@
2
2
  * User Balance WebSocket Event Types
3
3
  *
4
4
  * Types for real-time user balance update events.
5
- * This is an authenticated channel - requires JWT token.
5
+ * This is an authenticated channel - requires the signed session-key handshake.
6
6
  */
7
7
  import type { Address } from "viem";
8
8
  /**
@@ -2,5 +2,5 @@
2
2
  * User Balance WebSocket Event Types
3
3
  *
4
4
  * Types for real-time user balance update events.
5
- * This is an authenticated channel - requires JWT token.
5
+ * This is an authenticated channel - requires the signed session-key handshake.
6
6
  */
@@ -2,7 +2,7 @@
2
2
  * User Movement WebSocket Event Types
3
3
  *
4
4
  * Types for real-time user ledger movement events (deposits, withdrawals, transfers).
5
- * This is an authenticated channel - requires JWT token.
5
+ * This is an authenticated channel - requires the signed session-key handshake.
6
6
  */
7
7
  import type { Address } from "viem";
8
8
  /**
@@ -2,5 +2,5 @@
2
2
  * User Movement WebSocket Event Types
3
3
  *
4
4
  * Types for real-time user ledger movement events (deposits, withdrawals, transfers).
5
- * This is an authenticated channel - requires JWT token.
5
+ * This is an authenticated channel - requires the signed session-key handshake.
6
6
  */
@@ -10,6 +10,6 @@
10
10
  * hand-written SDK surface. CI regenerates it and fails on a diff, identical to
11
11
  * the `schema.ts` wire-types tripwire (MON-1476), so it can never go stale.
12
12
  */
13
- export declare const OPERATION_IDS: readonly ["add_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "replace_order", "revoke_delegated_agent", "revoke_session", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
13
+ export declare const OPERATION_IDS: readonly ["add_position_margin", "attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "check_trader_code_availability", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "mint_tokens", "reduce_position_margin", "refresh_session", "replace_order", "revoke_delegated_agent", "revoke_session", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
14
14
  /** Union of every OpenAPI operationId in the spec. */
15
15
  export type OperationId = (typeof OPERATION_IDS)[number];
@@ -21,6 +21,8 @@ export const OPERATION_IDS = [
21
21
  "batch_replace_orders",
22
22
  "cancel_conditional_order",
23
23
  "cancel_order",
24
+ "check_trader_code_availability",
25
+ "clear_trader_code",
24
26
  "close_position",
25
27
  "create_challenge",
26
28
  "create_delegated_session",
@@ -98,6 +100,7 @@ export const OPERATION_IDS = [
98
100
  "replace_order",
99
101
  "revoke_delegated_agent",
100
102
  "revoke_session",
103
+ "set_trader_code",
101
104
  "simulate_fees",
102
105
  "simulate_order_risk",
103
106
  "simulate_parent_margin_order_risk",
@@ -1496,8 +1496,17 @@ export interface paths {
1496
1496
  * Batch replace orders
1497
1497
  * @description Batch replace orders.
1498
1498
  *
1499
- * Replace multiple orders in a single batch. Each order is processed
1500
- * sequentially through the matching engine.
1499
+ * Replace multiple orders in one engine step with per-item results: every
1500
+ * original is cancelled first, then each replacement is placed in request
1501
+ * order. A
1502
+ * two-sided quote can therefore shift across its own resting prices in one
1503
+ * call, and a replacement may use funds freed by any original in the batch.
1504
+ *
1505
+ * Failure semantics: an item that fails validation, or whose original
1506
+ * cannot be found, leaves the original resting. An item whose replacement
1507
+ * fails to PLACE (for example insufficient balance or self-trade
1508
+ * prevention) reports the error with its original already cancelled — the
1509
+ * original is never silently left resting after a failed replacement.
1501
1510
  */
1502
1511
  post: operations["batch_replace_orders"];
1503
1512
  delete?: never;
@@ -1594,6 +1603,31 @@ export interface paths {
1594
1603
  patch?: never;
1595
1604
  trace?: never;
1596
1605
  };
1606
+ "/api/v1/pitpass/codes/available": {
1607
+ parameters: {
1608
+ query?: never;
1609
+ header?: never;
1610
+ path?: never;
1611
+ cookie?: never;
1612
+ };
1613
+ /**
1614
+ * Check custom TraderCode availability
1615
+ * @description Check custom-handle availability (public, advisory).
1616
+ *
1617
+ * Unauthenticated as-you-type check for a custom handle: returns `available`
1618
+ * plus, when unavailable, a snake_case `reason` code. Advisory only — the
1619
+ * authoritative gate is the atomic claim in SetTraderCode — so a positive
1620
+ * result never reserves the handle.
1621
+ */
1622
+ get: operations["check_trader_code_availability"];
1623
+ put?: never;
1624
+ post?: never;
1625
+ delete?: never;
1626
+ options?: never;
1627
+ head?: never;
1628
+ patch?: never;
1629
+ trace?: never;
1630
+ };
1597
1631
  "/api/v1/pitpass/codes/me": {
1598
1632
  parameters: {
1599
1633
  query?: never;
@@ -1621,6 +1655,44 @@ export interface paths {
1621
1655
  patch?: never;
1622
1656
  trace?: never;
1623
1657
  };
1658
+ "/api/v1/pitpass/codes/me/custom": {
1659
+ parameters: {
1660
+ query?: never;
1661
+ header?: never;
1662
+ path?: never;
1663
+ cookie?: never;
1664
+ };
1665
+ get?: never;
1666
+ /**
1667
+ * Claim or edit your custom TraderCode
1668
+ * @description Claim or edit your custom TraderCode handle.
1669
+ *
1670
+ * Single claim-or-edit entry point: set the authenticated caller's custom
1671
+ * vanity handle (a `[A-Za-z0-9_]`, letter-first, 5–20-char name), keeping the
1672
+ * permanent wallet-derived code as the reward identity. The first claim is
1673
+ * free; subsequent changes are rate-limited and release the freed handle into
1674
+ * a cooldown before anyone else can reclaim it. Case is preserved on store;
1675
+ * uniqueness is case-insensitive. Gated by the `custom_trader_codes_enabled`
1676
+ * feature flag. Returns the caller's updated TraderCode identity.
1677
+ */
1678
+ put: operations["set_trader_code"];
1679
+ post?: never;
1680
+ /**
1681
+ * Clear your custom TraderCode
1682
+ * @description Clear your custom TraderCode handle.
1683
+ *
1684
+ * Revert the authenticated caller to their wallet-derived default, releasing
1685
+ * the freed handle into cooldown. A no-op (returns the current default) when
1686
+ * no custom handle is set. Like an edit, a clear counts against the
1687
+ * rolling-hour rate-limit. Gated by the `custom_trader_codes_enabled` feature
1688
+ * flag.
1689
+ */
1690
+ delete: operations["clear_trader_code"];
1691
+ options?: never;
1692
+ head?: never;
1693
+ patch?: never;
1694
+ trace?: never;
1695
+ };
1624
1696
  "/api/v1/pitpass/codes/{code}": {
1625
1697
  parameters: {
1626
1698
  query?: never;
@@ -2855,6 +2927,18 @@ export interface components {
2855
2927
  */
2856
2928
  value?: string | null;
2857
2929
  };
2930
+ CheckTraderCodeAvailabilityResponse: {
2931
+ /**
2932
+ * @description True when the handle passes validation and is neither live nor cooling down.
2933
+ * @example false
2934
+ */
2935
+ available?: boolean | null;
2936
+ /**
2937
+ * @description When unavailable, the snake_case reason: one of `taken`, `too_short`, `too_long`, `reserved`, `invalid_char`, `looks_like_address`. Empty when available.
2938
+ * @example taken
2939
+ */
2940
+ reason?: string | null;
2941
+ };
2858
2942
  ClosePositionRequest: {
2859
2943
  quantity?: string | null;
2860
2944
  closeType?: string | null;
@@ -4317,6 +4401,26 @@ export interface components {
4317
4401
  * executions do not account for its whole lifetime.
4318
4402
  */
4319
4403
  realizedRoe?: string | null;
4404
+ /**
4405
+ * @description Volume-weighted average price across the position's reducing executions.
4406
+ * Positions closed in several fills exit at this price, not at the final
4407
+ * fill or the mark at close. Terminal rows only; absent when the position's
4408
+ * reducing executions do not account for its whole lifetime.
4409
+ */
4410
+ exitPrice?: string | null;
4411
+ /**
4412
+ * @description Lifetime funding paid (signed; negative means received), summed over the
4413
+ * position's reducing executions. Terminal rows only; absent when the
4414
+ * position's reducing executions do not account for its whole lifetime.
4415
+ */
4416
+ fundingPaid?: string | null;
4417
+ /**
4418
+ * @description Trading fees paid on the position's reducing executions (signed; negative
4419
+ * means rebated). Closing-side fees only — fees on opening fills are not
4420
+ * included. Terminal rows only; absent when the position's reducing
4421
+ * executions do not account for its whole lifetime.
4422
+ */
4423
+ feesPaid?: string | null;
4320
4424
  };
4321
4425
  GetPositionRiskResponse: {
4322
4426
  positionId?: string | null;
@@ -5483,6 +5587,26 @@ export interface components {
5483
5587
  * executions do not account for its whole lifetime.
5484
5588
  */
5485
5589
  realizedRoe?: string | null;
5590
+ /**
5591
+ * @description Volume-weighted average price across the position's reducing executions.
5592
+ * Positions closed in several fills exit at this price, not at the final
5593
+ * fill or the mark at close. Terminal rows only; absent when the position's
5594
+ * reducing executions do not account for its whole lifetime.
5595
+ */
5596
+ exitPrice?: string | null;
5597
+ /**
5598
+ * @description Lifetime funding paid (signed; negative means received), summed over the
5599
+ * position's reducing executions. Terminal rows only; absent when the
5600
+ * position's reducing executions do not account for its whole lifetime.
5601
+ */
5602
+ fundingPaid?: string | null;
5603
+ /**
5604
+ * @description Trading fees paid on the position's reducing executions (signed; negative
5605
+ * means rebated). Closing-side fees only — fees on opening fills are not
5606
+ * included. Terminal rows only; absent when the position's reducing
5607
+ * executions do not account for its whole lifetime.
5608
+ */
5609
+ feesPaid?: string | null;
5486
5610
  };
5487
5611
  PositionHistoryEvent: {
5488
5612
  id?: string | null;
@@ -5898,6 +6022,13 @@ export interface components {
5898
6022
  */
5899
6023
  priceChangePercent?: string | null;
5900
6024
  };
6025
+ SetTraderCodeRequest: {
6026
+ /**
6027
+ * @description The custom handle to claim or edit to: `[A-Za-z0-9_]`, must start with a letter, 5–20 characters. Case is preserved on store; uniqueness is case-insensitive.
6028
+ * @example CryptoKing
6029
+ */
6030
+ code: string;
6031
+ };
5901
6032
  SimulateFeesResponse: {
5902
6033
  /**
5903
6034
  * @description Notional value (price x quantity)
@@ -6248,7 +6379,7 @@ export interface components {
6248
6379
  };
6249
6380
  TraderCodeResponse: {
6250
6381
  /**
6251
- * @description Your TraderCode — your normalized wallet address (clients render it `Monaco - <address>`).
6382
+ * @description Your TraderCode — your normalized wallet address (clients render it `Monaco - <address>`). Always present; the permanent reward identity and a public alias even when a custom handle is set.
6252
6383
  * @example 0x0000000000000000000000000000000000000002
6253
6384
  */
6254
6385
  code?: string | null;
@@ -6257,6 +6388,21 @@ export interface components {
6257
6388
  * @example 2026-07-07T18:00:00Z
6258
6389
  */
6259
6390
  createdAt?: string | null;
6391
+ /**
6392
+ * @description Your custom vanity handle, exactly as entered (case preserved), or an empty string when the wallet-derived default is kept. Use `is_custom` to disambiguate.
6393
+ * @example CryptoKing
6394
+ */
6395
+ customCode?: string | null;
6396
+ /**
6397
+ * @description True when a custom handle is set; false when the wallet-derived default is in effect.
6398
+ * @example true
6399
+ */
6400
+ isCustom?: boolean | null;
6401
+ /**
6402
+ * @description The single human-facing string to render: the custom handle when set, otherwise the `Monaco - <address>` default form.
6403
+ * @example CryptoKing
6404
+ */
6405
+ display?: string | null;
6260
6406
  };
6261
6407
  /** @description Trading pair configuration including tokens, fees, and order limits. */
6262
6408
  TradingPairData: {
@@ -10077,6 +10223,42 @@ export interface operations {
10077
10223
  };
10078
10224
  };
10079
10225
  };
10226
+ check_trader_code_availability: {
10227
+ parameters: {
10228
+ query?: {
10229
+ code?: string;
10230
+ };
10231
+ header?: never;
10232
+ path?: never;
10233
+ cookie?: never;
10234
+ };
10235
+ requestBody?: never;
10236
+ responses: {
10237
+ /** @description OK */
10238
+ 200: {
10239
+ headers: {
10240
+ [name: string]: unknown;
10241
+ };
10242
+ content: {
10243
+ "application/json": components["schemas"]["CheckTraderCodeAvailabilityResponse"];
10244
+ };
10245
+ };
10246
+ /** @description Availability check rate-limit exceeded */
10247
+ 429: {
10248
+ headers: {
10249
+ [name: string]: unknown;
10250
+ };
10251
+ content?: never;
10252
+ };
10253
+ /** @description Internal server error */
10254
+ 500: {
10255
+ headers: {
10256
+ [name: string]: unknown;
10257
+ };
10258
+ content?: never;
10259
+ };
10260
+ };
10261
+ };
10080
10262
  get_my_trader_code: {
10081
10263
  parameters: {
10082
10264
  query?: never;
@@ -10111,6 +10293,120 @@ export interface operations {
10111
10293
  };
10112
10294
  };
10113
10295
  };
10296
+ set_trader_code: {
10297
+ parameters: {
10298
+ query?: never;
10299
+ header?: never;
10300
+ path?: never;
10301
+ cookie?: never;
10302
+ };
10303
+ requestBody: {
10304
+ content: {
10305
+ "application/json": components["schemas"]["SetTraderCodeRequest"];
10306
+ };
10307
+ };
10308
+ responses: {
10309
+ /** @description OK */
10310
+ 200: {
10311
+ headers: {
10312
+ [name: string]: unknown;
10313
+ };
10314
+ content: {
10315
+ "application/json": components["schemas"]["TraderCodeResponse"];
10316
+ };
10317
+ };
10318
+ /** @description Authentication required */
10319
+ 401: {
10320
+ headers: {
10321
+ [name: string]: unknown;
10322
+ };
10323
+ content?: never;
10324
+ };
10325
+ /** @description Custom trader codes are not enabled */
10326
+ 403: {
10327
+ headers: {
10328
+ [name: string]: unknown;
10329
+ };
10330
+ content?: never;
10331
+ };
10332
+ /** @description Handle is taken (case-insensitive) or cooling down */
10333
+ 409: {
10334
+ headers: {
10335
+ [name: string]: unknown;
10336
+ };
10337
+ content?: never;
10338
+ };
10339
+ /** @description Validation failed; body carries a reason code */
10340
+ 422: {
10341
+ headers: {
10342
+ [name: string]: unknown;
10343
+ };
10344
+ content?: never;
10345
+ };
10346
+ /** @description Edit rate-limit exceeded */
10347
+ 429: {
10348
+ headers: {
10349
+ [name: string]: unknown;
10350
+ };
10351
+ content?: never;
10352
+ };
10353
+ /** @description Internal server error */
10354
+ 500: {
10355
+ headers: {
10356
+ [name: string]: unknown;
10357
+ };
10358
+ content?: never;
10359
+ };
10360
+ };
10361
+ };
10362
+ clear_trader_code: {
10363
+ parameters: {
10364
+ query?: never;
10365
+ header?: never;
10366
+ path?: never;
10367
+ cookie?: never;
10368
+ };
10369
+ requestBody?: never;
10370
+ responses: {
10371
+ /** @description OK */
10372
+ 200: {
10373
+ headers: {
10374
+ [name: string]: unknown;
10375
+ };
10376
+ content: {
10377
+ "application/json": components["schemas"]["TraderCodeResponse"];
10378
+ };
10379
+ };
10380
+ /** @description Authentication required */
10381
+ 401: {
10382
+ headers: {
10383
+ [name: string]: unknown;
10384
+ };
10385
+ content?: never;
10386
+ };
10387
+ /** @description Custom trader codes are not enabled */
10388
+ 403: {
10389
+ headers: {
10390
+ [name: string]: unknown;
10391
+ };
10392
+ content?: never;
10393
+ };
10394
+ /** @description Edit rate-limit exceeded */
10395
+ 429: {
10396
+ headers: {
10397
+ [name: string]: unknown;
10398
+ };
10399
+ content?: never;
10400
+ };
10401
+ /** @description Internal server error */
10402
+ 500: {
10403
+ headers: {
10404
+ [name: string]: unknown;
10405
+ };
10406
+ content?: never;
10407
+ };
10408
+ };
10409
+ };
10114
10410
  get_trader_code_info: {
10115
10411
  parameters: {
10116
10412
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.32",
3
+ "version": "1.0.33-develop.c485f61",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "lint": "biome lint ."
21
21
  },
22
22
  "dependencies": {
23
- "@0xmonaco/contracts": "1.0.32",
23
+ "@0xmonaco/contracts": "1.0.33-develop.c485f61",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {