@metamask-previews/perps-controller 13.0.0-preview-7fead6160 → 13.0.0-preview-add047418
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/CHANGELOG.md +0 -1
- package/dist/providers/HyperLiquidProvider.cjs +20 -11
- package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
- package/dist/providers/HyperLiquidProvider.mjs +20 -11
- package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
- package/dist/utils/hyperLiquidAdapter.cjs +2 -2
- package/dist/utils/hyperLiquidAdapter.cjs.map +1 -1
- package/dist/utils/hyperLiquidAdapter.mjs +2 -2
- package/dist/utils/hyperLiquidAdapter.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Fixed
|
|
11
11
|
|
|
12
|
-
- Preserve trigger prices and normalized trigger order types in HyperLiquid historical orders while retaining their lifecycle and execution semantics ([#9982](https://github.com/MetaMask/core/pull/9982)).
|
|
13
12
|
- Classify `xyz:CBRS` and `xyz:SPCX` as stocks in the Hyperliquid fallback market map ([#9988](https://github.com/MetaMask/core/pull/9988))
|
|
14
13
|
|
|
15
14
|
## [13.0.0]
|
|
@@ -3210,6 +3210,8 @@ class HyperLiquidProvider {
|
|
|
3210
3210
|
// Transform HyperLiquid orders to abstract Order type
|
|
3211
3211
|
const orders = (rawOrders || []).map((rawOrder) => {
|
|
3212
3212
|
const { order, status, statusTimestamp } = rawOrder;
|
|
3213
|
+
// Normalize side: HyperLiquid uses 'A' (Ask/Sell) and 'B' (Bid/Buy)
|
|
3214
|
+
const normalizedSide = order.side === 'B' ? 'buy' : 'sell';
|
|
3213
3215
|
// Normalize status
|
|
3214
3216
|
let normalizedStatus;
|
|
3215
3217
|
switch (status) {
|
|
@@ -3242,21 +3244,28 @@ class HyperLiquidProvider {
|
|
|
3242
3244
|
default:
|
|
3243
3245
|
normalizedStatus = 'queued';
|
|
3244
3246
|
}
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
const
|
|
3249
|
-
?.toLowerCase()
|
|
3250
|
-
.includes('limit')
|
|
3251
|
-
? 'limit'
|
|
3252
|
-
: 'market';
|
|
3247
|
+
// Calculate filled and remaining size
|
|
3248
|
+
const originalSize = parseFloat(order.origSz || order.sz);
|
|
3249
|
+
const currentSize = parseFloat(order.sz);
|
|
3250
|
+
const filledSize = originalSize - currentSize;
|
|
3253
3251
|
return {
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3252
|
+
orderId: order.oid?.toString() || '',
|
|
3253
|
+
symbol: order.coin,
|
|
3254
|
+
side: normalizedSide,
|
|
3255
|
+
orderType: order.orderType?.toLowerCase().includes('limit')
|
|
3256
|
+
? 'limit'
|
|
3257
|
+
: 'market',
|
|
3258
|
+
size: order.sz,
|
|
3259
|
+
originalSize: order.origSz || order.sz,
|
|
3260
|
+
price: order.limitPx || '0',
|
|
3261
|
+
filledSize: filledSize.toString(),
|
|
3262
|
+
remainingSize: currentSize.toString(),
|
|
3257
3263
|
status: normalizedStatus,
|
|
3258
3264
|
timestamp: statusTimestamp,
|
|
3259
3265
|
lastUpdated: statusTimestamp,
|
|
3266
|
+
detailedOrderType: order.orderType, // Full order type from exchange (e.g., 'Take Profit Limit', 'Stop Market')
|
|
3267
|
+
isTrigger: order.isTrigger,
|
|
3268
|
+
reduceOnly: order.reduceOnly,
|
|
3260
3269
|
};
|
|
3261
3270
|
});
|
|
3262
3271
|
return orders;
|