@pear-protocol/exchanges-sdk 0.0.8-test.0 → 0.0.8-test.2
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,7 +110,8 @@ 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")
|
|
113
|
+
const isCross = (marginMode ?? "cross") == "cross";
|
|
114
|
+
console.log(`Setting leverage for asset ${asset} to ${leverage} with margin mode ${marginMode}`);
|
|
114
115
|
await setLeverage(creds, asset, Number.parseFloat(leverage), isCross);
|
|
115
116
|
}
|
|
116
117
|
canUntrackAsset(coin) {
|
|
@@ -5,6 +5,7 @@ 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"}`);
|
|
8
9
|
await exchangeClient.updateLeverage({ asset, leverage, isCross });
|
|
9
10
|
}
|
|
10
11
|
|