opentool 0.13.0 → 0.14.0
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/adapters/hyperliquid/browser.js +10 -10
- package/dist/adapters/hyperliquid/browser.js.map +1 -1
- package/dist/adapters/hyperliquid/index.js +7 -7
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/wallet/browser.js +3 -2
- package/dist/wallet/browser.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/package.json +1 -1
|
@@ -1224,7 +1224,7 @@ async function placeHyperliquidTwapOrder(options) {
|
|
|
1224
1224
|
symbol: twap.symbol,
|
|
1225
1225
|
baseUrl: API_BASES[env],
|
|
1226
1226
|
environment: env,
|
|
1227
|
-
fetcher: fetch
|
|
1227
|
+
fetcher: (...args) => fetch(...args)
|
|
1228
1228
|
});
|
|
1229
1229
|
const action = {
|
|
1230
1230
|
type: "twapOrder",
|
|
@@ -1246,7 +1246,7 @@ async function cancelHyperliquidTwapOrder(options) {
|
|
|
1246
1246
|
symbol: options.cancel.symbol,
|
|
1247
1247
|
baseUrl: API_BASES[env],
|
|
1248
1248
|
environment: env,
|
|
1249
|
-
fetcher: fetch
|
|
1249
|
+
fetcher: (...args) => fetch(...args)
|
|
1250
1250
|
});
|
|
1251
1251
|
const action = {
|
|
1252
1252
|
type: "twapCancel",
|
|
@@ -1263,7 +1263,7 @@ async function updateHyperliquidLeverage(options) {
|
|
|
1263
1263
|
symbol: options.input.symbol,
|
|
1264
1264
|
baseUrl: API_BASES[env],
|
|
1265
1265
|
environment: env,
|
|
1266
|
-
fetcher: fetch
|
|
1266
|
+
fetcher: (...args) => fetch(...args)
|
|
1267
1267
|
});
|
|
1268
1268
|
const action = {
|
|
1269
1269
|
type: "updateLeverage",
|
|
@@ -1281,7 +1281,7 @@ async function updateHyperliquidIsolatedMargin(options) {
|
|
|
1281
1281
|
symbol: options.input.symbol,
|
|
1282
1282
|
baseUrl: API_BASES[env],
|
|
1283
1283
|
environment: env,
|
|
1284
|
-
fetcher: fetch
|
|
1284
|
+
fetcher: (...args) => fetch(...args)
|
|
1285
1285
|
});
|
|
1286
1286
|
const action = {
|
|
1287
1287
|
type: "updateIsolatedMargin",
|
|
@@ -1396,7 +1396,7 @@ async function withAssetIndexes(options, entries, mapper) {
|
|
|
1396
1396
|
symbol: entry.symbol,
|
|
1397
1397
|
baseUrl: API_BASES[env],
|
|
1398
1398
|
environment: env,
|
|
1399
|
-
fetcher: fetch
|
|
1399
|
+
fetcher: (...args) => fetch(...args)
|
|
1400
1400
|
});
|
|
1401
1401
|
return mapper(assetIndex, entry);
|
|
1402
1402
|
})
|
|
@@ -1411,7 +1411,7 @@ async function buildOrder(intent, options) {
|
|
|
1411
1411
|
symbol: intent.symbol,
|
|
1412
1412
|
baseUrl: API_BASES[env],
|
|
1413
1413
|
environment: env,
|
|
1414
|
-
fetcher: fetch
|
|
1414
|
+
fetcher: (...args) => fetch(...args)
|
|
1415
1415
|
});
|
|
1416
1416
|
const limitOrTrigger = intent.trigger ? mapTrigger(intent.trigger) : {
|
|
1417
1417
|
limit: {
|
|
@@ -1574,7 +1574,7 @@ function assertPositiveDecimalInput(value, label) {
|
|
|
1574
1574
|
if (!trimmed.length) {
|
|
1575
1575
|
throw new Error(`${label} must be a non-empty string.`);
|
|
1576
1576
|
}
|
|
1577
|
-
if (!/^(
|
|
1577
|
+
if (!/^(?:\d+\.?\d*|\.\d+)$/.test(trimmed)) {
|
|
1578
1578
|
throw new Error(`${label} must be a positive decimal string.`);
|
|
1579
1579
|
}
|
|
1580
1580
|
const numeric = Number(trimmed);
|
|
@@ -1587,10 +1587,10 @@ function normalizePositiveDecimalString(raw, label) {
|
|
|
1587
1587
|
if (!trimmed.length) {
|
|
1588
1588
|
throw new Error(`${label} must be a non-empty decimal string.`);
|
|
1589
1589
|
}
|
|
1590
|
-
if (!/^(
|
|
1590
|
+
if (!/^(?:\d+\.?\d*|\.\d+)$/.test(trimmed)) {
|
|
1591
1591
|
throw new Error(`${label} must be a positive decimal string.`);
|
|
1592
1592
|
}
|
|
1593
|
-
const normalized = trimmed.replace(/^0+(
|
|
1593
|
+
const normalized = trimmed.replace(/^0+(?=\d)/, "").replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
|
|
1594
1594
|
const numeric = Number(normalized);
|
|
1595
1595
|
if (!Number.isFinite(numeric) || numeric <= 0) {
|
|
1596
1596
|
throw new Error(`${label} must be positive.`);
|
|
@@ -1626,7 +1626,7 @@ async function placeHyperliquidOrder(options) {
|
|
|
1626
1626
|
symbol: intent.symbol,
|
|
1627
1627
|
baseUrl: resolvedBaseUrl,
|
|
1628
1628
|
environment: inferredEnvironment,
|
|
1629
|
-
fetcher: fetch
|
|
1629
|
+
fetcher: (...args) => fetch(...args)
|
|
1630
1630
|
});
|
|
1631
1631
|
const order = {
|
|
1632
1632
|
a: assetIndex,
|