@0xmonaco/types 0.8.5 → 0.8.7-develop.0f12336

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.
Files changed (64) hide show
  1. package/README.md +5 -3
  2. package/dist/api/index.d.ts +13 -5
  3. package/dist/api/index.js +1 -1
  4. package/dist/applications/index.d.ts +47 -5
  5. package/dist/applications/index.js +2 -1
  6. package/dist/applications/requests.d.ts +78 -0
  7. package/dist/applications/requests.js +7 -0
  8. package/dist/applications/responses.d.ts +213 -2
  9. package/dist/applications/responses.js +3 -1
  10. package/dist/auth/index.d.ts +29 -31
  11. package/dist/auth/index.js +2 -2
  12. package/dist/auth/responses.d.ts +25 -21
  13. package/dist/contracts/balances.d.ts +1 -1
  14. package/dist/delegated-agents/index.d.ts +35 -18
  15. package/dist/faucet/index.d.ts +54 -0
  16. package/dist/faucet/index.js +10 -0
  17. package/dist/fees/index.d.ts +4 -4
  18. package/dist/fees/responses.d.ts +17 -17
  19. package/dist/fees/responses.js +20 -20
  20. package/dist/index.d.ts +4 -0
  21. package/dist/index.js +4 -0
  22. package/dist/margin-accounts/index.d.ts +91 -55
  23. package/dist/market/index.d.ts +214 -94
  24. package/dist/positions/index.d.ts +67 -44
  25. package/dist/profile/index.d.ts +157 -67
  26. package/dist/sdk/index.d.ts +43 -5
  27. package/dist/sub-accounts/index.d.ts +146 -0
  28. package/dist/sub-accounts/index.js +9 -0
  29. package/dist/trading/index.d.ts +8 -8
  30. package/dist/trading/orders.d.ts +20 -20
  31. package/dist/trading/responses.d.ts +82 -101
  32. package/dist/validation/margin-accounts.d.ts +53 -13
  33. package/dist/validation/margin-accounts.js +38 -14
  34. package/dist/validation/market.d.ts +1 -1
  35. package/dist/validation/market.js +1 -1
  36. package/dist/validation/positions.d.ts +11 -7
  37. package/dist/validation/positions.js +10 -6
  38. package/dist/validation/profile.d.ts +13 -6
  39. package/dist/validation/profile.js +13 -6
  40. package/dist/validation/trading.d.ts +17 -42
  41. package/dist/validation/trading.js +51 -42
  42. package/dist/validation/vault.d.ts +8 -0
  43. package/dist/validation/vault.js +3 -0
  44. package/dist/vault/index.d.ts +46 -13
  45. package/dist/vault/responses.d.ts +50 -12
  46. package/dist/websocket/events/balance-events.d.ts +2 -1
  47. package/dist/websocket/events/movement-events.d.ts +2 -1
  48. package/dist/whitelist/index.d.ts +44 -0
  49. package/dist/whitelist/index.js +10 -0
  50. package/dist/wire/assert.d.ts +54 -0
  51. package/dist/wire/assert.js +0 -0
  52. package/dist/wire/audit.d.ts +47 -0
  53. package/dist/wire/audit.js +43 -0
  54. package/dist/wire/coverage.d.ts +1 -0
  55. package/dist/wire/coverage.js +0 -0
  56. package/dist/wire/index.d.ts +21 -0
  57. package/dist/wire/index.js +2 -0
  58. package/dist/wire/operations.d.ts +15 -0
  59. package/dist/wire/operations.js +101 -0
  60. package/dist/wire/schema.d.ts +8930 -0
  61. package/dist/wire/schema.js +4 -0
  62. package/dist/withdrawals/index.d.ts +114 -0
  63. package/dist/withdrawals/index.js +0 -0
  64. package/package.json +6 -2
@@ -33,7 +33,7 @@ export interface Token {
33
33
  */
34
34
  export interface UserBalance {
35
35
  /** Token address */
36
- token: string;
36
+ token: Address;
37
37
  /** Available balance for trading */
38
38
  available: bigint;
39
39
  /** Locked balance in open orders */
@@ -1,3 +1,4 @@
1
+ import type { Address } from "viem";
1
2
  import type { BaseAPI } from "../api";
2
3
  export type DelegatedAgentAction = "CREATE_ORDER" | "CANCEL_ORDER" | "REPLACE_ORDER" | "create_order" | "cancel_order" | "replace_order";
3
4
  export interface UpsertDelegatedAgentRequest {
@@ -15,37 +16,53 @@ export interface UpsertDelegatedAgentRequest {
15
16
  }
16
17
  export interface DelegatedAgent {
17
18
  id: string;
18
- owner_user_id: string;
19
- agent_address: string;
19
+ ownerUserId: string;
20
+ agentAddress: Address;
20
21
  name?: string;
21
- is_active: boolean;
22
- expires_at?: string;
23
- revoked_at?: string;
24
- allowed_actions: string[];
25
- allowed_trading_pair_ids: string[];
26
- allowed_margin_account_ids: string[];
27
- allowed_order_types?: string[];
28
- allowed_time_in_force?: string[];
29
- max_leverage?: string;
30
- max_order_notional?: string;
31
- max_open_orders?: number;
22
+ isActive: boolean;
23
+ expiresAt?: string;
24
+ revokedAt?: string;
25
+ allowedActions: string[];
26
+ allowedTradingPairIds: string[];
27
+ allowedMarginAccountIds: string[];
28
+ allowedOrderTypes?: string[];
29
+ allowedTimeInForce?: string[];
30
+ maxLeverage?: string;
31
+ maxOrderNotional?: string;
32
+ maxOpenOrders?: number;
32
33
  }
33
34
  export interface ListDelegatedAgentsResponse {
34
35
  agents: DelegatedAgent[];
35
36
  }
37
+ export interface DelegatedAgentOwner {
38
+ ownerUserId: string;
39
+ delegationId: string;
40
+ name?: string;
41
+ isActive: boolean;
42
+ expiresAt?: string;
43
+ }
44
+ export interface ListDelegatedOwnersResponse {
45
+ owners: DelegatedAgentOwner[];
46
+ }
36
47
  export interface CreateDelegatedSessionRequest {
37
48
  ownerUserId: string;
49
+ /**
50
+ * Lowercase-hex (64 chars) ed25519 public key the agent generated for this
51
+ * delegated session. Required: subsequent requests acting on the owner's
52
+ * behalf are signed with the matching private key.
53
+ */
54
+ sessionPublicKey: string;
38
55
  }
39
56
  export interface CreateDelegatedSessionResponse {
40
- access_token: string;
41
- expires_at: number;
42
- delegation_id: string;
43
- owner_user_id: string;
44
- agent_address: string;
57
+ expiresAt: number;
58
+ delegationId: string;
59
+ ownerUserId: string;
60
+ agentAddress: Address;
45
61
  }
46
62
  export interface DelegatedAgentsAPI extends BaseAPI {
47
63
  upsertDelegatedAgent(request: UpsertDelegatedAgentRequest): Promise<DelegatedAgent>;
48
64
  listDelegatedAgents(): Promise<ListDelegatedAgentsResponse>;
65
+ listDelegatedOwners(): Promise<ListDelegatedOwnersResponse>;
49
66
  revokeDelegatedAgent(delegatedAgentId: string): Promise<{
50
67
  status: "REVOKED";
51
68
  }>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Faucet Types
3
+ *
4
+ * Types for the testnet token faucet. Wire shapes are snake_case.
5
+ *
6
+ * NOTE: The faucet is **testnet-only** and performs real on-chain mints from a
7
+ * backend-operator-funded signer. It is disabled (returns an error) if the
8
+ * gateway operator has not configured a signer; the SDK caller has no control
9
+ * over that. It is rate-limited per user (default 1 request / 24h).
10
+ */
11
+ import type { BaseAPI } from "../api";
12
+ /** A token successfully minted by the faucet. */
13
+ export interface MintedToken {
14
+ /** Asset UUID */
15
+ assetId: string;
16
+ /** Token symbol */
17
+ symbol: string;
18
+ /** Amount minted in token units */
19
+ amount: string;
20
+ /** On-chain transaction hash */
21
+ txHash: string;
22
+ }
23
+ /** A token the faucet failed to mint. */
24
+ export interface FailedMint {
25
+ /** Asset UUID */
26
+ assetId: string;
27
+ /** Token symbol */
28
+ symbol: string;
29
+ /** Error message describing why the mint failed */
30
+ error: string;
31
+ }
32
+ /** Result of a faucet mint request. */
33
+ export interface MintTokensResponse {
34
+ /** Tokens that were successfully minted */
35
+ minted: MintedToken[];
36
+ /** Tokens that failed to mint */
37
+ failed: FailedMint[];
38
+ /** Remaining faucet requests in the next 24h */
39
+ remainingRequests24h: number;
40
+ }
41
+ /**
42
+ * Faucet API interface. Session-authenticated.
43
+ */
44
+ export interface FaucetAPI extends BaseAPI {
45
+ /**
46
+ * Mints the full set of testnet tokens to the authenticated user.
47
+ *
48
+ * Testnet-only and rate-limited; see the module note. Partial success is
49
+ * possible — inspect `minted` and `failed` in the response.
50
+ *
51
+ * @returns Promise resolving to the minted/failed tokens and remaining quota
52
+ */
53
+ mint(): Promise<MintTokensResponse>;
54
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Faucet Types
3
+ *
4
+ * Types for the testnet token faucet. Wire shapes are snake_case.
5
+ *
6
+ * NOTE: The faucet is **testnet-only** and performs real on-chain mints from a
7
+ * backend-operator-funded signer. It is disabled (returns an error) if the
8
+ * gateway operator has not configured a signer; the SDK caller has no control
9
+ * over that. It is rate-limited per user (default 1 request / 24h).
10
+ */
@@ -15,7 +15,7 @@ export interface FeesAPI extends BaseAPI {
15
15
  * Returns exact fees for that specific order.
16
16
  *
17
17
  * @param params - Parameters for fee simulation
18
- * @param params.trading_pair_id - Trading pair ID
18
+ * @param params.tradingPairId - Trading pair ID
19
19
  * @param params.side - Order side ("BUY" or "SELL")
20
20
  * @param params.price - Price per unit
21
21
  * @param params.quantity - Quantity to trade
@@ -24,13 +24,13 @@ export interface FeesAPI extends BaseAPI {
24
24
  * @example
25
25
  * ```typescript
26
26
  * const feeDetails = await feesAPI.simulateFees({
27
- * trading_pair_id: "123e4567-e89b-12d3-a456-426614174000",
27
+ * tradingPairId: "123e4567-e89b-12d3-a456-426614174000",
28
28
  * side: "BUY",
29
29
  * price: "40000.00",
30
30
  * quantity: "0.5"
31
31
  * });
32
- * console.log(`Total taker fees: ${feeDetails.total_taker_fees}`);
33
- * console.log(`Taker must pay: ${feeDetails.taker_total_payment}`);
32
+ * console.log(`Total taker fees: ${feeDetails.totalTakerFees}`);
33
+ * console.log(`Taker must pay: ${feeDetails.takerTotalPayment}`);
34
34
  * ```
35
35
  */
36
36
  simulateFees(params: SimulateFeeParams): Promise<SimulateFeeResponse>;
@@ -9,38 +9,38 @@ import { z } from "zod";
9
9
  * Zod schema for simulating order fees parameters
10
10
  */
11
11
  export declare const SimulateFeeParamsSchema: z.ZodObject<{
12
- trading_pair_id: z.ZodString;
12
+ tradingPairId: z.ZodString;
13
13
  side: z.ZodEnum<{
14
14
  BUY: "BUY";
15
15
  SELL: "SELL";
16
16
  }>;
17
17
  price: z.ZodString;
18
18
  quantity: z.ZodString;
19
- order_type: z.ZodOptional<z.ZodEnum<{
19
+ orderType: z.ZodOptional<z.ZodEnum<{
20
20
  LIMIT: "LIMIT";
21
21
  MARKET: "MARKET";
22
22
  }>>;
23
- slippage_tolerance_bps: z.ZodOptional<z.ZodNumber>;
23
+ slippageToleranceBps: z.ZodOptional<z.ZodNumber>;
24
24
  }, z.core.$strip>;
25
25
  /**
26
26
  * Zod schema for fee simulation response
27
27
  */
28
28
  export declare const SimulateFeeResponseSchema: z.ZodObject<{
29
- application_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
- application_taker_fee: z.ZodString;
31
- application_taker_fee_bps: z.ZodNumber;
32
- buy_order_lock_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- maker_total_receipt: z.ZodString;
34
- monaco_maker_rebate: z.ZodString;
35
- monaco_maker_rebate_bps: z.ZodNumber;
36
- monaco_taker_fee: z.ZodString;
37
- monaco_taker_fee_bps: z.ZodNumber;
29
+ applicationName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
+ applicationTakerFee: z.ZodString;
31
+ applicationTakerFeeBps: z.ZodNumber;
32
+ buyOrderLockAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ makerTotalReceipt: z.ZodString;
34
+ monacoMakerRebate: z.ZodString;
35
+ monacoMakerRebateBps: z.ZodNumber;
36
+ monacoTakerFee: z.ZodString;
37
+ monacoTakerFeeBps: z.ZodNumber;
38
38
  notional: z.ZodString;
39
- taker_total_payment: z.ZodString;
40
- total_taker_fees: z.ZodString;
41
- max_quantity: z.ZodNullable<z.ZodString>;
42
- max_quantity_raw: z.ZodNullable<z.ZodString>;
43
- slippage_tolerance_bps: z.ZodNullable<z.ZodNumber>;
39
+ takerTotalPayment: z.ZodString;
40
+ totalTakerFees: z.ZodString;
41
+ maxQuantity: z.ZodNullable<z.ZodString>;
42
+ maxQuantityRaw: z.ZodNullable<z.ZodString>;
43
+ slippageToleranceBps: z.ZodNullable<z.ZodNumber>;
44
44
  }, z.core.$strip>;
45
45
  /**
46
46
  * Parameters for simulating order fees
@@ -11,7 +11,7 @@ import { z } from "zod";
11
11
  export const SimulateFeeParamsSchema = z
12
12
  .object({
13
13
  /** Trading pair ID */
14
- trading_pair_id: z.string().trim().min(1, "Trading pair ID is required and cannot be empty"),
14
+ tradingPairId: z.string().trim().min(1, "Trading pair ID is required and cannot be empty"),
15
15
  /** Order side: "BUY" or "SELL" */
16
16
  side: z.enum(["BUY", "SELL"], {
17
17
  message: "Order side is required and must be either 'BUY' or 'SELL'",
@@ -31,9 +31,9 @@ export const SimulateFeeParamsSchema = z
31
31
  .refine((val) => !Number.isNaN(Number(val)), "Quantity must be a valid number")
32
32
  .refine((val) => Number(val) > 0, "Quantity must be greater than 0"),
33
33
  /** Order type: "LIMIT" (default) or "MARKET". MARKET orders include a slippage buffer in the lock amount. */
34
- order_type: z.enum(["LIMIT", "MARKET"]).optional(),
34
+ orderType: z.enum(["LIMIT", "MARKET"]).optional(),
35
35
  /** Slippage tolerance in basis points (0–1000). Only valid for MARKET orders. Default: 500 (5%). */
36
- slippage_tolerance_bps: z
36
+ slippageToleranceBps: z
37
37
  .number()
38
38
  .int()
39
39
  .min(0, "Slippage tolerance must be between 0 and 1000 bps")
@@ -41,11 +41,11 @@ export const SimulateFeeParamsSchema = z
41
41
  .optional(),
42
42
  })
43
43
  .superRefine((data, ctx) => {
44
- if (data.slippage_tolerance_bps !== undefined && data.order_type !== "MARKET") {
44
+ if (data.slippageToleranceBps !== undefined && data.orderType !== "MARKET") {
45
45
  ctx.addIssue({
46
46
  code: z.ZodIssueCode.custom,
47
- message: "slippage_tolerance_bps is only valid when order_type is MARKET",
48
- path: ["slippage_tolerance_bps"],
47
+ message: "slippageToleranceBps is only valid when orderType is MARKET",
48
+ path: ["slippageToleranceBps"],
49
49
  });
50
50
  }
51
51
  });
@@ -54,33 +54,33 @@ export const SimulateFeeParamsSchema = z
54
54
  */
55
55
  export const SimulateFeeResponseSchema = z.object({
56
56
  /** Application name (if applicable) */
57
- application_name: z.string().nullable().optional(),
57
+ applicationName: z.string().nullable().optional(),
58
58
  /** Frontend application taker fee */
59
- application_taker_fee: z.string(),
59
+ applicationTakerFee: z.string(),
60
60
  /** Application fee in basis points */
61
- application_taker_fee_bps: z.number(),
61
+ applicationTakerFeeBps: z.number(),
62
62
  /** Amount to lock for BUY orders (null for `SELL`) */
63
- buy_order_lock_amount: z.string().nullable().optional(),
63
+ buyOrderLockAmount: z.string().nullable().optional(),
64
64
  /** Total amount maker receives */
65
- maker_total_receipt: z.string(),
65
+ makerTotalReceipt: z.string(),
66
66
  /** Monaco protocol maker rebate (negative = rebate) */
67
- monaco_maker_rebate: z.string(),
67
+ monacoMakerRebate: z.string(),
68
68
  /** Monaco maker rebate in basis points */
69
- monaco_maker_rebate_bps: z.number(),
69
+ monacoMakerRebateBps: z.number(),
70
70
  /** Monaco protocol taker fee */
71
- monaco_taker_fee: z.string(),
71
+ monacoTakerFee: z.string(),
72
72
  /** Monaco taker fee in basis points */
73
- monaco_taker_fee_bps: z.number(),
73
+ monacoTakerFeeBps: z.number(),
74
74
  /** Notional value (price * quantity) */
75
75
  notional: z.string(),
76
76
  /** Total amount taker must pay */
77
- taker_total_payment: z.string(),
77
+ takerTotalPayment: z.string(),
78
78
  /** Total taker fees (monaco + application) */
79
- total_taker_fees: z.string(),
79
+ totalTakerFees: z.string(),
80
80
  /** Maximum quantity affordable at the given price, accounting for fees (null if not authenticated or balance unavailable) */
81
- max_quantity: z.string().nullable(),
81
+ maxQuantity: z.string().nullable(),
82
82
  /** Maximum quantity in RAW (smallest unit) format */
83
- max_quantity_raw: z.string().nullable(),
83
+ maxQuantityRaw: z.string().nullable(),
84
84
  /** Slippage tolerance used in the calculation, echoed back for MARKET orders (null for LIMIT orders) */
85
- slippage_tolerance_bps: z.number().nullable(),
85
+ slippageToleranceBps: z.number().nullable(),
86
86
  });
package/dist/index.d.ts CHANGED
@@ -9,13 +9,17 @@ export * from "./applications";
9
9
  export * from "./auth";
10
10
  export * from "./contracts";
11
11
  export * from "./delegated-agents";
12
+ export * from "./faucet";
12
13
  export * from "./fees";
13
14
  export * from "./margin-accounts";
14
15
  export * from "./market";
15
16
  export * from "./positions";
16
17
  export * from "./profile";
17
18
  export * from "./sdk";
19
+ export * from "./sub-accounts";
18
20
  export * from "./trading";
19
21
  export * from "./validation";
20
22
  export * from "./vault";
21
23
  export * from "./websocket";
24
+ export * from "./whitelist";
25
+ export * from "./withdrawals";
package/dist/index.js CHANGED
@@ -10,13 +10,17 @@ export * from "./applications";
10
10
  export * from "./auth";
11
11
  export * from "./contracts";
12
12
  export * from "./delegated-agents";
13
+ export * from "./faucet";
13
14
  export * from "./fees";
14
15
  export * from "./margin-accounts";
15
16
  export * from "./market";
16
17
  export * from "./positions";
17
18
  export * from "./profile";
18
19
  export * from "./sdk";
20
+ export * from "./sub-accounts";
19
21
  export * from "./trading";
20
22
  export * from "./validation";
21
23
  export * from "./vault";
22
24
  export * from "./websocket";
25
+ export * from "./whitelist";
26
+ export * from "./withdrawals";
@@ -1,24 +1,26 @@
1
1
  import type { BaseAPI } from "../api";
2
2
  import type { OrderSide, OrderType, PositionSide } from "../trading";
3
3
  export interface MarginAccountSummary {
4
- margin_account_id: string;
4
+ marginAccountId: string;
5
5
  label?: string;
6
- trading_pair_id?: string;
7
- strategy_key?: string;
8
- account_state: string;
6
+ riskBucketId?: string;
7
+ marginMode?: "ISOLATED" | "CROSS";
8
+ tradingPairId?: string;
9
+ strategyKey?: string;
10
+ accountState: string;
9
11
  equity: string;
10
- initial_margin_required: string;
11
- maintenance_margin_required: string;
12
- free_collateral: string;
13
- withdrawable_collateral: string;
14
- total_position_notional: string;
15
- unrealized_pnl: string;
16
- realized_pnl: string;
17
- updated_at: string;
12
+ initialMarginRequired: string;
13
+ maintenanceMarginRequired: string;
14
+ freeCollateral: string;
15
+ withdrawableCollateral: string;
16
+ totalPositionNotional: string;
17
+ unrealizedPnl: string;
18
+ realizedPnl: string;
19
+ updatedAt: string;
18
20
  }
19
21
  export interface ListMarginAccountsParams {
20
22
  page?: number;
21
- page_size?: number;
23
+ pageSize?: number;
22
24
  state?: string;
23
25
  tradingPairId?: string;
24
26
  }
@@ -26,69 +28,77 @@ export interface ListMarginAccountsResponse {
26
28
  accounts: MarginAccountSummary[];
27
29
  total: number;
28
30
  page: number;
29
- page_size: number;
31
+ pageSize: number;
30
32
  }
31
- export interface CreateMarginAccountRequest {
32
- label?: string;
33
- collateralAsset?: string;
34
- }
35
- export interface CreateMarginAccountResponse {
36
- margin_account_id: string;
37
- label?: string;
38
- account_state: string;
39
- collateral_asset: string;
40
- created_at: string;
33
+ export interface GetMarginAccountSummaryParams {
34
+ tradingPairId?: string;
41
35
  }
42
36
  export interface GetAvailableCollateralParams {
43
37
  asset?: string;
44
38
  }
45
39
  export interface GetAvailableCollateralResponse {
46
40
  asset: string;
47
- wallet_available: string;
48
- wallet_locked: string;
49
- margin_transferable?: string;
41
+ walletAvailable: string;
42
+ walletLocked: string;
43
+ marginTransferable?: string;
44
+ /**
45
+ * Free collateral held in the user's parent margin account for this asset
46
+ * (equity minus initial margin required) — collateral already inside margin
47
+ * and available to open new positions or transfer back out. Absent when the
48
+ * user has no margin account yet.
49
+ */
50
+ marginAvailableCollateral?: string;
50
51
  }
51
52
  export interface TransferCollateralRequest {
52
53
  asset: string;
53
54
  amount: string;
55
+ tradingPairId?: string;
56
+ strategyKey?: string;
54
57
  }
55
- export interface TransferCollateralToAutoMarginAccountRequest extends TransferCollateralRequest {
58
+ export interface TransferCollateralToParentMarginAccountRequest {
59
+ asset: string;
60
+ amount: string;
61
+ }
62
+ export interface TransferCollateralToRiskBucketRequest extends TransferCollateralToParentMarginAccountRequest {
56
63
  tradingPairId: string;
57
64
  strategyKey?: string;
58
65
  }
66
+ export interface TransferCollateralFromParentMarginAccountRequest {
67
+ asset: string;
68
+ amount: string;
69
+ }
59
70
  export interface TransferCollateralResponse {
60
- movement_id: string;
61
- margin_account_id: string;
62
- strategy_key?: string;
71
+ movementId: string;
72
+ marginAccountId: string;
73
+ strategyKey?: string;
63
74
  asset: string;
64
75
  amount: string;
65
76
  status: string;
66
- new_equity: string;
67
- new_total_collateral_value: string;
68
- new_withdrawable_collateral: string;
77
+ newEquity: string;
78
+ newTotalCollateralValue: string;
79
+ newWithdrawableCollateral: string;
69
80
  }
70
81
  export interface GetMarginAccountMovementsParams {
71
- movement_type?: string;
82
+ movementType?: string;
72
83
  page?: number;
73
- page_size?: number;
84
+ pageSize?: number;
74
85
  }
75
86
  export interface MarginAccountMovement {
76
- movement_id: string;
77
- margin_account_id: string;
78
- movement_type: string;
87
+ movementId: string;
88
+ marginAccountId: string;
89
+ movementType: string;
79
90
  asset: string;
80
91
  amount: string;
81
- created_at: string;
92
+ createdAt: string;
82
93
  }
83
94
  export interface GetMarginAccountMovementsResponse {
84
95
  movements: MarginAccountMovement[];
85
96
  total: number;
86
97
  page: number;
87
- page_size: number;
98
+ pageSize: number;
88
99
  }
89
100
  export interface SimulateOrderRiskRequest {
90
101
  tradingPairId: string;
91
- strategyKey?: string;
92
102
  side: OrderSide;
93
103
  positionSide: PositionSide;
94
104
  orderType: OrderType;
@@ -97,27 +107,53 @@ export interface SimulateOrderRiskRequest {
97
107
  leverage: string;
98
108
  reduceOnly?: boolean;
99
109
  }
110
+ export interface SimulateRiskBucketOrderRiskRequest extends SimulateOrderRiskRequest {
111
+ strategyKey?: string;
112
+ }
100
113
  export interface SimulateOrderRiskResponse {
101
114
  accepted: boolean;
102
- reject_reason?: string;
103
- margin_account_id: string;
104
- strategy_key?: string;
105
- equity_after: string;
106
- initial_margin_required_after: string;
107
- maintenance_margin_required_after: string;
108
- free_collateral_after: string;
109
- estimated_fee?: string;
110
- estimated_liquidation_price?: string;
115
+ rejectReason?: string;
116
+ marginAccountId: string;
117
+ strategyKey?: string;
118
+ equityAfter: string;
119
+ initialMarginRequiredAfter: string;
120
+ maintenanceMarginRequiredAfter: string;
121
+ freeCollateralAfter: string;
122
+ estimatedFee?: string;
123
+ estimatedLiquidationPrice?: string;
111
124
  }
112
125
  export interface MarginAccountsAPI extends BaseAPI {
113
126
  listMarginAccounts(params?: ListMarginAccountsParams): Promise<ListMarginAccountsResponse>;
114
- createMarginAccount(request?: CreateMarginAccountRequest): Promise<CreateMarginAccountResponse>;
115
- getMarginAccountSummary(marginAccountId: string): Promise<MarginAccountSummary>;
127
+ getParentMarginAccountSummary(params?: GetMarginAccountSummaryParams): Promise<MarginAccountSummary>;
128
+ /**
129
+ * @deprecated Prefer getParentMarginAccountSummary(). Parent margin account ids
130
+ * are auto-resolved for the authenticated wallet/application scope.
131
+ */
132
+ getMarginAccountSummary(marginAccountId: string, params?: GetMarginAccountSummaryParams): Promise<MarginAccountSummary>;
116
133
  getAvailableCollateral(params?: GetAvailableCollateralParams): Promise<GetAvailableCollateralResponse>;
134
+ /**
135
+ * @deprecated Prefer transferCollateralToParentMarginAccount() or
136
+ * transferCollateralToRiskBucket().
137
+ */
117
138
  transferCollateralToMarginAccount(marginAccountId: string, request: TransferCollateralRequest): Promise<TransferCollateralResponse>;
118
- transferCollateralToAutoMarginAccount(request: TransferCollateralToAutoMarginAccountRequest): Promise<TransferCollateralResponse>;
139
+ transferCollateralToParentMarginAccount(request: TransferCollateralToParentMarginAccountRequest): Promise<TransferCollateralResponse>;
140
+ transferCollateralToRiskBucket(request: TransferCollateralToRiskBucketRequest): Promise<TransferCollateralResponse>;
141
+ /**
142
+ * @deprecated Prefer transferCollateralFromParentMarginAccount().
143
+ */
119
144
  transferCollateralFromMarginAccount(marginAccountId: string, request: TransferCollateralRequest): Promise<TransferCollateralResponse>;
145
+ transferCollateralFromParentMarginAccount(request: TransferCollateralFromParentMarginAccountRequest): Promise<TransferCollateralResponse>;
146
+ getParentMarginAccountMovements(params?: GetMarginAccountMovementsParams): Promise<GetMarginAccountMovementsResponse>;
147
+ /**
148
+ * @deprecated Prefer getParentMarginAccountMovements(). Parent margin account ids
149
+ * are auto-resolved for the authenticated wallet/application scope.
150
+ */
120
151
  getMarginAccountMovements(marginAccountId: string, params?: GetMarginAccountMovementsParams): Promise<GetMarginAccountMovementsResponse>;
152
+ simulateParentMarginOrderRisk(request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
153
+ /**
154
+ * @deprecated Prefer simulateParentMarginOrderRisk(). Parent margin account ids
155
+ * are auto-resolved for the authenticated wallet/application scope.
156
+ */
121
157
  simulateOrderRisk(marginAccountId: string, request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
122
- simulateAutoMarginOrderRisk(request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
158
+ simulateRiskBucketOrderRisk(request: SimulateRiskBucketOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
123
159
  }