@luxfi/dex 1.3.0 → 2.0.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/dist/hooks/index.d.ts +16 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +20 -1
- package/dist/hooks/use-lxbook.d.ts +84 -0
- package/dist/hooks/use-lxbook.d.ts.map +1 -0
- package/dist/hooks/use-lxbook.js +213 -0
- package/dist/hooks/use-lxfeed.d.ts +42 -0
- package/dist/hooks/use-lxfeed.d.ts.map +1 -0
- package/dist/hooks/use-lxfeed.js +152 -0
- package/dist/hooks/use-lxvault.d.ts +75 -0
- package/dist/hooks/use-lxvault.d.ts.map +1 -0
- package/dist/hooks/use-lxvault.js +227 -0
- package/dist/index.d.ts +38 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -26
- package/dist/precompile/abis.d.ts +593 -2
- package/dist/precompile/abis.d.ts.map +1 -1
- package/dist/precompile/abis.js +458 -2
- package/dist/precompile/addresses.d.ts +89 -25
- package/dist/precompile/addresses.d.ts.map +1 -1
- package/dist/precompile/addresses.js +86 -21
- package/dist/precompile/index.d.ts +13 -2
- package/dist/precompile/index.d.ts.map +1 -1
- package/dist/precompile/index.js +13 -2
- package/dist/precompile/types.d.ts +171 -1
- package/dist/precompile/types.d.ts.map +1 -1
- package/dist/precompile/types.js +67 -0
- package/package.json +2 -2
- package/src/hooks/index.ts +24 -1
- package/src/hooks/use-lxbook.ts +343 -0
- package/src/hooks/use-lxfeed.ts +179 -0
- package/src/hooks/use-lxvault.ts +318 -0
- package/src/index.ts +92 -26
- package/src/precompile/abis.ts +466 -2
- package/src/precompile/addresses.ts +109 -28
- package/src/precompile/index.ts +13 -2
- package/src/precompile/types.ts +200 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LXVault Hooks (LP-9030)
|
|
3
|
+
* React hooks for custody, margin, and positions via LXVault precompile
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { useReadContract, useWriteContract, useWaitForTransactionReceipt, useAccount } from 'wagmi';
|
|
7
|
+
import { LX } from '../precompile/addresses';
|
|
8
|
+
import { LX_VAULT_ABI } from '../precompile/abis';
|
|
9
|
+
/**
|
|
10
|
+
* Build account tuple from address and subaccount
|
|
11
|
+
*/
|
|
12
|
+
function buildAccount(main, subaccountId = 0) {
|
|
13
|
+
return { main, subaccountId };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook to get token balance in vault
|
|
17
|
+
*/
|
|
18
|
+
export function useLXVaultBalance(token, subaccountId = 0) {
|
|
19
|
+
const { address } = useAccount();
|
|
20
|
+
const { data, isLoading, error, refetch } = useReadContract({
|
|
21
|
+
address: LX.LX_VAULT,
|
|
22
|
+
abi: LX_VAULT_ABI,
|
|
23
|
+
functionName: 'getBalance',
|
|
24
|
+
args: address ? [buildAccount(address, subaccountId), token] : undefined,
|
|
25
|
+
query: { enabled: !!address },
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
balance: data,
|
|
29
|
+
isLoading,
|
|
30
|
+
error,
|
|
31
|
+
refetch,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hook to get position for a market
|
|
36
|
+
*/
|
|
37
|
+
export function useLXVaultPosition(marketId, subaccountId = 0) {
|
|
38
|
+
const { address } = useAccount();
|
|
39
|
+
const { data, isLoading, error, refetch } = useReadContract({
|
|
40
|
+
address: LX.LX_VAULT,
|
|
41
|
+
abi: LX_VAULT_ABI,
|
|
42
|
+
functionName: 'getPosition',
|
|
43
|
+
args: address ? [buildAccount(address, subaccountId), marketId] : undefined,
|
|
44
|
+
query: { enabled: !!address },
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
position: data,
|
|
48
|
+
isLoading,
|
|
49
|
+
error,
|
|
50
|
+
refetch,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Hook to get margin info (free margin, used margin, etc.)
|
|
55
|
+
*/
|
|
56
|
+
export function useLXVaultMargin(subaccountId = 0) {
|
|
57
|
+
const { address } = useAccount();
|
|
58
|
+
const { data, isLoading, error, refetch } = useReadContract({
|
|
59
|
+
address: LX.LX_VAULT,
|
|
60
|
+
abi: LX_VAULT_ABI,
|
|
61
|
+
functionName: 'getMargin',
|
|
62
|
+
args: address ? [buildAccount(address, subaccountId)] : undefined,
|
|
63
|
+
query: { enabled: !!address },
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
margin: data,
|
|
67
|
+
isLoading,
|
|
68
|
+
error,
|
|
69
|
+
refetch,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Hook to check if account is liquidatable
|
|
74
|
+
*/
|
|
75
|
+
export function useLXVaultLiquidatable(account, subaccountId = 0) {
|
|
76
|
+
const { address: connectedAddress } = useAccount();
|
|
77
|
+
const targetAddress = account ?? connectedAddress;
|
|
78
|
+
const { data, isLoading, error, refetch } = useReadContract({
|
|
79
|
+
address: LX.LX_VAULT,
|
|
80
|
+
abi: LX_VAULT_ABI,
|
|
81
|
+
functionName: 'isLiquidatable',
|
|
82
|
+
args: targetAddress ? [buildAccount(targetAddress, subaccountId)] : undefined,
|
|
83
|
+
query: { enabled: !!targetAddress },
|
|
84
|
+
});
|
|
85
|
+
const result = data;
|
|
86
|
+
return {
|
|
87
|
+
liquidatable: result?.[0],
|
|
88
|
+
shortfall: result?.[1],
|
|
89
|
+
isLoading,
|
|
90
|
+
error,
|
|
91
|
+
refetch,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Hook to get funding rate for a market
|
|
96
|
+
*/
|
|
97
|
+
export function useLXVaultFundingRate(marketId) {
|
|
98
|
+
const { data, isLoading, error, refetch } = useReadContract({
|
|
99
|
+
address: LX.LX_VAULT,
|
|
100
|
+
abi: LX_VAULT_ABI,
|
|
101
|
+
functionName: 'getFundingRate',
|
|
102
|
+
args: [marketId],
|
|
103
|
+
});
|
|
104
|
+
const result = data;
|
|
105
|
+
return {
|
|
106
|
+
rateX18: result?.[0],
|
|
107
|
+
nextFundingTime: result?.[1],
|
|
108
|
+
isLoading,
|
|
109
|
+
error,
|
|
110
|
+
refetch,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Hook for depositing tokens into vault
|
|
115
|
+
*/
|
|
116
|
+
export function useLXVaultDeposit() {
|
|
117
|
+
const { writeContract, data: hash, isPending, error } = useWriteContract();
|
|
118
|
+
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
119
|
+
const deposit = useCallback((token, amount, subaccountId = 0) => {
|
|
120
|
+
writeContract({
|
|
121
|
+
address: LX.LX_VAULT,
|
|
122
|
+
abi: LX_VAULT_ABI,
|
|
123
|
+
functionName: 'deposit',
|
|
124
|
+
args: [token, amount, subaccountId],
|
|
125
|
+
});
|
|
126
|
+
}, [writeContract]);
|
|
127
|
+
return {
|
|
128
|
+
deposit,
|
|
129
|
+
hash,
|
|
130
|
+
isPending,
|
|
131
|
+
isConfirming,
|
|
132
|
+
isSuccess,
|
|
133
|
+
error,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Hook for withdrawing tokens from vault
|
|
138
|
+
*/
|
|
139
|
+
export function useLXVaultWithdraw() {
|
|
140
|
+
const { writeContract, data: hash, isPending, error } = useWriteContract();
|
|
141
|
+
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
142
|
+
const withdraw = useCallback((token, amount, subaccountId = 0) => {
|
|
143
|
+
writeContract({
|
|
144
|
+
address: LX.LX_VAULT,
|
|
145
|
+
abi: LX_VAULT_ABI,
|
|
146
|
+
functionName: 'withdraw',
|
|
147
|
+
args: [token, amount, subaccountId],
|
|
148
|
+
});
|
|
149
|
+
}, [writeContract]);
|
|
150
|
+
return {
|
|
151
|
+
withdraw,
|
|
152
|
+
hash,
|
|
153
|
+
isPending,
|
|
154
|
+
isConfirming,
|
|
155
|
+
isSuccess,
|
|
156
|
+
error,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Hook for transferring between subaccounts
|
|
161
|
+
*/
|
|
162
|
+
export function useLXVaultTransfer() {
|
|
163
|
+
const { writeContract, data: hash, isPending, error } = useWriteContract();
|
|
164
|
+
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
165
|
+
const transfer = useCallback((token, amount, fromSubaccount, toSubaccount) => {
|
|
166
|
+
writeContract({
|
|
167
|
+
address: LX.LX_VAULT,
|
|
168
|
+
abi: LX_VAULT_ABI,
|
|
169
|
+
functionName: 'transfer',
|
|
170
|
+
args: [token, amount, fromSubaccount, toSubaccount],
|
|
171
|
+
});
|
|
172
|
+
}, [writeContract]);
|
|
173
|
+
return {
|
|
174
|
+
transfer,
|
|
175
|
+
hash,
|
|
176
|
+
isPending,
|
|
177
|
+
isConfirming,
|
|
178
|
+
isSuccess,
|
|
179
|
+
error,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Hook for liquidating underwater positions
|
|
184
|
+
*/
|
|
185
|
+
export function useLXVaultLiquidate() {
|
|
186
|
+
const { writeContract, data: hash, isPending, error } = useWriteContract();
|
|
187
|
+
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
188
|
+
const liquidate = useCallback((targetAccount, targetSubaccount, marketId, sizeX18) => {
|
|
189
|
+
writeContract({
|
|
190
|
+
address: LX.LX_VAULT,
|
|
191
|
+
abi: LX_VAULT_ABI,
|
|
192
|
+
functionName: 'liquidate',
|
|
193
|
+
args: [buildAccount(targetAccount, targetSubaccount), marketId, sizeX18],
|
|
194
|
+
});
|
|
195
|
+
}, [writeContract]);
|
|
196
|
+
return {
|
|
197
|
+
liquidate,
|
|
198
|
+
hash,
|
|
199
|
+
isPending,
|
|
200
|
+
isConfirming,
|
|
201
|
+
isSuccess,
|
|
202
|
+
error,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Combined hook for common vault operations
|
|
207
|
+
*/
|
|
208
|
+
export function useLXVault(subaccountId = 0) {
|
|
209
|
+
const { address } = useAccount();
|
|
210
|
+
const margin = useLXVaultMargin(subaccountId);
|
|
211
|
+
const { deposit, isPending: isDepositing } = useLXVaultDeposit();
|
|
212
|
+
const { withdraw, isPending: isWithdrawing } = useLXVaultWithdraw();
|
|
213
|
+
const { transfer, isPending: isTransferring } = useLXVaultTransfer();
|
|
214
|
+
return {
|
|
215
|
+
address,
|
|
216
|
+
subaccountId,
|
|
217
|
+
margin: margin.margin,
|
|
218
|
+
isLoadingMargin: margin.isLoading,
|
|
219
|
+
deposit,
|
|
220
|
+
withdraw,
|
|
221
|
+
transfer,
|
|
222
|
+
isDepositing,
|
|
223
|
+
isWithdrawing,
|
|
224
|
+
isTransferring,
|
|
225
|
+
refetchMargin: margin.refetch,
|
|
226
|
+
};
|
|
227
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @luxfi/dex
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* LX Integration Package
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
6
|
+
* Native precompile integration for Lux DEX stack:
|
|
7
|
+
* - LXPool (LP-9010): v4-style AMM PoolManager
|
|
8
|
+
* - LXOracle (LP-9011): Multi-source price aggregation
|
|
9
|
+
* - LXRouter (LP-9012): Optimized swap routing
|
|
10
|
+
* - LXHooks (LP-9013): Hook contract registry
|
|
11
|
+
* - LXFlash (LP-9014): Flash loan facility
|
|
12
|
+
* - LXBook (LP-9020): CLOB matching engine
|
|
13
|
+
* - LXVault (LP-9030): Custody and margin engine
|
|
14
|
+
* - LXFeed (LP-9040): Mark price and funding feeds
|
|
9
15
|
*
|
|
10
16
|
* Architecture:
|
|
11
17
|
* ```
|
|
12
|
-
*
|
|
13
|
-
* │
|
|
14
|
-
* │
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* │
|
|
22
|
-
* │
|
|
23
|
-
* │
|
|
24
|
-
* │ •
|
|
25
|
-
* │ •
|
|
26
|
-
* │ • Perps
|
|
27
|
-
*
|
|
18
|
+
* ┌─────────────────────────────────────────────────────────────┐
|
|
19
|
+
* │ Omnichain Router │
|
|
20
|
+
* │ Best execution between CLOB & AMM │
|
|
21
|
+
* └─────────────────────────┬───────────────────────────────────┘
|
|
22
|
+
* │
|
|
23
|
+
* ┌───────────────────┼───────────────────┐
|
|
24
|
+
* │ │ │
|
|
25
|
+
* ▼ ▼ ▼
|
|
26
|
+
* ┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
27
|
+
* │ LXBook │ │ LXPool │ │ LXVault │
|
|
28
|
+
* │ (LP-9020) │ │ (LP-9010) │ │ (LP-9030) │
|
|
29
|
+
* │ │ │ │ │ │
|
|
30
|
+
* │ • Orders │ │ • Swaps │ │ • Custody │
|
|
31
|
+
* │ • CLOB │ │ • AMM │ │ • Margin │
|
|
32
|
+
* │ • Perps │ │ • Flash │ │ • Liq. │
|
|
33
|
+
* └───────────┘ └───────────┘ └───────────┘
|
|
34
|
+
* │ │ │
|
|
35
|
+
* └───────────────────┴───────────────────┘
|
|
36
|
+
* │
|
|
37
|
+
* ┌──────┴──────┐
|
|
38
|
+
* │ LXFeed │
|
|
39
|
+
* │ (LP-9040) │
|
|
40
|
+
* │ │
|
|
41
|
+
* │ • Mark Px │
|
|
42
|
+
* │ • Index Px │
|
|
43
|
+
* │ • Funding │
|
|
44
|
+
* └─────────────┘
|
|
28
45
|
* ```
|
|
29
46
|
*/
|
|
30
|
-
export { type Currency, type PoolKey, type BalanceDelta, type SwapParams, type ModifyLiquidityParams, type PoolState, type Position as AMMPosition, NATIVE_LUX, sortCurrencies, createPoolKey, POOL_MANAGER_ABI, SWAP_ROUTER_ABI, HOOKS_REGISTRY_ABI, FLASH_LOAN_ABI, DEX_PRECOMPILES, type DexPrecompile, } from './precompile';
|
|
47
|
+
export { type Currency, type PoolKey, type BalanceDelta, type SwapParams, type ModifyLiquidityParams, type PoolState, type Position as AMMPosition, NATIVE_LUX, sortCurrencies, createPoolKey, TIF, OrderKind, GroupType, ActionType, type LXOrder, type LXAction, type LXPlaceResult, type LXL1, MarginMode, PositionSide, type LXAccount, type LXPosition, type LXMarginInfo, type LXSettlement, type LXLiquidationResult, type LXMarkPrice, type LXFundingRate, POOL_MANAGER_ABI, SWAP_ROUTER_ABI, HOOKS_REGISTRY_ABI, FLASH_LOAN_ABI, LX_BOOK_ABI, LX_VAULT_ABI, LX_FEED_ABI, LX_ORACLE_ABI, LX, DEX_PRECOMPILES, type LxdexPrecompile, type DexPrecompile, fromLP, toLP, isDEXPrecompile, isBridgePrecompile, } from './precompile';
|
|
31
48
|
export { type OrderSide, type OrderType, type OrderStatus, type TimeInForce, type OrderRequest, type Order, type OrderBookEntry, type OrderBook, type Trade, type Position as CLOBPosition, type Balance, type ICLOBClient, CLOBClient, createCLOBClient, } from './client';
|
|
32
49
|
export * from './router';
|
|
33
50
|
export * from './hooks';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAMH,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,QAAQ,IAAI,WAAW,EAC5B,UAAU,EACV,cAAc,EACd,aAAa,EAGb,GAAG,EACH,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,IAAI,EAGT,UAAU,EACV,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAGxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAGlB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,cAAc,EAGd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EAGb,EAAE,EACF,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,MAAM,EACN,IAAI,EACJ,eAAe,EACf,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAMrB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,UAAU,EACV,gBAAgB,GACjB,MAAM,UAAU,CAAA;AAMjB,cAAc,UAAU,CAAA;AAMxB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @luxfi/dex
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* LX Integration Package
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
6
|
+
* Native precompile integration for Lux DEX stack:
|
|
7
|
+
* - LXPool (LP-9010): v4-style AMM PoolManager
|
|
8
|
+
* - LXOracle (LP-9011): Multi-source price aggregation
|
|
9
|
+
* - LXRouter (LP-9012): Optimized swap routing
|
|
10
|
+
* - LXHooks (LP-9013): Hook contract registry
|
|
11
|
+
* - LXFlash (LP-9014): Flash loan facility
|
|
12
|
+
* - LXBook (LP-9020): CLOB matching engine
|
|
13
|
+
* - LXVault (LP-9030): Custody and margin engine
|
|
14
|
+
* - LXFeed (LP-9040): Mark price and funding feeds
|
|
9
15
|
*
|
|
10
16
|
* Architecture:
|
|
11
17
|
* ```
|
|
12
|
-
*
|
|
13
|
-
* │
|
|
14
|
-
* │
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* │
|
|
22
|
-
* │
|
|
23
|
-
* │
|
|
24
|
-
* │ •
|
|
25
|
-
* │ •
|
|
26
|
-
* │ • Perps
|
|
27
|
-
*
|
|
18
|
+
* ┌─────────────────────────────────────────────────────────────┐
|
|
19
|
+
* │ Omnichain Router │
|
|
20
|
+
* │ Best execution between CLOB & AMM │
|
|
21
|
+
* └─────────────────────────┬───────────────────────────────────┘
|
|
22
|
+
* │
|
|
23
|
+
* ┌───────────────────┼───────────────────┐
|
|
24
|
+
* │ │ │
|
|
25
|
+
* ▼ ▼ ▼
|
|
26
|
+
* ┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
27
|
+
* │ LXBook │ │ LXPool │ │ LXVault │
|
|
28
|
+
* │ (LP-9020) │ │ (LP-9010) │ │ (LP-9030) │
|
|
29
|
+
* │ │ │ │ │ │
|
|
30
|
+
* │ • Orders │ │ • Swaps │ │ • Custody │
|
|
31
|
+
* │ • CLOB │ │ • AMM │ │ • Margin │
|
|
32
|
+
* │ • Perps │ │ • Flash │ │ • Liq. │
|
|
33
|
+
* └───────────┘ └───────────┘ └───────────┘
|
|
34
|
+
* │ │ │
|
|
35
|
+
* └───────────────────┴───────────────────┘
|
|
36
|
+
* │
|
|
37
|
+
* ┌──────┴──────┐
|
|
38
|
+
* │ LXFeed │
|
|
39
|
+
* │ (LP-9040) │
|
|
40
|
+
* │ │
|
|
41
|
+
* │ • Mark Px │
|
|
42
|
+
* │ • Index Px │
|
|
43
|
+
* │ • Funding │
|
|
44
|
+
* └─────────────┘
|
|
28
45
|
* ```
|
|
29
46
|
*/
|
|
30
|
-
//
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// Precompile Types, ABIs, and Addresses
|
|
49
|
+
// =============================================================================
|
|
31
50
|
export { NATIVE_LUX, sortCurrencies, createPoolKey,
|
|
32
|
-
//
|
|
51
|
+
// LXBook Types (LP-9020)
|
|
52
|
+
TIF, OrderKind, GroupType, ActionType,
|
|
53
|
+
// LXVault Types (LP-9030)
|
|
54
|
+
MarginMode, PositionSide,
|
|
55
|
+
// AMM ABIs
|
|
33
56
|
POOL_MANAGER_ABI, SWAP_ROUTER_ABI, HOOKS_REGISTRY_ABI, FLASH_LOAN_ABI,
|
|
57
|
+
// LX* ABIs
|
|
58
|
+
LX_BOOK_ABI, LX_VAULT_ABI, LX_FEED_ABI, LX_ORACLE_ABI,
|
|
34
59
|
// Addresses
|
|
35
|
-
DEX_PRECOMPILES, } from './precompile';
|
|
36
|
-
//
|
|
60
|
+
LX, DEX_PRECOMPILES, fromLP, toLP, isDEXPrecompile, isBridgePrecompile, } from './precompile';
|
|
61
|
+
// =============================================================================
|
|
62
|
+
// CLOB Client (External ~/work/lux/dex integration)
|
|
63
|
+
// =============================================================================
|
|
37
64
|
export { CLOBClient, createCLOBClient, } from './client';
|
|
38
|
-
//
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// Omnichain Router
|
|
67
|
+
// =============================================================================
|
|
39
68
|
export * from './router';
|
|
40
|
-
//
|
|
69
|
+
// =============================================================================
|
|
70
|
+
// React Hooks
|
|
71
|
+
// =============================================================================
|
|
41
72
|
export * from './hooks';
|