@pear-protocol/hyperliquid-sdk 0.1.8 → 0.1.10
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/index.js +4 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1599,7 +1599,7 @@ const useTokenSelectionMetadataStore = create((set) => ({
|
|
|
1599
1599
|
maxLeverage: 0,
|
|
1600
1600
|
minSize: {},
|
|
1601
1601
|
leverageMatched: true,
|
|
1602
|
-
recompute: ({ tokenMetadata, marketData, longTokens, shortTokens
|
|
1602
|
+
recompute: ({ tokenMetadata, marketData, longTokens, shortTokens }) => {
|
|
1603
1603
|
const isPriceDataReady = Object.keys(tokenMetadata).length > 0;
|
|
1604
1604
|
const longSymbols = longTokens.map((t) => t.symbol);
|
|
1605
1605
|
const shortSymbols = shortTokens.map((t) => t.symbol);
|
|
@@ -1730,10 +1730,9 @@ const useTokenSelectionMetadataStore = create((set) => ({
|
|
|
1730
1730
|
return 0;
|
|
1731
1731
|
let maxLev = 0;
|
|
1732
1732
|
allSymbols.forEach((symbol) => {
|
|
1733
|
-
var _a;
|
|
1734
1733
|
const tokenDetail = tokenMetadata[symbol];
|
|
1735
|
-
if (
|
|
1736
|
-
maxLev = Math.max(maxLev, tokenDetail.
|
|
1734
|
+
if (tokenDetail === null || tokenDetail === void 0 ? void 0 : tokenDetail.maxLeverage) {
|
|
1735
|
+
maxLev = Math.max(maxLev, tokenDetail.maxLeverage);
|
|
1737
1736
|
}
|
|
1738
1737
|
});
|
|
1739
1738
|
return maxLev;
|
|
@@ -7729,7 +7728,7 @@ const useAllUserBalances = () => {
|
|
|
7729
7728
|
}
|
|
7730
7729
|
}
|
|
7731
7730
|
if (!availableToTrades['USDC']) {
|
|
7732
|
-
availableToTrades['USDC'] = parseFloat((aggregatedClearingHouseState === null || aggregatedClearingHouseState === void 0 ? void 0 : aggregatedClearingHouseState.marginSummary.
|
|
7731
|
+
availableToTrades['USDC'] = parseFloat((aggregatedClearingHouseState === null || aggregatedClearingHouseState === void 0 ? void 0 : aggregatedClearingHouseState.marginSummary.accountValue) || '0') - parseFloat((aggregatedClearingHouseState === null || aggregatedClearingHouseState === void 0 ? void 0 : aggregatedClearingHouseState.marginSummary.totalMarginUsed) || '0');
|
|
7733
7732
|
}
|
|
7734
7733
|
return {
|
|
7735
7734
|
spotBalances,
|