@lifi/perps-types 9.0.0 → 11.0.0
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/cjs/account.d.ts +16 -8
- package/dist/cjs/account.d.ts.map +1 -1
- package/dist/esm/account.d.ts +78 -15
- package/dist/esm/account.d.ts.map +1 -1
- package/dist/types/account.d.ts +78 -15
- package/dist/types/account.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +79 -15
package/dist/cjs/account.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export interface OpenOrder {
|
|
|
29
29
|
market: MarketDisplay;
|
|
30
30
|
side: OrderSide;
|
|
31
31
|
type: OrderType;
|
|
32
|
-
|
|
32
|
+
originalSize: string;
|
|
33
|
+
remainingSize: string;
|
|
33
34
|
price: string;
|
|
34
35
|
filledSize: string;
|
|
35
36
|
reduceOnly: boolean;
|
|
@@ -85,6 +86,10 @@ export interface OrdersResponse {
|
|
|
85
86
|
triggerOrders: TriggerOrder[];
|
|
86
87
|
pagination: Pagination;
|
|
87
88
|
}
|
|
89
|
+
export interface Fee {
|
|
90
|
+
amount: string;
|
|
91
|
+
asset: string;
|
|
92
|
+
}
|
|
88
93
|
export interface Fill {
|
|
89
94
|
id: string;
|
|
90
95
|
orderId: string;
|
|
@@ -96,7 +101,7 @@ export interface Fill {
|
|
|
96
101
|
status: FillStatus;
|
|
97
102
|
liquidity: LiquidityRole;
|
|
98
103
|
filledSize?: string;
|
|
99
|
-
fee?:
|
|
104
|
+
fee?: Fee;
|
|
100
105
|
realizedPnl?: string | null;
|
|
101
106
|
startPosition?: string;
|
|
102
107
|
classification: FillClassification;
|
|
@@ -121,25 +126,27 @@ export interface BaseActivity {
|
|
|
121
126
|
}
|
|
122
127
|
export interface DepositActivity extends BaseActivity {
|
|
123
128
|
type: ActivityType.DEPOSIT;
|
|
129
|
+
asset: string;
|
|
124
130
|
amount: string;
|
|
125
131
|
explorerLink?: string;
|
|
126
132
|
}
|
|
127
133
|
export interface WithdrawalActivity extends BaseActivity {
|
|
128
134
|
type: ActivityType.WITHDRAWAL;
|
|
135
|
+
asset: string;
|
|
129
136
|
amount: string;
|
|
130
|
-
fee
|
|
137
|
+
fee?: Fee;
|
|
131
138
|
explorerLink?: string;
|
|
132
139
|
}
|
|
133
140
|
export interface LiquidatedPosition {
|
|
134
141
|
market: MarketDisplay;
|
|
135
|
-
size
|
|
142
|
+
size?: string;
|
|
136
143
|
}
|
|
137
144
|
export interface LiquidationActivity extends BaseActivity {
|
|
138
145
|
type: ActivityType.LIQUIDATION;
|
|
139
|
-
liquidatedNotionalPosition
|
|
140
|
-
accountValue
|
|
141
|
-
leverageType
|
|
142
|
-
liquidatedPositions: LiquidatedPosition[];
|
|
146
|
+
liquidatedNotionalPosition?: string;
|
|
147
|
+
accountValue?: string;
|
|
148
|
+
leverageType?: string;
|
|
149
|
+
liquidatedPositions: [LiquidatedPosition, ...LiquidatedPosition[]];
|
|
143
150
|
}
|
|
144
151
|
export interface FundingActivity extends BaseActivity {
|
|
145
152
|
type: ActivityType.FUNDING;
|
|
@@ -153,6 +160,7 @@ export type TransferActivity = BaseActivity & {
|
|
|
153
160
|
direction: 'IN' | 'OUT';
|
|
154
161
|
asset: string;
|
|
155
162
|
amount: string;
|
|
163
|
+
fees?: Fee[];
|
|
156
164
|
meta?: Record<string, unknown>;
|
|
157
165
|
explorerLink?: string;
|
|
158
166
|
} & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,M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Ae,CAAC,EAAE,MAAM,CAAA;IAExB,aAAa,EAAE,OAAO,CAAA;IAEtB,gBAAgB,EAAE,OAAO,CAAA;IAEzB,WAAW,EAAE,OAAO,CAAA;IAEpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAOD,MAAM,MAAM,aAAa,GACrB,wBAAwB,GACxB,oBAAoB,GACpB,iBAAiB,CAAA;AAOrB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IAEZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CACxC;AAQD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAE5B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/esm/account.d.ts
CHANGED
|
@@ -76,8 +76,10 @@ export interface OpenOrder {
|
|
|
76
76
|
market: MarketDisplay;
|
|
77
77
|
side: OrderSide;
|
|
78
78
|
type: OrderType;
|
|
79
|
-
/**
|
|
80
|
-
|
|
79
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
80
|
+
originalSize: string;
|
|
81
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
82
|
+
remainingSize: string;
|
|
81
83
|
/** Limit/order price in quote-asset units. */
|
|
82
84
|
price: string;
|
|
83
85
|
/** Quantity already filled in base-asset units. */
|
|
@@ -194,6 +196,24 @@ export interface OrdersResponse {
|
|
|
194
196
|
triggerOrders: TriggerOrder[];
|
|
195
197
|
pagination: Pagination;
|
|
196
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
201
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
202
|
+
* a consumer must format the amount against `asset` and never against the
|
|
203
|
+
* fill's quote asset or the activity's own `asset`.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
export interface Fee {
|
|
208
|
+
/** Decimal string in `asset`'s units. */
|
|
209
|
+
amount: string;
|
|
210
|
+
/**
|
|
211
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
212
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
213
|
+
* symbol.
|
|
214
|
+
*/
|
|
215
|
+
asset: string;
|
|
216
|
+
}
|
|
197
217
|
/**
|
|
198
218
|
* Normalized execution/fill record for an order.
|
|
199
219
|
*
|
|
@@ -215,7 +235,8 @@ export interface Fill {
|
|
|
215
235
|
status: FillStatus;
|
|
216
236
|
liquidity: LiquidityRole;
|
|
217
237
|
filledSize?: string;
|
|
218
|
-
fee
|
|
238
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
239
|
+
fee?: Fee;
|
|
219
240
|
realizedPnl?: string | null;
|
|
220
241
|
startPosition?: string;
|
|
221
242
|
classification: FillClassification;
|
|
@@ -258,26 +279,38 @@ export interface BaseActivity {
|
|
|
258
279
|
timestamp: string;
|
|
259
280
|
}
|
|
260
281
|
/**
|
|
261
|
-
* Account activity representing a completed deposit.
|
|
282
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
283
|
+
* string in `asset`'s units.
|
|
262
284
|
*
|
|
263
285
|
* @public
|
|
264
286
|
*/
|
|
265
287
|
export interface DepositActivity extends BaseActivity {
|
|
266
288
|
type: ActivityType.DEPOSIT;
|
|
289
|
+
/**
|
|
290
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
291
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
292
|
+
*/
|
|
293
|
+
asset: string;
|
|
267
294
|
amount: string;
|
|
268
295
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
269
296
|
explorerLink?: string;
|
|
270
297
|
}
|
|
271
298
|
/**
|
|
272
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
273
|
-
*
|
|
299
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
300
|
+
* string in `asset`'s units.
|
|
274
301
|
*
|
|
275
302
|
* @public
|
|
276
303
|
*/
|
|
277
304
|
export interface WithdrawalActivity extends BaseActivity {
|
|
278
305
|
type: ActivityType.WITHDRAWAL;
|
|
306
|
+
/**
|
|
307
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
308
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
309
|
+
*/
|
|
310
|
+
asset: string;
|
|
279
311
|
amount: string;
|
|
280
|
-
fee
|
|
312
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
313
|
+
fee?: Fee;
|
|
281
314
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
282
315
|
explorerLink?: string;
|
|
283
316
|
}
|
|
@@ -288,19 +321,35 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
288
321
|
*/
|
|
289
322
|
export interface LiquidatedPosition {
|
|
290
323
|
market: MarketDisplay;
|
|
291
|
-
size
|
|
324
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
325
|
+
size?: string;
|
|
292
326
|
}
|
|
293
327
|
/**
|
|
294
|
-
* Account activity representing a liquidation event.
|
|
328
|
+
* Account activity representing a liquidation event. A venue that liquidates
|
|
329
|
+
* several cross-margin positions in one cascade reports them as one activity
|
|
330
|
+
* with several entries, so consumers must never group activities by
|
|
331
|
+
* timestamp.
|
|
295
332
|
*
|
|
296
333
|
* @public
|
|
297
334
|
*/
|
|
298
335
|
export interface LiquidationActivity extends BaseActivity {
|
|
299
336
|
type: ActivityType.LIQUIDATION;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
337
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
338
|
+
liquidatedNotionalPosition?: string;
|
|
339
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
340
|
+
accountValue?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
343
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
344
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
345
|
+
* liquidation row.
|
|
346
|
+
*/
|
|
347
|
+
leverageType?: string;
|
|
348
|
+
/**
|
|
349
|
+
* At least one entry is guaranteed — a provider adapter drops any
|
|
350
|
+
* liquidation record whose positions it cannot resolve to a known market.
|
|
351
|
+
*/
|
|
352
|
+
liquidatedPositions: [LiquidatedPosition, ...LiquidatedPosition[]];
|
|
304
353
|
}
|
|
305
354
|
/**
|
|
306
355
|
* Account activity representing a periodic funding payment. Amount and rate
|
|
@@ -311,13 +360,19 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
311
360
|
export interface FundingActivity extends BaseActivity {
|
|
312
361
|
type: ActivityType.FUNDING;
|
|
313
362
|
market: MarketDisplay;
|
|
363
|
+
/**
|
|
364
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
365
|
+
* funding; negative means the account paid it.
|
|
366
|
+
*/
|
|
314
367
|
amount: string;
|
|
315
368
|
positionSize: string;
|
|
316
369
|
fundingRate: string;
|
|
317
370
|
}
|
|
318
371
|
/**
|
|
319
|
-
* Account activity representing an inbound or outbound transfer
|
|
320
|
-
* counterparty identifier is required by the
|
|
372
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
373
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
374
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
375
|
+
* margin-location moves — are never reported as transfers.
|
|
321
376
|
*
|
|
322
377
|
* @public
|
|
323
378
|
*/
|
|
@@ -326,6 +381,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
326
381
|
direction: 'IN' | 'OUT';
|
|
327
382
|
asset: string;
|
|
328
383
|
amount: string;
|
|
384
|
+
/**
|
|
385
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
386
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
387
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
388
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
389
|
+
* venue reports no fee.
|
|
390
|
+
*/
|
|
391
|
+
fees?: Fee[];
|
|
329
392
|
meta?: Record<string, unknown>;
|
|
330
393
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
331
394
|
explorerLink?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,IAAI,EAAE,YAAY,CAAA;IAClB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAA;IACxB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAA;IAChC,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ACrF,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,qGAAqG;IACrG,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/types/account.d.ts
CHANGED
|
@@ -76,8 +76,10 @@ export interface OpenOrder {
|
|
|
76
76
|
market: MarketDisplay;
|
|
77
77
|
side: OrderSide;
|
|
78
78
|
type: OrderType;
|
|
79
|
-
/**
|
|
80
|
-
|
|
79
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
80
|
+
originalSize: string;
|
|
81
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
82
|
+
remainingSize: string;
|
|
81
83
|
/** Limit/order price in quote-asset units. */
|
|
82
84
|
price: string;
|
|
83
85
|
/** Quantity already filled in base-asset units. */
|
|
@@ -194,6 +196,24 @@ export interface OrdersResponse {
|
|
|
194
196
|
triggerOrders: TriggerOrder[];
|
|
195
197
|
pagination: Pagination;
|
|
196
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
201
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
202
|
+
* a consumer must format the amount against `asset` and never against the
|
|
203
|
+
* fill's quote asset or the activity's own `asset`.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
export interface Fee {
|
|
208
|
+
/** Decimal string in `asset`'s units. */
|
|
209
|
+
amount: string;
|
|
210
|
+
/**
|
|
211
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
212
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
213
|
+
* symbol.
|
|
214
|
+
*/
|
|
215
|
+
asset: string;
|
|
216
|
+
}
|
|
197
217
|
/**
|
|
198
218
|
* Normalized execution/fill record for an order.
|
|
199
219
|
*
|
|
@@ -215,7 +235,8 @@ export interface Fill {
|
|
|
215
235
|
status: FillStatus;
|
|
216
236
|
liquidity: LiquidityRole;
|
|
217
237
|
filledSize?: string;
|
|
218
|
-
fee
|
|
238
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
239
|
+
fee?: Fee;
|
|
219
240
|
realizedPnl?: string | null;
|
|
220
241
|
startPosition?: string;
|
|
221
242
|
classification: FillClassification;
|
|
@@ -258,26 +279,38 @@ export interface BaseActivity {
|
|
|
258
279
|
timestamp: string;
|
|
259
280
|
}
|
|
260
281
|
/**
|
|
261
|
-
* Account activity representing a completed deposit.
|
|
282
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
283
|
+
* string in `asset`'s units.
|
|
262
284
|
*
|
|
263
285
|
* @public
|
|
264
286
|
*/
|
|
265
287
|
export interface DepositActivity extends BaseActivity {
|
|
266
288
|
type: ActivityType.DEPOSIT;
|
|
289
|
+
/**
|
|
290
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
291
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
292
|
+
*/
|
|
293
|
+
asset: string;
|
|
267
294
|
amount: string;
|
|
268
295
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
269
296
|
explorerLink?: string;
|
|
270
297
|
}
|
|
271
298
|
/**
|
|
272
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
273
|
-
*
|
|
299
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
300
|
+
* string in `asset`'s units.
|
|
274
301
|
*
|
|
275
302
|
* @public
|
|
276
303
|
*/
|
|
277
304
|
export interface WithdrawalActivity extends BaseActivity {
|
|
278
305
|
type: ActivityType.WITHDRAWAL;
|
|
306
|
+
/**
|
|
307
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
308
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
309
|
+
*/
|
|
310
|
+
asset: string;
|
|
279
311
|
amount: string;
|
|
280
|
-
fee
|
|
312
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
313
|
+
fee?: Fee;
|
|
281
314
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
282
315
|
explorerLink?: string;
|
|
283
316
|
}
|
|
@@ -288,19 +321,35 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
288
321
|
*/
|
|
289
322
|
export interface LiquidatedPosition {
|
|
290
323
|
market: MarketDisplay;
|
|
291
|
-
size
|
|
324
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
325
|
+
size?: string;
|
|
292
326
|
}
|
|
293
327
|
/**
|
|
294
|
-
* Account activity representing a liquidation event.
|
|
328
|
+
* Account activity representing a liquidation event. A venue that liquidates
|
|
329
|
+
* several cross-margin positions in one cascade reports them as one activity
|
|
330
|
+
* with several entries, so consumers must never group activities by
|
|
331
|
+
* timestamp.
|
|
295
332
|
*
|
|
296
333
|
* @public
|
|
297
334
|
*/
|
|
298
335
|
export interface LiquidationActivity extends BaseActivity {
|
|
299
336
|
type: ActivityType.LIQUIDATION;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
337
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
338
|
+
liquidatedNotionalPosition?: string;
|
|
339
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
340
|
+
accountValue?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
343
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
344
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
345
|
+
* liquidation row.
|
|
346
|
+
*/
|
|
347
|
+
leverageType?: string;
|
|
348
|
+
/**
|
|
349
|
+
* At least one entry is guaranteed — a provider adapter drops any
|
|
350
|
+
* liquidation record whose positions it cannot resolve to a known market.
|
|
351
|
+
*/
|
|
352
|
+
liquidatedPositions: [LiquidatedPosition, ...LiquidatedPosition[]];
|
|
304
353
|
}
|
|
305
354
|
/**
|
|
306
355
|
* Account activity representing a periodic funding payment. Amount and rate
|
|
@@ -311,13 +360,19 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
311
360
|
export interface FundingActivity extends BaseActivity {
|
|
312
361
|
type: ActivityType.FUNDING;
|
|
313
362
|
market: MarketDisplay;
|
|
363
|
+
/**
|
|
364
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
365
|
+
* funding; negative means the account paid it.
|
|
366
|
+
*/
|
|
314
367
|
amount: string;
|
|
315
368
|
positionSize: string;
|
|
316
369
|
fundingRate: string;
|
|
317
370
|
}
|
|
318
371
|
/**
|
|
319
|
-
* Account activity representing an inbound or outbound transfer
|
|
320
|
-
* counterparty identifier is required by the
|
|
372
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
373
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
374
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
375
|
+
* margin-location moves — are never reported as transfers.
|
|
321
376
|
*
|
|
322
377
|
* @public
|
|
323
378
|
*/
|
|
@@ -326,6 +381,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
326
381
|
direction: 'IN' | 'OUT';
|
|
327
382
|
asset: string;
|
|
328
383
|
amount: string;
|
|
384
|
+
/**
|
|
385
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
386
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
387
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
388
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
389
|
+
* venue reports no fee.
|
|
390
|
+
*/
|
|
391
|
+
fees?: Fee[];
|
|
329
392
|
meta?: Record<string, unknown>;
|
|
330
393
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
331
394
|
explorerLink?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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@ -90,8 +90,10 @@ export interface OpenOrder {
|
|
|
90
90
|
market: MarketDisplay
|
|
91
91
|
side: OrderSide
|
|
92
92
|
type: OrderType
|
|
93
|
-
/**
|
|
94
|
-
|
|
93
|
+
/** Quantity the order was submitted for, in base-asset units. */
|
|
94
|
+
originalSize: string
|
|
95
|
+
/** Quantity still resting on the book, in base-asset units. */
|
|
96
|
+
remainingSize: string
|
|
95
97
|
/** Limit/order price in quote-asset units. */
|
|
96
98
|
price: string
|
|
97
99
|
/** Quantity already filled in base-asset units. */
|
|
@@ -216,6 +218,25 @@ export interface OrdersResponse {
|
|
|
216
218
|
pagination: Pagination
|
|
217
219
|
}
|
|
218
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Fee a venue charged, in the asset the venue charged it in. A venue does not
|
|
223
|
+
* always charge a fee in the asset the record is otherwise denominated in, so
|
|
224
|
+
* a consumer must format the amount against `asset` and never against the
|
|
225
|
+
* fill's quote asset or the activity's own `asset`.
|
|
226
|
+
*
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
export interface Fee {
|
|
230
|
+
/** Decimal string in `asset`'s units. */
|
|
231
|
+
amount: string
|
|
232
|
+
/**
|
|
233
|
+
* Display symbol the fee is denominated in, resolved by the provider
|
|
234
|
+
* adapter. Falls back to the venue's own asset id when the registry knows no
|
|
235
|
+
* symbol.
|
|
236
|
+
*/
|
|
237
|
+
asset: string
|
|
238
|
+
}
|
|
239
|
+
|
|
219
240
|
/**
|
|
220
241
|
* Normalized execution/fill record for an order.
|
|
221
242
|
*
|
|
@@ -237,7 +258,8 @@ export interface Fill {
|
|
|
237
258
|
status: FillStatus
|
|
238
259
|
liquidity: LiquidityRole
|
|
239
260
|
filledSize?: string
|
|
240
|
-
fee
|
|
261
|
+
/** Absent when the venue reports no fee for the fill. */
|
|
262
|
+
fee?: Fee
|
|
241
263
|
realizedPnl?: string | null
|
|
242
264
|
startPosition?: string
|
|
243
265
|
classification: FillClassification
|
|
@@ -284,27 +306,39 @@ export interface BaseActivity {
|
|
|
284
306
|
}
|
|
285
307
|
|
|
286
308
|
/**
|
|
287
|
-
* Account activity representing a completed deposit.
|
|
309
|
+
* Account activity representing a completed deposit. `amount` is a decimal
|
|
310
|
+
* string in `asset`'s units.
|
|
288
311
|
*
|
|
289
312
|
* @public
|
|
290
313
|
*/
|
|
291
314
|
export interface DepositActivity extends BaseActivity {
|
|
292
315
|
type: ActivityType.DEPOSIT
|
|
316
|
+
/**
|
|
317
|
+
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
318
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
319
|
+
*/
|
|
320
|
+
asset: string
|
|
293
321
|
amount: string
|
|
294
322
|
/** Fully-resolved block-explorer URL for the on-chain deposit tx. */
|
|
295
323
|
explorerLink?: string
|
|
296
324
|
}
|
|
297
325
|
|
|
298
326
|
/**
|
|
299
|
-
* Account activity representing a completed withdrawal. `amount`
|
|
300
|
-
*
|
|
327
|
+
* Account activity representing a completed withdrawal. `amount` is a decimal
|
|
328
|
+
* string in `asset`'s units.
|
|
301
329
|
*
|
|
302
330
|
* @public
|
|
303
331
|
*/
|
|
304
332
|
export interface WithdrawalActivity extends BaseActivity {
|
|
305
333
|
type: ActivityType.WITHDRAWAL
|
|
334
|
+
/**
|
|
335
|
+
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
336
|
+
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
337
|
+
*/
|
|
338
|
+
asset: string
|
|
306
339
|
amount: string
|
|
307
|
-
fee
|
|
340
|
+
/** Absent when the venue reports no fee for the withdrawal. */
|
|
341
|
+
fee?: Fee
|
|
308
342
|
/** Fully-resolved block-explorer URL for the on-chain withdrawal tx. */
|
|
309
343
|
explorerLink?: string
|
|
310
344
|
}
|
|
@@ -316,20 +350,36 @@ export interface WithdrawalActivity extends BaseActivity {
|
|
|
316
350
|
*/
|
|
317
351
|
export interface LiquidatedPosition {
|
|
318
352
|
market: MarketDisplay
|
|
319
|
-
size
|
|
353
|
+
/** Absent when the venue reports no liquidated size for the position. */
|
|
354
|
+
size?: string
|
|
320
355
|
}
|
|
321
356
|
|
|
322
357
|
/**
|
|
323
|
-
* Account activity representing a liquidation event.
|
|
358
|
+
* Account activity representing a liquidation event. A venue that liquidates
|
|
359
|
+
* several cross-margin positions in one cascade reports them as one activity
|
|
360
|
+
* with several entries, so consumers must never group activities by
|
|
361
|
+
* timestamp.
|
|
324
362
|
*
|
|
325
363
|
* @public
|
|
326
364
|
*/
|
|
327
365
|
export interface LiquidationActivity extends BaseActivity {
|
|
328
366
|
type: ActivityType.LIQUIDATION
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
367
|
+
/** Absent when the venue reports no liquidated notional. */
|
|
368
|
+
liquidatedNotionalPosition?: string
|
|
369
|
+
/** Absent when the venue reports no account value at liquidation time. */
|
|
370
|
+
accountValue?: string
|
|
371
|
+
/**
|
|
372
|
+
* Margin mode the liquidated account ran under, in the venue's own
|
|
373
|
+
* vocabulary — typically `cross` or `isolated`, but the venue may report
|
|
374
|
+
* any string. Absent when the venue reports no margin mode on a
|
|
375
|
+
* liquidation row.
|
|
376
|
+
*/
|
|
377
|
+
leverageType?: string
|
|
378
|
+
/**
|
|
379
|
+
* At least one entry is guaranteed — a provider adapter drops any
|
|
380
|
+
* liquidation record whose positions it cannot resolve to a known market.
|
|
381
|
+
*/
|
|
382
|
+
liquidatedPositions: [LiquidatedPosition, ...LiquidatedPosition[]]
|
|
333
383
|
}
|
|
334
384
|
|
|
335
385
|
/**
|
|
@@ -341,6 +391,10 @@ export interface LiquidationActivity extends BaseActivity {
|
|
|
341
391
|
export interface FundingActivity extends BaseActivity {
|
|
342
392
|
type: ActivityType.FUNDING
|
|
343
393
|
market: MarketDisplay
|
|
394
|
+
/**
|
|
395
|
+
* Signed, in quote-currency units. Positive means the account received
|
|
396
|
+
* funding; negative means the account paid it.
|
|
397
|
+
*/
|
|
344
398
|
amount: string
|
|
345
399
|
positionSize: string
|
|
346
400
|
fundingRate: string
|
|
@@ -349,8 +403,10 @@ export interface FundingActivity extends BaseActivity {
|
|
|
349
403
|
// At least one of `counterpartyAccountIndex` / `counterpartyAddress` is always
|
|
350
404
|
// present; both may appear together.
|
|
351
405
|
/**
|
|
352
|
-
* Account activity representing an inbound or outbound transfer
|
|
353
|
-
* counterparty identifier is required by the
|
|
406
|
+
* Account activity representing an inbound or outbound transfer between two
|
|
407
|
+
* distinct accounts. At least one counterparty identifier is required by the
|
|
408
|
+
* type-level union below. Same-account movements — a venue's own route or
|
|
409
|
+
* margin-location moves — are never reported as transfers.
|
|
354
410
|
*
|
|
355
411
|
* @public
|
|
356
412
|
*/
|
|
@@ -359,6 +415,14 @@ export type TransferActivity = BaseActivity & {
|
|
|
359
415
|
direction: 'IN' | 'OUT'
|
|
360
416
|
asset: string
|
|
361
417
|
amount: string
|
|
418
|
+
/**
|
|
419
|
+
* Every fee the venue charged for the transfer, in the order the venue
|
|
420
|
+
* reports them. A venue may charge several fees for one transfer, each in a
|
|
421
|
+
* different asset — a transfer fee plus a separate gas fee in the chain's
|
|
422
|
+
* native token — so this is a list and not a single amount. Absent when the
|
|
423
|
+
* venue reports no fee.
|
|
424
|
+
*/
|
|
425
|
+
fees?: Fee[]
|
|
362
426
|
meta?: Record<string, unknown>
|
|
363
427
|
/** Fully-resolved block-explorer URL for the on-chain transfer tx. */
|
|
364
428
|
explorerLink?: string
|