@lifi/perps-types 0.1.1-alpha.8 → 0.2.0-alpha.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/package.json +18 -4
- package/providers/lighter/package.json +5 -0
- package/src/_cjs/{market.js → action.js} +1 -1
- package/src/_cjs/action.js.map +1 -0
- package/src/_cjs/{trading.js → asset.js} +1 -1
- package/src/_cjs/asset.js.map +1 -0
- package/src/_cjs/enums.js +88 -15
- package/src/_cjs/enums.js.map +1 -1
- package/src/_cjs/index.js +3 -4
- package/src/_cjs/index.js.map +1 -1
- package/src/_cjs/providers/_shared/fillClassification.js +37 -0
- package/src/_cjs/providers/_shared/fillClassification.js.map +1 -0
- package/src/_cjs/providers/hyperliquid/assetId.js +11 -9
- package/src/_cjs/providers/hyperliquid/assetId.js.map +1 -1
- package/src/_cjs/providers/hyperliquid/mappers/_market.js +15 -0
- package/src/_cjs/providers/hyperliquid/mappers/_market.js.map +1 -0
- package/src/_cjs/providers/hyperliquid/mappers/activity.js +128 -0
- package/src/_cjs/providers/hyperliquid/mappers/activity.js.map +1 -0
- package/src/_cjs/providers/hyperliquid/mappers/{market.js → asset.js} +10 -9
- package/src/_cjs/providers/hyperliquid/mappers/asset.js.map +1 -0
- package/src/_cjs/providers/hyperliquid/mappers/fill.js +36 -0
- package/src/_cjs/providers/hyperliquid/mappers/fill.js.map +1 -0
- package/src/_cjs/providers/hyperliquid/mappers/index.js +12 -7
- package/src/_cjs/providers/hyperliquid/mappers/index.js.map +1 -1
- package/src/_cjs/providers/hyperliquid/mappers/order.js +86 -9
- package/src/_cjs/providers/hyperliquid/mappers/order.js.map +1 -1
- package/src/_cjs/providers/hyperliquid/mappers/position.js +8 -5
- package/src/_cjs/providers/hyperliquid/mappers/position.js.map +1 -1
- package/src/_cjs/providers/hyperliquid/mappers/shared.js +0 -10
- package/src/_cjs/providers/hyperliquid/mappers/shared.js.map +1 -1
- package/src/_cjs/providers/hyperliquid/types.js +18 -0
- package/src/_cjs/providers/hyperliquid/types.js.map +1 -1
- package/src/_cjs/{authorization.js → providers/lighter/apiTypes.js} +1 -1
- package/src/_cjs/providers/lighter/apiTypes.js.map +1 -0
- package/src/_cjs/providers/lighter/index.js +20 -0
- package/src/_cjs/providers/lighter/index.js.map +1 -0
- package/src/_cjs/providers/lighter/mappers/fill.js +34 -0
- package/src/_cjs/providers/lighter/mappers/fill.js.map +1 -0
- package/src/_cjs/providers/lighter/mappers/index.js +13 -0
- package/src/_cjs/providers/lighter/mappers/index.js.map +1 -0
- package/src/_cjs/providers/lighter/mappers/order.js +142 -0
- package/src/_cjs/providers/lighter/mappers/order.js.map +1 -0
- package/src/_cjs/providers/lighter/mappers/position.js +35 -0
- package/src/_cjs/providers/lighter/mappers/position.js.map +1 -0
- package/src/_cjs/providers/lighter/types.js +23 -0
- package/src/_cjs/providers/lighter/types.js.map +1 -0
- package/src/_cjs/{withdrawal.js → providers.js} +1 -1
- package/src/_cjs/providers.js.map +1 -0
- package/src/_esm/action.js +2 -0
- package/src/_esm/action.js.map +1 -0
- package/src/_esm/asset.js +2 -0
- package/src/_esm/asset.js.map +1 -0
- package/src/_esm/enums.js +97 -14
- package/src/_esm/enums.js.map +1 -1
- package/src/_esm/index.js +3 -4
- package/src/_esm/index.js.map +1 -1
- package/src/_esm/providers/_shared/fillClassification.js +43 -0
- package/src/_esm/providers/_shared/fillClassification.js.map +1 -0
- package/src/_esm/providers/hyperliquid/assetId.js +13 -11
- package/src/_esm/providers/hyperliquid/assetId.js.map +1 -1
- package/src/_esm/providers/hyperliquid/mappers/_market.js +22 -0
- package/src/_esm/providers/hyperliquid/mappers/_market.js.map +1 -0
- package/src/_esm/providers/hyperliquid/mappers/activity.js +138 -0
- package/src/_esm/providers/hyperliquid/mappers/activity.js.map +1 -0
- package/src/_esm/providers/hyperliquid/mappers/{market.js → asset.js} +8 -7
- package/src/_esm/providers/hyperliquid/mappers/asset.js.map +1 -0
- package/src/_esm/providers/hyperliquid/mappers/fill.js +32 -0
- package/src/_esm/providers/hyperliquid/mappers/fill.js.map +1 -0
- package/src/_esm/providers/hyperliquid/mappers/index.js +4 -4
- package/src/_esm/providers/hyperliquid/mappers/index.js.map +1 -1
- package/src/_esm/providers/hyperliquid/mappers/order.js +88 -8
- package/src/_esm/providers/hyperliquid/mappers/order.js.map +1 -1
- package/src/_esm/providers/hyperliquid/mappers/position.js +8 -5
- package/src/_esm/providers/hyperliquid/mappers/position.js.map +1 -1
- package/src/_esm/providers/hyperliquid/mappers/shared.js +1 -12
- package/src/_esm/providers/hyperliquid/mappers/shared.js.map +1 -1
- package/src/_esm/providers/hyperliquid/types.js +32 -2
- package/src/_esm/providers/hyperliquid/types.js.map +1 -1
- package/src/_esm/providers/lighter/apiTypes.js +5 -0
- package/src/_esm/providers/lighter/apiTypes.js.map +1 -0
- package/src/_esm/providers/lighter/index.js +4 -0
- package/src/_esm/providers/lighter/index.js.map +1 -0
- package/src/_esm/providers/lighter/mappers/fill.js +39 -0
- package/src/_esm/providers/lighter/mappers/fill.js.map +1 -0
- package/src/_esm/providers/lighter/mappers/index.js +4 -0
- package/src/_esm/providers/lighter/mappers/index.js.map +1 -0
- package/src/_esm/providers/lighter/mappers/order.js +162 -0
- package/src/_esm/providers/lighter/mappers/order.js.map +1 -0
- package/src/_esm/providers/lighter/mappers/position.js +38 -0
- package/src/_esm/providers/lighter/mappers/position.js.map +1 -0
- package/src/_esm/providers/lighter/types.js +26 -0
- package/src/_esm/providers/lighter/types.js.map +1 -0
- package/src/_esm/providers.js +2 -0
- package/src/_esm/providers.js.map +1 -0
- package/src/_types/account.d.ts +211 -18
- package/src/_types/account.d.ts.map +1 -1
- package/src/_types/action.d.ts +261 -0
- package/src/_types/action.d.ts.map +1 -0
- package/src/_types/{market.d.ts → asset.d.ts} +23 -34
- package/src/_types/asset.d.ts.map +1 -0
- package/src/_types/enums.d.ts +81 -5
- package/src/_types/enums.d.ts.map +1 -1
- package/src/_types/index.d.ts +3 -4
- package/src/_types/index.d.ts.map +1 -1
- package/src/_types/providers/_shared/fillClassification.d.ts +12 -0
- package/src/_types/providers/_shared/fillClassification.d.ts.map +1 -0
- package/src/_types/providers/hyperliquid/assetId.d.ts +8 -6
- package/src/_types/providers/hyperliquid/assetId.d.ts.map +1 -1
- package/src/_types/providers/hyperliquid/mappers/_market.d.ts +13 -0
- package/src/_types/providers/hyperliquid/mappers/_market.d.ts.map +1 -0
- package/src/_types/providers/hyperliquid/mappers/activity.d.ts +13 -0
- package/src/_types/providers/hyperliquid/mappers/activity.d.ts.map +1 -0
- package/src/_types/providers/hyperliquid/mappers/asset.d.ts +4 -0
- package/src/_types/providers/hyperliquid/mappers/asset.d.ts.map +1 -0
- package/src/_types/providers/hyperliquid/mappers/fill.d.ts +6 -0
- package/src/_types/providers/hyperliquid/mappers/fill.d.ts.map +1 -0
- package/src/_types/providers/hyperliquid/mappers/index.d.ts +4 -4
- package/src/_types/providers/hyperliquid/mappers/index.d.ts.map +1 -1
- package/src/_types/providers/hyperliquid/mappers/order.d.ts +15 -3
- package/src/_types/providers/hyperliquid/mappers/order.d.ts.map +1 -1
- package/src/_types/providers/hyperliquid/mappers/position.d.ts +1 -1
- package/src/_types/providers/hyperliquid/mappers/position.d.ts.map +1 -1
- package/src/_types/providers/hyperliquid/mappers/shared.d.ts +0 -6
- package/src/_types/providers/hyperliquid/mappers/shared.d.ts.map +1 -1
- package/src/_types/providers/hyperliquid/types.d.ts +112 -0
- package/src/_types/providers/hyperliquid/types.d.ts.map +1 -1
- package/src/_types/providers/lighter/apiTypes.d.ts +76 -0
- package/src/_types/providers/lighter/apiTypes.d.ts.map +1 -0
- package/src/_types/providers/lighter/index.d.ts +4 -0
- package/src/_types/providers/lighter/index.d.ts.map +1 -0
- package/src/_types/providers/lighter/mappers/fill.d.ts +9 -0
- package/src/_types/providers/lighter/mappers/fill.d.ts.map +1 -0
- package/src/_types/providers/lighter/mappers/index.d.ts +4 -0
- package/src/_types/providers/lighter/mappers/index.d.ts.map +1 -0
- package/src/_types/providers/lighter/mappers/order.d.ts +35 -0
- package/src/_types/providers/lighter/mappers/order.d.ts.map +1 -0
- package/src/_types/providers/lighter/mappers/position.d.ts +8 -0
- package/src/_types/providers/lighter/mappers/position.d.ts.map +1 -0
- package/src/_types/providers/lighter/types.d.ts +90 -0
- package/src/_types/providers/lighter/types.d.ts.map +1 -0
- package/src/_types/providers.d.ts +145 -0
- package/src/_types/providers.d.ts.map +1 -0
- package/src/_types/subscriptions.d.ts +23 -18
- package/src/_types/subscriptions.d.ts.map +1 -1
- package/src/_types/typedData.d.ts +13 -5
- package/src/_types/typedData.d.ts.map +1 -1
- package/src/account.ts +244 -18
- package/src/action.ts +324 -0
- package/src/asset.ts +88 -0
- package/src/enums.ts +92 -3
- package/src/index.ts +3 -4
- package/src/providers/_shared/fillClassification.ts +50 -0
- package/src/providers/hyperliquid/assetId.ts +18 -12
- package/src/providers/hyperliquid/mappers/_market.ts +21 -0
- package/src/providers/hyperliquid/mappers/activity.ts +169 -0
- package/src/providers/hyperliquid/mappers/{market.ts → asset.ts} +10 -12
- package/src/providers/hyperliquid/mappers/fill.ts +41 -0
- package/src/providers/hyperliquid/mappers/index.ts +10 -4
- package/src/providers/hyperliquid/mappers/order.ts +95 -14
- package/src/providers/hyperliquid/mappers/position.ts +8 -10
- package/src/providers/hyperliquid/mappers/shared.ts +0 -15
- package/src/providers/hyperliquid/types.ts +158 -0
- package/src/providers/lighter/apiTypes.ts +87 -0
- package/src/providers/lighter/index.ts +3 -0
- package/src/providers/lighter/mappers/fill.ts +57 -0
- package/src/providers/lighter/mappers/index.ts +8 -0
- package/src/providers/lighter/mappers/order.ts +184 -0
- package/src/providers/lighter/mappers/position.ts +46 -0
- package/src/providers/lighter/types.ts +111 -0
- package/src/providers.ts +153 -0
- package/src/subscriptions.ts +21 -20
- package/src/typedData.ts +15 -5
- package/src/_cjs/authorization.js.map +0 -1
- package/src/_cjs/market.js.map +0 -1
- package/src/_cjs/providers/hyperliquid/mappers/history.js +0 -22
- package/src/_cjs/providers/hyperliquid/mappers/history.js.map +0 -1
- package/src/_cjs/providers/hyperliquid/mappers/market.js.map +0 -1
- package/src/_cjs/trading.js.map +0 -1
- package/src/_cjs/withdrawal.js.map +0 -1
- package/src/_esm/authorization.js +0 -2
- package/src/_esm/authorization.js.map +0 -1
- package/src/_esm/market.js +0 -2
- package/src/_esm/market.js.map +0 -1
- package/src/_esm/providers/hyperliquid/mappers/history.js +0 -18
- package/src/_esm/providers/hyperliquid/mappers/history.js.map +0 -1
- package/src/_esm/providers/hyperliquid/mappers/market.js.map +0 -1
- package/src/_esm/trading.js +0 -2
- package/src/_esm/trading.js.map +0 -1
- package/src/_esm/withdrawal.js +0 -2
- package/src/_esm/withdrawal.js.map +0 -1
- package/src/_types/authorization.d.ts +0 -39
- package/src/_types/authorization.d.ts.map +0 -1
- package/src/_types/market.d.ts.map +0 -1
- package/src/_types/providers/hyperliquid/mappers/history.d.ts +0 -4
- package/src/_types/providers/hyperliquid/mappers/history.d.ts.map +0 -1
- package/src/_types/providers/hyperliquid/mappers/market.d.ts +0 -4
- package/src/_types/providers/hyperliquid/mappers/market.d.ts.map +0 -1
- package/src/_types/trading.d.ts +0 -80
- package/src/_types/trading.d.ts.map +0 -1
- package/src/_types/withdrawal.d.ts +0 -37
- package/src/_types/withdrawal.d.ts.map +0 -1
- package/src/authorization.ts +0 -46
- package/src/market.ts +0 -97
- package/src/providers/hyperliquid/mappers/history.ts +0 -25
- package/src/trading.ts +0 -97
- package/src/withdrawal.ts +0 -44
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { OrderType } from '../../../enums.js';
|
|
2
|
+
import type { OpenOrder, TriggerOrder } from '../../../account.js';
|
|
3
|
+
import type { Order } from '../../../action.js';
|
|
4
|
+
import type { LtOrder } from '../apiTypes.js';
|
|
5
|
+
/**
|
|
6
|
+
* Map a raw Lighter order status to a short English sentence describing
|
|
7
|
+
* *why* the order ended in a terminal non-FILLED state. Non-terminal
|
|
8
|
+
* statuses, plain `filled`, and unknown values return `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const mapStatusReason: (status: string) => string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* True for order types Lighter exposes as TP/SL legs. Mirrors the
|
|
13
|
+
* Hyperliquid helper of the same name so the backend can split a raw
|
|
14
|
+
* Lighter order list into the same `openOrders` / `triggerOrders`
|
|
15
|
+
* buckets the SDK declares on `OrdersResponse`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isTriggerType: (type: OrderType) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Map a raw Lighter trigger order (stop/take-profit, market or limit) to
|
|
20
|
+
* the generic `TriggerOrder` shape. For market variants the `limitPrice`
|
|
21
|
+
* field is omitted; for limit variants `order.price` is the limit and
|
|
22
|
+
* `order.trigger_price` is the activation level.
|
|
23
|
+
*/
|
|
24
|
+
export declare const mapTriggerOrder: (order: LtOrder, symbol: string) => TriggerOrder;
|
|
25
|
+
/**
|
|
26
|
+
* Map a raw Lighter order to the generic OpenOrder type.
|
|
27
|
+
* @param symbol - Resolved symbol (market_index → symbol lookup)
|
|
28
|
+
*/
|
|
29
|
+
export declare const mapOrder: (order: LtOrder, symbol: string) => OpenOrder;
|
|
30
|
+
/**
|
|
31
|
+
* Map a raw Lighter order to the rich Order type — adds status, time-in-force
|
|
32
|
+
* and remaining/filled sizes on top of the OpenOrder fields.
|
|
33
|
+
*/
|
|
34
|
+
export declare const mapOrderDetail: (order: LtOrder, symbol: string) => Order;
|
|
35
|
+
//# sourceMappingURL=order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../../providers/lighter/mappers/order.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAEV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAmD7C;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,SA+BzD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,KAAG,OAIjB,CAAA;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,EACd,QAAQ,MAAM,KACb,YAkBF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,QAAQ,MAAM,KAAG,SAexD,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,EAAE,QAAQ,MAAM,KAAG,KAoB9D,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Position } from '../../../account.js';
|
|
2
|
+
import type { LtAccountPosition } from '../apiTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Map a raw Lighter account position to the generic Position type.
|
|
5
|
+
* @param symbol Resolved symbol (market_id → symbol lookup, or `pos.symbol`).
|
|
6
|
+
*/
|
|
7
|
+
export declare const mapPosition: (pos: LtAccountPosition, symbol: string) => Position;
|
|
8
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../providers/lighter/mappers/position.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,iBAAiB,EACtB,QAAQ,MAAM,KACb,QAiCF,CAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Backend-provided params for SignCreateOrder. */
|
|
2
|
+
export type LtCreateOrderWasmParams = {
|
|
3
|
+
market_index: number;
|
|
4
|
+
client_order_index: number;
|
|
5
|
+
base_amount: number;
|
|
6
|
+
price: number;
|
|
7
|
+
is_ask: number;
|
|
8
|
+
order_type: number;
|
|
9
|
+
time_in_force: number;
|
|
10
|
+
reduce_only: boolean;
|
|
11
|
+
trigger_price: number;
|
|
12
|
+
order_expiry: number;
|
|
13
|
+
integrator_account_index: number;
|
|
14
|
+
integrator_taker_fee: number;
|
|
15
|
+
integrator_maker_fee: number;
|
|
16
|
+
};
|
|
17
|
+
/** Backend-provided params for SignCancelOrder. */
|
|
18
|
+
export type LtCancelOrderWasmParams = {
|
|
19
|
+
market_index: number;
|
|
20
|
+
order_index: number;
|
|
21
|
+
};
|
|
22
|
+
/** Backend-provided params for SignModifyOrder. */
|
|
23
|
+
export type LtModifyOrderWasmParams = {
|
|
24
|
+
market_index: number;
|
|
25
|
+
order_index: number;
|
|
26
|
+
base_amount: number;
|
|
27
|
+
price: number;
|
|
28
|
+
trigger_price: number;
|
|
29
|
+
integrator_account_index: number;
|
|
30
|
+
integrator_taker_fee: number;
|
|
31
|
+
integrator_maker_fee: number;
|
|
32
|
+
};
|
|
33
|
+
/** Backend-provided params for SignUpdateLeverage. */
|
|
34
|
+
export type LtUpdateLeverageWasmParams = {
|
|
35
|
+
market_index: number;
|
|
36
|
+
fraction: number;
|
|
37
|
+
margin_mode: number;
|
|
38
|
+
};
|
|
39
|
+
/** Backend-provided params for SignUpdateMargin. */
|
|
40
|
+
export type LtUpdateMarginWasmParams = {
|
|
41
|
+
market_index: number;
|
|
42
|
+
usdc_amount: number;
|
|
43
|
+
direction: number;
|
|
44
|
+
};
|
|
45
|
+
/** Backend-provided params for SignWithdraw. */
|
|
46
|
+
export type LtWithdrawWasmParams = {
|
|
47
|
+
asset_index: number;
|
|
48
|
+
route_type: number;
|
|
49
|
+
amount: number;
|
|
50
|
+
};
|
|
51
|
+
/** Backend-provided params for SignCancelAllOrders. */
|
|
52
|
+
export type LtCancelAllOrdersWasmParams = {
|
|
53
|
+
/** 0=immediate (cancel GTC), 1=scheduled, 2=abort scheduled */
|
|
54
|
+
time_in_force: number;
|
|
55
|
+
/** Unix timestamp in milliseconds. Use Date.now() for immediate cancels. */
|
|
56
|
+
timestamp_ms: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Backend-provided params for SignChangePubKey (REGISTER_API_KEY).
|
|
60
|
+
*
|
|
61
|
+
* Hybrid signing: this action requires both a WASM blob and an L1 Ethereum
|
|
62
|
+
* signature (the user's wallet signs the ChangePubKey message). The SDK
|
|
63
|
+
* generates the keypair via the WASM signer and fills in `new_public_key`
|
|
64
|
+
* before invoking SignChangePubKey.
|
|
65
|
+
*/
|
|
66
|
+
export type LtChangePubKeyWasmParams = {
|
|
67
|
+
/** API key slot index to register (0-255). SDK fills in the generated public key. */
|
|
68
|
+
api_key_index: number;
|
|
69
|
+
nonce: number;
|
|
70
|
+
};
|
|
71
|
+
export declare const LT_ORDER_TYPE_LIMIT = 0;
|
|
72
|
+
export declare const LT_ORDER_TYPE_MARKET = 1;
|
|
73
|
+
export declare const LT_ORDER_TYPE_STOP_LOSS = 2;
|
|
74
|
+
export declare const LT_ORDER_TYPE_STOP_LOSS_LIMIT = 3;
|
|
75
|
+
export declare const LT_ORDER_TYPE_TAKE_PROFIT = 4;
|
|
76
|
+
export declare const LT_ORDER_TYPE_TAKE_PROFIT_LIMIT = 5;
|
|
77
|
+
export declare const LT_ORDER_TYPE_TWAP = 6;
|
|
78
|
+
export declare const LT_TIME_IN_FORCE_IOC = 0;
|
|
79
|
+
export declare const LT_TIME_IN_FORCE_GTC = 1;
|
|
80
|
+
export declare const LT_TIME_IN_FORCE_POST_ONLY = 2;
|
|
81
|
+
export declare const LT_MARGIN_MODE_CROSS = 0;
|
|
82
|
+
export declare const LT_MARGIN_MODE_ISOLATED = 1;
|
|
83
|
+
export declare const LT_MARGIN_DIRECTION_REMOVE = 0;
|
|
84
|
+
export declare const LT_MARGIN_DIRECTION_ADD = 1;
|
|
85
|
+
export declare const LT_ROUTE_PERP = 0;
|
|
86
|
+
export declare const LT_ROUTE_SPOT = 1;
|
|
87
|
+
export declare const LT_ASSET_ID_USDC = 3;
|
|
88
|
+
export declare const LT_NIL_TRIGGER_PRICE = 0;
|
|
89
|
+
export declare const LT_DEFAULT_ORDER_EXPIRY = -1;
|
|
90
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../providers/lighter/types.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,wBAAwB,EAAE,MAAM,CAAA;IAChC,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,wBAAwB,EAAE,MAAM,CAAA;IAChC,oBAAoB,EAAE,MAAM,CAAA;IAC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CAAA;AAExC,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAC3C,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC,eAAO,MAAM,aAAa,IAAI,CAAA;AAC9B,eAAO,MAAM,aAAa,IAAI,CAAA;AAE9B,eAAO,MAAM,gBAAgB,IAAI,CAAA;AAEjC,eAAO,MAAM,oBAAoB,IAAI,CAAA;AACrC,eAAO,MAAM,uBAAuB,KAAK,CAAA"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { ActionType, PerpsSigner, SigningMethod } from './enums.js';
|
|
2
|
+
export interface ActionDescriptor {
|
|
3
|
+
type: ActionType;
|
|
4
|
+
signers: PerpsSigner[];
|
|
5
|
+
/**
|
|
6
|
+
* How the SDK must sign this specific action. Most actions match the
|
|
7
|
+
* provider's dominant pattern (Hyperliquid: EIP712, Lighter: WASM_BLOB),
|
|
8
|
+
* but on-chain bridge actions like DEPOSIT are EVM_TX regardless of
|
|
9
|
+
* provider — the SDK dispatches by this field rather than by
|
|
10
|
+
* `Provider.signingMethod`.
|
|
11
|
+
*/
|
|
12
|
+
signingMethod: SigningMethod;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One selectable value on a `Param` whose `values` are enumerated.
|
|
16
|
+
*
|
|
17
|
+
* `value` is the opaque per-provider identifier the SDK passes back to the
|
|
18
|
+
* backend in the corresponding action params (e.g. the string assigned to
|
|
19
|
+
* `mode` for `ACCOUNT_MODE`, or `tier` for `ACCOUNT_TYPE`).
|
|
20
|
+
* `label` is the user-facing string the widget renders.
|
|
21
|
+
*/
|
|
22
|
+
export interface ParamOption {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A single parameter the widget must collect from the user before
|
|
28
|
+
* dispatching an action.
|
|
29
|
+
*
|
|
30
|
+
* `name` is the wire key the widget passes through to `execute()` — for the
|
|
31
|
+
* existing `ACCOUNT_MODE` action that's `'mode'`, for `ACCOUNT_TYPE` it's
|
|
32
|
+
* `'tier'`, etc. The widget builds the action's params object as
|
|
33
|
+
* `{ [param.name]: <selected value> }` straight from the descriptor at
|
|
34
|
+
* dispatch time; there is no per-ActionType translation layer.
|
|
35
|
+
*
|
|
36
|
+
* `type` describes the primitive shape of the value. Currently only
|
|
37
|
+
* `'string'` is admitted — numeric / boolean primitives are deferred until
|
|
38
|
+
* a real descriptor needs them.
|
|
39
|
+
*
|
|
40
|
+
* `values` is present iff the parameter has a fixed enumeration of
|
|
41
|
+
* admissible values (e.g. Hyperliquid abstraction modes, Lighter account
|
|
42
|
+
* tiers). When absent the widget renders a free-form input appropriate to
|
|
43
|
+
* the primitive `type`.
|
|
44
|
+
*
|
|
45
|
+
* `default` flags the suggested choice when `values` is provided. Must be
|
|
46
|
+
* one of the entries in `values` if specified; consumers should fall back
|
|
47
|
+
* to "no selection" when absent and let the user pick.
|
|
48
|
+
*
|
|
49
|
+
* `readOnly: true` means the widget must render the control disabled —
|
|
50
|
+
* typically used when the provider exposes the current value but does not
|
|
51
|
+
* allow the user to change it from this surface (e.g. Lighter account
|
|
52
|
+
* mode, which is set during onboarding and immutable thereafter).
|
|
53
|
+
*/
|
|
54
|
+
export interface Param {
|
|
55
|
+
name: string;
|
|
56
|
+
type: 'string';
|
|
57
|
+
values?: ParamOption[];
|
|
58
|
+
default?: ParamOption;
|
|
59
|
+
readOnly?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Self-documenting descriptor for an account-level action the user may
|
|
63
|
+
* (setup) or must (options) interact with. Extends `ActionDescriptor`
|
|
64
|
+
* because each descriptor resolves to exactly one action the SDK
|
|
65
|
+
* dispatches when the user proceeds; the additional fields are the
|
|
66
|
+
* presentation and parameter-collection metadata the widget needs to
|
|
67
|
+
* render the action without hardcoded per-ActionType branches.
|
|
68
|
+
*
|
|
69
|
+
* `params` is the list of parameters the widget must collect from the
|
|
70
|
+
* user (zero-or-more); each entry tells the widget the wire key, the
|
|
71
|
+
* primitive type, optional enumeration of admissible values, and
|
|
72
|
+
* optional default. See `Param` for the field-level semantics.
|
|
73
|
+
*
|
|
74
|
+
* Categorisation of a descriptor as "setup" vs "options" is carried by
|
|
75
|
+
* which array on `Provider` it appears in (`Provider.setup` vs
|
|
76
|
+
* `Provider.options`), NOT by a field on the descriptor — by design.
|
|
77
|
+
* `ProviderSetup` and `ProviderOption` are type aliases for this same
|
|
78
|
+
* shape with no additional fields.
|
|
79
|
+
*/
|
|
80
|
+
export interface ProviderActionDescriptor extends ActionDescriptor {
|
|
81
|
+
/** User-facing row title rendered in the setup / options modal. */
|
|
82
|
+
title: string;
|
|
83
|
+
/** User-facing description rendered in the setup / options modal. */
|
|
84
|
+
description: string;
|
|
85
|
+
/** Parameters the widget must collect before dispatching the action. */
|
|
86
|
+
params: Param[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A descriptor that gates trading: the user MUST satisfy every entry on
|
|
90
|
+
* `Provider.setup` before they can place orders with this provider. The
|
|
91
|
+
* widget renders these in `<SetupModal />`, which auto-pops mid-session
|
|
92
|
+
* whenever setup becomes unsatisfied (e.g. Hyperliquid agent expiry).
|
|
93
|
+
*
|
|
94
|
+
* Type alias for `ProviderActionDescriptor` — no additional fields. The
|
|
95
|
+
* setup-vs-options distinction is the array, not a flag on the item.
|
|
96
|
+
*/
|
|
97
|
+
export type ProviderSetup = ProviderActionDescriptor;
|
|
98
|
+
/**
|
|
99
|
+
* A post-setup descriptor the user MAY interact with to tune provider
|
|
100
|
+
* behaviour (e.g. switching Hyperliquid abstraction modes, switching
|
|
101
|
+
* Lighter account tier). The widget renders these in `<OptionsModal />`
|
|
102
|
+
* behind a cog icon; they never gate trading.
|
|
103
|
+
*
|
|
104
|
+
* Type alias for `ProviderActionDescriptor` — no additional fields. The
|
|
105
|
+
* setup-vs-options distinction is the array, not a flag on the item.
|
|
106
|
+
*/
|
|
107
|
+
export type ProviderOption = ProviderActionDescriptor;
|
|
108
|
+
export interface ProviderMarketInfo {
|
|
109
|
+
id: string;
|
|
110
|
+
quoteAsset: string | null;
|
|
111
|
+
}
|
|
112
|
+
export interface Provider {
|
|
113
|
+
key: string;
|
|
114
|
+
name: string;
|
|
115
|
+
logoURI: string;
|
|
116
|
+
signingMethod: SigningMethod;
|
|
117
|
+
/** When false, the provider is announced but not yet selectable in clients. */
|
|
118
|
+
active: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Mandatory account-setup descriptors. The user MUST satisfy every
|
|
121
|
+
* entry before trading. The widget renders these in `<SetupModal />`,
|
|
122
|
+
* which auto-pops whenever setup becomes unsatisfied. An empty array
|
|
123
|
+
* is valid and indicates the provider has no setup gates.
|
|
124
|
+
*/
|
|
125
|
+
setup: ProviderSetup[];
|
|
126
|
+
/**
|
|
127
|
+
* Optional post-setup descriptors the user may tune (account mode,
|
|
128
|
+
* fee tier, etc.). Rendered in `<OptionsModal />` behind the cog icon;
|
|
129
|
+
* never gates trading. An empty array is valid.
|
|
130
|
+
*/
|
|
131
|
+
options: ProviderOption[];
|
|
132
|
+
actions: ActionDescriptor[];
|
|
133
|
+
markets: ProviderMarketInfo[];
|
|
134
|
+
wsUrl?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Minimum deposit amount in USD that the provider's deposit path will
|
|
137
|
+
* accept. Absent means no minimum is advertised — clients should not
|
|
138
|
+
* gate the deposit UX on a value they don't have.
|
|
139
|
+
*/
|
|
140
|
+
minDepositUsd?: number;
|
|
141
|
+
}
|
|
142
|
+
export interface ProvidersResponse {
|
|
143
|
+
providers: Provider[];
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAExE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EA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CAAA;IAC3B,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address } from './typedData.js';
|
|
2
|
-
import type { Candle, OhlcvInterval, OrderbookResponse
|
|
3
|
-
import type {
|
|
4
|
-
import type { Order } from './
|
|
2
|
+
import type { Candle, OhlcvInterval, OrderbookResponse } from './asset.js';
|
|
3
|
+
import type { Fill, Position } from './account.js';
|
|
4
|
+
import type { Order } from './action.js';
|
|
5
5
|
export type PricesSubscription = {
|
|
6
6
|
channel: 'prices';
|
|
7
7
|
dex: string;
|
|
@@ -9,18 +9,13 @@ export type PricesSubscription = {
|
|
|
9
9
|
export type OrderbookSubscription = {
|
|
10
10
|
channel: 'orderbook';
|
|
11
11
|
dex: string;
|
|
12
|
-
|
|
12
|
+
assetId: string;
|
|
13
13
|
depth?: number;
|
|
14
14
|
};
|
|
15
|
-
export type TradesSubscription = {
|
|
16
|
-
channel: 'trades';
|
|
17
|
-
dex: string;
|
|
18
|
-
symbol: string;
|
|
19
|
-
};
|
|
20
15
|
export type CandleSubscription = {
|
|
21
16
|
channel: 'candle';
|
|
22
17
|
dex: string;
|
|
23
|
-
|
|
18
|
+
assetId: string;
|
|
24
19
|
interval: OhlcvInterval;
|
|
25
20
|
};
|
|
26
21
|
export type OrderUpdatesSubscription = {
|
|
@@ -38,19 +33,25 @@ export type PositionsSubscription = {
|
|
|
38
33
|
dex: string;
|
|
39
34
|
address: Address;
|
|
40
35
|
};
|
|
41
|
-
export type
|
|
36
|
+
export type SpotBalancesSubscription = {
|
|
37
|
+
channel: 'spotBalances';
|
|
38
|
+
dex: string;
|
|
39
|
+
address: Address;
|
|
40
|
+
};
|
|
41
|
+
export type Subscription = PricesSubscription | OrderbookSubscription | CandleSubscription | OrderUpdatesSubscription | FillsSubscription | PositionsSubscription | SpotBalancesSubscription;
|
|
42
|
+
export interface SpotBalance {
|
|
43
|
+
coin: string;
|
|
44
|
+
total: string;
|
|
45
|
+
hold: string;
|
|
46
|
+
}
|
|
42
47
|
export type PricesEvent = {
|
|
43
48
|
channel: 'prices';
|
|
44
|
-
data:
|
|
49
|
+
data: Record<string, string>;
|
|
45
50
|
};
|
|
46
51
|
export type OrderbookEvent = {
|
|
47
52
|
channel: 'orderbook';
|
|
48
53
|
data: OrderbookResponse;
|
|
49
54
|
};
|
|
50
|
-
export type TradesEvent = {
|
|
51
|
-
channel: 'trades';
|
|
52
|
-
data: HistoryItem[];
|
|
53
|
-
};
|
|
54
55
|
export type CandleEvent = {
|
|
55
56
|
channel: 'candle';
|
|
56
57
|
data: Candle;
|
|
@@ -61,11 +62,15 @@ export type OrderUpdatesEvent = {
|
|
|
61
62
|
};
|
|
62
63
|
export type FillsEvent = {
|
|
63
64
|
channel: 'fills';
|
|
64
|
-
data:
|
|
65
|
+
data: Fill[];
|
|
65
66
|
};
|
|
66
67
|
export type PositionsEvent = {
|
|
67
68
|
channel: 'positions';
|
|
68
69
|
data: Position[];
|
|
69
70
|
};
|
|
70
|
-
export type
|
|
71
|
+
export type SpotBalancesEvent = {
|
|
72
|
+
channel: 'spotBalances';
|
|
73
|
+
data: SpotBalance[];
|
|
74
|
+
};
|
|
75
|
+
export type SubscriptionEvent = PricesEvent | OrderbookEvent | CandleEvent | OrderUpdatesEvent | FillsEvent | PositionsEvent | SpotBalancesEvent;
|
|
71
76
|
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"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
|
|
|
1
|
-
import type { TypedData, SignedTypedData } from '@lifi/types';
|
|
2
1
|
import type { Address, Hex, TypedDataDomain, TypedDataParameter } from 'viem';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { HlPrimaryType } from './providers/hyperliquid/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* All known EIP-712 primaryType values across supported providers.
|
|
5
|
+
* Extend this union when adding a new EIP-712 provider.
|
|
6
|
+
*/
|
|
7
|
+
export type PerpsPrimaryType = HlPrimaryType;
|
|
8
|
+
export type PerpsTypedData = {
|
|
9
|
+
domain: TypedDataDomain;
|
|
10
|
+
types: Record<string, readonly TypedDataParameter[]>;
|
|
11
|
+
primaryType: PerpsPrimaryType;
|
|
12
|
+
message: Record<string, any>;
|
|
5
13
|
};
|
|
6
|
-
export type PerpsSignedTypedData =
|
|
7
|
-
|
|
14
|
+
export type PerpsSignedTypedData = PerpsTypedData & {
|
|
15
|
+
signature: Hex;
|
|
8
16
|
};
|
|
9
17
|
export type { Address, Hex, TypedDataDomain, TypedDataParameter };
|
|
10
18
|
//# sourceMappingURL=typedData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAErE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAA;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC,CAAA;IACpD,WAAW,EAAE,gBAAgB,CAAA;IAE7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAClD,SAAS,EAAE,GAAG,CAAA;CACf,CAAA;AAGD,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
|