@0xmonaco/types 0.0.0-develop-20260120180031

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 (134) hide show
  1. package/README.md +391 -0
  2. package/dist/api/index.d.ts +19 -0
  3. package/dist/api/index.d.ts.map +1 -0
  4. package/dist/api/index.js +8 -0
  5. package/dist/api/index.js.map +1 -0
  6. package/dist/applications/index.d.ts +24 -0
  7. package/dist/applications/index.d.ts.map +1 -0
  8. package/dist/applications/index.js +7 -0
  9. package/dist/applications/index.js.map +1 -0
  10. package/dist/applications/responses.d.ts +21 -0
  11. package/dist/applications/responses.d.ts.map +1 -0
  12. package/dist/applications/responses.js +7 -0
  13. package/dist/applications/responses.js.map +1 -0
  14. package/dist/auth/index.d.ts +76 -0
  15. package/dist/auth/index.d.ts.map +1 -0
  16. package/dist/auth/index.js +8 -0
  17. package/dist/auth/index.js.map +1 -0
  18. package/dist/auth/responses.d.ts +68 -0
  19. package/dist/auth/responses.d.ts.map +1 -0
  20. package/dist/auth/responses.js +7 -0
  21. package/dist/auth/responses.js.map +1 -0
  22. package/dist/contracts/balances.d.ts +44 -0
  23. package/dist/contracts/balances.d.ts.map +1 -0
  24. package/dist/contracts/balances.js +7 -0
  25. package/dist/contracts/balances.js.map +1 -0
  26. package/dist/contracts/index.d.ts +28 -0
  27. package/dist/contracts/index.d.ts.map +1 -0
  28. package/dist/contracts/index.js +7 -0
  29. package/dist/contracts/index.js.map +1 -0
  30. package/dist/fees/index.d.ts +40 -0
  31. package/dist/fees/index.d.ts.map +1 -0
  32. package/dist/fees/index.js +7 -0
  33. package/dist/fees/index.js.map +1 -0
  34. package/dist/fees/responses.d.ts +47 -0
  35. package/dist/fees/responses.d.ts.map +1 -0
  36. package/dist/fees/responses.js +62 -0
  37. package/dist/fees/responses.js.map +1 -0
  38. package/dist/index.d.ts +19 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +20 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/market/index.d.ts +224 -0
  43. package/dist/market/index.d.ts.map +1 -0
  44. package/dist/market/index.js +7 -0
  45. package/dist/market/index.js.map +1 -0
  46. package/dist/profile/index.d.ts +228 -0
  47. package/dist/profile/index.d.ts.map +1 -0
  48. package/dist/profile/index.js +7 -0
  49. package/dist/profile/index.js.map +1 -0
  50. package/dist/sdk/index.d.ts +122 -0
  51. package/dist/sdk/index.d.ts.map +1 -0
  52. package/dist/sdk/index.js +2 -0
  53. package/dist/sdk/index.js.map +1 -0
  54. package/dist/sdk/network.d.ts +31 -0
  55. package/dist/sdk/network.d.ts.map +1 -0
  56. package/dist/sdk/network.js +7 -0
  57. package/dist/sdk/network.js.map +1 -0
  58. package/dist/trading/index.d.ts +88 -0
  59. package/dist/trading/index.d.ts.map +1 -0
  60. package/dist/trading/index.js +7 -0
  61. package/dist/trading/index.js.map +1 -0
  62. package/dist/trading/orders.d.ts +108 -0
  63. package/dist/trading/orders.d.ts.map +1 -0
  64. package/dist/trading/orders.js +7 -0
  65. package/dist/trading/orders.js.map +1 -0
  66. package/dist/trading/responses.d.ts +130 -0
  67. package/dist/trading/responses.d.ts.map +1 -0
  68. package/dist/trading/responses.js +7 -0
  69. package/dist/trading/responses.js.map +1 -0
  70. package/dist/validation/common.d.ts +181 -0
  71. package/dist/validation/common.d.ts.map +1 -0
  72. package/dist/validation/common.js +196 -0
  73. package/dist/validation/common.js.map +1 -0
  74. package/dist/validation/index.d.ts +20 -0
  75. package/dist/validation/index.d.ts.map +1 -0
  76. package/dist/validation/index.js +22 -0
  77. package/dist/validation/index.js.map +1 -0
  78. package/dist/validation/market.d.ts +215 -0
  79. package/dist/validation/market.d.ts.map +1 -0
  80. package/dist/validation/market.js +226 -0
  81. package/dist/validation/market.js.map +1 -0
  82. package/dist/validation/trading.d.ts +148 -0
  83. package/dist/validation/trading.d.ts.map +1 -0
  84. package/dist/validation/trading.js +139 -0
  85. package/dist/validation/trading.js.map +1 -0
  86. package/dist/validation/vault.d.ts +62 -0
  87. package/dist/validation/vault.d.ts.map +1 -0
  88. package/dist/validation/vault.js +75 -0
  89. package/dist/validation/vault.js.map +1 -0
  90. package/dist/vault/index.d.ts +64 -0
  91. package/dist/vault/index.d.ts.map +1 -0
  92. package/dist/vault/index.js +7 -0
  93. package/dist/vault/index.js.map +1 -0
  94. package/dist/vault/responses.d.ts +34 -0
  95. package/dist/vault/responses.d.ts.map +1 -0
  96. package/dist/vault/responses.js +7 -0
  97. package/dist/vault/responses.js.map +1 -0
  98. package/dist/websocket/base.d.ts +32 -0
  99. package/dist/websocket/base.d.ts.map +1 -0
  100. package/dist/websocket/base.js +7 -0
  101. package/dist/websocket/base.js.map +1 -0
  102. package/dist/websocket/clients/orderbook-client.d.ts +15 -0
  103. package/dist/websocket/clients/orderbook-client.d.ts.map +1 -0
  104. package/dist/websocket/clients/orderbook-client.js +5 -0
  105. package/dist/websocket/clients/orderbook-client.js.map +1 -0
  106. package/dist/websocket/events/index.d.ts +6 -0
  107. package/dist/websocket/events/index.d.ts.map +1 -0
  108. package/dist/websocket/events/index.js +6 -0
  109. package/dist/websocket/events/index.js.map +1 -0
  110. package/dist/websocket/events/movement-events.d.ts +53 -0
  111. package/dist/websocket/events/movement-events.d.ts.map +1 -0
  112. package/dist/websocket/events/movement-events.js +8 -0
  113. package/dist/websocket/events/movement-events.js.map +1 -0
  114. package/dist/websocket/events/ohlcv-events.d.ts +32 -0
  115. package/dist/websocket/events/ohlcv-events.d.ts.map +1 -0
  116. package/dist/websocket/events/ohlcv-events.js +7 -0
  117. package/dist/websocket/events/ohlcv-events.js.map +1 -0
  118. package/dist/websocket/events/orderbook-events.d.ts +73 -0
  119. package/dist/websocket/events/orderbook-events.d.ts.map +1 -0
  120. package/dist/websocket/events/orderbook-events.js +7 -0
  121. package/dist/websocket/events/orderbook-events.js.map +1 -0
  122. package/dist/websocket/events/orders-events.d.ts +285 -0
  123. package/dist/websocket/events/orders-events.d.ts.map +1 -0
  124. package/dist/websocket/events/orders-events.js +2 -0
  125. package/dist/websocket/events/orders-events.js.map +1 -0
  126. package/dist/websocket/events/trade-events.d.ts +35 -0
  127. package/dist/websocket/events/trade-events.d.ts.map +1 -0
  128. package/dist/websocket/events/trade-events.js +7 -0
  129. package/dist/websocket/events/trade-events.js.map +1 -0
  130. package/dist/websocket/index.d.ts +9 -0
  131. package/dist/websocket/index.d.ts.map +1 -0
  132. package/dist/websocket/index.js +9 -0
  133. package/dist/websocket/index.js.map +1 -0
  134. package/package.json +31 -0
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Contract Balance Types
3
+ *
4
+ * Types for contract balance management and token information.
5
+ */
6
+ import type { Address } from "viem";
7
+ /**
8
+ * Type representing a token in the Monaco Markets protocol.
9
+ * Contains essential token metadata and contract information.
10
+ *
11
+ * @property address - Token contract address
12
+ * @property symbol - Token symbol (e.g. "ETH", "USDC")
13
+ * @property decimals - Number of decimal places for token amounts
14
+ * @property name - Full token name
15
+ */
16
+ export interface Token {
17
+ /** Token contract address */
18
+ address: Address;
19
+ /** Token symbol (e.g. "ETH", "USDC") */
20
+ symbol: string;
21
+ /** Number of decimal places for token amounts */
22
+ decimals: number;
23
+ /** Full token name */
24
+ name: string;
25
+ }
26
+ /**
27
+ * Type representing a user's balance for a specific token in contract storage.
28
+ *
29
+ * @property token - Token address
30
+ * @property available - Available balance for trading
31
+ * @property locked - Locked balance in open orders
32
+ * @property total - Total balance (available + locked)
33
+ */
34
+ export interface UserBalance {
35
+ /** Token address */
36
+ token: string;
37
+ /** Available balance for trading */
38
+ available: bigint;
39
+ /** Locked balance in open orders */
40
+ locked: bigint;
41
+ /** Total balance (available + locked) */
42
+ total: bigint;
43
+ }
44
+ //# sourceMappingURL=balances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../../src/contracts/balances.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IACpB,6BAA6B;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Contract Balance Types
3
+ *
4
+ * Types for contract balance management and token information.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=balances.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balances.js","sourceRoot":"","sources":["../../src/contracts/balances.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Contract Types
3
+ *
4
+ * Types for contract addresses, instances, and contract-related operations.
5
+ */
6
+ import type { CONTRACT_ABIS } from "@0xmonaco/contracts";
7
+ import type { GetContractReturnType } from "viem";
8
+ /**
9
+ * Interface for all contract addresses in the Monaco Markets protocol.
10
+ *
11
+ * @property VAULT - Vault contract address for managing user balances
12
+ */
13
+ export interface ContractAddresses {
14
+ /** Vault contract address for managing user balances */
15
+ VAULT: string;
16
+ }
17
+ /**
18
+ * Type representing all contract instances.
19
+ * Maps contract names to their typed instances with full ABI type safety.
20
+ *
21
+ * @property vault - Vault contract instance for managing user balances
22
+ */
23
+ export type ContractInstances = {
24
+ /** Vault contract instance for managing user balances */
25
+ vault: GetContractReturnType<typeof CONTRACT_ABIS.vault>;
26
+ };
27
+ export type { Token, UserBalance } from "./balances";
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yDAAyD;IACzD,KAAK,EAAE,qBAAqB,CAAC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;CAC1D,CAAC;AAGF,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Contract Types
3
+ *
4
+ * Types for contract addresses, instances, and contract-related operations.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Fees Types
3
+ *
4
+ * Types for fees operations including fee simulation.
5
+ */
6
+ import type { BaseAPI } from "../api/index";
7
+ import type { SimulateFeeParams, SimulateFeeResponse } from "./responses";
8
+ /**
9
+ * Fees API interface.
10
+ * Provides methods for simulating and calculating trading fees.
11
+ */
12
+ export interface FeesAPI extends BaseAPI {
13
+ /**
14
+ * Simulate fees for an order before placing it.
15
+ * Returns exact fees for that specific order.
16
+ *
17
+ * @param params - Parameters for fee simulation
18
+ * @param params.trading_pair_id - Trading pair ID
19
+ * @param params.side - Order side ("BUY" or "SELL")
20
+ * @param params.price - Price per unit
21
+ * @param params.quantity - Quantity to trade
22
+ * @returns Promise resolving to fee simulation details
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const feeDetails = await feesAPI.simulateFees({
27
+ * trading_pair_id: "123e4567-e89b-12d3-a456-426614174000",
28
+ * side: "BUY",
29
+ * price: "40000.00",
30
+ * quantity: "0.5"
31
+ * });
32
+ * console.log(`Total taker fees: ${feeDetails.total_taker_fees}`);
33
+ * console.log(`Taker must pay: ${feeDetails.taker_total_payment}`);
34
+ * ```
35
+ */
36
+ simulateFees(params: SimulateFeeParams): Promise<SimulateFeeResponse>;
37
+ }
38
+ export type { SimulateFeeParams, SimulateFeeResponse } from "./responses";
39
+ export { SimulateFeeParamsSchema, SimulateFeeResponseSchema } from "./responses";
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fees/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,OAAQ,SAAQ,OAAO;IACtC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvE;AAGD,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Fees Types
3
+ *
4
+ * Types for fees operations including fee simulation.
5
+ */
6
+ export { SimulateFeeParamsSchema, SimulateFeeResponseSchema } from "./responses";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fees/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsCH,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Fees Response Types
3
+ *
4
+ * Types for fees-related API responses.
5
+ * All types are derived from Zod schemas for runtime validation.
6
+ */
7
+ import { z } from "zod";
8
+ /**
9
+ * Zod schema for simulating order fees parameters
10
+ */
11
+ export declare const SimulateFeeParamsSchema: z.ZodObject<{
12
+ trading_pair_id: z.ZodString;
13
+ side: z.ZodEnum<{
14
+ BUY: "BUY";
15
+ SELL: "SELL";
16
+ }>;
17
+ price: z.ZodString;
18
+ quantity: z.ZodString;
19
+ }, z.core.$strip>;
20
+ /**
21
+ * Zod schema for fee simulation response
22
+ */
23
+ export declare const SimulateFeeResponseSchema: z.ZodObject<{
24
+ application_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ application_taker_fee: z.ZodString;
26
+ application_taker_fee_bps: z.ZodNumber;
27
+ buy_order_lock_amount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ maker_total_receipt: z.ZodString;
29
+ monaco_maker_rebate: z.ZodString;
30
+ monaco_maker_rebate_bps: z.ZodNumber;
31
+ monaco_taker_fee: z.ZodString;
32
+ monaco_taker_fee_bps: z.ZodNumber;
33
+ notional: z.ZodString;
34
+ taker_total_payment: z.ZodString;
35
+ total_taker_fees: z.ZodString;
36
+ }, z.core.$strip>;
37
+ /**
38
+ * Parameters for simulating order fees
39
+ * @remarks Type is inferred from SimulateFeeParamsSchema
40
+ */
41
+ export type SimulateFeeParams = z.infer<typeof SimulateFeeParamsSchema>;
42
+ /**
43
+ * Response with detailed fee breakdown for simulating order fees
44
+ * @remarks Type is inferred from SimulateFeeResponseSchema
45
+ */
46
+ export type SimulateFeeResponse = z.infer<typeof SimulateFeeResponseSchema>;
47
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/fees/responses.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;iBAqBlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAyBpC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Fees Response Types
3
+ *
4
+ * Types for fees-related API responses.
5
+ * All types are derived from Zod schemas for runtime validation.
6
+ */
7
+ import { z } from "zod";
8
+ /**
9
+ * Zod schema for simulating order fees parameters
10
+ */
11
+ export const SimulateFeeParamsSchema = z.object({
12
+ /** Trading pair ID */
13
+ trading_pair_id: z.string().trim().min(1, "Trading pair ID is required and cannot be empty"),
14
+ /** Order side: "BUY" or "SELL" */
15
+ side: z.enum(["BUY", "SELL"], {
16
+ message: "Order side is required and must be either 'BUY' or 'SELL'",
17
+ }),
18
+ /** Price per unit */
19
+ price: z
20
+ .string()
21
+ .trim()
22
+ .min(1, "Price is required and cannot be empty")
23
+ .refine((val) => !Number.isNaN(Number(val)), "Price must be a valid number")
24
+ .refine((val) => Number(val) > 0, "Price must be greater than 0"),
25
+ /** Quantity to trade */
26
+ quantity: z
27
+ .string()
28
+ .trim()
29
+ .min(1, "Quantity is required and cannot be empty")
30
+ .refine((val) => !Number.isNaN(Number(val)), "Quantity must be a valid number")
31
+ .refine((val) => Number(val) > 0, "Quantity must be greater than 0"),
32
+ });
33
+ /**
34
+ * Zod schema for fee simulation response
35
+ */
36
+ export const SimulateFeeResponseSchema = z.object({
37
+ /** Application name (if applicable) */
38
+ application_name: z.string().nullable().optional(),
39
+ /** Frontend application taker fee */
40
+ application_taker_fee: z.string(),
41
+ /** Application fee in basis points */
42
+ application_taker_fee_bps: z.number(),
43
+ /** Amount to lock for BUY orders (null for SELL) */
44
+ buy_order_lock_amount: z.string().nullable().optional(),
45
+ /** Total amount maker receives */
46
+ maker_total_receipt: z.string(),
47
+ /** Monaco protocol maker rebate (negative = rebate) */
48
+ monaco_maker_rebate: z.string(),
49
+ /** Monaco maker rebate in basis points */
50
+ monaco_maker_rebate_bps: z.number(),
51
+ /** Monaco protocol taker fee */
52
+ monaco_taker_fee: z.string(),
53
+ /** Monaco taker fee in basis points */
54
+ monaco_taker_fee_bps: z.number(),
55
+ /** Notional value (price * quantity) */
56
+ notional: z.string(),
57
+ /** Total amount taker must pay */
58
+ taker_total_payment: z.string(),
59
+ /** Total taker fees (monaco + application) */
60
+ total_taker_fees: z.string(),
61
+ });
62
+ //# sourceMappingURL=responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/fees/responses.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,sBAAsB;IACtB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,iDAAiD,CAAC;IAC5F,kCAAkC;IAClC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE;QAC5B,OAAO,EAAE,2DAA2D;KACrE,CAAC;IACF,qBAAqB;IACrB,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,uCAAuC,CAAC;SAC/C,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,8BAA8B,CAA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AkC;IAClC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,8CAA8C;IAC9C,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC7B,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Monaco Types Package
3
+ *
4
+ * This package provides TypeScript types for the Monaco protocol.
5
+ * It includes SDK types, vault types, trading types, contract types, and common types.
6
+ */
7
+ export * from "./api";
8
+ export * from "./applications";
9
+ export * from "./auth";
10
+ export * from "./contracts";
11
+ export * from "./fees";
12
+ export * from "./market";
13
+ export * from "./profile";
14
+ export * from "./sdk";
15
+ export * from "./trading";
16
+ export * from "./validation";
17
+ export * from "./vault";
18
+ export * from "./websocket";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Monaco Types Package
3
+ *
4
+ * This package provides TypeScript types for the Monaco protocol.
5
+ * It includes SDK types, vault types, trading types, contract types, and common types.
6
+ */
7
+ // Export everything from all modules
8
+ export * from "./api";
9
+ export * from "./applications";
10
+ export * from "./auth";
11
+ export * from "./contracts";
12
+ export * from "./fees";
13
+ export * from "./market";
14
+ export * from "./profile";
15
+ export * from "./sdk";
16
+ export * from "./trading";
17
+ export * from "./validation";
18
+ export * from "./vault";
19
+ export * from "./websocket";
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qCAAqC;AACrC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Market Types
3
+ *
4
+ * Types for market data operations including trading pair metadata and OHLCV data.
5
+ */
6
+ import type { BaseAPI } from "../api";
7
+ /**
8
+ * Trading pair metadata
9
+ */
10
+ export interface TradingPair {
11
+ /** Unique identifier */
12
+ id: string;
13
+ /** Trading pair symbol e.g. BTC/USDC */
14
+ symbol: string;
15
+ /** Base token symbol */
16
+ base_token: string;
17
+ /** Quote token symbol */
18
+ quote_token: string;
19
+ /** Base asset ID (UUID) */
20
+ base_asset_id: string;
21
+ /** Quote asset ID (UUID) */
22
+ quote_asset_id: string;
23
+ /** Base token contract address */
24
+ base_token_contract: string;
25
+ /** Quote token contract address */
26
+ quote_token_contract: string;
27
+ /** Base token decimals */
28
+ base_decimals: number;
29
+ /** Base token icon URL */
30
+ base_icon_url: string;
31
+ /** Quote token decimals */
32
+ quote_decimals: number;
33
+ /** Quote token icon URL */
34
+ quote_icon_url: string;
35
+ /** Market type (e.g. SPOT) */
36
+ market_type: string;
37
+ /** Whether the market is active */
38
+ is_active: boolean;
39
+ /** Maker fee in basis points */
40
+ maker_fee_bps: number;
41
+ /** Taker fee in basis points */
42
+ taker_fee_bps: number;
43
+ /** Minimum order size */
44
+ min_order_size: string;
45
+ /** Maximum order size */
46
+ max_order_size: string;
47
+ /** Tick size for price increments */
48
+ tick_size: string;
49
+ }
50
+ /**
51
+ * OHLCV candlestick data point (matches API response format)
52
+ *
53
+ * Note: Field naming follows backend API format where:
54
+ * - T = Start timestamp (open_time from backend)
55
+ * - t = End timestamp (close_time from backend)
56
+ */
57
+ export interface Candlestick {
58
+ /** Start timestamp for the candlestick period (Unix timestamp in milliseconds) */
59
+ T: number;
60
+ /** End timestamp for the candlestick period (Unix timestamp in milliseconds) */
61
+ t: number;
62
+ /** Opening price */
63
+ o: string;
64
+ /** Highest price during the period */
65
+ h: string;
66
+ /** Lowest price during the period */
67
+ l: string;
68
+ /** Closing price */
69
+ c: string;
70
+ /** Volume traded during the period */
71
+ v: string;
72
+ /** Symbol */
73
+ s: string;
74
+ /** Interval */
75
+ i: string;
76
+ /** Number of trades */
77
+ n: number;
78
+ }
79
+ /**
80
+ * Supported candlestick intervals
81
+ */
82
+ export type Interval = "1m" | "5m" | "15m" | "1h" | "4h" | "1d";
83
+ /**
84
+ * Candlestick subscription configuration
85
+ */
86
+ export interface CandlestickSubscription {
87
+ /** Trading pair ID (UUID) */
88
+ tradingPairId: string;
89
+ /** Candlestick interval */
90
+ interval: Interval;
91
+ }
92
+ /**
93
+ * Query parameters for fetching candlestick data
94
+ *
95
+ * All parameters are optional and can be used independently:
96
+ * - Use `endTime` + `limit` for backward pagination (TradingView primary pattern)
97
+ * - Use `startTime` + `limit` for forward pagination
98
+ * - Use just `limit` for most recent bars
99
+ * - Use `startTime` + `endTime` + `limit` for a specific range (capped at limit)
100
+ */
101
+ export interface GetCandlesticksParams {
102
+ /** Start time (Unix ms). Use with `limit` for forward pagination from this timestamp. */
103
+ startTime?: number;
104
+ /** End time (Unix ms). Use with `limit` for backward pagination ending at this timestamp. */
105
+ endTime?: number;
106
+ /** Maximum number of bars to return (max: 500, server defaults to 350 if omitted) */
107
+ limit?: number;
108
+ }
109
+ /**
110
+ * Query parameters for fetching trading pairs
111
+ */
112
+ export interface GetTradingPairsParams {
113
+ /** Page number (starts from 1) */
114
+ page?: number;
115
+ /** Number of items per page (max 100) */
116
+ limit?: number;
117
+ /** Filter by market type (SPOT, MARGIN) */
118
+ market_type?: string;
119
+ /** Filter by base token symbol */
120
+ base_token?: string;
121
+ /** Filter by quote token symbol */
122
+ quote_token?: string;
123
+ /** Filter by active status */
124
+ is_active?: boolean;
125
+ }
126
+ /**
127
+ * Paginated response for trading pairs
128
+ */
129
+ export interface PaginatedTradingPairs {
130
+ data: TradingPair[];
131
+ limit: number;
132
+ page: number;
133
+ total: number;
134
+ total_pages: number;
135
+ }
136
+ /**
137
+ * API response wrapper for trading pairs
138
+ */
139
+ export interface GetTradingPairsResponse {
140
+ data: PaginatedTradingPairs;
141
+ success: boolean;
142
+ }
143
+ /**
144
+ * API response wrapper for single trading pair
145
+ */
146
+ export interface GetTradingPairResponse {
147
+ data: TradingPair;
148
+ success: boolean;
149
+ }
150
+ /**
151
+ * API response wrapper for single trading pair
152
+ */
153
+ export interface GetCandlestickResponse {
154
+ data: Candlestick[];
155
+ success: boolean;
156
+ }
157
+ /**
158
+ * Market metadata with 24-hour statistics
159
+ */
160
+ export interface MarketMetadata {
161
+ /** Trading pair symbol (e.g., "BTC/USDC") */
162
+ symbol: string;
163
+ /** Base token icon URL */
164
+ base_icon_url: string;
165
+ /** Quote token icon URL */
166
+ quote_icon_url: string;
167
+ /** Current price (8 decimal precision) */
168
+ last_price: string;
169
+ /** Unix timestamp (ms) of latest price */
170
+ last_price_timestamp: number;
171
+ /** 24h high price (null if <24h data) */
172
+ high_24h: string | null;
173
+ /** 24h low price (null if <24h data) */
174
+ low_24h: string | null;
175
+ /** 24h volume in base asset (null if <24h data) */
176
+ volume_24h: string | null;
177
+ /** Absolute price change in 24h (null if <24h data) */
178
+ price_change_24h: string | null;
179
+ /** Percentage price change in 24h (2 decimals, null if <24h data) */
180
+ price_change_percent_24h: string | null;
181
+ /** Unix timestamp (ms) when market started trading (null if not available) */
182
+ market_initialization_timestamp: number | null;
183
+ }
184
+ /**
185
+ * Market API interface.
186
+ * Provides methods for fetching market metadata and trading pair information.
187
+ */
188
+ export interface MarketAPI extends BaseAPI {
189
+ /**
190
+ * Fetch all available trading pairs supported by Monaco.
191
+ * @param params - Optional query parameters for filtering and pagination
192
+ * @returns Promise resolving to paginated response with trading pairs
193
+ */
194
+ getPaginatedTradingPairs(params?: GetTradingPairsParams): Promise<GetTradingPairsResponse>;
195
+ /**
196
+ * Fetch metadata for a single trading pair by its symbol (e.g. BTC-USDC).
197
+ * @param symbol - Trading pair symbol
198
+ * @returns Promise resolving to trading pair or undefined if not found
199
+ */
200
+ getTradingPairBySymbol(symbol: string): Promise<TradingPair | undefined>;
201
+ /**
202
+ * Fetch historical candlestick data for a trading pair.
203
+ *
204
+ * Supports TradingView-compliant query patterns:
205
+ * - `endTime` + `limit`: Backward pagination (bars ending at timestamp)
206
+ * - `startTime` + `limit`: Forward pagination (bars starting from timestamp)
207
+ * - `limit` only: Most recent bars
208
+ * - `startTime` + `endTime` + `limit`: Specific range (capped at limit)
209
+ *
210
+ * @param tradingPairId - Trading pair UUID
211
+ * @param interval - Candlestick interval (1m, 5m, 15m, 1h, 4h, 1d)
212
+ * @param params - Optional query parameters (startTime, endTime, limit). Server defaults to 350 bars if limit omitted.
213
+ * @returns Promise resolving to array of candlesticks (oldest to newest)
214
+ */
215
+ getCandlesticks(tradingPairId: string, interval: Interval, params?: GetCandlesticksParams): Promise<Candlestick[]>;
216
+ /**
217
+ * Get comprehensive market metadata including 24h statistics.
218
+ * @param tradingPairId - Trading pair UUID
219
+ * @returns Promise resolving to market metadata with current price and 24h stats
220
+ * @throws {ApiError} If pair not found or no data available
221
+ */
222
+ getMarketMetadata(tradingPairId: string): Promise<MarketMetadata>;
223
+ }
224
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/market/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAA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AE,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEnH;;;;;OAKG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACnE"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Market Types
3
+ *
4
+ * Types for market data operations including trading pair metadata and OHLCV data.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/market/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}