@lifi/perps-types 12.3.0 → 14.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 +34 -23
- package/dist/cjs/account.d.ts.map +1 -1
- package/dist/cjs/action.d.ts +2 -34
- package/dist/cjs/action.d.ts.map +1 -1
- package/dist/cjs/enums.d.ts +1 -21
- package/dist/cjs/enums.d.ts.map +1 -1
- package/dist/cjs/enums.js +2 -26
- package/dist/cjs/enums.js.map +1 -1
- package/dist/cjs/primitives.d.ts +1 -0
- package/dist/cjs/primitives.d.ts.map +1 -1
- package/dist/cjs/subscriptions.d.ts +2 -3
- package/dist/cjs/subscriptions.d.ts.map +1 -1
- package/dist/esm/account.d.ts +54 -57
- package/dist/esm/account.d.ts.map +1 -1
- package/dist/esm/action.d.ts +2 -53
- package/dist/esm/action.d.ts.map +1 -1
- package/dist/esm/enums.d.ts +11 -26
- package/dist/esm/enums.d.ts.map +1 -1
- package/dist/esm/enums.js +11 -30
- package/dist/esm/enums.js.map +1 -1
- package/dist/esm/primitives.d.ts +2 -0
- package/dist/esm/primitives.d.ts.map +1 -1
- package/dist/esm/subscriptions.d.ts +3 -9
- package/dist/esm/subscriptions.d.ts.map +1 -1
- package/dist/types/account.d.ts +54 -57
- package/dist/types/account.d.ts.map +1 -1
- package/dist/types/action.d.ts +2 -53
- package/dist/types/action.d.ts.map +1 -1
- package/dist/types/enums.d.ts +11 -26
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/primitives.d.ts +2 -0
- package/dist/types/primitives.d.ts.map +1 -1
- package/dist/types/subscriptions.d.ts +3 -9
- package/dist/types/subscriptions.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +64 -58
- package/src/action.ts +1 -57
- package/src/enums.ts +11 -30
- package/src/primitives.ts +3 -0
- package/src/subscriptions.ts +3 -10
package/dist/types/action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AcceptTermsParams } from './acceptTerms.js';
|
|
2
|
-
import type { ActionType, MarginMode, OrderSide,
|
|
3
|
-
import type {
|
|
2
|
+
import type { ActionType, MarginMode, OrderSide, OrderType, PerpsErrorCode, TimeInForce } from './enums.js';
|
|
3
|
+
import type { MarketRef } from './market.js';
|
|
4
4
|
import type { Address, Hex } from './primitives.js';
|
|
5
5
|
import type { CreateReferralCodeParams, OnboardParams } from './referral.js';
|
|
6
6
|
import type { PerpsTypedData } from './typedData.js';
|
|
@@ -254,34 +254,6 @@ export interface ModifyOrderInput {
|
|
|
254
254
|
triggerPrice?: string;
|
|
255
255
|
limitPrice?: string;
|
|
256
256
|
}
|
|
257
|
-
/**
|
|
258
|
-
* Normalized order returned by a provider, including lifecycle and trigger
|
|
259
|
-
* metadata. Quantities and prices are decimal strings.
|
|
260
|
-
*
|
|
261
|
-
* @public
|
|
262
|
-
*/
|
|
263
|
-
export interface Order {
|
|
264
|
-
orderId: string;
|
|
265
|
-
market: MarketDisplay;
|
|
266
|
-
side: OrderSide;
|
|
267
|
-
type: OrderType;
|
|
268
|
-
price?: string;
|
|
269
|
-
originalSize: string;
|
|
270
|
-
remainingSize: string;
|
|
271
|
-
filledSize: string;
|
|
272
|
-
timeInForce?: TimeInForce;
|
|
273
|
-
expiresAt?: string;
|
|
274
|
-
reduceOnly?: boolean;
|
|
275
|
-
isTrigger?: boolean;
|
|
276
|
-
triggerPrice?: string;
|
|
277
|
-
triggerCondition?: TriggerCondition;
|
|
278
|
-
status: OrderStatus;
|
|
279
|
-
/** Human-readable reason for a terminal non-FILLED status; undefined when no actionable detail. */
|
|
280
|
-
statusReason?: string;
|
|
281
|
-
averagePrice?: string;
|
|
282
|
-
createdAt: string;
|
|
283
|
-
updatedAt: string;
|
|
284
|
-
}
|
|
285
257
|
/**
|
|
286
258
|
* Parameters for placing a regular order on a market.
|
|
287
259
|
*
|
|
@@ -356,29 +328,6 @@ export interface CancelTwapOrderParams {
|
|
|
356
328
|
*/
|
|
357
329
|
twapId: string;
|
|
358
330
|
}
|
|
359
|
-
/**
|
|
360
|
-
* Normalized running-TWAP read model returned by provider TWAP queries.
|
|
361
|
-
* Quantities and prices are decimal strings.
|
|
362
|
-
*
|
|
363
|
-
* @public
|
|
364
|
-
*/
|
|
365
|
-
export interface TwapOrder {
|
|
366
|
-
/** Provider-native TWAP identifier, stringified (see {@link CancelTwapOrderParams.twapId}). */
|
|
367
|
-
twapId: string;
|
|
368
|
-
market: MarketDisplay;
|
|
369
|
-
side: OrderSide;
|
|
370
|
-
/** Total base-asset size the TWAP was placed for. */
|
|
371
|
-
totalSize: string;
|
|
372
|
-
/** Base-asset size executed so far. */
|
|
373
|
-
filledSize: string;
|
|
374
|
-
/** Volume-weighted average fill price; absent until the first child fill. */
|
|
375
|
-
avgFillPrice?: string;
|
|
376
|
-
/** ISO-8601 timestamp at which the TWAP started executing. */
|
|
377
|
-
startedAt: string;
|
|
378
|
-
/** Total execution window in seconds. */
|
|
379
|
-
durationSeconds: number;
|
|
380
|
-
status: TwapOrderStatus;
|
|
381
|
-
}
|
|
382
331
|
/**
|
|
383
332
|
* Parameters for cancelling one or more venue orders.
|
|
384
333
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C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"STOP_LIMIT",
|
|
64
64
|
TAKE_PROFIT_MARKET = "TAKE_PROFIT_MARKET",
|
|
65
65
|
TAKE_PROFIT_LIMIT = "TAKE_PROFIT_LIMIT",
|
|
66
|
-
|
|
67
|
-
/** Read-side only: TWAP parents/children surfaced in venue order feeds. Excluded from `PlaceOrderParams.type` — placement goes through `ActionType.PLACE_TWAP_ORDER`. */
|
|
66
|
+
/** Returned on SDK reads; placement uses `ActionType.PLACE_TWAP_ORDER`. */
|
|
68
67
|
TWAP = "TWAP"
|
|
69
68
|
}
|
|
70
69
|
/** Direction of an open position. @public */
|
|
@@ -95,22 +94,25 @@ export declare enum TimeInForce {
|
|
|
95
94
|
}
|
|
96
95
|
/** Lifecycle status of a provider order. @public */
|
|
97
96
|
export declare enum OrderStatus {
|
|
97
|
+
/** A placement TP/SL leg waits for its parent order to fill. */
|
|
98
98
|
PENDING = "PENDING",
|
|
99
|
+
/** The venue accepted the order and has not yet placed it on the book. Unlike `PENDING`, it waits on no parent order. */
|
|
100
|
+
ACCEPTED = "ACCEPTED",
|
|
101
|
+
/** Live on the book, or an armed trigger waiting for its trigger price. */
|
|
99
102
|
OPEN = "OPEN",
|
|
103
|
+
/** Open with a positive filled size. */
|
|
100
104
|
PARTIALLY_FILLED = "PARTIALLY_FILLED",
|
|
105
|
+
/** Terminal: the order filled. */
|
|
101
106
|
FILLED = "FILLED",
|
|
107
|
+
/** Terminal: the order was cancelled; statusReason carries the venue reason. */
|
|
102
108
|
CANCELLED = "CANCELLED",
|
|
109
|
+
/** Terminal: the order was rejected; statusReason carries the venue reason. */
|
|
103
110
|
REJECTED = "REJECTED",
|
|
111
|
+
/** Terminal: the order expired. */
|
|
104
112
|
EXPIRED = "EXPIRED",
|
|
113
|
+
/** The trigger price was hit and the order went live. */
|
|
105
114
|
TRIGGERED = "TRIGGERED"
|
|
106
115
|
}
|
|
107
|
-
/** Lifecycle status of an execution/fill. @public */
|
|
108
|
-
export declare enum FillStatus {
|
|
109
|
-
FILLED = "FILLED",
|
|
110
|
-
PARTIALLY_FILLED = "PARTIALLY_FILLED",
|
|
111
|
-
CANCELLED = "CANCELLED",
|
|
112
|
-
REJECTED = "REJECTED"
|
|
113
|
-
}
|
|
114
116
|
/** Whether a fill supplied maker or taker liquidity. @public */
|
|
115
117
|
export declare enum LiquidityRole {
|
|
116
118
|
MAKER = "maker",
|
|
@@ -165,23 +167,6 @@ export declare enum TriggerCondition {
|
|
|
165
167
|
ABOVE = "ABOVE",
|
|
166
168
|
BELOW = "BELOW"
|
|
167
169
|
}
|
|
168
|
-
/** Take-profit or stop-loss trigger order classification. @public */
|
|
169
|
-
export declare enum TriggerOrderType {
|
|
170
|
-
TAKE_PROFIT = "TAKE_PROFIT",
|
|
171
|
-
STOP_LOSS = "STOP_LOSS"
|
|
172
|
-
}
|
|
173
|
-
/** Lifecycle status of a trigger order. @public */
|
|
174
|
-
export declare enum TriggerOrderStatus {
|
|
175
|
-
WAITING = "WAITING",
|
|
176
|
-
TRIGGERED = "TRIGGERED",
|
|
177
|
-
CANCELLED = "CANCELLED"
|
|
178
|
-
}
|
|
179
|
-
/** Lifecycle status of a running TWAP order. @public */
|
|
180
|
-
export declare enum TwapOrderStatus {
|
|
181
|
-
RUNNING = "RUNNING",
|
|
182
|
-
COMPLETED = "COMPLETED",
|
|
183
|
-
CANCELLED = "CANCELLED"
|
|
184
|
-
}
|
|
185
170
|
/** Account activity record categories. @public */
|
|
186
171
|
export declare enum ActivityType {
|
|
187
172
|
DEPOSIT = "DEPOSIT",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,cAAc;IAExB,YAAY,OAAO;IACnB,wEAAwE;IACxE,WAAW,OAAO;IAClB,eAAe,OAAO;IACtB,YAAY,OAAO;IACnB;;;OAGG;IACH,eAAe,OAAO;IACtB,QAAQ,OAAO;IAGf,gBAAgB,OAAO;IACvB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Ac;CACxB;AAED,iEAAiE;AACjE,oBAAY,yBAAyB;IACnC,UAAU,eAAe;CAC1B;AAED,6DAA6D;AAC7D,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;CACpB;AAED,qFAAqF;AACrF,oBAAY,sBAAsB;IAChC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAC9B,kBAAkB,GAClB,yBAAyB,GACzB,qBAAqB,GACrB,sBAAsB,CAAA;AAE1B;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED;;;;;GAKG;AACH,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,SAAS,aAAa;IACtB,MAAM,UAAU;IAChB,sIAAsI;IACtI,IAAI,SAAS;IACb,qEAAqE;IACrE,IAAI,SAAS;IACb,gJAAgJ;IAChJ,OAAO,YAAY;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/primitives.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/primitives.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAA;AAE/B,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountSummary, Balance, Fill,
|
|
1
|
+
import type { AccountSummary, Balance, Fill, Order, Position } from './account.js';
|
|
2
2
|
import type { Candle, MarketContext, OhlcvInterval, OrderbookResponse, Trade } from './market.js';
|
|
3
3
|
import type { Address } from './primitives.js';
|
|
4
4
|
/** Subscription for the provider's aggregate market-context stream. @public */
|
|
@@ -104,14 +104,8 @@ export type TradesEvent = {
|
|
|
104
104
|
export type OrderUpdatesEvent = {
|
|
105
105
|
channel: 'orderUpdates';
|
|
106
106
|
data: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
/** Upserts — active orders with trigger semantics (TP/SL). */
|
|
110
|
-
triggerOrders: TriggerOrder[];
|
|
111
|
-
/**
|
|
112
|
-
* orderIds whose status just transitioned to terminal (filled, cancelled,
|
|
113
|
-
* rejected, expired). Consumers should evict these from both buckets.
|
|
114
|
-
*/
|
|
107
|
+
orders: Order[];
|
|
108
|
+
/** Terminal order ids to evict from an active-order cache. */
|
|
115
109
|
terminated: string[];
|
|
116
110
|
};
|
|
117
111
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,IAAI,EACJ,KAAK,EACL,QAAQ,EACT,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,KAAK,EACN,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,+EAA+E;AAC/E,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,gBAAgB,CAAA;IACzB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AACD,iEAAiE;AACjE,MAAM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ACD,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,IAAI,EAAE,CAAA;CAAE,CAAA;AAC3D;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAA;AACvE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,CAAC,OAAO,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAA;CACvC,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,gBAAgB,CAAA;IACzB,IAAI,EAAE,cAAc,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,WAAW,GACX,iBAAiB,GACjB,UAAU,GACV,cAAc,GACd,iBAAiB,GACjB,mBAAmB,CAAA"}
|
package/package.json
CHANGED
package/src/account.ts
CHANGED
|
@@ -3,15 +3,17 @@ import type {
|
|
|
3
3
|
ActionType,
|
|
4
4
|
ActivityType,
|
|
5
5
|
FillClassification,
|
|
6
|
-
FillStatus,
|
|
7
6
|
LiquidityRole,
|
|
8
7
|
MarginMode,
|
|
9
8
|
OrderSide,
|
|
9
|
+
OrderStatus,
|
|
10
10
|
OrderType,
|
|
11
11
|
PositionSide,
|
|
12
|
+
TimeInForce,
|
|
13
|
+
TriggerCondition,
|
|
12
14
|
} from './enums.js'
|
|
13
15
|
import type { MarketDisplay, PerpsMarketDisplay } from './market.js'
|
|
14
|
-
import type { Address } from './primitives.js'
|
|
16
|
+
import type { Address, ProviderId } from './primitives.js'
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Maker and taker fee rates for the account's current venue tier.
|
|
@@ -80,33 +82,63 @@ export interface PositionMarginConstraints {
|
|
|
80
82
|
amountIncrement: string
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @public
|
|
87
|
-
*/
|
|
88
|
-
export interface OpenOrder {
|
|
85
|
+
/** Shared identity, quantities, and lifecycle of a venue order. */
|
|
86
|
+
export interface OrderBase {
|
|
87
|
+
/** Venue-assigned id: Hyperliquid `oid`, Lighter `order_index`, Ondo `orderId`. */
|
|
89
88
|
orderId: string
|
|
89
|
+
/** Client-set id, absent when the placer set none. */
|
|
90
|
+
clientOrderId?: string
|
|
90
91
|
market: MarketDisplay
|
|
91
92
|
side: OrderSide
|
|
92
|
-
|
|
93
|
-
/**
|
|
93
|
+
status: OrderStatus
|
|
94
|
+
/** Venue text for a REJECTED or CANCELLED order, when the venue gives one. */
|
|
95
|
+
statusReason?: string
|
|
94
96
|
originalSize: string
|
|
95
|
-
/** Quantity still resting on the book, in base-asset units. */
|
|
96
97
|
remainingSize: string
|
|
97
|
-
/** Limit/order price in quote-asset units. */
|
|
98
|
-
price: string
|
|
99
|
-
/** Quantity already filled in base-asset units. */
|
|
100
98
|
filledSize: string
|
|
99
|
+
averagePrice?: string
|
|
101
100
|
reduceOnly: boolean
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
/** Parent of a placement TP/SL leg or TWAP child; absent on position-level triggers. */
|
|
102
|
+
parentOrderId?: string
|
|
103
|
+
/** Set only when the venue row carries a transaction hash. */
|
|
104
|
+
explorerLink?: string
|
|
104
105
|
createdAt: string
|
|
106
|
+
updatedAt: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Market or limit order with a time-in-force policy. */
|
|
110
|
+
export interface RegularOrder extends OrderBase {
|
|
111
|
+
type: OrderType.MARKET | OrderType.LIMIT
|
|
112
|
+
price?: string
|
|
113
|
+
timeInForce: TimeInForce
|
|
114
|
+
expiresAt?: string
|
|
105
115
|
}
|
|
106
116
|
|
|
117
|
+
/** Price-activated take-profit or stop-loss order. */
|
|
118
|
+
export interface TriggerOrder extends OrderBase {
|
|
119
|
+
type:
|
|
120
|
+
| OrderType.STOP_MARKET
|
|
121
|
+
| OrderType.STOP_LIMIT
|
|
122
|
+
| OrderType.TAKE_PROFIT_MARKET
|
|
123
|
+
| OrderType.TAKE_PROFIT_LIMIT
|
|
124
|
+
triggerPrice: string
|
|
125
|
+
triggerCondition: TriggerCondition
|
|
126
|
+
limitPrice?: string
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Time-weighted execution parent. */
|
|
130
|
+
export interface TwapOrder extends OrderBase {
|
|
131
|
+
type: OrderType.TWAP
|
|
132
|
+
durationSeconds: number
|
|
133
|
+
startedAt: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Venue order discriminated only by its execution type. */
|
|
137
|
+
export type Order = RegularOrder | TriggerOrder | TwapOrder
|
|
138
|
+
|
|
107
139
|
/**
|
|
108
|
-
* Asset balance normalized across providers. `units` and `valueUsd`
|
|
109
|
-
* decimal strings; `valueUsd` is the balance's USD valuation.
|
|
140
|
+
* Asset balance normalized across providers. `units`, `price` and `valueUsd`
|
|
141
|
+
* are decimal strings; `valueUsd` is the balance's USD valuation.
|
|
110
142
|
*
|
|
111
143
|
* @public
|
|
112
144
|
*/
|
|
@@ -117,6 +149,8 @@ export interface Balance {
|
|
|
117
149
|
units: string
|
|
118
150
|
/** USD value the SDK fills from the prices map; consumers render with zero math. */
|
|
119
151
|
valueUsd: string
|
|
152
|
+
/** USD price of one unit. Absent when the provider holds no price for the asset. */
|
|
153
|
+
price?: string
|
|
120
154
|
/**
|
|
121
155
|
* Fraction of `valueUsd` that backs available margin (a loan-to-value
|
|
122
156
|
* ratio). Absent means 1 — full value. Set below 1 for collateral the
|
|
@@ -179,25 +213,6 @@ export interface MarketSettings {
|
|
|
179
213
|
leverage: number
|
|
180
214
|
}
|
|
181
215
|
|
|
182
|
-
/**
|
|
183
|
-
* Normalized take-profit or stop-loss order waiting for its trigger condition.
|
|
184
|
-
*
|
|
185
|
-
* @public
|
|
186
|
-
*/
|
|
187
|
-
export interface TriggerOrder {
|
|
188
|
-
orderId: string
|
|
189
|
-
market: MarketDisplay
|
|
190
|
-
type: OrderType
|
|
191
|
-
/** Triggered quantity in base-asset units. */
|
|
192
|
-
size: string
|
|
193
|
-
/** Price at which the trigger activates, in quote-asset units. */
|
|
194
|
-
triggerPrice: string
|
|
195
|
-
/** Optional limit price submitted after activation, in quote-asset units. */
|
|
196
|
-
limitPrice?: string
|
|
197
|
-
label?: string
|
|
198
|
-
createdAt: string
|
|
199
|
-
}
|
|
200
|
-
|
|
201
216
|
/**
|
|
202
217
|
* Paginated open-position response for one provider and account.
|
|
203
218
|
*
|
|
@@ -209,15 +224,10 @@ export interface PositionsResponse {
|
|
|
209
224
|
pagination: Pagination
|
|
210
225
|
}
|
|
211
226
|
|
|
212
|
-
/**
|
|
213
|
-
* Paginated open-order response containing regular and trigger orders.
|
|
214
|
-
*
|
|
215
|
-
* @public
|
|
216
|
-
*/
|
|
227
|
+
/** Paginated order response for the requested lifecycle statuses. */
|
|
217
228
|
export interface OrdersResponse {
|
|
218
|
-
provider:
|
|
219
|
-
|
|
220
|
-
triggerOrders: TriggerOrder[]
|
|
229
|
+
provider: ProviderId
|
|
230
|
+
orders: Order[]
|
|
221
231
|
pagination: Pagination
|
|
222
232
|
}
|
|
223
233
|
|
|
@@ -258,7 +268,6 @@ export interface Fill {
|
|
|
258
268
|
type?: OrderType
|
|
259
269
|
size: string
|
|
260
270
|
price: string
|
|
261
|
-
status: FillStatus
|
|
262
271
|
liquidity: LiquidityRole
|
|
263
272
|
filledSize?: string
|
|
264
273
|
/** Absent when the venue reports no fee for the fill. */
|
|
@@ -334,11 +343,7 @@ export interface BaseActivity {
|
|
|
334
343
|
*/
|
|
335
344
|
export interface DepositActivity extends BaseActivity {
|
|
336
345
|
type: ActivityType.DEPOSIT
|
|
337
|
-
|
|
338
|
-
* Display symbol of the deposited asset, resolved by the provider adapter.
|
|
339
|
-
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
340
|
-
*/
|
|
341
|
-
asset: string
|
|
346
|
+
asset: Asset
|
|
342
347
|
amount: string
|
|
343
348
|
/**
|
|
344
349
|
* Address the deposited funds came from, as the venue reports it. Absent
|
|
@@ -357,11 +362,7 @@ export interface DepositActivity extends BaseActivity {
|
|
|
357
362
|
*/
|
|
358
363
|
export interface WithdrawalActivity extends BaseActivity {
|
|
359
364
|
type: ActivityType.WITHDRAWAL
|
|
360
|
-
|
|
361
|
-
* Display symbol of the withdrawn asset, resolved by the provider adapter.
|
|
362
|
-
* Falls back to the venue's own asset id when the registry knows no symbol.
|
|
363
|
-
*/
|
|
364
|
-
asset: string
|
|
365
|
+
asset: Asset
|
|
365
366
|
amount: string
|
|
366
367
|
/** Absent when the venue reports no fee for the withdrawal. */
|
|
367
368
|
fee?: Fee
|
|
@@ -439,7 +440,7 @@ export interface FundingActivity extends BaseActivity {
|
|
|
439
440
|
export type TransferActivity = BaseActivity & {
|
|
440
441
|
type: ActivityType.TRANSFER
|
|
441
442
|
direction: 'IN' | 'OUT'
|
|
442
|
-
asset:
|
|
443
|
+
asset: Asset
|
|
443
444
|
amount: string
|
|
444
445
|
/**
|
|
445
446
|
* Every fee the venue charged for the transfer, in the order the venue
|
|
@@ -552,7 +553,12 @@ export interface LighterAccountConfig {
|
|
|
552
553
|
*/
|
|
553
554
|
apiKeyIndex?: number
|
|
554
555
|
apiKeyRegistered: boolean
|
|
555
|
-
/**
|
|
556
|
+
/**
|
|
557
|
+
* Lighter `account_type`: the `SubAccountType` of this account
|
|
558
|
+
* (`Main` = 0, `Sub` = 1, `Public` = 2, `LighterPublic` = 3,
|
|
559
|
+
* `Staking` = 4). It is not an account tier — the tier is
|
|
560
|
+
* {@link LighterAccountConfig.userTierName}.
|
|
561
|
+
*/
|
|
556
562
|
accountType: number
|
|
557
563
|
/**
|
|
558
564
|
* Lighter `user_tier_name` from `/accountLimits`, in the tier vocabulary
|
package/src/action.ts
CHANGED
|
@@ -3,14 +3,11 @@ import type {
|
|
|
3
3
|
ActionType,
|
|
4
4
|
MarginMode,
|
|
5
5
|
OrderSide,
|
|
6
|
-
OrderStatus,
|
|
7
6
|
OrderType,
|
|
8
7
|
PerpsErrorCode,
|
|
9
8
|
TimeInForce,
|
|
10
|
-
TriggerCondition,
|
|
11
|
-
TwapOrderStatus,
|
|
12
9
|
} from './enums.js'
|
|
13
|
-
import type {
|
|
10
|
+
import type { MarketRef } from './market.js'
|
|
14
11
|
import type { Address, Hex } from './primitives.js'
|
|
15
12
|
import type { CreateReferralCodeParams, OnboardParams } from './referral.js'
|
|
16
13
|
import type { PerpsTypedData } from './typedData.js'
|
|
@@ -296,35 +293,6 @@ export interface ModifyOrderInput {
|
|
|
296
293
|
limitPrice?: string
|
|
297
294
|
}
|
|
298
295
|
|
|
299
|
-
/**
|
|
300
|
-
* Normalized order returned by a provider, including lifecycle and trigger
|
|
301
|
-
* metadata. Quantities and prices are decimal strings.
|
|
302
|
-
*
|
|
303
|
-
* @public
|
|
304
|
-
*/
|
|
305
|
-
export interface Order {
|
|
306
|
-
orderId: string
|
|
307
|
-
market: MarketDisplay
|
|
308
|
-
side: OrderSide
|
|
309
|
-
type: OrderType
|
|
310
|
-
price?: string
|
|
311
|
-
originalSize: string
|
|
312
|
-
remainingSize: string
|
|
313
|
-
filledSize: string
|
|
314
|
-
timeInForce?: TimeInForce
|
|
315
|
-
expiresAt?: string
|
|
316
|
-
reduceOnly?: boolean
|
|
317
|
-
isTrigger?: boolean
|
|
318
|
-
triggerPrice?: string
|
|
319
|
-
triggerCondition?: TriggerCondition
|
|
320
|
-
status: OrderStatus
|
|
321
|
-
/** Human-readable reason for a terminal non-FILLED status; undefined when no actionable detail. */
|
|
322
|
-
statusReason?: string
|
|
323
|
-
averagePrice?: string
|
|
324
|
-
createdAt: string
|
|
325
|
-
updatedAt: string
|
|
326
|
-
}
|
|
327
|
-
|
|
328
296
|
/**
|
|
329
297
|
* Parameters for placing a regular order on a market.
|
|
330
298
|
*
|
|
@@ -403,30 +371,6 @@ export interface CancelTwapOrderParams {
|
|
|
403
371
|
twapId: string
|
|
404
372
|
}
|
|
405
373
|
|
|
406
|
-
/**
|
|
407
|
-
* Normalized running-TWAP read model returned by provider TWAP queries.
|
|
408
|
-
* Quantities and prices are decimal strings.
|
|
409
|
-
*
|
|
410
|
-
* @public
|
|
411
|
-
*/
|
|
412
|
-
export interface TwapOrder {
|
|
413
|
-
/** Provider-native TWAP identifier, stringified (see {@link CancelTwapOrderParams.twapId}). */
|
|
414
|
-
twapId: string
|
|
415
|
-
market: MarketDisplay
|
|
416
|
-
side: OrderSide
|
|
417
|
-
/** Total base-asset size the TWAP was placed for. */
|
|
418
|
-
totalSize: string
|
|
419
|
-
/** Base-asset size executed so far. */
|
|
420
|
-
filledSize: string
|
|
421
|
-
/** Volume-weighted average fill price; absent until the first child fill. */
|
|
422
|
-
avgFillPrice?: string
|
|
423
|
-
/** ISO-8601 timestamp at which the TWAP started executing. */
|
|
424
|
-
startedAt: string
|
|
425
|
-
/** Total execution window in seconds. */
|
|
426
|
-
durationSeconds: number
|
|
427
|
-
status: TwapOrderStatus
|
|
428
|
-
}
|
|
429
|
-
|
|
430
374
|
/**
|
|
431
375
|
* Parameters for cancelling one or more venue orders.
|
|
432
376
|
*
|
package/src/enums.ts
CHANGED
|
@@ -82,8 +82,7 @@ export enum OrderType {
|
|
|
82
82
|
STOP_LIMIT = 'STOP_LIMIT',
|
|
83
83
|
TAKE_PROFIT_MARKET = 'TAKE_PROFIT_MARKET',
|
|
84
84
|
TAKE_PROFIT_LIMIT = 'TAKE_PROFIT_LIMIT',
|
|
85
|
-
|
|
86
|
-
/** Read-side only: TWAP parents/children surfaced in venue order feeds. Excluded from `PlaceOrderParams.type` — placement goes through `ActionType.PLACE_TWAP_ORDER`. */
|
|
85
|
+
/** Returned on SDK reads; placement uses `ActionType.PLACE_TWAP_ORDER`. */
|
|
87
86
|
TWAP = 'TWAP',
|
|
88
87
|
}
|
|
89
88
|
|
|
@@ -119,24 +118,26 @@ export enum TimeInForce {
|
|
|
119
118
|
|
|
120
119
|
/** Lifecycle status of a provider order. @public */
|
|
121
120
|
export enum OrderStatus {
|
|
121
|
+
/** A placement TP/SL leg waits for its parent order to fill. */
|
|
122
122
|
PENDING = 'PENDING',
|
|
123
|
+
/** The venue accepted the order and has not yet placed it on the book. Unlike `PENDING`, it waits on no parent order. */
|
|
124
|
+
ACCEPTED = 'ACCEPTED',
|
|
125
|
+
/** Live on the book, or an armed trigger waiting for its trigger price. */
|
|
123
126
|
OPEN = 'OPEN',
|
|
127
|
+
/** Open with a positive filled size. */
|
|
124
128
|
PARTIALLY_FILLED = 'PARTIALLY_FILLED',
|
|
129
|
+
/** Terminal: the order filled. */
|
|
125
130
|
FILLED = 'FILLED',
|
|
131
|
+
/** Terminal: the order was cancelled; statusReason carries the venue reason. */
|
|
126
132
|
CANCELLED = 'CANCELLED',
|
|
133
|
+
/** Terminal: the order was rejected; statusReason carries the venue reason. */
|
|
127
134
|
REJECTED = 'REJECTED',
|
|
135
|
+
/** Terminal: the order expired. */
|
|
128
136
|
EXPIRED = 'EXPIRED',
|
|
137
|
+
/** The trigger price was hit and the order went live. */
|
|
129
138
|
TRIGGERED = 'TRIGGERED',
|
|
130
139
|
}
|
|
131
140
|
|
|
132
|
-
/** Lifecycle status of an execution/fill. @public */
|
|
133
|
-
export enum FillStatus {
|
|
134
|
-
FILLED = 'FILLED',
|
|
135
|
-
PARTIALLY_FILLED = 'PARTIALLY_FILLED',
|
|
136
|
-
CANCELLED = 'CANCELLED',
|
|
137
|
-
REJECTED = 'REJECTED',
|
|
138
|
-
}
|
|
139
|
-
|
|
140
141
|
/** Whether a fill supplied maker or taker liquidity. @public */
|
|
141
142
|
export enum LiquidityRole {
|
|
142
143
|
MAKER = 'maker',
|
|
@@ -194,26 +195,6 @@ export enum TriggerCondition {
|
|
|
194
195
|
BELOW = 'BELOW',
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
/** Take-profit or stop-loss trigger order classification. @public */
|
|
198
|
-
export enum TriggerOrderType {
|
|
199
|
-
TAKE_PROFIT = 'TAKE_PROFIT',
|
|
200
|
-
STOP_LOSS = 'STOP_LOSS',
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** Lifecycle status of a trigger order. @public */
|
|
204
|
-
export enum TriggerOrderStatus {
|
|
205
|
-
WAITING = 'WAITING',
|
|
206
|
-
TRIGGERED = 'TRIGGERED',
|
|
207
|
-
CANCELLED = 'CANCELLED',
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/** Lifecycle status of a running TWAP order. @public */
|
|
211
|
-
export enum TwapOrderStatus {
|
|
212
|
-
RUNNING = 'RUNNING',
|
|
213
|
-
COMPLETED = 'COMPLETED',
|
|
214
|
-
CANCELLED = 'CANCELLED',
|
|
215
|
-
}
|
|
216
|
-
|
|
217
198
|
/** Account activity record categories. @public */
|
|
218
199
|
export enum ActivityType {
|
|
219
200
|
DEPOSIT = 'DEPOSIT',
|
package/src/primitives.ts
CHANGED
package/src/subscriptions.ts
CHANGED
|
@@ -2,9 +2,8 @@ import type {
|
|
|
2
2
|
AccountSummary,
|
|
3
3
|
Balance,
|
|
4
4
|
Fill,
|
|
5
|
-
|
|
5
|
+
Order,
|
|
6
6
|
Position,
|
|
7
|
-
TriggerOrder,
|
|
8
7
|
} from './account.js'
|
|
9
8
|
import type {
|
|
10
9
|
Candle,
|
|
@@ -121,14 +120,8 @@ export type TradesEvent = { channel: 'trades'; data: Trade[] }
|
|
|
121
120
|
export type OrderUpdatesEvent = {
|
|
122
121
|
channel: 'orderUpdates'
|
|
123
122
|
data: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/** Upserts — active orders with trigger semantics (TP/SL). */
|
|
127
|
-
triggerOrders: TriggerOrder[]
|
|
128
|
-
/**
|
|
129
|
-
* orderIds whose status just transitioned to terminal (filled, cancelled,
|
|
130
|
-
* rejected, expired). Consumers should evict these from both buckets.
|
|
131
|
-
*/
|
|
123
|
+
orders: Order[]
|
|
124
|
+
/** Terminal order ids to evict from an active-order cache. */
|
|
132
125
|
terminated: string[]
|
|
133
126
|
}
|
|
134
127
|
}
|