@0xmonaco/types 0.8.14 → 0.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/applications/requests.d.ts +15 -15
- package/dist/applications/responses.d.ts +52 -52
- package/dist/delegated-agents/index.d.ts +21 -21
- package/dist/faucet/index.d.ts +4 -4
- package/dist/fees/index.d.ts +4 -4
- package/dist/fees/responses.d.ts +17 -17
- package/dist/fees/responses.js +20 -20
- package/dist/margin-accounts/index.d.ts +42 -42
- package/dist/market/index.d.ts +122 -123
- package/dist/positions/index.d.ts +51 -51
- package/dist/profile/index.d.ts +98 -90
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sub-accounts/index.d.ts +19 -19
- package/dist/trading/index.d.ts +2 -2
- package/dist/trading/orders.d.ts +20 -20
- package/dist/trading/responses.d.ts +74 -74
- package/dist/validation/margin-accounts.d.ts +5 -5
- package/dist/validation/margin-accounts.js +3 -3
- package/dist/validation/market.d.ts +1 -1
- package/dist/validation/market.js +1 -1
- package/dist/validation/positions.d.ts +7 -7
- package/dist/validation/positions.js +6 -6
- package/dist/validation/profile.d.ts +10 -10
- package/dist/validation/profile.js +10 -10
- package/dist/validation/trading.d.ts +9 -9
- package/dist/validation/trading.js +9 -9
- package/dist/whitelist/index.d.ts +4 -4
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +1 -0
- package/dist/wire/schema.d.ts +941 -821
- package/dist/withdrawals/index.d.ts +58 -5
- package/package.json +2 -2
|
@@ -12,17 +12,17 @@ export interface ListAppOrdersParams {
|
|
|
12
12
|
/** Page number (starts from 1) */
|
|
13
13
|
page?: number;
|
|
14
14
|
/** Items per page (max 100) */
|
|
15
|
-
|
|
15
|
+
pageSize?: number;
|
|
16
16
|
/** Filter by order status (e.g. SUBMITTED, PARTIALLY_FILLED, FILLED, SETTLED, CANCELLED, EXPIRED, REJECTED) */
|
|
17
17
|
status?: string;
|
|
18
18
|
/** Filter by user UUID */
|
|
19
|
-
|
|
19
|
+
userId?: string;
|
|
20
20
|
/** Filter by trading pair UUID */
|
|
21
|
-
|
|
21
|
+
tradingPairId?: string;
|
|
22
22
|
/** Filter by order side: BUY or SELL */
|
|
23
23
|
side?: string;
|
|
24
24
|
/** Filter by order type (e.g. LIMIT, MARKET, STOP_LOSS, TAKE_PROFIT, STOP_LIMIT, TRAILING_STOP) */
|
|
25
|
-
|
|
25
|
+
orderType?: string;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Query parameters for listing application users.
|
|
@@ -31,11 +31,11 @@ export interface ListAppUsersParams {
|
|
|
31
31
|
/** Page number (starts from 1) */
|
|
32
32
|
page?: number;
|
|
33
33
|
/** Items per page (max 100) */
|
|
34
|
-
|
|
34
|
+
pageSize?: number;
|
|
35
35
|
/** Filter by active status */
|
|
36
|
-
|
|
36
|
+
isActive?: boolean;
|
|
37
37
|
/** Filter by account type: master or sub */
|
|
38
|
-
|
|
38
|
+
accountType?: string;
|
|
39
39
|
/** Filter by wallet address (partial match, case-insensitive) */
|
|
40
40
|
address?: string;
|
|
41
41
|
}
|
|
@@ -46,15 +46,15 @@ export interface ListAppMovementsParams {
|
|
|
46
46
|
/** Page number (starts from 1) */
|
|
47
47
|
page?: number;
|
|
48
48
|
/** Items per page (max 100) */
|
|
49
|
-
|
|
49
|
+
pageSize?: number;
|
|
50
50
|
/** Filter by user UUID */
|
|
51
|
-
|
|
51
|
+
userId?: string;
|
|
52
52
|
/** Filter by transaction type (e.g. DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD) */
|
|
53
|
-
|
|
53
|
+
transactionType?: string;
|
|
54
54
|
/** Filter by entry type (e.g. CREDIT, DEBIT, LOCK, UNLOCK, FEE) */
|
|
55
|
-
|
|
55
|
+
entryType?: string;
|
|
56
56
|
/** Filter by asset UUID */
|
|
57
|
-
|
|
57
|
+
assetId?: string;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Query parameters for listing application balances.
|
|
@@ -63,11 +63,11 @@ export interface ListAppBalancesParams {
|
|
|
63
63
|
/** Page number (starts from 1) */
|
|
64
64
|
page?: number;
|
|
65
65
|
/** Items per page (max 100) */
|
|
66
|
-
|
|
66
|
+
pageSize?: number;
|
|
67
67
|
/** Filter by user UUID */
|
|
68
|
-
|
|
68
|
+
userId?: string;
|
|
69
69
|
/** Filter by asset UUID */
|
|
70
|
-
|
|
70
|
+
assetId?: string;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Query parameters for application stats.
|
|
@@ -30,11 +30,11 @@ export interface AppOrder {
|
|
|
30
30
|
/** Order UUID */
|
|
31
31
|
id: string;
|
|
32
32
|
/** User UUID who placed the order */
|
|
33
|
-
|
|
33
|
+
userId: string;
|
|
34
34
|
/** Trading pair UUID */
|
|
35
|
-
|
|
35
|
+
tradingPairId: string;
|
|
36
36
|
/** Order type: LIMIT, MARKET, STOP_LOSS, TAKE_PROFIT, STOP_LIMIT, or TRAILING_STOP */
|
|
37
|
-
|
|
37
|
+
orderType: string;
|
|
38
38
|
/** Order side: BUY or SELL */
|
|
39
39
|
side: string;
|
|
40
40
|
/** Order price (null for market orders) */
|
|
@@ -42,23 +42,23 @@ export interface AppOrder {
|
|
|
42
42
|
/** Order quantity (normalized for display) */
|
|
43
43
|
quantity: string;
|
|
44
44
|
/** Order quantity in raw format (for precision) */
|
|
45
|
-
|
|
45
|
+
quantityRaw: string;
|
|
46
46
|
/** Filled quantity (normalized for display) */
|
|
47
|
-
|
|
47
|
+
filledQuantity: string | null;
|
|
48
48
|
/** Filled quantity in raw format */
|
|
49
|
-
|
|
49
|
+
filledQuantityRaw: string | null;
|
|
50
50
|
/** Volume-weighted average fill price */
|
|
51
|
-
|
|
51
|
+
averageFillPrice: string | null;
|
|
52
52
|
/** Order status */
|
|
53
53
|
status: string;
|
|
54
54
|
/** Trading mode: SPOT or MARGIN */
|
|
55
|
-
|
|
55
|
+
tradingMode: string;
|
|
56
56
|
/** Time in force: GTC, IOC, or FOK */
|
|
57
|
-
|
|
57
|
+
timeInForce: string | null;
|
|
58
58
|
/** Order creation timestamp (ISO 8601) */
|
|
59
|
-
|
|
59
|
+
createdAt: string | null;
|
|
60
60
|
/** Order last update timestamp (ISO 8601) */
|
|
61
|
-
|
|
61
|
+
updatedAt: string | null;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* One user belonging to an application.
|
|
@@ -71,21 +71,21 @@ export interface AppUser {
|
|
|
71
71
|
/** Display username */
|
|
72
72
|
username: string | null;
|
|
73
73
|
/** Account type: master or sub */
|
|
74
|
-
|
|
74
|
+
accountType: string;
|
|
75
75
|
/** Whether the user is allowed to withdraw */
|
|
76
|
-
|
|
76
|
+
canWithdraw: boolean;
|
|
77
77
|
/** Account creation timestamp (ISO 8601) */
|
|
78
|
-
|
|
78
|
+
createdAt: string | null;
|
|
79
79
|
/** Email address */
|
|
80
80
|
email: string | null;
|
|
81
81
|
/** Whether the user account is active */
|
|
82
|
-
|
|
82
|
+
isActive: boolean | null;
|
|
83
83
|
/** Whether the user is banned */
|
|
84
|
-
|
|
84
|
+
isBanned: boolean | null;
|
|
85
85
|
/** Master account ID (for sub-accounts) */
|
|
86
|
-
|
|
86
|
+
masterAccountId: string | null;
|
|
87
87
|
/** Last update timestamp (ISO 8601) */
|
|
88
|
-
|
|
88
|
+
updatedAt: string | null;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* One ledger movement (deposit, withdrawal, trade, etc.) for an application.
|
|
@@ -94,68 +94,68 @@ export interface AppMovement {
|
|
|
94
94
|
/** Transaction amount */
|
|
95
95
|
amount: string;
|
|
96
96
|
/** Balance after this transaction */
|
|
97
|
-
|
|
97
|
+
balanceAfter: string | null;
|
|
98
98
|
/** Balance before this transaction */
|
|
99
|
-
|
|
99
|
+
balanceBefore: string | null;
|
|
100
100
|
/** Balance UUID this movement affects */
|
|
101
|
-
|
|
101
|
+
balanceId: string;
|
|
102
102
|
/** Blockchain block number */
|
|
103
|
-
|
|
103
|
+
blockNumber: number | null;
|
|
104
104
|
/** Transaction timestamp (ISO 8601) */
|
|
105
|
-
|
|
105
|
+
createdAt: string | null;
|
|
106
106
|
/** Human readable description */
|
|
107
107
|
description: string | null;
|
|
108
108
|
/** Type of ledger entry */
|
|
109
|
-
|
|
109
|
+
entryType: string;
|
|
110
110
|
/** Movement UUID */
|
|
111
111
|
id: string;
|
|
112
112
|
/** Locked balance after transaction */
|
|
113
|
-
|
|
113
|
+
lockedAfter: string | null;
|
|
114
114
|
/** Locked balance before transaction */
|
|
115
|
-
|
|
115
|
+
lockedBefore: string | null;
|
|
116
116
|
/** Reference identifier for related operations */
|
|
117
|
-
|
|
117
|
+
referenceId: string | null;
|
|
118
118
|
/** Reference type */
|
|
119
|
-
|
|
119
|
+
referenceType: string | null;
|
|
120
120
|
/** Token address */
|
|
121
121
|
token: Address;
|
|
122
122
|
/** Type of transaction */
|
|
123
|
-
|
|
123
|
+
transactionType: string;
|
|
124
124
|
/** Blockchain transaction hash */
|
|
125
|
-
|
|
125
|
+
txHash: string | null;
|
|
126
126
|
/** User UUID who owns this movement */
|
|
127
|
-
|
|
127
|
+
userId: string;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* One user balance held within an application.
|
|
131
131
|
*/
|
|
132
132
|
export interface AppBalance {
|
|
133
133
|
/** Available balance for trading */
|
|
134
|
-
|
|
134
|
+
availableBalance: string;
|
|
135
135
|
/** Balance creation timestamp (ISO 8601) */
|
|
136
|
-
|
|
136
|
+
createdAt: string | null;
|
|
137
137
|
/** Token decimals */
|
|
138
138
|
decimals: number;
|
|
139
139
|
/** Balance UUID */
|
|
140
140
|
id: string;
|
|
141
141
|
/** Last sync timestamp (ISO 8601) */
|
|
142
|
-
|
|
142
|
+
lastSyncAt: string | null;
|
|
143
143
|
/** Last sync block number */
|
|
144
|
-
|
|
144
|
+
lastSyncBlock: number | null;
|
|
145
145
|
/** Locked balance */
|
|
146
|
-
|
|
146
|
+
lockedBalance: string;
|
|
147
147
|
/** On-chain balance */
|
|
148
|
-
|
|
148
|
+
onChainBalance: string;
|
|
149
149
|
/** Token symbol */
|
|
150
150
|
symbol: string | null;
|
|
151
151
|
/** Token address */
|
|
152
152
|
token: Address;
|
|
153
153
|
/** Total balance */
|
|
154
|
-
|
|
154
|
+
totalBalance: string;
|
|
155
155
|
/** Balance last update timestamp (ISO 8601) */
|
|
156
|
-
|
|
156
|
+
updatedAt: string | null;
|
|
157
157
|
/** User UUID who owns this balance */
|
|
158
|
-
|
|
158
|
+
userId: string;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Paginated list of application orders.
|
|
@@ -167,9 +167,9 @@ export interface ListAppOrdersResponse {
|
|
|
167
167
|
/** Current page number */
|
|
168
168
|
page: number;
|
|
169
169
|
/** Items per page */
|
|
170
|
-
|
|
170
|
+
pageSize: number;
|
|
171
171
|
/** Total number of pages */
|
|
172
|
-
|
|
172
|
+
totalPages: number;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Paginated list of application users.
|
|
@@ -181,9 +181,9 @@ export interface ListAppUsersResponse {
|
|
|
181
181
|
/** Current page number */
|
|
182
182
|
page: number;
|
|
183
183
|
/** Items per page */
|
|
184
|
-
|
|
184
|
+
pageSize: number;
|
|
185
185
|
/** Total number of pages */
|
|
186
|
-
|
|
186
|
+
totalPages: number;
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Paginated list of application movements.
|
|
@@ -195,9 +195,9 @@ export interface ListAppMovementsResponse {
|
|
|
195
195
|
/** Current page number */
|
|
196
196
|
page: number;
|
|
197
197
|
/** Items per page */
|
|
198
|
-
|
|
198
|
+
pageSize: number;
|
|
199
199
|
/** Total number of pages */
|
|
200
|
-
|
|
200
|
+
totalPages: number;
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
* Paginated list of application balances.
|
|
@@ -209,9 +209,9 @@ export interface ListAppBalancesResponse {
|
|
|
209
209
|
/** Current page number */
|
|
210
210
|
page: number;
|
|
211
211
|
/** Items per page */
|
|
212
|
-
|
|
212
|
+
pageSize: number;
|
|
213
213
|
/** Total number of pages */
|
|
214
|
-
|
|
214
|
+
totalPages: number;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
217
|
* Aggregate volume and fee stats for an application.
|
|
@@ -223,11 +223,11 @@ export interface GetAppStatsResponse {
|
|
|
223
223
|
/** Total quote volume for trades where this application's users were the taker */
|
|
224
224
|
volume: string;
|
|
225
225
|
/** Total maker fees collected */
|
|
226
|
-
|
|
226
|
+
makerFee: string;
|
|
227
227
|
/** Total taker fees collected */
|
|
228
|
-
|
|
228
|
+
takerFee: string;
|
|
229
229
|
/** Application revenue share from taker fees */
|
|
230
|
-
|
|
230
|
+
applicationTakerFee: string;
|
|
231
231
|
/** Total number of trades */
|
|
232
|
-
|
|
232
|
+
tradeCount: number;
|
|
233
233
|
}
|
|
@@ -16,30 +16,30 @@ export interface UpsertDelegatedAgentRequest {
|
|
|
16
16
|
}
|
|
17
17
|
export interface DelegatedAgent {
|
|
18
18
|
id: string;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
ownerUserId: string;
|
|
20
|
+
agentAddress: Address;
|
|
21
21
|
name?: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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;
|
|
33
33
|
}
|
|
34
34
|
export interface ListDelegatedAgentsResponse {
|
|
35
35
|
agents: DelegatedAgent[];
|
|
36
36
|
}
|
|
37
37
|
export interface DelegatedAgentOwner {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
ownerUserId: string;
|
|
39
|
+
delegationId: string;
|
|
40
40
|
name?: string;
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
isActive: boolean;
|
|
42
|
+
expiresAt?: string;
|
|
43
43
|
}
|
|
44
44
|
export interface ListDelegatedOwnersResponse {
|
|
45
45
|
owners: DelegatedAgentOwner[];
|
|
@@ -54,10 +54,10 @@ export interface CreateDelegatedSessionRequest {
|
|
|
54
54
|
sessionPublicKey: string;
|
|
55
55
|
}
|
|
56
56
|
export interface CreateDelegatedSessionResponse {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
expiresAt: number;
|
|
58
|
+
delegationId: string;
|
|
59
|
+
ownerUserId: string;
|
|
60
|
+
agentAddress: Address;
|
|
61
61
|
}
|
|
62
62
|
export interface DelegatedAgentsAPI extends BaseAPI {
|
|
63
63
|
upsertDelegatedAgent(request: UpsertDelegatedAgentRequest): Promise<DelegatedAgent>;
|
package/dist/faucet/index.d.ts
CHANGED
|
@@ -12,18 +12,18 @@ import type { BaseAPI } from "../api";
|
|
|
12
12
|
/** A token successfully minted by the faucet. */
|
|
13
13
|
export interface MintedToken {
|
|
14
14
|
/** Asset UUID */
|
|
15
|
-
|
|
15
|
+
assetId: string;
|
|
16
16
|
/** Token symbol */
|
|
17
17
|
symbol: string;
|
|
18
18
|
/** Amount minted in token units */
|
|
19
19
|
amount: string;
|
|
20
20
|
/** On-chain transaction hash */
|
|
21
|
-
|
|
21
|
+
txHash: string;
|
|
22
22
|
}
|
|
23
23
|
/** A token the faucet failed to mint. */
|
|
24
24
|
export interface FailedMint {
|
|
25
25
|
/** Asset UUID */
|
|
26
|
-
|
|
26
|
+
assetId: string;
|
|
27
27
|
/** Token symbol */
|
|
28
28
|
symbol: string;
|
|
29
29
|
/** Error message describing why the mint failed */
|
|
@@ -36,7 +36,7 @@ export interface MintTokensResponse {
|
|
|
36
36
|
/** Tokens that failed to mint */
|
|
37
37
|
failed: FailedMint[];
|
|
38
38
|
/** Remaining faucet requests in the next 24h */
|
|
39
|
-
|
|
39
|
+
remainingRequests24h: number;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Faucet API interface. Session-authenticated.
|
package/dist/fees/index.d.ts
CHANGED
|
@@ -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.
|
|
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
|
-
*
|
|
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.
|
|
33
|
-
* console.log(`Taker must pay: ${feeDetails.
|
|
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>;
|
package/dist/fees/responses.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
19
|
+
orderType: z.ZodOptional<z.ZodEnum<{
|
|
20
20
|
LIMIT: "LIMIT";
|
|
21
21
|
MARKET: "MARKET";
|
|
22
22
|
}>>;
|
|
23
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
package/dist/fees/responses.js
CHANGED
|
@@ -11,7 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
export const SimulateFeeParamsSchema = z
|
|
12
12
|
.object({
|
|
13
13
|
/** Trading pair ID */
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
44
|
+
if (data.slippageToleranceBps !== undefined && data.orderType !== "MARKET") {
|
|
45
45
|
ctx.addIssue({
|
|
46
46
|
code: z.ZodIssueCode.custom,
|
|
47
|
-
message: "
|
|
48
|
-
path: ["
|
|
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
|
-
|
|
57
|
+
applicationName: z.string().nullable().optional(),
|
|
58
58
|
/** Frontend application taker fee */
|
|
59
|
-
|
|
59
|
+
applicationTakerFee: z.string(),
|
|
60
60
|
/** Application fee in basis points */
|
|
61
|
-
|
|
61
|
+
applicationTakerFeeBps: z.number(),
|
|
62
62
|
/** Amount to lock for BUY orders (null for `SELL`) */
|
|
63
|
-
|
|
63
|
+
buyOrderLockAmount: z.string().nullable().optional(),
|
|
64
64
|
/** Total amount maker receives */
|
|
65
|
-
|
|
65
|
+
makerTotalReceipt: z.string(),
|
|
66
66
|
/** Monaco protocol maker rebate (negative = rebate) */
|
|
67
|
-
|
|
67
|
+
monacoMakerRebate: z.string(),
|
|
68
68
|
/** Monaco maker rebate in basis points */
|
|
69
|
-
|
|
69
|
+
monacoMakerRebateBps: z.number(),
|
|
70
70
|
/** Monaco protocol taker fee */
|
|
71
|
-
|
|
71
|
+
monacoTakerFee: z.string(),
|
|
72
72
|
/** Monaco taker fee in basis points */
|
|
73
|
-
|
|
73
|
+
monacoTakerFeeBps: z.number(),
|
|
74
74
|
/** Notional value (price * quantity) */
|
|
75
75
|
notional: z.string(),
|
|
76
76
|
/** Total amount taker must pay */
|
|
77
|
-
|
|
77
|
+
takerTotalPayment: z.string(),
|
|
78
78
|
/** Total taker fees (monaco + application) */
|
|
79
|
-
|
|
79
|
+
totalTakerFees: z.string(),
|
|
80
80
|
/** Maximum quantity affordable at the given price, accounting for fees (null if not authenticated or balance unavailable) */
|
|
81
|
-
|
|
81
|
+
maxQuantity: z.string().nullable(),
|
|
82
82
|
/** Maximum quantity in RAW (smallest unit) format */
|
|
83
|
-
|
|
83
|
+
maxQuantityRaw: z.string().nullable(),
|
|
84
84
|
/** Slippage tolerance used in the calculation, echoed back for MARKET orders (null for LIMIT orders) */
|
|
85
|
-
|
|
85
|
+
slippageToleranceBps: z.number().nullable(),
|
|
86
86
|
});
|