@0xmonaco/types 0.8.22 → 1.0.2

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.
@@ -22,9 +22,12 @@ export interface AuthAPI extends BaseAPI {
22
22
  * 4. Verifies the signature, registering the session public key
23
23
  *
24
24
  * @param clientId - Client ID of the application
25
+ * @param referralCode - Optional PitPass TraderCode (wallet address) of the referrer.
26
+ * Passed through to the verify call so a first-time sign-up records the referral
27
+ * relationship. Has no effect when the user already exists.
25
28
  * @returns Promise resolving to the authentication state (including the session keypair)
26
29
  */
27
- authenticate(clientId: string): Promise<AuthState>;
30
+ authenticate(clientId: string, referralCode?: string): Promise<AuthState>;
28
31
  /**
29
32
  * Signs a challenge message using the wallet client.
30
33
  *
@@ -54,9 +57,11 @@ export interface AuthAPI extends BaseAPI {
54
57
  * @param nonce - Nonce from the challenge response
55
58
  * @param clientId - Client ID of the application
56
59
  * @param session - The locally-generated session keypair (hex-encoded)
60
+ * @param referralCode - Optional PitPass TraderCode (wallet address) of the referrer;
61
+ * recorded at first sign-up only.
57
62
  * @returns Promise resolving to the authentication state
58
63
  */
59
- verifySignature(address: string, signature: string, nonce: string, clientId: string, session: SessionCredentials): Promise<AuthState>;
64
+ verifySignature(address: string, signature: string, nonce: string, clientId: string, session: SessionCredentials, referralCode?: string): Promise<AuthState>;
60
65
  /**
61
66
  * Extends the current session's expiry. The request is signed with the
62
67
  * active session key (set via {@link setSessionKeypair}).
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from "./faucet";
13
13
  export * from "./fees";
14
14
  export * from "./margin-accounts";
15
15
  export * from "./market";
16
+ export * from "./pitpass";
16
17
  export * from "./positions";
17
18
  export * from "./profile";
18
19
  export * from "./sdk";
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ export * from "./faucet";
14
14
  export * from "./fees";
15
15
  export * from "./margin-accounts";
16
16
  export * from "./market";
17
+ export * from "./pitpass";
17
18
  export * from "./positions";
18
19
  export * from "./profile";
19
20
  export * from "./sdk";
@@ -0,0 +1,60 @@
1
+ /**
2
+ * PitPass Types
3
+ *
4
+ * Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
5
+ */
6
+ import type { BaseAPI } from "../api";
7
+ import type { GetRewardsBalanceResponse, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse } from "./responses";
8
+ /**
9
+ * PitPass TraderCode API interface.
10
+ *
11
+ * Provides methods for reading your wallet-derived TraderCode, looking up a
12
+ * referral code at sign-up, reading your accrued rewards balance, and
13
+ * transferring rewards into a tradeable balance.
14
+ */
15
+ export interface PitpassAPI extends BaseAPI {
16
+ /**
17
+ * Return the authenticated caller's TraderCode (their normalized wallet address).
18
+ *
19
+ * Never 404s — every signed-in wallet has a derivable code. Ensures the
20
+ * backing row so referrals attributed to this wallet have a code to link.
21
+ *
22
+ * @returns Promise resolving to the caller's TraderCode and its creation timestamp
23
+ */
24
+ getMyTraderCode(): Promise<TraderCodeResponse>;
25
+ /**
26
+ * Public, unauthenticated lookup of a TraderCode.
27
+ *
28
+ * Used to validate a referral code at sign-up. The code is a wallet address
29
+ * (the `Monaco - <address>` display form is also accepted). Returns the
30
+ * normalized code when it resolves to a known wallet, or throws a 404 when
31
+ * the code does not resolve to any user.
32
+ *
33
+ * @param code - The TraderCode (wallet address or `Monaco - <address>` form) to look up
34
+ * @returns Promise resolving to the normalized TraderCode
35
+ */
36
+ getTraderCodeInfo(code: string): Promise<TraderCodeInfoResponse>;
37
+ /**
38
+ * Return the caller's current PitPass rewards-bucket balances.
39
+ *
40
+ * Rewards accumulate here as referred users trade. Call
41
+ * {@link transferRewards} to move them into a tradeable balance.
42
+ * Returns an empty `balances` array when no rewards have been earned yet.
43
+ *
44
+ * @returns Promise resolving to the list of per-token reward balances
45
+ */
46
+ getRewardsBalance(): Promise<GetRewardsBalanceResponse>;
47
+ /**
48
+ * Transfer earned PitPass rewards into a trading balance.
49
+ *
50
+ * Moves the specified amount of a reward token from the caller's rewards
51
+ * bucket into their trading balance under the authenticated application.
52
+ * Ledger-only — no on-chain transaction, immediately tradeable.
53
+ *
54
+ * @param params - Token address and raw-unit amount to transfer
55
+ * @returns Promise resolving to the post-transfer rewards and trading balances
56
+ */
57
+ transferRewards(params: TransferRewardsParams): Promise<TransferRewardsResponse>;
58
+ }
59
+ export type { GetRewardsBalanceResponse, RewardsBalanceEntry, TraderCodeInfoResponse, TraderCodeResponse, TransferRewardsParams, TransferRewardsResponse, } from "./responses";
60
+ export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PitPass Types
3
+ *
4
+ * Types for PitPass TraderCode API: code lookup, rewards balance, and transfer.
5
+ */
6
+ export { GetRewardsBalanceResponseSchema, RewardsBalanceEntrySchema, TraderCodeInfoResponseSchema, TraderCodeResponseSchema, TransferRewardsParamsSchema, TransferRewardsResponseSchema, } from "./responses";
@@ -0,0 +1,44 @@
1
+ /**
2
+ * PitPass TraderCode Response Types
3
+ *
4
+ * Types for PitPass TraderCode API responses and requests.
5
+ * All types are derived from Zod schemas for runtime validation.
6
+ */
7
+ import { z } from "zod";
8
+ /** Schema for a single token entry in the rewards balance response. */
9
+ export declare const RewardsBalanceEntrySchema: z.ZodObject<{
10
+ token: z.ZodString;
11
+ available: z.ZodString;
12
+ }, z.core.$strip>;
13
+ /** Schema for the rewards balance response. */
14
+ export declare const GetRewardsBalanceResponseSchema: z.ZodObject<{
15
+ balances: z.ZodArray<z.ZodObject<{
16
+ token: z.ZodString;
17
+ available: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>;
20
+ /** Schema for a TraderCode response. */
21
+ export declare const TraderCodeResponseSchema: z.ZodObject<{
22
+ code: z.ZodString;
23
+ createdAt: z.ZodString;
24
+ }, z.core.$strip>;
25
+ /** Schema for the public TraderCode info response. */
26
+ export declare const TraderCodeInfoResponseSchema: z.ZodObject<{
27
+ code: z.ZodString;
28
+ }, z.core.$strip>;
29
+ /** Schema for the transfer rewards request body. */
30
+ export declare const TransferRewardsParamsSchema: z.ZodObject<{
31
+ token: z.ZodString;
32
+ amount: z.ZodString;
33
+ }, z.core.$strip>;
34
+ /** Schema for the transfer rewards response. */
35
+ export declare const TransferRewardsResponseSchema: z.ZodObject<{
36
+ rewardsBalance: z.ZodString;
37
+ tradingBalance: z.ZodString;
38
+ }, z.core.$strip>;
39
+ export type RewardsBalanceEntry = z.infer<typeof RewardsBalanceEntrySchema>;
40
+ export type GetRewardsBalanceResponse = z.infer<typeof GetRewardsBalanceResponseSchema>;
41
+ export type TraderCodeResponse = z.infer<typeof TraderCodeResponseSchema>;
42
+ export type TraderCodeInfoResponse = z.infer<typeof TraderCodeInfoResponseSchema>;
43
+ export type TransferRewardsParams = z.infer<typeof TransferRewardsParamsSchema>;
44
+ export type TransferRewardsResponse = z.infer<typeof TransferRewardsResponseSchema>;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * PitPass TraderCode Response Types
3
+ *
4
+ * Types for PitPass TraderCode API responses and requests.
5
+ * All types are derived from Zod schemas for runtime validation.
6
+ */
7
+ import { z } from "zod";
8
+ /** Schema for a single token entry in the rewards balance response. */
9
+ export const RewardsBalanceEntrySchema = z.object({
10
+ /** Reward token contract address (0x-prefixed). */
11
+ token: z.string(),
12
+ /** Available rewards balance in RAW atomic units of the token. */
13
+ available: z.string(),
14
+ });
15
+ /** Schema for the rewards balance response. */
16
+ export const GetRewardsBalanceResponseSchema = z.object({
17
+ /** One entry per reward token that has a non-zero available balance. */
18
+ balances: z.array(RewardsBalanceEntrySchema),
19
+ });
20
+ /** Schema for a TraderCode response. */
21
+ export const TraderCodeResponseSchema = z.object({
22
+ /** The caller's TraderCode — their normalized wallet address. */
23
+ code: z.string(),
24
+ /** RFC 3339 timestamp when the code row was first derived. */
25
+ createdAt: z.string(),
26
+ });
27
+ /** Schema for the public TraderCode info response. */
28
+ export const TraderCodeInfoResponseSchema = z.object({
29
+ /** The resolved TraderCode (normalized wallet address). */
30
+ code: z.string(),
31
+ });
32
+ /** Schema for the transfer rewards request body. */
33
+ export const TransferRewardsParamsSchema = z.object({
34
+ /** Reward token contract address (0x-prefixed) to transfer. */
35
+ token: z
36
+ .string()
37
+ .trim()
38
+ .min(1, "token is required")
39
+ .regex(/^0x[0-9a-fA-F]{40}$/, "token must be a 0x-prefixed EVM address"),
40
+ /** Amount to transfer, in RAW atomic units of the token. Must be a positive integer string. */
41
+ amount: z
42
+ .string()
43
+ .trim()
44
+ .min(1, "amount is required")
45
+ .refine((v) => /^\d+$/.test(v) && BigInt(v) > 0n, "amount must be a positive integer string"),
46
+ });
47
+ /** Schema for the transfer rewards response. */
48
+ export const TransferRewardsResponseSchema = z.object({
49
+ /** Your rewards-bucket balance after the transfer, RAW atomic units. */
50
+ rewardsBalance: z.string(),
51
+ /** Your trading balance for the token after the transfer, RAW atomic units. */
52
+ tradingBalance: z.string(),
53
+ });
@@ -6,6 +6,7 @@ import type { FaucetAPI } from "../faucet";
6
6
  import type { FeesAPI } from "../fees";
7
7
  import type { MarginAccountsAPI } from "../margin-accounts";
8
8
  import type { Interval, MarketAPI } from "../market";
9
+ import type { PitpassAPI } from "../pitpass";
9
10
  import type { PositionsAPI } from "../positions";
10
11
  import type { ProfileAPI } from "../profile";
11
12
  import type { SubAccountsAPI } from "../sub-accounts";
@@ -81,6 +82,8 @@ export interface MonacoSDK {
81
82
  positions: PositionsAPI;
82
83
  /** Sub-account management API */
83
84
  subAccounts: SubAccountsAPI;
85
+ /** PitPass TraderCode referral and rewards API */
86
+ pitpass: PitpassAPI;
84
87
  /** Testnet faucet API */
85
88
  faucet: FaucetAPI;
86
89
  /** Public whitelist (waitlist) submission API */
@@ -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", "authenticate_backend", "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_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_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_chart", "get_portfolio_stats", "get_position", "get_position_pnl_history", "get_position_risk", "get_screener", "get_sub_account_limits", "get_trade_by_id", "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_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", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
13
+ export declare const OPERATION_IDS: readonly ["add_position_margin", "attach_position_tp_sl", "authenticate_backend", "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_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_chart", "get_portfolio_stats", "get_position", "get_position_pnl_history", "get_position_risk", "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_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"];
14
14
  /** Union of every OpenAPI operationId in the spec. */
15
15
  export type OperationId = (typeof OPERATION_IDS)[number];
@@ -41,6 +41,7 @@ export const OPERATION_IDS = [
41
41
  "get_market_metadata",
42
42
  "get_market_stats",
43
43
  "get_my_fee_tier",
44
+ "get_my_trader_code",
44
45
  "get_open_interest",
45
46
  "get_order_by_id",
46
47
  "get_orderbook_snapshot",
@@ -54,9 +55,11 @@ export const OPERATION_IDS = [
54
55
  "get_position",
55
56
  "get_position_pnl_history",
56
57
  "get_position_risk",
58
+ "get_rewards_balance",
57
59
  "get_screener",
58
60
  "get_sub_account_limits",
59
61
  "get_trade_by_id",
62
+ "get_trader_code_info",
60
63
  "get_trades",
61
64
  "get_trading_pair_by_id",
62
65
  "get_user_balance_by_asset",
@@ -98,6 +101,7 @@ export const OPERATION_IDS = [
98
101
  "transfer_collateral_to_margin_account",
99
102
  "transfer_collateral_to_parent_margin_account",
100
103
  "transfer_collateral_to_risk_bucket",
104
+ "transfer_rewards",
101
105
  "update_sub_account_limit",
102
106
  "upsert_delegated_agent",
103
107
  "verify_signature",
@@ -1470,6 +1470,108 @@ export interface paths {
1470
1470
  patch?: never;
1471
1471
  trace?: never;
1472
1472
  };
1473
+ "/api/v1/pitpass/codes/me": {
1474
+ parameters: {
1475
+ query?: never;
1476
+ header?: never;
1477
+ path?: never;
1478
+ cookie?: never;
1479
+ };
1480
+ /**
1481
+ * Get your TraderCode
1482
+ * @description Claim your TraderCode.
1483
+ *
1484
+ * Get your TraderCode.
1485
+ *
1486
+ * Return the authenticated caller's TraderCode, which is derived from their
1487
+ * wallet address (rendered `Monaco - <address>` by clients). Never 404s — the
1488
+ * code always exists for a signed-in wallet — and ensures the backing row so
1489
+ * referrals attributed to this wallet have a code to link.
1490
+ */
1491
+ get: operations["get_my_trader_code"];
1492
+ put?: never;
1493
+ post?: never;
1494
+ delete?: never;
1495
+ options?: never;
1496
+ head?: never;
1497
+ patch?: never;
1498
+ trace?: never;
1499
+ };
1500
+ "/api/v1/pitpass/codes/{code}": {
1501
+ parameters: {
1502
+ query?: never;
1503
+ header?: never;
1504
+ path?: never;
1505
+ cookie?: never;
1506
+ };
1507
+ /**
1508
+ * Look up a TraderCode
1509
+ * @description Look up a TraderCode (public).
1510
+ *
1511
+ * Public, unauthenticated lookup used to validate a referral code at signup.
1512
+ * The code is a wallet address; returns the normalized code when it resolves
1513
+ * to a known wallet. Returns 404 when the code does not resolve to a user.
1514
+ */
1515
+ get: operations["get_trader_code_info"];
1516
+ put?: never;
1517
+ post?: never;
1518
+ delete?: never;
1519
+ options?: never;
1520
+ head?: never;
1521
+ patch?: never;
1522
+ trace?: never;
1523
+ };
1524
+ "/api/v1/pitpass/rewards/balance": {
1525
+ parameters: {
1526
+ query?: never;
1527
+ header?: never;
1528
+ path?: never;
1529
+ cookie?: never;
1530
+ };
1531
+ /**
1532
+ * Get your rewards balance
1533
+ * @description Read accrued PitPass rewards balance.
1534
+ *
1535
+ * Return the caller's current rewards-bucket balances across all reward tokens.
1536
+ * Rewards accumulate here as referred users trade; call TransferRewards to move
1537
+ * them into a tradeable balance. Returns an empty list when no rewards have
1538
+ * been earned yet.
1539
+ */
1540
+ get: operations["get_rewards_balance"];
1541
+ put?: never;
1542
+ post?: never;
1543
+ delete?: never;
1544
+ options?: never;
1545
+ head?: never;
1546
+ patch?: never;
1547
+ trace?: never;
1548
+ };
1549
+ "/api/v1/pitpass/rewards/transfer": {
1550
+ parameters: {
1551
+ query?: never;
1552
+ header?: never;
1553
+ path?: never;
1554
+ cookie?: never;
1555
+ };
1556
+ get?: never;
1557
+ put?: never;
1558
+ /**
1559
+ * Transfer rewards into a trading balance
1560
+ * @description Transfer earned rewards into a trading balance.
1561
+ *
1562
+ * Move spendable PitPass reward balance from your rewards bucket into a
1563
+ * trading balance under the authenticated application, making it tradeable
1564
+ * immediately. Ledger-only (one shared vault + one backend ledger) — no
1565
+ * on-chain transaction and no gas. Fails with 402 when the rewards balance is
1566
+ * insufficient.
1567
+ */
1568
+ post: operations["transfer_rewards"];
1569
+ delete?: never;
1570
+ options?: never;
1571
+ head?: never;
1572
+ patch?: never;
1573
+ trace?: never;
1574
+ };
1473
1575
  "/api/v1/positions": {
1474
1576
  parameters: {
1475
1577
  query?: never;
@@ -1808,7 +1910,10 @@ export type webhooks = Record<string, never>;
1808
1910
  export interface components {
1809
1911
  schemas: {
1810
1912
  AccountBalance: {
1811
- /** @description Token contract address */
1913
+ /**
1914
+ * @description Token contract address
1915
+ * @example 0x6a86da986797d59a839d136db490292cd560c131
1916
+ */
1812
1917
  token?: string | null;
1813
1918
  /**
1814
1919
  * @description Token symbol
@@ -1878,7 +1983,10 @@ export interface components {
1878
1983
  * @example 123e4567-e89b-12d3-a456-426614174000
1879
1984
  */
1880
1985
  id?: string | null;
1881
- /** @description Wallet address */
1986
+ /**
1987
+ * @description Wallet address
1988
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
1989
+ */
1882
1990
  address?: string | null;
1883
1991
  /**
1884
1992
  * @description Display username
@@ -2515,7 +2623,10 @@ export interface components {
2515
2623
  message?: string | null;
2516
2624
  };
2517
2625
  Candle: {
2518
- /** @description Unix timestamp for the start of the candle period in milliseconds */
2626
+ /**
2627
+ * @description Unix timestamp for the start of the candle period in milliseconds
2628
+ * @example 1699800000000
2629
+ */
2519
2630
  timestamp?: string | null;
2520
2631
  /**
2521
2632
  * @description Opening price
@@ -2553,18 +2664,27 @@ export interface components {
2553
2664
  * @example 342
2554
2665
  */
2555
2666
  tradeCount?: number | null;
2556
- /** @description Unix timestamp for the end of the candle period in milliseconds */
2667
+ /**
2668
+ * @description Unix timestamp for the end of the candle period in milliseconds
2669
+ * @example 1699800059999
2670
+ */
2557
2671
  closeTimestampMs?: string | null;
2558
2672
  };
2559
2673
  ChallengeRequest: {
2560
- /** @description Ethereum wallet address */
2674
+ /**
2675
+ * @description Ethereum wallet address
2676
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
2677
+ */
2561
2678
  address: string;
2562
2679
  /**
2563
2680
  * @description Optional application identifier
2564
2681
  * @example monaco-frontend
2565
2682
  */
2566
2683
  clientId?: string | null;
2567
- /** @description Optional chain ID supplied by SDK clients */
2684
+ /**
2685
+ * @description Optional chain ID supplied by SDK clients
2686
+ * @example 1328
2687
+ */
2568
2688
  chainId?: string | null;
2569
2689
  /**
2570
2690
  * @description Lowercase hex (64 chars) ed25519 public key generated locally by the SDK. The returned challenge message will embed this key so the wallet's signature binds it; the same value must be submitted to /api/v1/auth/verify.
@@ -2657,7 +2777,10 @@ export interface components {
2657
2777
  sessionPublicKey?: string | null;
2658
2778
  };
2659
2779
  CreateDelegatedSessionResponse: {
2660
- /** @description Session expiry as a Unix timestamp (seconds) */
2780
+ /**
2781
+ * @description Session expiry as a Unix timestamp (seconds)
2782
+ * @example 1735689599
2783
+ */
2661
2784
  expiresAt?: string | null;
2662
2785
  /**
2663
2786
  * Format: uuid
@@ -2857,7 +2980,10 @@ export interface components {
2857
2980
  * @description Owner account UUID the agent acts on behalf of
2858
2981
  */
2859
2982
  ownerUserId?: string | null;
2860
- /** @description Agent wallet address (EVM) */
2983
+ /**
2984
+ * @description Agent wallet address (EVM)
2985
+ * @example 0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5
2986
+ */
2861
2987
  agentAddress?: string | null;
2862
2988
  /** @description Human-friendly label for the agent */
2863
2989
  name?: string | null;
@@ -3062,7 +3188,10 @@ export interface components {
3062
3188
  * @example 5.67
3063
3189
  */
3064
3190
  applicationTakerFee?: string | null;
3065
- /** @description Total number of trades */
3191
+ /**
3192
+ * @description Total number of trades
3193
+ * @example 42
3194
+ */
3066
3195
  tradeCount?: string | null;
3067
3196
  };
3068
3197
  GetAvailableCollateralResponse: {
@@ -3079,7 +3208,10 @@ export interface components {
3079
3208
  marginAvailableCollateral?: string | null;
3080
3209
  };
3081
3210
  GetBalanceByAssetResponse: {
3082
- /** @description Token contract address */
3211
+ /**
3212
+ * @description Token contract address
3213
+ * @example 0x6a86da986797d59a839d136db490292cd560c131
3214
+ */
3083
3215
  token?: string | null;
3084
3216
  /**
3085
3217
  * @description Token symbol
@@ -3175,7 +3307,10 @@ export interface components {
3175
3307
  allowedOrigins?: string[] | null;
3176
3308
  /** @description Webhook URL for notifications */
3177
3309
  webhookUrl?: string | null;
3178
- /** @description Vault contract address for this application */
3310
+ /**
3311
+ * @description Vault contract address for this application
3312
+ * @example 0xA393B04EA77354570Ace35869F5EbB1e380DC232
3313
+ */
3179
3314
  vaultContractAddress?: string | null;
3180
3315
  /**
3181
3316
  * @description Application client ID, embedded in on-chain deposit calls
@@ -3759,9 +3894,15 @@ export interface components {
3759
3894
  * @example 231.81
3760
3895
  */
3761
3896
  volume?: string | null;
3762
- /** @description Number of trades in period */
3897
+ /**
3898
+ * @description Number of trades in period
3899
+ * @example 42
3900
+ */
3763
3901
  totalTrades?: string | null;
3764
- /** @description Number of orders in period */
3902
+ /**
3903
+ * @description Number of orders in period
3904
+ * @example 56
3905
+ */
3765
3906
  totalOrders?: string | null;
3766
3907
  /**
3767
3908
  * @description Total fees paid by user
@@ -3885,7 +4026,10 @@ export interface components {
3885
4026
  * @example 123e4567-e89b-12d3-a456-426614174000
3886
4027
  */
3887
4028
  id?: string | null;
3888
- /** @description Wallet address */
4029
+ /**
4030
+ * @description Wallet address
4031
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
4032
+ */
3889
4033
  address?: string | null;
3890
4034
  /**
3891
4035
  * @description Display username
@@ -3932,6 +4076,10 @@ export interface components {
3932
4076
  */
3933
4077
  applicationMakerFeeBps?: number | null;
3934
4078
  };
4079
+ GetRewardsBalanceResponse: {
4080
+ /** @description One entry per reward token that has a non-zero available balance. */
4081
+ balances?: components["schemas"]["RewardsBalanceEntry"][] | null;
4082
+ };
3935
4083
  /** @description Paginated screener response sorted by quoteVolume24h desc (nulls last). */
3936
4084
  GetScreenerResponse: {
3937
4085
  items?: components["schemas"]["ScreenerItem"][] | null;
@@ -3980,6 +4128,13 @@ export interface components {
3980
4128
  */
3981
4129
  tradingMode?: string | null;
3982
4130
  };
4131
+ GetTraderCodeInfoResponse: {
4132
+ /**
4133
+ * @description The resolved TraderCode (normalized wallet address)
4134
+ * @example 0x0000000000000000000000000000000000000002
4135
+ */
4136
+ code?: string | null;
4137
+ };
3983
4138
  /** @description Recent trades for a trading pair. */
3984
4139
  GetTradesResponse: {
3985
4140
  trades?: components["schemas"]["PublicTrade"][] | null;
@@ -4002,13 +4157,25 @@ export interface components {
4002
4157
  };
4003
4158
  GetUserTradesResponse: {
4004
4159
  trades?: components["schemas"]["UserTrade"][] | null;
4005
- /** @description Current page number */
4160
+ /**
4161
+ * @description Current page number
4162
+ * @example 1
4163
+ */
4006
4164
  page?: string | null;
4007
- /** @description Items per page */
4165
+ /**
4166
+ * @description Items per page
4167
+ * @example 20
4168
+ */
4008
4169
  pageSize?: string | null;
4009
- /** @description Total number of trades */
4170
+ /**
4171
+ * @description Total number of trades
4172
+ * @example 150
4173
+ */
4010
4174
  total?: string | null;
4011
- /** @description Total number of pages */
4175
+ /**
4176
+ * @description Total number of pages
4177
+ * @example 8
4178
+ */
4012
4179
  totalPages?: string | null;
4013
4180
  };
4014
4181
  IndexComponent: {
@@ -4029,7 +4196,10 @@ export interface components {
4029
4196
  * @example 1000000000000000000
4030
4197
  */
4031
4198
  amount?: string | null;
4032
- /** @description On-chain address that will receive the withdrawal (EVM, 42 chars including 0x) */
4199
+ /**
4200
+ * @description On-chain address that will receive the withdrawal (EVM, 42 chars including 0x)
4201
+ * @example 0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5
4202
+ */
4033
4203
  destination?: string | null;
4034
4204
  /**
4035
4205
  * @description Source ledger to withdraw from: "spot" (default) debits spot balance; "margin" directly debits withdrawable collateral from the parent margin account
@@ -4059,7 +4229,10 @@ export interface components {
4059
4229
  * @example 100.50
4060
4230
  */
4061
4231
  amount?: string | null;
4062
- /** @description Token contract address */
4232
+ /**
4233
+ * @description Token contract address
4234
+ * @example 0x6a86da986797d59a839d136db490292cd560c131
4235
+ */
4063
4236
  token?: string | null;
4064
4237
  /**
4065
4238
  * @description Available balance before this movement
@@ -4096,9 +4269,15 @@ export interface components {
4096
4269
  * @example USDC deposit
4097
4270
  */
4098
4271
  description?: string | null;
4099
- /** @description On-chain transaction hash (if applicable) */
4272
+ /**
4273
+ * @description On-chain transaction hash (if applicable)
4274
+ * @example 0xabc123...
4275
+ */
4100
4276
  txHash?: string | null;
4101
- /** @description Block number of the on-chain transaction */
4277
+ /**
4278
+ * @description Block number of the on-chain transaction
4279
+ * @example 18500000
4280
+ */
4102
4281
  blockNumber?: string | null;
4103
4282
  /**
4104
4283
  * @description Movement timestamp (ISO 8601)
@@ -4539,7 +4718,10 @@ export interface components {
4539
4718
  * @example 10000.00
4540
4719
  */
4541
4720
  amount?: string | null;
4542
- /** @description On-chain transaction hash */
4721
+ /**
4722
+ * @description On-chain transaction hash
4723
+ * @example 0xabc123def456...
4724
+ */
4543
4725
  txHash?: string | null;
4544
4726
  };
4545
4727
  OrderbookData: {
@@ -4606,7 +4788,10 @@ export interface components {
4606
4788
  * is confirmed on-chain; fetch it from GetWithdrawal once it becomes ready).
4607
4789
  */
4608
4790
  PendingWithdrawal: {
4609
- /** @description Allocated withdrawal index — matches executeWithdrawal.index on-chain */
4791
+ /**
4792
+ * @description Allocated withdrawal index — matches executeWithdrawal.index on-chain
4793
+ * @example 42
4794
+ */
4610
4795
  withdrawalIndex?: string | null;
4611
4796
  /**
4612
4797
  * Format: uuid
@@ -4624,7 +4809,10 @@ export interface components {
4624
4809
  * @example 1000000000000000000
4625
4810
  */
4626
4811
  amount?: string | null;
4627
- /** @description On-chain address that will receive the withdrawal (EVM, 42 chars including 0x) */
4812
+ /**
4813
+ * @description On-chain address that will receive the withdrawal (EVM, 42 chars including 0x)
4814
+ * @example 0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5
4815
+ */
4628
4816
  destination?: string | null;
4629
4817
  /**
4630
4818
  * @description Withdrawal lifecycle status; always "pending" for entries in this response
@@ -4924,6 +5112,18 @@ export interface components {
4924
5112
  */
4925
5113
  message?: string | null;
4926
5114
  };
5115
+ RewardsBalanceEntry: {
5116
+ /**
5117
+ * @description Reward token contract address (0x-prefixed).
5118
+ * @example 0x0000000000000000000000000000000000000002
5119
+ */
5120
+ token?: string | null;
5121
+ /**
5122
+ * @description Available rewards balance in RAW atomic units of the token.
5123
+ * @example 1200000
5124
+ */
5125
+ available?: string | null;
5126
+ };
4927
5127
  RiskTier: {
4928
5128
  initialMarginRatio?: string | null;
4929
5129
  maintenanceMarginRatio?: string | null;
@@ -5179,7 +5379,10 @@ export interface components {
5179
5379
  * @example 123e4567-e89b-12d3-a456-426614174000
5180
5380
  */
5181
5381
  id?: string | null;
5182
- /** @description Sub-account wallet address */
5382
+ /**
5383
+ * @description Sub-account wallet address
5384
+ * @example 0x742d35Cc6634C0532925a3b8D1B9d7c2bd34e8Dc
5385
+ */
5183
5386
  address?: string | null;
5184
5387
  /**
5185
5388
  * @description Sub-account display username
@@ -5211,7 +5414,10 @@ export interface components {
5211
5414
  * @example 123e4567-e89b-12d3-a456-426614174000
5212
5415
  */
5213
5416
  subAccountId?: string | null;
5214
- /** @description Token contract address */
5417
+ /**
5418
+ * @description Token contract address
5419
+ * @example 0x6a86da986797d59a839d136db490292cd560c131
5420
+ */
5215
5421
  token?: string | null;
5216
5422
  /**
5217
5423
  * @description Maximum daily spending limit in token units
@@ -5256,7 +5462,10 @@ export interface components {
5256
5462
  isActive?: boolean | null;
5257
5463
  };
5258
5464
  SubmitWhitelistRequest: {
5259
- /** @description Applicant wallet address */
5465
+ /**
5466
+ * @description Applicant wallet address
5467
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
5468
+ */
5260
5469
  walletAddress: string;
5261
5470
  /**
5262
5471
  * Format: email
@@ -5332,6 +5541,18 @@ export interface components {
5332
5541
  */
5333
5542
  tradeId?: string | null;
5334
5543
  };
5544
+ TraderCodeResponse: {
5545
+ /**
5546
+ * @description Your TraderCode — your normalized wallet address (clients render it `Monaco - <address>`).
5547
+ * @example 0x0000000000000000000000000000000000000002
5548
+ */
5549
+ code?: string | null;
5550
+ /**
5551
+ * @description RFC 3339 timestamp when the code row was first derived
5552
+ * @example 2026-07-07T18:00:00Z
5553
+ */
5554
+ createdAt?: string | null;
5555
+ };
5335
5556
  /** @description Trading pair configuration including tokens, fees, and order limits. */
5336
5557
  TradingPairData: {
5337
5558
  /**
@@ -5356,7 +5577,10 @@ export interface components {
5356
5577
  * @example BTC
5357
5578
  */
5358
5579
  baseToken?: string | null;
5359
- /** @description Base token contract address */
5580
+ /**
5581
+ * @description Base token contract address
5582
+ * @example 0x1234567890abcdef1234567890abcdef12345678
5583
+ */
5360
5584
  baseTokenContract?: string | null;
5361
5585
  /**
5362
5586
  * Format: uuid
@@ -5412,7 +5636,10 @@ export interface components {
5412
5636
  * @example USDC
5413
5637
  */
5414
5638
  quoteToken?: string | null;
5415
- /** @description Quote token contract address */
5639
+ /**
5640
+ * @description Quote token contract address
5641
+ * @example 0x6a86da986797d59a839d136db490292cd560c131
5642
+ */
5416
5643
  quoteTokenContract?: string | null;
5417
5644
  /**
5418
5645
  * @description Trading pair symbol
@@ -5532,6 +5759,30 @@ export interface components {
5532
5759
  /** @description Trading pair UUIDs selected into the cross risk bucket. Required when marginMode is CROSS. */
5533
5760
  selectedTradingPairIds?: string[] | null;
5534
5761
  };
5762
+ TransferRewardsRequest: {
5763
+ /**
5764
+ * @description Reward token contract address (0x-prefixed) to transfer.
5765
+ * @example 0x0000000000000000000000000000000000000002
5766
+ */
5767
+ token: string;
5768
+ /**
5769
+ * @description Amount to transfer, in RAW atomic units of the token.
5770
+ * @example 1000000
5771
+ */
5772
+ amount: string;
5773
+ };
5774
+ TransferRewardsResponse: {
5775
+ /**
5776
+ * @description Your rewards-bucket balance after the transfer, RAW atomic units.
5777
+ * @example 0
5778
+ */
5779
+ rewardsBalance?: string | null;
5780
+ /**
5781
+ * @description Your trading balance for the token after the transfer, RAW atomic units.
5782
+ * @example 1000000
5783
+ */
5784
+ tradingBalance?: string | null;
5785
+ };
5535
5786
  UpdateLimitRequest: {
5536
5787
  /**
5537
5788
  * Format: uuid
@@ -5577,7 +5828,10 @@ export interface components {
5577
5828
  quantity?: string | null;
5578
5829
  };
5579
5830
  UpsertDelegatedAgentRequest: {
5580
- /** @description Agent wallet address (EVM, 42 chars including 0x) */
5831
+ /**
5832
+ * @description Agent wallet address (EVM, 42 chars including 0x)
5833
+ * @example 0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5
5834
+ */
5581
5835
  agentAddress?: string | null;
5582
5836
  /**
5583
5837
  * @description Optional human-friendly label for the agent
@@ -5639,7 +5893,10 @@ export interface components {
5639
5893
  * @example 123e4567-e89b-12d3-a456-426614174000
5640
5894
  */
5641
5895
  id?: string | null;
5642
- /** @description Wallet address */
5896
+ /**
5897
+ * @description Wallet address
5898
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
5899
+ */
5643
5900
  address?: string | null;
5644
5901
  /**
5645
5902
  * @description Display username
@@ -5663,9 +5920,15 @@ export interface components {
5663
5920
  timestamp?: string | null;
5664
5921
  };
5665
5922
  VerifyRequest: {
5666
- /** @description Ethereum wallet address */
5923
+ /**
5924
+ * @description Ethereum wallet address
5925
+ * @example 0x742d35Cc6634C0532925a3b8D4060f31E2C3d8B5
5926
+ */
5667
5927
  address: string;
5668
- /** @description Wallet signature over the challenge message */
5928
+ /**
5929
+ * @description Wallet signature over the challenge message
5930
+ * @example 0x1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0
5931
+ */
5669
5932
  signature: string;
5670
5933
  /**
5671
5934
  * @description Challenge nonce
@@ -5677,13 +5940,21 @@ export interface components {
5677
5940
  * @example monaco-frontend
5678
5941
  */
5679
5942
  clientId?: string | null;
5680
- /** @description Optional chain ID supplied by SDK clients */
5943
+ /**
5944
+ * @description Optional chain ID supplied by SDK clients
5945
+ * @example 1328
5946
+ */
5681
5947
  chainId?: string | null;
5682
5948
  /**
5683
5949
  * @description Lowercase hex (64 chars) ed25519 public key generated locally by the SDK. Subsequent authenticated requests are signed with the matching private key. The wallet's signature on the challenge message proves the user authorized this specific public key.
5684
5950
  * @example 3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29
5685
5951
  */
5686
5952
  sessionPublicKey: string;
5953
+ /**
5954
+ * @description Optional PitPass TraderCode captured at signup (e.g. from a `?ref=CODE` link). When a user verifies for the very first time with a valid code, a referral relationship is recorded atomically. Ignored for users who already exist, and silently ignored if the code is unknown — a bad code never blocks sign-in.
5955
+ * @example 0x1234567890abcdef1234567890abcdef12345678
5956
+ */
5957
+ referralCode?: string | null;
5687
5958
  };
5688
5959
  VerifyResponse: {
5689
5960
  /**
@@ -5695,9 +5966,15 @@ export interface components {
5695
5966
  user?: components["schemas"]["UserInfo"];
5696
5967
  };
5697
5968
  Withdrawal: {
5698
- /** @description Allocated withdrawal index — matches executeWithdrawal.index on-chain */
5969
+ /**
5970
+ * @description Allocated withdrawal index — matches executeWithdrawal.index on-chain
5971
+ * @example 42
5972
+ */
5699
5973
  withdrawalIndex?: string | null;
5700
- /** @description 0x-prefixed lowercase address of the vault contract the calldata is submitted to */
5974
+ /**
5975
+ * @description 0x-prefixed lowercase address of the vault contract the calldata is submitted to
5976
+ * @example 0x5fbdb2315678afecb367f032d93f642f64180aa3
5977
+ */
5701
5978
  vaultAddress?: string | null;
5702
5979
  /** @description 0x-prefixed ABI-encoded executeWithdrawal(...) calldata; submit as tx.data to the vault. Empty on InitiateWithdrawal (the merkle proof is not available until the withdrawal root is confirmed on-chain) — fetch it from GetWithdrawal once ready */
5703
5980
  calldata?: string | null;
@@ -8724,6 +9001,162 @@ export interface operations {
8724
9001
  };
8725
9002
  };
8726
9003
  };
9004
+ get_my_trader_code: {
9005
+ parameters: {
9006
+ query?: never;
9007
+ header?: never;
9008
+ path?: never;
9009
+ cookie?: never;
9010
+ };
9011
+ requestBody?: never;
9012
+ responses: {
9013
+ /** @description OK */
9014
+ 200: {
9015
+ headers: {
9016
+ [name: string]: unknown;
9017
+ };
9018
+ content: {
9019
+ "application/json": components["schemas"]["TraderCodeResponse"];
9020
+ };
9021
+ };
9022
+ /** @description Authentication required */
9023
+ 401: {
9024
+ headers: {
9025
+ [name: string]: unknown;
9026
+ };
9027
+ content?: never;
9028
+ };
9029
+ /** @description Internal server error */
9030
+ 500: {
9031
+ headers: {
9032
+ [name: string]: unknown;
9033
+ };
9034
+ content?: never;
9035
+ };
9036
+ };
9037
+ };
9038
+ get_trader_code_info: {
9039
+ parameters: {
9040
+ query?: never;
9041
+ header?: never;
9042
+ path: {
9043
+ code: string;
9044
+ };
9045
+ cookie?: never;
9046
+ };
9047
+ requestBody?: never;
9048
+ responses: {
9049
+ /** @description OK */
9050
+ 200: {
9051
+ headers: {
9052
+ [name: string]: unknown;
9053
+ };
9054
+ content: {
9055
+ "application/json": components["schemas"]["GetTraderCodeInfoResponse"];
9056
+ };
9057
+ };
9058
+ /** @description Code not found */
9059
+ 404: {
9060
+ headers: {
9061
+ [name: string]: unknown;
9062
+ };
9063
+ content?: never;
9064
+ };
9065
+ /** @description Internal server error */
9066
+ 500: {
9067
+ headers: {
9068
+ [name: string]: unknown;
9069
+ };
9070
+ content?: never;
9071
+ };
9072
+ };
9073
+ };
9074
+ get_rewards_balance: {
9075
+ parameters: {
9076
+ query?: never;
9077
+ header?: never;
9078
+ path?: never;
9079
+ cookie?: never;
9080
+ };
9081
+ requestBody?: never;
9082
+ responses: {
9083
+ /** @description OK */
9084
+ 200: {
9085
+ headers: {
9086
+ [name: string]: unknown;
9087
+ };
9088
+ content: {
9089
+ "application/json": components["schemas"]["GetRewardsBalanceResponse"];
9090
+ };
9091
+ };
9092
+ /** @description Authentication required */
9093
+ 401: {
9094
+ headers: {
9095
+ [name: string]: unknown;
9096
+ };
9097
+ content?: never;
9098
+ };
9099
+ /** @description Internal server error */
9100
+ 500: {
9101
+ headers: {
9102
+ [name: string]: unknown;
9103
+ };
9104
+ content?: never;
9105
+ };
9106
+ };
9107
+ };
9108
+ transfer_rewards: {
9109
+ parameters: {
9110
+ query?: never;
9111
+ header?: never;
9112
+ path?: never;
9113
+ cookie?: never;
9114
+ };
9115
+ requestBody: {
9116
+ content: {
9117
+ "application/json": components["schemas"]["TransferRewardsRequest"];
9118
+ };
9119
+ };
9120
+ responses: {
9121
+ /** @description OK */
9122
+ 200: {
9123
+ headers: {
9124
+ [name: string]: unknown;
9125
+ };
9126
+ content: {
9127
+ "application/json": components["schemas"]["TransferRewardsResponse"];
9128
+ };
9129
+ };
9130
+ /** @description Invalid token or amount */
9131
+ 400: {
9132
+ headers: {
9133
+ [name: string]: unknown;
9134
+ };
9135
+ content?: never;
9136
+ };
9137
+ /** @description Authentication required */
9138
+ 401: {
9139
+ headers: {
9140
+ [name: string]: unknown;
9141
+ };
9142
+ content?: never;
9143
+ };
9144
+ /** @description Insufficient rewards balance */
9145
+ 409: {
9146
+ headers: {
9147
+ [name: string]: unknown;
9148
+ };
9149
+ content?: never;
9150
+ };
9151
+ /** @description Internal server error */
9152
+ 500: {
9153
+ headers: {
9154
+ [name: string]: unknown;
9155
+ };
9156
+ content?: never;
9157
+ };
9158
+ };
9159
+ };
8727
9160
  list_positions: {
8728
9161
  parameters: {
8729
9162
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "0.8.22",
3
+ "version": "1.0.2",
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": "0.8.22",
23
+ "@0xmonaco/contracts": "1.0.2",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {