@reyaxyz/common 0.261.1 → 0.262.1
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/README.md +1 -1
- package/dist/rest/helpers/constants.js +16 -10
- package/dist/rest/helpers/constants.js.map +1 -1
- package/dist/trading-api-types.js.map +1 -1
- package/dist/types/rest/helpers/constants.d.ts +1 -1
- package/dist/types/rest/helpers/constants.d.ts.map +1 -1
- package/dist/types/trading-api-types.d.ts +320 -360
- package/dist/types/trading-api-types.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -3
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
- package/src/rest/helpers/constants.ts +30 -11
- package/src/trading-api-types.ts +414 -341
- package/src/types.ts +5 -3
|
@@ -39,367 +39,297 @@ type Order = {
|
|
|
39
39
|
unique_id: bigint | null;
|
|
40
40
|
created_at: Date;
|
|
41
41
|
};
|
|
42
|
+
type Position = {
|
|
43
|
+
market_id: Decimal;
|
|
44
|
+
account_id: Decimal;
|
|
45
|
+
base: Decimal | null;
|
|
46
|
+
realized_pnl: Decimal | null;
|
|
47
|
+
realized_pnl_latest_snapshot: Decimal | null;
|
|
48
|
+
average_entry_price_off_chain_tracker: Decimal | null;
|
|
49
|
+
funding_value_off_chain_tracker: Decimal | null;
|
|
50
|
+
last_price: Decimal | null;
|
|
51
|
+
position_data_last_price_data_timestamp: Decimal | null;
|
|
52
|
+
funding_value: Decimal | null;
|
|
53
|
+
base_multiplier: Decimal | null;
|
|
54
|
+
adl_unwind_price: Decimal | null;
|
|
55
|
+
transaction_hash: string;
|
|
56
|
+
block_timestamp: Decimal | null;
|
|
57
|
+
block_number: Decimal;
|
|
58
|
+
unique_id: bigint | null;
|
|
59
|
+
};
|
|
60
|
+
type ConditionalOrder = {
|
|
61
|
+
id: string;
|
|
62
|
+
account_id: Decimal;
|
|
63
|
+
market_id: Decimal;
|
|
64
|
+
order_type: string;
|
|
65
|
+
is_long: boolean;
|
|
66
|
+
trigger_price: number;
|
|
67
|
+
order_base: Decimal;
|
|
68
|
+
exchange_id: bigint;
|
|
69
|
+
inputs: string;
|
|
70
|
+
counterparty_account_id: bigint;
|
|
71
|
+
reya_chain_id: bigint;
|
|
72
|
+
deadline: bigint;
|
|
73
|
+
signer_address: string;
|
|
74
|
+
nonce: Decimal;
|
|
75
|
+
signature: string;
|
|
76
|
+
status: string;
|
|
77
|
+
creation_timestamp_ms: bigint;
|
|
78
|
+
last_update_timestamp_ms: bigint;
|
|
79
|
+
transaction_hash: string | null;
|
|
80
|
+
};
|
|
81
|
+
type Swap = {
|
|
82
|
+
id: string;
|
|
83
|
+
account_id: Decimal;
|
|
84
|
+
token_in: string;
|
|
85
|
+
token_out: string;
|
|
86
|
+
amount_in: Decimal;
|
|
87
|
+
amount_out: Decimal;
|
|
88
|
+
executed_amount_out: Decimal;
|
|
89
|
+
transaction_hash: string;
|
|
90
|
+
block_timestamp: Decimal;
|
|
91
|
+
block_number: Decimal;
|
|
92
|
+
unique_id: bigint | null;
|
|
93
|
+
};
|
|
94
|
+
type Market = {
|
|
95
|
+
id: Decimal;
|
|
96
|
+
ticker: string;
|
|
97
|
+
markPrice: number;
|
|
98
|
+
isActive: boolean;
|
|
99
|
+
maxLeverage: number;
|
|
100
|
+
volume24H: number;
|
|
101
|
+
priceChange24H: number;
|
|
102
|
+
longOI: number;
|
|
103
|
+
shortOI: number;
|
|
104
|
+
availableLong: number;
|
|
105
|
+
availableShort: number;
|
|
106
|
+
marketPriceDeviation: number;
|
|
107
|
+
riskBlockId: number;
|
|
108
|
+
rootCollateralPoolId: number;
|
|
109
|
+
description: string;
|
|
110
|
+
name: string;
|
|
111
|
+
quoteTokenId: string;
|
|
112
|
+
tickSizeDecimals: number;
|
|
113
|
+
underlyingAssetId: string;
|
|
114
|
+
priceChange24HPercentage: number;
|
|
115
|
+
openInterest: number;
|
|
116
|
+
fundingRate: number;
|
|
117
|
+
priority: number;
|
|
118
|
+
};
|
|
119
|
+
type Account = {
|
|
120
|
+
account_id: Decimal;
|
|
121
|
+
name: string;
|
|
122
|
+
status: AccountStatus;
|
|
123
|
+
updated_timestamp_ms: Decimal;
|
|
124
|
+
source: string | null;
|
|
125
|
+
};
|
|
126
|
+
type Price = {
|
|
127
|
+
block_number: Decimal;
|
|
128
|
+
unique_id: bigint | null;
|
|
129
|
+
contract_id: string;
|
|
130
|
+
price: Decimal | null;
|
|
131
|
+
round_id: Decimal | null;
|
|
132
|
+
timestamp: Decimal;
|
|
133
|
+
};
|
|
134
|
+
type AccountBalance = {
|
|
135
|
+
account_id: number | null;
|
|
136
|
+
collateral: string | null;
|
|
137
|
+
balance?: string | null;
|
|
138
|
+
delta?: string | null;
|
|
139
|
+
};
|
|
140
|
+
type AutoExchange = {
|
|
141
|
+
id: string;
|
|
142
|
+
liquidated_account_id: Decimal | null;
|
|
143
|
+
liquidator_account_id: Decimal | null;
|
|
144
|
+
requested_quote_amount: Decimal | null;
|
|
145
|
+
collateral_out_address: string | null;
|
|
146
|
+
collateral_in_address: string | null;
|
|
147
|
+
collateral_amount_to_liquidator: Decimal | null;
|
|
148
|
+
quote_amount_to_insurance_fund: Decimal | null;
|
|
149
|
+
quote_amount_to_account: Decimal | null;
|
|
150
|
+
block_timestamp: Decimal | null;
|
|
151
|
+
block_number: Decimal;
|
|
152
|
+
transaction_hash: string;
|
|
153
|
+
unique_id: bigint | null;
|
|
154
|
+
};
|
|
155
|
+
type Leverage = {
|
|
156
|
+
accountId: Decimal;
|
|
157
|
+
marketId: Decimal;
|
|
158
|
+
leverage: number;
|
|
159
|
+
createdAt: Date;
|
|
160
|
+
updatedAt: Date;
|
|
161
|
+
};
|
|
162
|
+
export type TradingApiEndpoint<Response, Params, ReplicationTable extends ReplicationModel = never, Replication = Response, Query = never> = {
|
|
163
|
+
params: Params;
|
|
164
|
+
query: Query;
|
|
165
|
+
response: Response;
|
|
166
|
+
replication: GenericReplicationMessage<Replication, ReplicationTable>;
|
|
167
|
+
};
|
|
168
|
+
export type TradingApiListEndpoint<Response, Params = never, ReplicationTable extends ReplicationModel = never, Replication = Response, Query = never> = {
|
|
169
|
+
params: Params;
|
|
170
|
+
query: Query;
|
|
171
|
+
response: Response[];
|
|
172
|
+
replication: GenericReplicationMessage<Replication, ReplicationTable>;
|
|
173
|
+
};
|
|
174
|
+
export type TradingApiInfiniteListEndpointResponse<Response> = {
|
|
175
|
+
data: Response[];
|
|
176
|
+
meta: PaginatedQueryMeta;
|
|
177
|
+
};
|
|
178
|
+
export type TradingApiInfiniteListEndpoint<Response, Params = never, ReplicationTable extends ReplicationModel = never, Replication = Response, Query = PaginatedQueryParams> = {
|
|
179
|
+
params: Params;
|
|
180
|
+
query: Query;
|
|
181
|
+
response: TradingApiInfiniteListEndpointResponse<Response>;
|
|
182
|
+
replication: GenericReplicationMessage<Replication, ReplicationTable>;
|
|
183
|
+
};
|
|
184
|
+
type AddressParam = {
|
|
185
|
+
address: string;
|
|
186
|
+
};
|
|
42
187
|
export type TradingApiSource = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}[];
|
|
189
|
-
};
|
|
190
|
-
Assets: {
|
|
191
|
-
params: never;
|
|
192
|
-
query: never;
|
|
193
|
-
response: {
|
|
194
|
-
address: string;
|
|
195
|
-
name: string;
|
|
196
|
-
short: string;
|
|
197
|
-
createdAt: Date;
|
|
198
|
-
updatedAt: Date;
|
|
199
|
-
asset_price_contract_id: string | null;
|
|
200
|
-
asset_price_usdc_contract_id: string | null;
|
|
201
|
-
decimals: number;
|
|
202
|
-
}[];
|
|
203
|
-
};
|
|
204
|
-
Prices: {
|
|
205
|
-
params: never;
|
|
206
|
-
query: never;
|
|
207
|
-
response: {
|
|
208
|
-
block_number: Decimal;
|
|
209
|
-
unique_id: bigint | null;
|
|
210
|
-
contract_id: string;
|
|
211
|
-
price: Decimal | null;
|
|
212
|
-
round_id: Decimal | null;
|
|
213
|
-
timestamp: Decimal;
|
|
214
|
-
}[];
|
|
215
|
-
};
|
|
216
|
-
Accounts: {
|
|
217
|
-
params: {
|
|
218
|
-
address: string;
|
|
219
|
-
};
|
|
220
|
-
query: never;
|
|
221
|
-
response: {
|
|
222
|
-
account_id: Decimal;
|
|
223
|
-
name: string;
|
|
224
|
-
status: AccountStatus;
|
|
225
|
-
updated_timestamp_ms: Decimal;
|
|
226
|
-
source: string | null;
|
|
227
|
-
}[];
|
|
228
|
-
};
|
|
229
|
-
AccountsBalances: {
|
|
230
|
-
params: {
|
|
231
|
-
address: string;
|
|
232
|
-
};
|
|
233
|
-
query: never;
|
|
234
|
-
response: {
|
|
235
|
-
account_id: number;
|
|
236
|
-
collateral: string;
|
|
237
|
-
balance: string;
|
|
238
|
-
}[];
|
|
239
|
-
};
|
|
240
|
-
AutoExchange: {
|
|
241
|
-
params: {
|
|
242
|
-
address: string;
|
|
243
|
-
};
|
|
244
|
-
query: PaginatedQueryParams;
|
|
245
|
-
response: {
|
|
246
|
-
data: {
|
|
247
|
-
id: string;
|
|
248
|
-
liquidated_account_id: Decimal | null;
|
|
249
|
-
liquidator_account_id: Decimal | null;
|
|
250
|
-
requested_quote_amount: Decimal | null;
|
|
251
|
-
collateral_out_address: string | null;
|
|
252
|
-
collateral_in_address: string | null;
|
|
253
|
-
collateral_amount_to_liquidator: Decimal | null;
|
|
254
|
-
quote_amount_to_insurance_fund: Decimal | null;
|
|
255
|
-
quote_amount_to_account: Decimal | null;
|
|
256
|
-
block_timestamp: Decimal | null;
|
|
257
|
-
block_number: Decimal;
|
|
258
|
-
transaction_hash: string;
|
|
259
|
-
unique_id: bigint | null;
|
|
260
|
-
}[];
|
|
261
|
-
meta: PaginatedQueryMeta;
|
|
262
|
-
};
|
|
263
|
-
};
|
|
264
|
-
Swaps: {
|
|
265
|
-
params: {
|
|
266
|
-
address: string;
|
|
267
|
-
};
|
|
268
|
-
query: PaginatedQueryParams;
|
|
269
|
-
response: {
|
|
270
|
-
data: {
|
|
271
|
-
id: string;
|
|
272
|
-
account_id: Decimal;
|
|
273
|
-
token_in: string;
|
|
274
|
-
token_out: string;
|
|
275
|
-
amount_in: Decimal;
|
|
276
|
-
amount_out: Decimal;
|
|
277
|
-
executed_amount_out: Decimal;
|
|
278
|
-
transaction_hash: string;
|
|
279
|
-
block_timestamp: Decimal;
|
|
280
|
-
block_number: Decimal;
|
|
281
|
-
unique_id: bigint | null;
|
|
282
|
-
}[];
|
|
283
|
-
meta: PaginatedQueryMeta;
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
MarketOrders: {
|
|
287
|
-
params: {
|
|
288
|
-
marketId: string;
|
|
289
|
-
type?: string;
|
|
290
|
-
};
|
|
291
|
-
query: PaginatedQueryParams;
|
|
292
|
-
response: {
|
|
293
|
-
data: Order[];
|
|
294
|
-
meta: PaginatedQueryMeta;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
AccountOrders: {
|
|
298
|
-
params: {
|
|
299
|
-
accountId: string;
|
|
300
|
-
type?: string;
|
|
301
|
-
};
|
|
302
|
-
query: PaginatedQueryParams;
|
|
303
|
-
response: {
|
|
304
|
-
data: Order[];
|
|
305
|
-
meta: PaginatedQueryMeta;
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
WalletBalanceHistory: {
|
|
309
|
-
params: {
|
|
310
|
-
address: string;
|
|
311
|
-
timestamp?: string;
|
|
312
|
-
};
|
|
313
|
-
query: never;
|
|
314
|
-
response: {
|
|
315
|
-
timestamp: number;
|
|
316
|
-
balance: number;
|
|
317
|
-
}[];
|
|
318
|
-
};
|
|
319
|
-
WalletOrders: {
|
|
320
|
-
params: {
|
|
321
|
-
address: string;
|
|
322
|
-
type?: string;
|
|
323
|
-
};
|
|
324
|
-
query: PaginatedQueryParams;
|
|
325
|
-
response: {
|
|
326
|
-
data: Order[];
|
|
327
|
-
meta: PaginatedQueryMeta;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
RiskMatrices: {
|
|
331
|
-
params: {
|
|
332
|
-
poolId: string;
|
|
333
|
-
};
|
|
334
|
-
query: never;
|
|
335
|
-
response: {
|
|
336
|
-
blockId: Decimal;
|
|
337
|
-
matrix: string[][];
|
|
338
|
-
}[];
|
|
339
|
-
};
|
|
340
|
-
Markets: {
|
|
341
|
-
params: never;
|
|
342
|
-
query: never;
|
|
343
|
-
response: {
|
|
344
|
-
id: Decimal;
|
|
345
|
-
ticker: string;
|
|
346
|
-
markPrice: number;
|
|
347
|
-
isActive: boolean;
|
|
348
|
-
maxLeverage: number;
|
|
349
|
-
volume24H: number;
|
|
350
|
-
priceChange24H: number;
|
|
351
|
-
longOI: number;
|
|
352
|
-
shortOI: number;
|
|
353
|
-
availableLong: number;
|
|
354
|
-
availableShort: number;
|
|
355
|
-
marketPriceDeviation: number;
|
|
356
|
-
riskBlockId: number;
|
|
357
|
-
rootCollateralPoolId: number;
|
|
358
|
-
description: string;
|
|
359
|
-
name: string;
|
|
360
|
-
quoteTokenId: string;
|
|
361
|
-
tickSizeDecimals: number;
|
|
362
|
-
underlyingAssetId: string;
|
|
363
|
-
priceChange24HPercentage: number;
|
|
364
|
-
openInterest: number;
|
|
365
|
-
fundingRate: number;
|
|
366
|
-
priority: number;
|
|
367
|
-
}[];
|
|
368
|
-
};
|
|
369
|
-
TierFees: {
|
|
370
|
-
params: never;
|
|
371
|
-
query: never;
|
|
372
|
-
response: {
|
|
373
|
-
market_id: Decimal;
|
|
374
|
-
tier_id: Decimal;
|
|
375
|
-
fee_parameter: Decimal | null;
|
|
376
|
-
}[];
|
|
377
|
-
};
|
|
378
|
-
AccountsTiers: {
|
|
379
|
-
params: {
|
|
380
|
-
address: string;
|
|
381
|
-
};
|
|
382
|
-
query: never;
|
|
383
|
-
response: {
|
|
384
|
-
market_id: Decimal;
|
|
385
|
-
account_id: Decimal;
|
|
386
|
-
tier_id: Decimal;
|
|
387
|
-
}[];
|
|
388
|
-
};
|
|
389
|
-
CollateralConfiguration: {
|
|
390
|
-
params: never;
|
|
391
|
-
query: never;
|
|
392
|
-
response: {
|
|
393
|
-
collateral_pool_id: Decimal;
|
|
394
|
-
collateral_address: string;
|
|
395
|
-
price_haircut: Decimal | null;
|
|
396
|
-
auto_exchange_discount: Decimal | null;
|
|
397
|
-
oracle_node_id: string | null;
|
|
398
|
-
block_timestamp: Decimal | null;
|
|
399
|
-
block_number: Decimal;
|
|
400
|
-
unique_id: bigint | null;
|
|
401
|
-
}[];
|
|
402
|
-
};
|
|
188
|
+
'poolBalance/:poolId?': TradingApiEndpoint<{
|
|
189
|
+
id: number;
|
|
190
|
+
timestamp: bigint;
|
|
191
|
+
pool_id: number;
|
|
192
|
+
value: Decimal;
|
|
193
|
+
apy: Decimal;
|
|
194
|
+
share_price: Decimal;
|
|
195
|
+
share_price_index: Decimal;
|
|
196
|
+
} | null, {
|
|
197
|
+
poolId?: string;
|
|
198
|
+
}>;
|
|
199
|
+
'wallet/:address/leverages': TradingApiListEndpoint<Leverage, {
|
|
200
|
+
address: string;
|
|
201
|
+
}, 'accountLeveragePerMarket'>;
|
|
202
|
+
'markets/configuration': TradingApiListEndpoint<{
|
|
203
|
+
market_id: Decimal;
|
|
204
|
+
risk_matrix_index: Decimal | null;
|
|
205
|
+
max_open_base: Decimal | null;
|
|
206
|
+
velocity_multiplier: Decimal | null;
|
|
207
|
+
minimum_order_base: Decimal | null;
|
|
208
|
+
base_spacing: Decimal | null;
|
|
209
|
+
price_spacing: Decimal | null;
|
|
210
|
+
oracle_node_id: string | null;
|
|
211
|
+
mtm_window: Decimal | null;
|
|
212
|
+
dutch_config_lambda: Decimal | null;
|
|
213
|
+
dutch_config_min_base: Decimal | null;
|
|
214
|
+
slippage_params_phi: Decimal | null;
|
|
215
|
+
slippage_params_beta: Decimal | null;
|
|
216
|
+
depth_factor: Decimal | null;
|
|
217
|
+
max_exposure_factor: Decimal | null;
|
|
218
|
+
max_p_slippage: Decimal | null;
|
|
219
|
+
price_spread: Decimal | null;
|
|
220
|
+
volatility_index_multiplier: Decimal | null;
|
|
221
|
+
block_timestamp: Decimal | null;
|
|
222
|
+
block_number: Decimal;
|
|
223
|
+
unique_id: bigint | null;
|
|
224
|
+
}>;
|
|
225
|
+
'markets/storage': TradingApiListEndpoint<{
|
|
226
|
+
market_id: Decimal;
|
|
227
|
+
quote_collateral: string | null;
|
|
228
|
+
instrument_address: string | null;
|
|
229
|
+
name: string | null;
|
|
230
|
+
risk_block_id: Decimal | null;
|
|
231
|
+
collateral_pool_id: Decimal | null;
|
|
232
|
+
block_timestamp: Decimal | null;
|
|
233
|
+
block_number: Decimal;
|
|
234
|
+
unique_id: bigint | null;
|
|
235
|
+
}>;
|
|
236
|
+
'markets/trackers': TradingApiListEndpoint<{
|
|
237
|
+
market_data_id: Decimal;
|
|
238
|
+
passive_pool_id: Decimal | null;
|
|
239
|
+
pool_account_id: Decimal | null;
|
|
240
|
+
quote_token: string | null;
|
|
241
|
+
quote_token_decimals: Decimal | null;
|
|
242
|
+
last_funding_velocity: Decimal | null;
|
|
243
|
+
last_funding_timestamp: Decimal | null;
|
|
244
|
+
last_mtm_price: Decimal | null;
|
|
245
|
+
last_mtm_timestamp: Decimal | null;
|
|
246
|
+
long_trackers_funding_value: Decimal | null;
|
|
247
|
+
last_funding_rate: Decimal | null;
|
|
248
|
+
long_trackers_base_multiplier: Decimal | null;
|
|
249
|
+
long_trackers_adl_unwind_price: Decimal | null;
|
|
250
|
+
short_trackers_funding_value: Decimal | null;
|
|
251
|
+
short_trackers_base_multiplier: Decimal | null;
|
|
252
|
+
short_trackers_adl_unwind_price: Decimal | null;
|
|
253
|
+
open_interest: Decimal | null;
|
|
254
|
+
block_timestamp: Decimal | null;
|
|
255
|
+
block_number: Decimal;
|
|
256
|
+
unique_id: bigint | null;
|
|
257
|
+
}>;
|
|
258
|
+
'wallet/:address/positions': TradingApiListEndpoint<Position, AddressParam, 'position_raw'>;
|
|
259
|
+
'wallet/:address/conditionalOrders': TradingApiListEndpoint<ConditionalOrder, AddressParam, 'ConditionalOrders'>;
|
|
260
|
+
assets: TradingApiListEndpoint<{
|
|
261
|
+
address: string;
|
|
262
|
+
name: string;
|
|
263
|
+
short: string;
|
|
264
|
+
createdAt: Date;
|
|
265
|
+
updatedAt: Date;
|
|
266
|
+
asset_price_contract_id: string | null;
|
|
267
|
+
asset_price_usdc_contract_id: string | null;
|
|
268
|
+
decimals: number;
|
|
269
|
+
}>;
|
|
270
|
+
prices: TradingApiListEndpoint<Price>;
|
|
271
|
+
'wallet/:address/accounts': TradingApiListEndpoint<Account, AddressParam, 'accountProfile'>;
|
|
272
|
+
'wallet/:address/accounts/tiers': TradingApiListEndpoint<{
|
|
273
|
+
market_id: Decimal;
|
|
274
|
+
account_id: Decimal;
|
|
275
|
+
tier_id: Decimal;
|
|
276
|
+
}, AddressParam>;
|
|
277
|
+
'wallet/:address/accounts/balances': TradingApiListEndpoint<AccountBalance, AddressParam, 'account_balances'>;
|
|
278
|
+
'wallet/:address/autoExchange': TradingApiInfiniteListEndpoint<AutoExchange, AddressParam, 'auto_exchange'>;
|
|
279
|
+
'wallet/:address/swaps': TradingApiInfiniteListEndpoint<Swap, AddressParam, 'swaps'>;
|
|
280
|
+
'market/:marketId/orders': TradingApiInfiniteListEndpoint<Order, {
|
|
281
|
+
marketId: string;
|
|
282
|
+
type?: string;
|
|
283
|
+
}, 'order_history'>;
|
|
284
|
+
'account/:accountId/orders': TradingApiInfiniteListEndpoint<Order, {
|
|
285
|
+
accountId: string;
|
|
286
|
+
type?: string;
|
|
287
|
+
}, 'order_history'>;
|
|
288
|
+
'wallet/:address/balanceHistory/:timestamp?': TradingApiListEndpoint<{
|
|
289
|
+
timestamp: number;
|
|
290
|
+
balance: number;
|
|
291
|
+
}, {
|
|
292
|
+
address: string;
|
|
293
|
+
timestamp?: string;
|
|
294
|
+
}>;
|
|
295
|
+
'wallet/:address/orders/:type?': TradingApiInfiniteListEndpoint<Order, {
|
|
296
|
+
address: string;
|
|
297
|
+
type?: string;
|
|
298
|
+
}, 'order_history'>;
|
|
299
|
+
'riskMatrices/:poolId?': TradingApiListEndpoint<{
|
|
300
|
+
blockId: Decimal;
|
|
301
|
+
matrix: string[][];
|
|
302
|
+
}, {
|
|
303
|
+
poolId: string;
|
|
304
|
+
}>;
|
|
305
|
+
markets: TradingApiListEndpoint<Market>;
|
|
306
|
+
tierFees: TradingApiListEndpoint<{
|
|
307
|
+
market_id: Decimal;
|
|
308
|
+
tier_id: Decimal;
|
|
309
|
+
fee_parameter: Decimal | null;
|
|
310
|
+
}>;
|
|
311
|
+
collateralConfiguration: TradingApiListEndpoint<{
|
|
312
|
+
collateral_pool_id: Decimal;
|
|
313
|
+
collateral_address: string;
|
|
314
|
+
price_haircut: Decimal | null;
|
|
315
|
+
auto_exchange_discount: Decimal | null;
|
|
316
|
+
oracle_node_id: string | null;
|
|
317
|
+
block_timestamp: Decimal | null;
|
|
318
|
+
block_number: Decimal;
|
|
319
|
+
unique_id: bigint | null;
|
|
320
|
+
}>;
|
|
321
|
+
candles: TradingApiEndpoint<{
|
|
322
|
+
t: number[];
|
|
323
|
+
o: number[];
|
|
324
|
+
h: number[];
|
|
325
|
+
l: number[];
|
|
326
|
+
c: number[];
|
|
327
|
+
}, never, never, never, {
|
|
328
|
+
from: number;
|
|
329
|
+
to: number;
|
|
330
|
+
resolution: 1 | 5 | 15 | 30 | 60 | 240 | '1D';
|
|
331
|
+
symbol: string;
|
|
332
|
+
}>;
|
|
403
333
|
};
|
|
404
334
|
export type Stringified<T, D = Decimal> = T extends D | bigint | Date ? string : T extends (infer U)[] ? Stringified<U, D>[] : {
|
|
405
335
|
[K in keyof T]: Stringified<T[K], D>;
|
|
@@ -413,7 +343,37 @@ export type TradingApi = {
|
|
|
413
343
|
params: TradingApiSource[K]['params'];
|
|
414
344
|
query: TradingApiSource[K]['query'];
|
|
415
345
|
response: Stringified<TradingApiSource[K]['response']>;
|
|
346
|
+
replication: Stringified<TradingApiSource[K]['replication']>;
|
|
416
347
|
};
|
|
417
348
|
};
|
|
349
|
+
type ReplicationModel = string | never;
|
|
350
|
+
export type GenericReplicationMessage<T, model extends ReplicationModel> = {
|
|
351
|
+
model: model;
|
|
352
|
+
result: T;
|
|
353
|
+
operation: 'create' | 'update' | 'upsert' | 'delete';
|
|
354
|
+
} | {
|
|
355
|
+
model: model;
|
|
356
|
+
result: T[];
|
|
357
|
+
operation: 'updateMany';
|
|
358
|
+
};
|
|
359
|
+
type account_collateral_balance_entries = {
|
|
360
|
+
id: string;
|
|
361
|
+
account_id: Decimal | null;
|
|
362
|
+
collateral: string | null;
|
|
363
|
+
amount: Decimal | null;
|
|
364
|
+
transaction_hash: string;
|
|
365
|
+
block_timestamp: Decimal | null;
|
|
366
|
+
block_number: Decimal;
|
|
367
|
+
unique_id: bigint | null;
|
|
368
|
+
};
|
|
369
|
+
type account_owner_updated_snapshot = {
|
|
370
|
+
account_id: Decimal;
|
|
371
|
+
transaction_hash: string;
|
|
372
|
+
new_owner: string | null;
|
|
373
|
+
block_timestamp: Decimal | null;
|
|
374
|
+
block_number: Decimal;
|
|
375
|
+
unique_id: bigint | null;
|
|
376
|
+
};
|
|
377
|
+
export type ReplicationMessage = GenericReplicationMessage<Order, 'order_history'> | GenericReplicationMessage<ConditionalOrder, 'ConditionalOrders'> | GenericReplicationMessage<Swap, 'swaps'> | GenericReplicationMessage<AutoExchange, 'auto_exchange'> | GenericReplicationMessage<Position, 'position_raw'> | GenericReplicationMessage<Price, 'asset_price'> | GenericReplicationMessage<Account, 'accountProfile'> | GenericReplicationMessage<Leverage, 'accountLeveragePerMarket'> | GenericReplicationMessage<account_owner_updated_snapshot, 'account_owner_updated_snapshot'> | GenericReplicationMessage<account_collateral_balance_entries, 'account_collateral_balance_entries'> | GenericReplicationMessage<AccountBalance, 'account_balances'> | GenericReplicationMessage<Market, 'Market'>;
|
|
418
378
|
export {};
|
|
419
379
|
//# sourceMappingURL=trading-api-types.d.ts.map
|