@pear-protocol/exchanges-sdk 0.0.8-test.2 → 0.0.8-test.3
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.
|
@@ -110,8 +110,7 @@ class HyperliquidOrchestrator extends BaseOrchestrator {
|
|
|
110
110
|
if (!creds) throw new Error("Not connected");
|
|
111
111
|
const asset = Number.parseInt(id, 10);
|
|
112
112
|
if (Number.isNaN(asset)) throw new Error(`Invalid Hyperliquid asset index: ${id}`);
|
|
113
|
-
const isCross = (marginMode ?? "cross")
|
|
114
|
-
console.log(`Setting leverage for asset ${asset} to ${leverage} with margin mode ${marginMode}`);
|
|
113
|
+
const isCross = (marginMode ?? "cross") === "cross";
|
|
115
114
|
await setLeverage(creds, asset, Number.parseFloat(leverage), isCross);
|
|
116
115
|
}
|
|
117
116
|
canUntrackAsset(coin) {
|
|
@@ -5,7 +5,6 @@ async function setLeverage(creds, asset, leverage, isCross) {
|
|
|
5
5
|
const transport = new HttpTransport();
|
|
6
6
|
const wallet = privateKeyToAccount(creds.signer_key);
|
|
7
7
|
const exchangeClient = new ExchangeClient({ transport, wallet });
|
|
8
|
-
console.log(`Setting leverage for asset ${asset} to ${leverage} with margin mode ${isCross ? "cross" : "isolated"}`);
|
|
9
8
|
await exchangeClient.updateLeverage({ asset, leverage, isCross });
|
|
10
9
|
}
|
|
11
10
|
|