@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
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { BaseAPI } from "../api";
|
|
2
2
|
import type { OrderSide, OrderType, PositionSide } from "../trading";
|
|
3
3
|
export interface MarginAccountSummary {
|
|
4
|
-
|
|
4
|
+
marginAccountId: string;
|
|
5
5
|
label?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
riskBucketId?: string;
|
|
7
|
+
marginMode?: "ISOLATED" | "CROSS";
|
|
8
|
+
tradingPairId?: string;
|
|
9
|
+
strategyKey?: string;
|
|
10
|
+
accountState: string;
|
|
11
11
|
equity: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
initialMarginRequired: string;
|
|
13
|
+
maintenanceMarginRequired: string;
|
|
14
|
+
freeCollateral: string;
|
|
15
|
+
withdrawableCollateral: string;
|
|
16
|
+
totalPositionNotional: string;
|
|
17
|
+
unrealizedPnl: string;
|
|
18
|
+
realizedPnl: string;
|
|
19
|
+
updatedAt: string;
|
|
20
20
|
}
|
|
21
21
|
export interface ListMarginAccountsParams {
|
|
22
22
|
page?: number;
|
|
23
|
-
|
|
23
|
+
pageSize?: number;
|
|
24
24
|
state?: string;
|
|
25
25
|
tradingPairId?: string;
|
|
26
26
|
}
|
|
@@ -28,7 +28,7 @@ export interface ListMarginAccountsResponse {
|
|
|
28
28
|
accounts: MarginAccountSummary[];
|
|
29
29
|
total: number;
|
|
30
30
|
page: number;
|
|
31
|
-
|
|
31
|
+
pageSize: number;
|
|
32
32
|
}
|
|
33
33
|
export interface GetMarginAccountSummaryParams {
|
|
34
34
|
tradingPairId?: string;
|
|
@@ -38,16 +38,16 @@ export interface GetAvailableCollateralParams {
|
|
|
38
38
|
}
|
|
39
39
|
export interface GetAvailableCollateralResponse {
|
|
40
40
|
asset: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
walletAvailable: string;
|
|
42
|
+
walletLocked: string;
|
|
43
|
+
marginTransferable?: string;
|
|
44
44
|
/**
|
|
45
45
|
* Free collateral held in the user's parent margin account for this asset
|
|
46
46
|
* (equity minus initial margin required) — collateral already inside margin
|
|
47
47
|
* and available to open new positions or transfer back out. Absent when the
|
|
48
48
|
* user has no margin account yet.
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
marginAvailableCollateral?: string;
|
|
51
51
|
}
|
|
52
52
|
export interface TransferCollateralRequest {
|
|
53
53
|
asset: string;
|
|
@@ -55,39 +55,47 @@ export interface TransferCollateralRequest {
|
|
|
55
55
|
tradingPairId?: string;
|
|
56
56
|
strategyKey?: string;
|
|
57
57
|
}
|
|
58
|
-
export interface
|
|
58
|
+
export interface TransferCollateralToParentMarginAccountRequest {
|
|
59
|
+
asset: string;
|
|
60
|
+
amount: string;
|
|
61
|
+
}
|
|
62
|
+
export interface TransferCollateralToRiskBucketRequest extends TransferCollateralToParentMarginAccountRequest {
|
|
59
63
|
tradingPairId: string;
|
|
60
64
|
strategyKey?: string;
|
|
61
65
|
}
|
|
66
|
+
export interface TransferCollateralFromParentMarginAccountRequest {
|
|
67
|
+
asset: string;
|
|
68
|
+
amount: string;
|
|
69
|
+
}
|
|
62
70
|
export interface TransferCollateralResponse {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
movementId: string;
|
|
72
|
+
marginAccountId: string;
|
|
73
|
+
strategyKey?: string;
|
|
66
74
|
asset: string;
|
|
67
75
|
amount: string;
|
|
68
76
|
status: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
newEquity: string;
|
|
78
|
+
newTotalCollateralValue: string;
|
|
79
|
+
newWithdrawableCollateral: string;
|
|
72
80
|
}
|
|
73
81
|
export interface GetMarginAccountMovementsParams {
|
|
74
|
-
|
|
82
|
+
movementType?: string;
|
|
75
83
|
page?: number;
|
|
76
|
-
|
|
84
|
+
pageSize?: number;
|
|
77
85
|
}
|
|
78
86
|
export interface MarginAccountMovement {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
movementId: string;
|
|
88
|
+
marginAccountId: string;
|
|
89
|
+
movementType: string;
|
|
82
90
|
asset: string;
|
|
83
91
|
amount: string;
|
|
84
|
-
|
|
92
|
+
createdAt: string;
|
|
85
93
|
}
|
|
86
94
|
export interface GetMarginAccountMovementsResponse {
|
|
87
95
|
movements: MarginAccountMovement[];
|
|
88
96
|
total: number;
|
|
89
97
|
page: number;
|
|
90
|
-
|
|
98
|
+
pageSize: number;
|
|
91
99
|
}
|
|
92
100
|
export interface SimulateOrderRiskRequest {
|
|
93
101
|
tradingPairId: string;
|
|
@@ -99,29 +107,53 @@ export interface SimulateOrderRiskRequest {
|
|
|
99
107
|
leverage: string;
|
|
100
108
|
reduceOnly?: boolean;
|
|
101
109
|
}
|
|
102
|
-
export interface
|
|
110
|
+
export interface SimulateRiskBucketOrderRiskRequest extends SimulateOrderRiskRequest {
|
|
103
111
|
strategyKey?: string;
|
|
104
112
|
}
|
|
105
113
|
export interface SimulateOrderRiskResponse {
|
|
106
114
|
accepted: boolean;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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;
|
|
116
124
|
}
|
|
117
125
|
export interface MarginAccountsAPI extends BaseAPI {
|
|
118
126
|
listMarginAccounts(params?: ListMarginAccountsParams): Promise<ListMarginAccountsResponse>;
|
|
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
|
+
*/
|
|
119
132
|
getMarginAccountSummary(marginAccountId: string, params?: GetMarginAccountSummaryParams): Promise<MarginAccountSummary>;
|
|
120
133
|
getAvailableCollateral(params?: GetAvailableCollateralParams): Promise<GetAvailableCollateralResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated Prefer transferCollateralToParentMarginAccount() or
|
|
136
|
+
* transferCollateralToRiskBucket().
|
|
137
|
+
*/
|
|
121
138
|
transferCollateralToMarginAccount(marginAccountId: string, request: TransferCollateralRequest): Promise<TransferCollateralResponse>;
|
|
122
|
-
|
|
139
|
+
transferCollateralToParentMarginAccount(request: TransferCollateralToParentMarginAccountRequest): Promise<TransferCollateralResponse>;
|
|
140
|
+
transferCollateralToRiskBucket(request: TransferCollateralToRiskBucketRequest): Promise<TransferCollateralResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Prefer transferCollateralFromParentMarginAccount().
|
|
143
|
+
*/
|
|
123
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
|
+
*/
|
|
124
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
|
+
*/
|
|
125
157
|
simulateOrderRisk(marginAccountId: string, request: SimulateOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
|
|
126
|
-
|
|
158
|
+
simulateRiskBucketOrderRisk(request: SimulateRiskBucketOrderRiskRequest): Promise<SimulateOrderRiskResponse>;
|
|
127
159
|
}
|
package/dist/market/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for market data operations including trading pair metadata and OHLCV data.
|
|
5
5
|
*/
|
|
6
|
+
import type { Address } from "viem";
|
|
6
7
|
import type { BaseAPI } from "../api";
|
|
8
|
+
import type { TradingMode } from "../trading";
|
|
7
9
|
/**
|
|
8
10
|
* Trading pair metadata
|
|
9
11
|
*/
|
|
@@ -13,45 +15,45 @@ export interface TradingPair {
|
|
|
13
15
|
/** Trading pair symbol e.g. BTC/USDC */
|
|
14
16
|
symbol: string;
|
|
15
17
|
/** Base token symbol */
|
|
16
|
-
|
|
18
|
+
baseToken: string;
|
|
17
19
|
/** Quote token symbol */
|
|
18
|
-
|
|
20
|
+
quoteToken: string;
|
|
19
21
|
/** Base asset ID (UUID) */
|
|
20
|
-
|
|
22
|
+
baseAssetId: string;
|
|
21
23
|
/** Quote asset ID (UUID) */
|
|
22
|
-
|
|
24
|
+
quoteAssetId: string;
|
|
23
25
|
/** Base token contract address */
|
|
24
|
-
|
|
26
|
+
baseTokenContract: Address;
|
|
25
27
|
/** Quote token contract address */
|
|
26
|
-
|
|
28
|
+
quoteTokenContract: Address;
|
|
27
29
|
/** Base token decimals */
|
|
28
|
-
|
|
30
|
+
baseDecimals: number;
|
|
29
31
|
/** Base token icon URL */
|
|
30
|
-
|
|
32
|
+
baseIconUrl: string;
|
|
31
33
|
/** Quote token decimals */
|
|
32
|
-
|
|
34
|
+
quoteDecimals: number;
|
|
33
35
|
/** Quote token icon URL */
|
|
34
|
-
|
|
35
|
-
/** Market type (
|
|
36
|
-
|
|
37
|
-
/** Asset-class category: crypto, equities, or
|
|
36
|
+
quoteIconUrl: string;
|
|
37
|
+
/** Market type (SPOT or MARGIN) */
|
|
38
|
+
marketType: TradingMode;
|
|
39
|
+
/** Asset-class category: crypto, equities, commodities, or fx */
|
|
38
40
|
category: string;
|
|
39
41
|
/** Whether the market is active */
|
|
40
|
-
|
|
42
|
+
isActive: boolean;
|
|
41
43
|
/** Maker fee in basis points */
|
|
42
|
-
|
|
44
|
+
makerFeeBps: number;
|
|
43
45
|
/** Taker fee in basis points */
|
|
44
|
-
|
|
46
|
+
takerFeeBps: number;
|
|
45
47
|
/** Minimum order size */
|
|
46
|
-
|
|
48
|
+
minOrderSize: string;
|
|
47
49
|
/** Maximum order size */
|
|
48
|
-
|
|
50
|
+
maxOrderSize: string;
|
|
49
51
|
/** Tick size for price increments */
|
|
50
|
-
|
|
52
|
+
tickSize: string;
|
|
51
53
|
/** Minimum supported leverage for margin markets (optional, margin only) */
|
|
52
|
-
|
|
54
|
+
minLeverage?: string | null;
|
|
53
55
|
/** Maximum supported leverage for margin markets (optional, margin only) */
|
|
54
|
-
|
|
56
|
+
maxLeverage?: string | null;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* OHLCV candlestick data point (matches API response format)
|
|
@@ -119,33 +121,33 @@ export interface GetTradingPairsParams {
|
|
|
119
121
|
/** Page number (starts from 1) */
|
|
120
122
|
page?: number;
|
|
121
123
|
/** Number of items per page (max 100) */
|
|
122
|
-
|
|
124
|
+
pageSize?: number;
|
|
123
125
|
/** Filter by market type (SPOT, MARGIN) */
|
|
124
|
-
|
|
126
|
+
marketType?: TradingMode;
|
|
125
127
|
/** Filter by base token symbol */
|
|
126
|
-
|
|
128
|
+
baseToken?: string;
|
|
127
129
|
/** Filter by quote token symbol */
|
|
128
|
-
|
|
130
|
+
quoteToken?: string;
|
|
129
131
|
/** Filter by active status */
|
|
130
|
-
|
|
131
|
-
/** Filter by asset-class category (crypto, equities, commodities) */
|
|
132
|
+
isActive?: boolean;
|
|
133
|
+
/** Filter by asset-class category (crypto, equities, commodities, fx) */
|
|
132
134
|
category?: string;
|
|
133
135
|
}
|
|
134
136
|
/**
|
|
135
137
|
* Response for listing trading pairs with pagination
|
|
136
138
|
*/
|
|
137
139
|
export interface GetTradingPairsResponse {
|
|
138
|
-
|
|
140
|
+
tradingPairs: TradingPair[];
|
|
139
141
|
page: number;
|
|
140
|
-
|
|
142
|
+
pageSize: number;
|
|
141
143
|
total: number;
|
|
142
|
-
|
|
144
|
+
totalPages: number;
|
|
143
145
|
}
|
|
144
146
|
/**
|
|
145
147
|
* Response for a single trading pair
|
|
146
148
|
*/
|
|
147
149
|
export interface GetTradingPairResponse {
|
|
148
|
-
|
|
150
|
+
tradingPair: TradingPair;
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
151
153
|
* Query parameters for the market screener
|
|
@@ -154,12 +156,12 @@ export interface GetScreenerParams {
|
|
|
154
156
|
/** Page number (min 1, default 1) */
|
|
155
157
|
page?: number;
|
|
156
158
|
/** Items per page (min 1, max 100, default 50) */
|
|
157
|
-
|
|
159
|
+
pageSize?: number;
|
|
158
160
|
/** Filter by market type: SPOT or MARGIN */
|
|
159
|
-
|
|
161
|
+
marketType?: TradingMode;
|
|
160
162
|
/** Filter by active status */
|
|
161
|
-
|
|
162
|
-
/** Filter by asset-class category (crypto, equities, commodities) */
|
|
163
|
+
isActive?: boolean;
|
|
164
|
+
/** Filter by asset-class category (crypto, equities, commodities, fx) */
|
|
163
165
|
category?: string;
|
|
164
166
|
}
|
|
165
167
|
/**
|
|
@@ -167,58 +169,58 @@ export interface GetScreenerParams {
|
|
|
167
169
|
*/
|
|
168
170
|
export interface ScreenerSnapshotPoint {
|
|
169
171
|
/** UTC day boundary (ms since epoch, as string) */
|
|
170
|
-
|
|
172
|
+
bucketStart: string;
|
|
171
173
|
/** Quote-token volume for the day */
|
|
172
|
-
|
|
174
|
+
quoteVolume: string;
|
|
173
175
|
/** Percent price change (close - open) / open * 100 for the day */
|
|
174
|
-
|
|
176
|
+
priceChangePercent: string;
|
|
175
177
|
}
|
|
176
178
|
/**
|
|
177
179
|
* Per-pair screener row. Window fields are null when there is insufficient history.
|
|
178
180
|
*/
|
|
179
181
|
export interface ScreenerItem {
|
|
180
182
|
/** Trading pair UUID */
|
|
181
|
-
|
|
183
|
+
tradingPairId: string;
|
|
182
184
|
/** Trading pair symbol (e.g. "BTC/USDC") */
|
|
183
185
|
symbol: string;
|
|
184
186
|
/** Base token icon URL */
|
|
185
|
-
|
|
187
|
+
baseIconUrl: string;
|
|
186
188
|
/** Quote token icon URL */
|
|
187
|
-
|
|
189
|
+
quoteIconUrl: string;
|
|
188
190
|
/** Most recent close price (null if no trades yet) */
|
|
189
|
-
|
|
191
|
+
lastPrice: string | null;
|
|
190
192
|
/** Timestamp of the last candle (ms since epoch, as string; null if no trades yet) */
|
|
191
|
-
|
|
193
|
+
lastPriceTimestamp: string | null;
|
|
192
194
|
/** Quote-token volume in the last 1 hour (null if <1h history) */
|
|
193
|
-
|
|
195
|
+
quoteVolume1h: string | null;
|
|
194
196
|
/** Quote-token volume in the last 24 hours (null if <24h history) */
|
|
195
|
-
|
|
197
|
+
quoteVolume24h: string | null;
|
|
196
198
|
/** Quote-token volume in the last 7 days (null if <7d history) */
|
|
197
|
-
|
|
199
|
+
quoteVolume7d: string | null;
|
|
198
200
|
/** Percent price change over the last 1 hour (null if <1h history) */
|
|
199
|
-
|
|
201
|
+
priceChangePercent1h: string | null;
|
|
200
202
|
/** Percent price change over the last 24 hours (null if <24h history) */
|
|
201
|
-
|
|
203
|
+
priceChangePercent24h: string | null;
|
|
202
204
|
/** Percent price change over the last 7 days (null if <7d history) */
|
|
203
|
-
|
|
205
|
+
priceChangePercent7d: string | null;
|
|
204
206
|
/** Up to 7 UTC-day buckets (oldest first); empty when <1 day of history */
|
|
205
|
-
|
|
206
|
-
/** Asset-class category: crypto, equities, or
|
|
207
|
+
snapshot7d: ScreenerSnapshotPoint[];
|
|
208
|
+
/** Asset-class category: crypto, equities, commodities, or fx */
|
|
207
209
|
category: string;
|
|
208
210
|
/** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
|
|
209
|
-
|
|
211
|
+
totalQuoteVolumeLtd: string;
|
|
210
212
|
/** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
|
|
211
|
-
|
|
213
|
+
totalTradeCountLtd: number;
|
|
212
214
|
}
|
|
213
215
|
/**
|
|
214
|
-
* Paginated screener response, sorted by
|
|
216
|
+
* Paginated screener response, sorted by quoteVolume24h desc (nulls last)
|
|
215
217
|
*/
|
|
216
218
|
export interface GetScreenerResponse {
|
|
217
219
|
items: ScreenerItem[];
|
|
218
220
|
page: number;
|
|
219
|
-
|
|
221
|
+
pageSize: number;
|
|
220
222
|
total: number;
|
|
221
|
-
|
|
223
|
+
totalPages: number;
|
|
222
224
|
}
|
|
223
225
|
/**
|
|
224
226
|
* API response wrapper for single trading pair
|
|
@@ -233,132 +235,131 @@ export interface MarketMetadata {
|
|
|
233
235
|
/** Trading pair symbol (e.g., "BTC/USDC") */
|
|
234
236
|
symbol: string;
|
|
235
237
|
/** Base token icon URL */
|
|
236
|
-
|
|
238
|
+
baseIconUrl: string;
|
|
237
239
|
/** Quote token icon URL */
|
|
238
|
-
|
|
240
|
+
quoteIconUrl: string;
|
|
239
241
|
/** Current price (8 decimal precision, null if no trades yet) */
|
|
240
|
-
|
|
242
|
+
lastPrice: string | null;
|
|
241
243
|
/** Unix timestamp (ms) of latest price (null if no trades yet) */
|
|
242
|
-
|
|
244
|
+
lastPriceTimestamp: number | null;
|
|
243
245
|
/** 24h high price (null if <24h data) */
|
|
244
|
-
|
|
246
|
+
high24h: string | null;
|
|
245
247
|
/** 24h low price (null if <24h data) */
|
|
246
|
-
|
|
248
|
+
low24h: string | null;
|
|
247
249
|
/** 24h volume in base asset (null if <24h data) */
|
|
248
|
-
|
|
250
|
+
volume24h: string | null;
|
|
249
251
|
/** Absolute price change in 24h (null if <24h data) */
|
|
250
|
-
|
|
252
|
+
priceChange24h: string | null;
|
|
251
253
|
/** Percentage price change in 24h (2 decimals, null if <24h data) */
|
|
252
|
-
|
|
254
|
+
priceChangePercent24h: string | null;
|
|
253
255
|
/** Unix timestamp (ms) when market started trading (null if not available) */
|
|
254
|
-
|
|
256
|
+
marketInitializationTimestamp: number | null;
|
|
255
257
|
/** Life-to-date cumulative base-token volume since inception ("0" if no trades yet) */
|
|
256
|
-
|
|
258
|
+
totalBaseVolumeLtd: string;
|
|
257
259
|
/** Life-to-date cumulative quote-token volume since inception ("0" if no trades yet) */
|
|
258
|
-
|
|
260
|
+
totalQuoteVolumeLtd: string;
|
|
259
261
|
/** Life-to-date cumulative number of trades since inception (0 if no trades yet) */
|
|
260
|
-
|
|
262
|
+
totalTradeCountLtd: number;
|
|
261
263
|
}
|
|
262
264
|
/**
|
|
263
265
|
* Exchange-wide life-to-date cumulative statistics across all trading pairs.
|
|
264
266
|
*/
|
|
265
267
|
export interface MarketStats {
|
|
266
268
|
/** Life-to-date cumulative quote-token (notional) volume summed across all pairs */
|
|
267
|
-
|
|
269
|
+
totalQuoteVolumeLtd: string;
|
|
268
270
|
/** Life-to-date cumulative number of trades summed across all pairs */
|
|
269
|
-
|
|
271
|
+
totalTradeCountLtd: number;
|
|
270
272
|
}
|
|
271
273
|
export interface RiskTier {
|
|
272
274
|
notional_floor: string;
|
|
273
275
|
notional_cap?: string;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
276
|
+
initialMarginRatio: string;
|
|
277
|
+
maintenanceMarginRatio: string;
|
|
278
|
+
maxLeverage: string;
|
|
277
279
|
}
|
|
278
280
|
export interface PerpMarketConfig {
|
|
279
|
-
|
|
281
|
+
tradingPairId: string;
|
|
280
282
|
symbol: string;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
283
|
+
minLeverage: string;
|
|
284
|
+
maxLeverage: string;
|
|
285
|
+
initialMarginRatio: string;
|
|
286
|
+
maintenanceMarginRatio: string;
|
|
287
|
+
fundingIntervalSeconds: number;
|
|
288
|
+
liquidationFeeBps?: string;
|
|
289
|
+
riskTiers: RiskTier[];
|
|
290
|
+
updatedAt: string;
|
|
289
291
|
}
|
|
290
292
|
export interface PerpMarketSummary {
|
|
291
|
-
|
|
293
|
+
tradingPairId: string;
|
|
292
294
|
symbol: string;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
295
|
+
lastPrice: string;
|
|
296
|
+
markPrice: string;
|
|
297
|
+
indexPrice: string;
|
|
298
|
+
high24h?: string;
|
|
299
|
+
low24h?: string;
|
|
300
|
+
volume24h?: string;
|
|
301
|
+
priceChange24h?: string;
|
|
302
|
+
priceChangePercent24h?: string;
|
|
303
|
+
openInterest: string;
|
|
304
|
+
currentFundingRate?: string;
|
|
305
|
+
estimatedNextFundingRate?: string;
|
|
306
|
+
nextFundingTime?: string;
|
|
307
|
+
marketStatus: string;
|
|
308
|
+
marketRegime: string;
|
|
309
|
+
updatedAt: string;
|
|
308
310
|
}
|
|
309
311
|
export interface MarkPrice {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
tradingPairId: string;
|
|
313
|
+
markPrice: string;
|
|
314
|
+
oracleProvider: string;
|
|
315
|
+
oracleEpoch?: string;
|
|
316
|
+
updatedAt: string;
|
|
315
317
|
regime: string;
|
|
316
318
|
}
|
|
317
319
|
export interface IndexComponent {
|
|
318
320
|
provider: string;
|
|
319
321
|
price: string;
|
|
320
322
|
weight?: string;
|
|
321
|
-
|
|
323
|
+
updatedAt?: string;
|
|
322
324
|
}
|
|
323
325
|
export interface IndexPrice {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
+
tradingPairId: string;
|
|
327
|
+
indexPrice: string;
|
|
326
328
|
components: IndexComponent[];
|
|
327
|
-
|
|
329
|
+
updatedAt: string;
|
|
328
330
|
}
|
|
329
331
|
export interface FundingState {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
332
|
+
tradingPairId: string;
|
|
333
|
+
currentFundingRate: string;
|
|
334
|
+
estimatedNextFundingRate?: string;
|
|
335
|
+
nextFundingTime: string;
|
|
336
|
+
fundingIntervalSeconds: number;
|
|
337
|
+
lastFundingTime?: string;
|
|
338
|
+
updatedAt: string;
|
|
337
339
|
}
|
|
338
340
|
export interface FundingRecord {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
cumulative_funding_per_unit?: string;
|
|
341
|
+
tradingPairId: string;
|
|
342
|
+
fundingRate: string;
|
|
343
|
+
cumulativeFundingPerUnit?: string;
|
|
343
344
|
}
|
|
344
345
|
export interface ListFundingHistoryParams {
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
startTime?: string;
|
|
347
|
+
endTime?: string;
|
|
347
348
|
page?: number;
|
|
348
|
-
|
|
349
|
+
pageSize?: number;
|
|
349
350
|
}
|
|
350
351
|
export interface ListFundingHistoryResponse {
|
|
351
352
|
records: FundingRecord[];
|
|
352
353
|
total: number;
|
|
353
354
|
page: number;
|
|
354
|
-
|
|
355
|
+
pageSize: number;
|
|
355
356
|
}
|
|
356
357
|
export interface OpenInterest {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
358
|
+
tradingPairId: string;
|
|
359
|
+
openInterest?: string;
|
|
360
|
+
openInterestBase: string;
|
|
361
|
+
openInterestNotional: string;
|
|
362
|
+
updatedAt: string;
|
|
362
363
|
}
|
|
363
364
|
/**
|
|
364
365
|
* Market API interface.
|
|
@@ -381,9 +382,11 @@ export interface MarketAPI extends BaseAPI {
|
|
|
381
382
|
/**
|
|
382
383
|
* Fetch metadata for a single trading pair by its symbol (e.g. BTC-USDC).
|
|
383
384
|
* @param symbol - Trading pair symbol
|
|
385
|
+
* @param marketType - Optional market type filter (e.g. "SPOT", "MARGIN") to
|
|
386
|
+
* disambiguate a symbol that exists in more than one market
|
|
384
387
|
* @returns Promise resolving to trading pair or undefined if not found
|
|
385
388
|
*/
|
|
386
|
-
getTradingPairBySymbol(symbol: string): Promise<TradingPair | undefined>;
|
|
389
|
+
getTradingPairBySymbol(symbol: string, marketType?: TradingMode): Promise<TradingPair | undefined>;
|
|
387
390
|
/**
|
|
388
391
|
* Fetch the paginated market screener: per-pair price/volume/change windows
|
|
389
392
|
* (1h, 24h, 7d) plus a 7-day daily snapshot, sorted by 24h quote volume.
|