@0xmonaco/types 0.8.11 → 0.8.15
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 +57 -56
- package/dist/auth/responses.d.ts +2 -1
- package/dist/contracts/balances.d.ts +1 -1
- package/dist/delegated-agents/index.d.ts +22 -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 +78 -46
- package/dist/market/index.d.ts +132 -129
- package/dist/positions/index.d.ts +67 -45
- package/dist/profile/index.d.ts +92 -89
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sub-accounts/index.d.ts +22 -21
- package/dist/trading/index.d.ts +6 -6
- package/dist/trading/orders.d.ts +20 -20
- package/dist/trading/responses.d.ts +79 -79
- package/dist/validation/margin-accounts.d.ts +47 -5
- package/dist/validation/margin-accounts.js +34 -8
- package/dist/validation/market.d.ts +1 -1
- package/dist/validation/market.js +1 -1
- package/dist/validation/positions.d.ts +11 -7
- package/dist/validation/positions.js +10 -6
- package/dist/validation/profile.d.ts +10 -10
- package/dist/validation/profile.js +10 -10
- package/dist/validation/trading.d.ts +17 -17
- package/dist/validation/trading.js +36 -36
- package/dist/validation/vault.d.ts +4 -0
- package/dist/validation/vault.js +1 -0
- package/dist/vault/index.d.ts +33 -12
- package/dist/vault/responses.d.ts +50 -12
- package/dist/websocket/events/balance-events.d.ts +2 -1
- package/dist/websocket/events/movement-events.d.ts +2 -1
- package/dist/whitelist/index.d.ts +4 -4
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +9 -2
- package/dist/wire/schema.d.ts +1323 -853
- package/dist/withdrawals/index.d.ts +83 -12
- 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.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* backend-authenticated application reporting endpoints. Reporting types use
|
|
6
6
|
* the wire shape (snake_case); optional fields are `null` rather than omitted.
|
|
7
7
|
*/
|
|
8
|
+
import type { Address } from "viem";
|
|
8
9
|
/**
|
|
9
10
|
* Response to an application configuration request.
|
|
10
11
|
*/
|
|
@@ -18,7 +19,7 @@ export interface ApplicationConfigResponse {
|
|
|
18
19
|
/** Webhook URL for receiving events (optional) */
|
|
19
20
|
webhookUrl?: string;
|
|
20
21
|
/** Vault contract address */
|
|
21
|
-
vaultContractAddress:
|
|
22
|
+
vaultContractAddress: Address;
|
|
22
23
|
/** Application client ID, embedded in on-chain deposit calls */
|
|
23
24
|
clientId: string;
|
|
24
25
|
}
|
|
@@ -29,11 +30,11 @@ export interface AppOrder {
|
|
|
29
30
|
/** Order UUID */
|
|
30
31
|
id: string;
|
|
31
32
|
/** User UUID who placed the order */
|
|
32
|
-
|
|
33
|
+
userId: string;
|
|
33
34
|
/** Trading pair UUID */
|
|
34
|
-
|
|
35
|
+
tradingPairId: string;
|
|
35
36
|
/** Order type: LIMIT, MARKET, STOP_LOSS, TAKE_PROFIT, STOP_LIMIT, or TRAILING_STOP */
|
|
36
|
-
|
|
37
|
+
orderType: string;
|
|
37
38
|
/** Order side: BUY or SELL */
|
|
38
39
|
side: string;
|
|
39
40
|
/** Order price (null for market orders) */
|
|
@@ -41,23 +42,23 @@ export interface AppOrder {
|
|
|
41
42
|
/** Order quantity (normalized for display) */
|
|
42
43
|
quantity: string;
|
|
43
44
|
/** Order quantity in raw format (for precision) */
|
|
44
|
-
|
|
45
|
+
quantityRaw: string;
|
|
45
46
|
/** Filled quantity (normalized for display) */
|
|
46
|
-
|
|
47
|
+
filledQuantity: string | null;
|
|
47
48
|
/** Filled quantity in raw format */
|
|
48
|
-
|
|
49
|
+
filledQuantityRaw: string | null;
|
|
49
50
|
/** Volume-weighted average fill price */
|
|
50
|
-
|
|
51
|
+
averageFillPrice: string | null;
|
|
51
52
|
/** Order status */
|
|
52
53
|
status: string;
|
|
53
54
|
/** Trading mode: SPOT or MARGIN */
|
|
54
|
-
|
|
55
|
+
tradingMode: string;
|
|
55
56
|
/** Time in force: GTC, IOC, or FOK */
|
|
56
|
-
|
|
57
|
+
timeInForce: string | null;
|
|
57
58
|
/** Order creation timestamp (ISO 8601) */
|
|
58
|
-
|
|
59
|
+
createdAt: string | null;
|
|
59
60
|
/** Order last update timestamp (ISO 8601) */
|
|
60
|
-
|
|
61
|
+
updatedAt: string | null;
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
63
64
|
* One user belonging to an application.
|
|
@@ -66,25 +67,25 @@ export interface AppUser {
|
|
|
66
67
|
/** User UUID */
|
|
67
68
|
id: string;
|
|
68
69
|
/** Wallet address */
|
|
69
|
-
address:
|
|
70
|
+
address: Address;
|
|
70
71
|
/** Display username */
|
|
71
72
|
username: string | null;
|
|
72
73
|
/** Account type: master or sub */
|
|
73
|
-
|
|
74
|
+
accountType: string;
|
|
74
75
|
/** Whether the user is allowed to withdraw */
|
|
75
|
-
|
|
76
|
+
canWithdraw: boolean;
|
|
76
77
|
/** Account creation timestamp (ISO 8601) */
|
|
77
|
-
|
|
78
|
+
createdAt: string | null;
|
|
78
79
|
/** Email address */
|
|
79
80
|
email: string | null;
|
|
80
81
|
/** Whether the user account is active */
|
|
81
|
-
|
|
82
|
+
isActive: boolean | null;
|
|
82
83
|
/** Whether the user is banned */
|
|
83
|
-
|
|
84
|
+
isBanned: boolean | null;
|
|
84
85
|
/** Master account ID (for sub-accounts) */
|
|
85
|
-
|
|
86
|
+
masterAccountId: string | null;
|
|
86
87
|
/** Last update timestamp (ISO 8601) */
|
|
87
|
-
|
|
88
|
+
updatedAt: string | null;
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* One ledger movement (deposit, withdrawal, trade, etc.) for an application.
|
|
@@ -93,68 +94,68 @@ export interface AppMovement {
|
|
|
93
94
|
/** Transaction amount */
|
|
94
95
|
amount: string;
|
|
95
96
|
/** Balance after this transaction */
|
|
96
|
-
|
|
97
|
+
balanceAfter: string | null;
|
|
97
98
|
/** Balance before this transaction */
|
|
98
|
-
|
|
99
|
+
balanceBefore: string | null;
|
|
99
100
|
/** Balance UUID this movement affects */
|
|
100
|
-
|
|
101
|
+
balanceId: string;
|
|
101
102
|
/** Blockchain block number */
|
|
102
|
-
|
|
103
|
+
blockNumber: number | null;
|
|
103
104
|
/** Transaction timestamp (ISO 8601) */
|
|
104
|
-
|
|
105
|
+
createdAt: string | null;
|
|
105
106
|
/** Human readable description */
|
|
106
107
|
description: string | null;
|
|
107
108
|
/** Type of ledger entry */
|
|
108
|
-
|
|
109
|
+
entryType: string;
|
|
109
110
|
/** Movement UUID */
|
|
110
111
|
id: string;
|
|
111
112
|
/** Locked balance after transaction */
|
|
112
|
-
|
|
113
|
+
lockedAfter: string | null;
|
|
113
114
|
/** Locked balance before transaction */
|
|
114
|
-
|
|
115
|
+
lockedBefore: string | null;
|
|
115
116
|
/** Reference identifier for related operations */
|
|
116
|
-
|
|
117
|
+
referenceId: string | null;
|
|
117
118
|
/** Reference type */
|
|
118
|
-
|
|
119
|
+
referenceType: string | null;
|
|
119
120
|
/** Token address */
|
|
120
|
-
token:
|
|
121
|
+
token: Address;
|
|
121
122
|
/** Type of transaction */
|
|
122
|
-
|
|
123
|
+
transactionType: string;
|
|
123
124
|
/** Blockchain transaction hash */
|
|
124
|
-
|
|
125
|
+
txHash: string | null;
|
|
125
126
|
/** User UUID who owns this movement */
|
|
126
|
-
|
|
127
|
+
userId: string;
|
|
127
128
|
}
|
|
128
129
|
/**
|
|
129
130
|
* One user balance held within an application.
|
|
130
131
|
*/
|
|
131
132
|
export interface AppBalance {
|
|
132
133
|
/** Available balance for trading */
|
|
133
|
-
|
|
134
|
+
availableBalance: string;
|
|
134
135
|
/** Balance creation timestamp (ISO 8601) */
|
|
135
|
-
|
|
136
|
+
createdAt: string | null;
|
|
136
137
|
/** Token decimals */
|
|
137
138
|
decimals: number;
|
|
138
139
|
/** Balance UUID */
|
|
139
140
|
id: string;
|
|
140
141
|
/** Last sync timestamp (ISO 8601) */
|
|
141
|
-
|
|
142
|
+
lastSyncAt: string | null;
|
|
142
143
|
/** Last sync block number */
|
|
143
|
-
|
|
144
|
+
lastSyncBlock: number | null;
|
|
144
145
|
/** Locked balance */
|
|
145
|
-
|
|
146
|
+
lockedBalance: string;
|
|
146
147
|
/** On-chain balance */
|
|
147
|
-
|
|
148
|
+
onChainBalance: string;
|
|
148
149
|
/** Token symbol */
|
|
149
150
|
symbol: string | null;
|
|
150
151
|
/** Token address */
|
|
151
|
-
token:
|
|
152
|
+
token: Address;
|
|
152
153
|
/** Total balance */
|
|
153
|
-
|
|
154
|
+
totalBalance: string;
|
|
154
155
|
/** Balance last update timestamp (ISO 8601) */
|
|
155
|
-
|
|
156
|
+
updatedAt: string | null;
|
|
156
157
|
/** User UUID who owns this balance */
|
|
157
|
-
|
|
158
|
+
userId: string;
|
|
158
159
|
}
|
|
159
160
|
/**
|
|
160
161
|
* Paginated list of application orders.
|
|
@@ -166,9 +167,9 @@ export interface ListAppOrdersResponse {
|
|
|
166
167
|
/** Current page number */
|
|
167
168
|
page: number;
|
|
168
169
|
/** Items per page */
|
|
169
|
-
|
|
170
|
+
pageSize: number;
|
|
170
171
|
/** Total number of pages */
|
|
171
|
-
|
|
172
|
+
totalPages: number;
|
|
172
173
|
}
|
|
173
174
|
/**
|
|
174
175
|
* Paginated list of application users.
|
|
@@ -180,9 +181,9 @@ export interface ListAppUsersResponse {
|
|
|
180
181
|
/** Current page number */
|
|
181
182
|
page: number;
|
|
182
183
|
/** Items per page */
|
|
183
|
-
|
|
184
|
+
pageSize: number;
|
|
184
185
|
/** Total number of pages */
|
|
185
|
-
|
|
186
|
+
totalPages: number;
|
|
186
187
|
}
|
|
187
188
|
/**
|
|
188
189
|
* Paginated list of application movements.
|
|
@@ -194,9 +195,9 @@ export interface ListAppMovementsResponse {
|
|
|
194
195
|
/** Current page number */
|
|
195
196
|
page: number;
|
|
196
197
|
/** Items per page */
|
|
197
|
-
|
|
198
|
+
pageSize: number;
|
|
198
199
|
/** Total number of pages */
|
|
199
|
-
|
|
200
|
+
totalPages: number;
|
|
200
201
|
}
|
|
201
202
|
/**
|
|
202
203
|
* Paginated list of application balances.
|
|
@@ -208,9 +209,9 @@ export interface ListAppBalancesResponse {
|
|
|
208
209
|
/** Current page number */
|
|
209
210
|
page: number;
|
|
210
211
|
/** Items per page */
|
|
211
|
-
|
|
212
|
+
pageSize: number;
|
|
212
213
|
/** Total number of pages */
|
|
213
|
-
|
|
214
|
+
totalPages: number;
|
|
214
215
|
}
|
|
215
216
|
/**
|
|
216
217
|
* Aggregate volume and fee stats for an application.
|
|
@@ -222,11 +223,11 @@ export interface GetAppStatsResponse {
|
|
|
222
223
|
/** Total quote volume for trades where this application's users were the taker */
|
|
223
224
|
volume: string;
|
|
224
225
|
/** Total maker fees collected */
|
|
225
|
-
|
|
226
|
+
makerFee: string;
|
|
226
227
|
/** Total taker fees collected */
|
|
227
|
-
|
|
228
|
+
takerFee: string;
|
|
228
229
|
/** Application revenue share from taker fees */
|
|
229
|
-
|
|
230
|
+
applicationTakerFee: string;
|
|
230
231
|
/** Total number of trades */
|
|
231
|
-
|
|
232
|
+
tradeCount: number;
|
|
232
233
|
}
|
package/dist/auth/responses.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Response types for authentication operations.
|
|
5
5
|
*/
|
|
6
|
+
import type { Address } from "viem";
|
|
6
7
|
/**
|
|
7
8
|
* Response to a challenge request.
|
|
8
9
|
*/
|
|
@@ -18,7 +19,7 @@ export interface User {
|
|
|
18
19
|
/** Unique identifier for the user */
|
|
19
20
|
id: string;
|
|
20
21
|
/** Wallet address of the user */
|
|
21
|
-
address:
|
|
22
|
+
address: Address;
|
|
22
23
|
/** Username of the user */
|
|
23
24
|
username?: string;
|
|
24
25
|
}
|
|
@@ -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,30 +16,30 @@ export interface UpsertDelegatedAgentRequest {
|
|
|
15
16
|
}
|
|
16
17
|
export interface DelegatedAgent {
|
|
17
18
|
id: string;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
ownerUserId: string;
|
|
20
|
+
agentAddress: Address;
|
|
20
21
|
name?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
}
|
|
36
37
|
export interface DelegatedAgentOwner {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
ownerUserId: string;
|
|
39
|
+
delegationId: string;
|
|
39
40
|
name?: string;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
isActive: boolean;
|
|
42
|
+
expiresAt?: string;
|
|
42
43
|
}
|
|
43
44
|
export interface ListDelegatedOwnersResponse {
|
|
44
45
|
owners: DelegatedAgentOwner[];
|
|
@@ -53,10 +54,10 @@ export interface CreateDelegatedSessionRequest {
|
|
|
53
54
|
sessionPublicKey: string;
|
|
54
55
|
}
|
|
55
56
|
export interface CreateDelegatedSessionResponse {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
expiresAt: number;
|
|
58
|
+
delegationId: string;
|
|
59
|
+
ownerUserId: string;
|
|
60
|
+
agentAddress: Address;
|
|
60
61
|
}
|
|
61
62
|
export interface DelegatedAgentsAPI extends BaseAPI {
|
|
62
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
|
});
|