opentool 0.15.1 → 0.17.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.d.ts +1 -1
- package/dist/adapters/hyperliquid/browser.js +355 -427
- package/dist/adapters/hyperliquid/browser.js.map +1 -1
- package/dist/adapters/hyperliquid/index.d.ts +2 -2
- package/dist/adapters/hyperliquid/index.js +279 -351
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/{browser-IWBnx7Q3.d.ts → browser-Bjl6u4Yt.d.ts} +6 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +279 -351
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2413,37 +2413,6 @@ async function signUserPortfolioMargin(args) {
|
|
|
2413
2413
|
});
|
|
2414
2414
|
return splitSignature(signatureHex);
|
|
2415
2415
|
}
|
|
2416
|
-
async function signUserDexAbstraction(args) {
|
|
2417
|
-
const { wallet: wallet2, action } = args;
|
|
2418
|
-
const domain = {
|
|
2419
|
-
name: "HyperliquidSignTransaction",
|
|
2420
|
-
version: "1",
|
|
2421
|
-
chainId: Number.parseInt(action.signatureChainId, 16),
|
|
2422
|
-
verifyingContract: ZERO_ADDRESS
|
|
2423
|
-
};
|
|
2424
|
-
const message = {
|
|
2425
|
-
hyperliquidChain: action.hyperliquidChain,
|
|
2426
|
-
user: action.user,
|
|
2427
|
-
enabled: action.enabled,
|
|
2428
|
-
nonce: BigInt(action.nonce)
|
|
2429
|
-
};
|
|
2430
|
-
const types = {
|
|
2431
|
-
"HyperliquidTransaction:UserDexAbstraction": [
|
|
2432
|
-
{ name: "hyperliquidChain", type: "string" },
|
|
2433
|
-
{ name: "user", type: "address" },
|
|
2434
|
-
{ name: "enabled", type: "bool" },
|
|
2435
|
-
{ name: "nonce", type: "uint64" }
|
|
2436
|
-
]
|
|
2437
|
-
};
|
|
2438
|
-
const signatureHex = await wallet2.walletClient.signTypedData({
|
|
2439
|
-
account: wallet2.account,
|
|
2440
|
-
domain,
|
|
2441
|
-
types,
|
|
2442
|
-
primaryType: "HyperliquidTransaction:UserDexAbstraction",
|
|
2443
|
-
message
|
|
2444
|
-
});
|
|
2445
|
-
return splitSignature(signatureHex);
|
|
2446
|
-
}
|
|
2447
2416
|
async function signUserSetAbstraction(args) {
|
|
2448
2417
|
const { wallet: wallet2, action } = args;
|
|
2449
2418
|
const domain = {
|
|
@@ -2543,6 +2512,270 @@ function assertPositiveNumber(value, label) {
|
|
|
2543
2512
|
}
|
|
2544
2513
|
}
|
|
2545
2514
|
|
|
2515
|
+
// src/adapters/hyperliquid/symbols.ts
|
|
2516
|
+
var UNKNOWN_SYMBOL2 = "UNKNOWN";
|
|
2517
|
+
function extractHyperliquidDex(symbol) {
|
|
2518
|
+
const idx = symbol.indexOf(":");
|
|
2519
|
+
if (idx <= 0) return null;
|
|
2520
|
+
const dex = symbol.slice(0, idx).trim().toLowerCase();
|
|
2521
|
+
return dex || null;
|
|
2522
|
+
}
|
|
2523
|
+
function parseHyperliquidSymbol(value) {
|
|
2524
|
+
if (!value) return null;
|
|
2525
|
+
const trimmed = value.trim();
|
|
2526
|
+
if (!trimmed) return null;
|
|
2527
|
+
if (trimmed.startsWith("@")) {
|
|
2528
|
+
return {
|
|
2529
|
+
raw: trimmed,
|
|
2530
|
+
kind: "spotIndex",
|
|
2531
|
+
normalized: trimmed,
|
|
2532
|
+
routeTicker: trimmed,
|
|
2533
|
+
displaySymbol: trimmed,
|
|
2534
|
+
base: null,
|
|
2535
|
+
quote: null,
|
|
2536
|
+
pair: null,
|
|
2537
|
+
dex: null,
|
|
2538
|
+
leverageMode: "cross"
|
|
2539
|
+
};
|
|
2540
|
+
}
|
|
2541
|
+
const dex = extractHyperliquidDex(trimmed);
|
|
2542
|
+
const pair = resolveHyperliquidPair(trimmed);
|
|
2543
|
+
const base2 = normalizeHyperliquidBaseSymbol(trimmed);
|
|
2544
|
+
if (dex) {
|
|
2545
|
+
if (!base2) return null;
|
|
2546
|
+
return {
|
|
2547
|
+
raw: trimmed,
|
|
2548
|
+
kind: "perp",
|
|
2549
|
+
normalized: `${dex}:${base2}`,
|
|
2550
|
+
routeTicker: `${dex}:${base2}`,
|
|
2551
|
+
displaySymbol: `${dex.toUpperCase()}:${base2}-USDC`,
|
|
2552
|
+
base: base2,
|
|
2553
|
+
quote: null,
|
|
2554
|
+
pair: null,
|
|
2555
|
+
dex,
|
|
2556
|
+
leverageMode: "isolated"
|
|
2557
|
+
};
|
|
2558
|
+
}
|
|
2559
|
+
if (pair) {
|
|
2560
|
+
const [pairBase, pairQuote] = pair.split("/");
|
|
2561
|
+
return {
|
|
2562
|
+
raw: trimmed,
|
|
2563
|
+
kind: "spot",
|
|
2564
|
+
normalized: pair,
|
|
2565
|
+
routeTicker: pair.replace("/", "-"),
|
|
2566
|
+
displaySymbol: pair.replace("/", "-"),
|
|
2567
|
+
base: pairBase ?? null,
|
|
2568
|
+
quote: pairQuote ?? null,
|
|
2569
|
+
pair,
|
|
2570
|
+
dex: null,
|
|
2571
|
+
leverageMode: "cross"
|
|
2572
|
+
};
|
|
2573
|
+
}
|
|
2574
|
+
if (!base2) return null;
|
|
2575
|
+
return {
|
|
2576
|
+
raw: trimmed,
|
|
2577
|
+
kind: "perp",
|
|
2578
|
+
normalized: base2,
|
|
2579
|
+
routeTicker: base2,
|
|
2580
|
+
displaySymbol: `${base2}-USDC`,
|
|
2581
|
+
base: base2,
|
|
2582
|
+
quote: null,
|
|
2583
|
+
pair: null,
|
|
2584
|
+
dex: null,
|
|
2585
|
+
leverageMode: "cross"
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
function normalizeSpotTokenName2(value) {
|
|
2589
|
+
const raw = (value ?? "").trim();
|
|
2590
|
+
if (!raw) return "";
|
|
2591
|
+
if (raw.endsWith("0") && raw.length > 1) {
|
|
2592
|
+
return raw.slice(0, -1);
|
|
2593
|
+
}
|
|
2594
|
+
return raw;
|
|
2595
|
+
}
|
|
2596
|
+
function canonicalizeHyperliquidTokenCase(value) {
|
|
2597
|
+
const trimmed = value.trim();
|
|
2598
|
+
if (!trimmed) return "";
|
|
2599
|
+
return trimmed === trimmed.toLowerCase() ? trimmed.toUpperCase() : trimmed;
|
|
2600
|
+
}
|
|
2601
|
+
function normalizeHyperliquidBaseSymbol(value) {
|
|
2602
|
+
if (!value) return null;
|
|
2603
|
+
const trimmed = value.trim();
|
|
2604
|
+
if (!trimmed) return null;
|
|
2605
|
+
const withoutDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
2606
|
+
const base2 = withoutDex.split("-")[0] ?? withoutDex;
|
|
2607
|
+
const baseNoPair = base2.split("/")[0] ?? base2;
|
|
2608
|
+
const normalized = canonicalizeHyperliquidTokenCase(baseNoPair);
|
|
2609
|
+
if (!normalized || normalized === UNKNOWN_SYMBOL2) return null;
|
|
2610
|
+
return normalized;
|
|
2611
|
+
}
|
|
2612
|
+
function normalizeHyperliquidMetaSymbol(symbol) {
|
|
2613
|
+
const trimmed = symbol.trim();
|
|
2614
|
+
const noDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
2615
|
+
const noPair = noDex.split("-")[0] ?? noDex;
|
|
2616
|
+
return (noPair.split("/")[0] ?? noPair).trim();
|
|
2617
|
+
}
|
|
2618
|
+
function resolveHyperliquidPair(value) {
|
|
2619
|
+
if (!value) return null;
|
|
2620
|
+
const trimmed = value.trim();
|
|
2621
|
+
if (!trimmed) return null;
|
|
2622
|
+
const withoutDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
2623
|
+
if (withoutDex.includes("/")) {
|
|
2624
|
+
const [base2, ...rest] = withoutDex.split("/");
|
|
2625
|
+
const quote = rest.join("/").trim();
|
|
2626
|
+
if (!base2 || !quote) return null;
|
|
2627
|
+
return `${canonicalizeHyperliquidTokenCase(base2)}/${canonicalizeHyperliquidTokenCase(quote)}`;
|
|
2628
|
+
}
|
|
2629
|
+
if (withoutDex.includes("-")) {
|
|
2630
|
+
const [base2, ...rest] = withoutDex.split("-");
|
|
2631
|
+
const quote = rest.join("-").trim();
|
|
2632
|
+
if (!base2 || !quote) return null;
|
|
2633
|
+
return `${canonicalizeHyperliquidTokenCase(base2)}/${canonicalizeHyperliquidTokenCase(quote)}`;
|
|
2634
|
+
}
|
|
2635
|
+
return null;
|
|
2636
|
+
}
|
|
2637
|
+
function resolveHyperliquidLeverageMode(symbol) {
|
|
2638
|
+
return symbol.includes(":") ? "isolated" : "cross";
|
|
2639
|
+
}
|
|
2640
|
+
function resolveHyperliquidProfileChain(environment) {
|
|
2641
|
+
return environment === "testnet" ? "hyperliquid-testnet" : "hyperliquid";
|
|
2642
|
+
}
|
|
2643
|
+
function buildHyperliquidProfileAssets(params) {
|
|
2644
|
+
const chain = resolveHyperliquidProfileChain(params.environment);
|
|
2645
|
+
return params.assets.map((asset) => {
|
|
2646
|
+
const symbols = asset.assetSymbols.map((symbol) => normalizeHyperliquidBaseSymbol(symbol)).filter((symbol) => Boolean(symbol));
|
|
2647
|
+
if (symbols.length === 0) return null;
|
|
2648
|
+
const explicitPair = typeof asset.pair === "string" ? resolveHyperliquidPair(asset.pair) : null;
|
|
2649
|
+
const derivedPair = symbols.length === 1 ? resolveHyperliquidPair(asset.assetSymbols[0] ?? symbols[0]) : null;
|
|
2650
|
+
const pair = explicitPair ?? derivedPair ?? void 0;
|
|
2651
|
+
const leverage = typeof asset.leverage === "number" && Number.isFinite(asset.leverage) && asset.leverage > 0 ? asset.leverage : void 0;
|
|
2652
|
+
const walletAddress = typeof asset.walletAddress === "string" && asset.walletAddress.trim().length > 0 ? asset.walletAddress.trim() : void 0;
|
|
2653
|
+
return {
|
|
2654
|
+
venue: "hyperliquid",
|
|
2655
|
+
chain,
|
|
2656
|
+
assetSymbols: symbols,
|
|
2657
|
+
...pair ? { pair } : {},
|
|
2658
|
+
...leverage ? { leverage } : {},
|
|
2659
|
+
...walletAddress ? { walletAddress } : {}
|
|
2660
|
+
};
|
|
2661
|
+
}).filter((asset) => asset !== null);
|
|
2662
|
+
}
|
|
2663
|
+
function parseSpotPairSymbol(symbol) {
|
|
2664
|
+
const trimmed = symbol.trim();
|
|
2665
|
+
if (!trimmed.includes("/")) return null;
|
|
2666
|
+
const [rawBase, rawQuote] = trimmed.split("/");
|
|
2667
|
+
const base2 = rawBase?.trim().toUpperCase() ?? "";
|
|
2668
|
+
const quote = rawQuote?.trim().toUpperCase() ?? "";
|
|
2669
|
+
if (!base2 || !quote) return null;
|
|
2670
|
+
return { base: base2, quote };
|
|
2671
|
+
}
|
|
2672
|
+
function isHyperliquidSpotSymbol(symbol) {
|
|
2673
|
+
const trimmed = symbol.trim();
|
|
2674
|
+
if (!trimmed) return false;
|
|
2675
|
+
if (trimmed.startsWith("@") || trimmed.includes("/")) return true;
|
|
2676
|
+
if (trimmed.includes(":")) return false;
|
|
2677
|
+
return resolveHyperliquidPair(trimmed) !== null;
|
|
2678
|
+
}
|
|
2679
|
+
function resolveHyperliquidMarketDataCoin(value) {
|
|
2680
|
+
if (!value) return null;
|
|
2681
|
+
const trimmed = value.trim();
|
|
2682
|
+
if (!trimmed) return null;
|
|
2683
|
+
if (trimmed.startsWith("@")) return trimmed;
|
|
2684
|
+
const pair = resolveHyperliquidPair(trimmed);
|
|
2685
|
+
if (pair && !extractHyperliquidDex(trimmed)) {
|
|
2686
|
+
return pair;
|
|
2687
|
+
}
|
|
2688
|
+
return trimmed;
|
|
2689
|
+
}
|
|
2690
|
+
function supportsHyperliquidBuilderFee(params) {
|
|
2691
|
+
if (!isHyperliquidSpotSymbol(params.symbol)) {
|
|
2692
|
+
return true;
|
|
2693
|
+
}
|
|
2694
|
+
return params.side === "sell";
|
|
2695
|
+
}
|
|
2696
|
+
function resolveSpotMidCandidates(baseSymbol) {
|
|
2697
|
+
const base2 = baseSymbol.trim().toUpperCase();
|
|
2698
|
+
if (!base2) return [];
|
|
2699
|
+
const candidates = [base2];
|
|
2700
|
+
if (base2.startsWith("U") && base2.length > 1) {
|
|
2701
|
+
candidates.push(base2.slice(1));
|
|
2702
|
+
}
|
|
2703
|
+
return Array.from(new Set(candidates));
|
|
2704
|
+
}
|
|
2705
|
+
function resolveSpotTokenCandidates(value) {
|
|
2706
|
+
const normalized = normalizeSpotTokenName2(value).toUpperCase();
|
|
2707
|
+
if (!normalized) return [];
|
|
2708
|
+
const candidates = [normalized];
|
|
2709
|
+
if (normalized.startsWith("U") && normalized.length > 1) {
|
|
2710
|
+
candidates.push(normalized.slice(1));
|
|
2711
|
+
}
|
|
2712
|
+
return Array.from(new Set(candidates));
|
|
2713
|
+
}
|
|
2714
|
+
function resolveHyperliquidOrderSymbol(value) {
|
|
2715
|
+
if (!value) return null;
|
|
2716
|
+
const trimmed = value.trim();
|
|
2717
|
+
if (!trimmed) return null;
|
|
2718
|
+
if (trimmed.startsWith("@")) return trimmed;
|
|
2719
|
+
if (trimmed.includes(":")) {
|
|
2720
|
+
const [rawDex, ...restParts] = trimmed.split(":");
|
|
2721
|
+
const dex = rawDex.trim().toLowerCase();
|
|
2722
|
+
const rest = restParts.join(":");
|
|
2723
|
+
const normalizedBase = normalizeHyperliquidBaseSymbol(rest);
|
|
2724
|
+
if (!dex || !normalizedBase || normalizedBase === UNKNOWN_SYMBOL2) {
|
|
2725
|
+
return null;
|
|
2726
|
+
}
|
|
2727
|
+
return `${dex}:${normalizedBase}`;
|
|
2728
|
+
}
|
|
2729
|
+
const pair = resolveHyperliquidPair(trimmed);
|
|
2730
|
+
if (pair) return pair;
|
|
2731
|
+
return normalizeHyperliquidBaseSymbol(trimmed);
|
|
2732
|
+
}
|
|
2733
|
+
function resolveHyperliquidSymbol(asset, override) {
|
|
2734
|
+
const raw = override && override.trim().length > 0 ? override.trim() : asset.trim();
|
|
2735
|
+
if (!raw) return raw;
|
|
2736
|
+
if (raw.startsWith("@")) return raw;
|
|
2737
|
+
if (raw.includes(":")) {
|
|
2738
|
+
const [dexRaw, ...restParts] = raw.split(":");
|
|
2739
|
+
const dex = dexRaw.trim().toLowerCase();
|
|
2740
|
+
const rest = restParts.join(":");
|
|
2741
|
+
const normalizedBase = normalizeHyperliquidBaseSymbol(rest) ?? canonicalizeHyperliquidTokenCase(rest);
|
|
2742
|
+
if (!dex) return normalizedBase;
|
|
2743
|
+
return `${dex}:${normalizedBase}`;
|
|
2744
|
+
}
|
|
2745
|
+
if (raw.includes("/")) {
|
|
2746
|
+
return resolveHyperliquidPair(raw) ?? raw;
|
|
2747
|
+
}
|
|
2748
|
+
if (raw.includes("-")) {
|
|
2749
|
+
return resolveHyperliquidPair(raw) ?? raw;
|
|
2750
|
+
}
|
|
2751
|
+
return normalizeHyperliquidBaseSymbol(raw) ?? canonicalizeHyperliquidTokenCase(raw);
|
|
2752
|
+
}
|
|
2753
|
+
function resolveHyperliquidPerpSymbol(asset) {
|
|
2754
|
+
const raw = asset.trim();
|
|
2755
|
+
if (!raw) return raw;
|
|
2756
|
+
const dex = extractHyperliquidDex(raw);
|
|
2757
|
+
const base2 = normalizeHyperliquidBaseSymbol(raw) ?? raw.toUpperCase();
|
|
2758
|
+
return dex ? `${dex}:${base2}` : base2;
|
|
2759
|
+
}
|
|
2760
|
+
function resolveHyperliquidSpotSymbol(asset, defaultQuote = "USDC") {
|
|
2761
|
+
const quote = defaultQuote.trim().toUpperCase() || "USDC";
|
|
2762
|
+
const raw = asset.trim().toUpperCase();
|
|
2763
|
+
if (!raw) {
|
|
2764
|
+
return { symbol: raw, base: raw, quote };
|
|
2765
|
+
}
|
|
2766
|
+
const pair = resolveHyperliquidPair(raw);
|
|
2767
|
+
if (pair) {
|
|
2768
|
+
const [base3, pairQuote] = pair.split("/");
|
|
2769
|
+
return {
|
|
2770
|
+
symbol: pair,
|
|
2771
|
+
base: base3?.trim() ?? raw,
|
|
2772
|
+
quote: pairQuote?.trim() ?? quote
|
|
2773
|
+
};
|
|
2774
|
+
}
|
|
2775
|
+
const base2 = normalizeHyperliquidBaseSymbol(raw) ?? raw;
|
|
2776
|
+
return { symbol: `${base2}/${quote}`, base: base2, quote };
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2546
2779
|
// src/adapters/hyperliquid/info.ts
|
|
2547
2780
|
async function postInfo(environment, payload) {
|
|
2548
2781
|
const baseUrl = API_BASES[environment];
|
|
@@ -2638,6 +2871,9 @@ var HyperliquidInfoClient = class {
|
|
|
2638
2871
|
async function fetchHyperliquidMeta(environment = "mainnet") {
|
|
2639
2872
|
return postInfo(environment, { type: "meta" });
|
|
2640
2873
|
}
|
|
2874
|
+
async function fetchHyperliquidDexMeta(environment = "mainnet", dex) {
|
|
2875
|
+
return postInfo(environment, { type: "meta", dex });
|
|
2876
|
+
}
|
|
2641
2877
|
async function fetchHyperliquidMetaAndAssetCtxs(environment = "mainnet") {
|
|
2642
2878
|
return postInfo(environment, { type: "metaAndAssetCtxs" });
|
|
2643
2879
|
}
|
|
@@ -2858,17 +3094,6 @@ var HyperliquidExchangeClient = class {
|
|
|
2858
3094
|
...params
|
|
2859
3095
|
});
|
|
2860
3096
|
}
|
|
2861
|
-
setDexAbstraction(params) {
|
|
2862
|
-
const base2 = {
|
|
2863
|
-
wallet: this.wallet,
|
|
2864
|
-
enabled: params.enabled,
|
|
2865
|
-
environment: this.environment,
|
|
2866
|
-
vaultAddress: this.vaultAddress,
|
|
2867
|
-
expiresAfter: this.expiresAfter,
|
|
2868
|
-
nonceSource: this.nonceSource
|
|
2869
|
-
};
|
|
2870
|
-
return setHyperliquidDexAbstraction(params.user ? { ...base2, user: params.user } : base2);
|
|
2871
|
-
}
|
|
2872
3097
|
setAccountAbstractionMode(params) {
|
|
2873
3098
|
const base2 = {
|
|
2874
3099
|
wallet: this.wallet,
|
|
@@ -2910,54 +3135,14 @@ async function setHyperliquidPortfolioMargin(options) {
|
|
|
2910
3135
|
const hyperliquidChain = HL_CHAIN_LABEL[env];
|
|
2911
3136
|
const user = normalizeAddress(options.user ?? options.wallet.address);
|
|
2912
3137
|
const action = {
|
|
2913
|
-
type: "userPortfolioMargin",
|
|
2914
|
-
enabled: Boolean(options.enabled),
|
|
2915
|
-
hyperliquidChain,
|
|
2916
|
-
signatureChainId,
|
|
2917
|
-
user,
|
|
2918
|
-
nonce
|
|
2919
|
-
};
|
|
2920
|
-
const signature = await signUserPortfolioMargin({
|
|
2921
|
-
wallet: options.wallet,
|
|
2922
|
-
action
|
|
2923
|
-
});
|
|
2924
|
-
const body = {
|
|
2925
|
-
action,
|
|
2926
|
-
nonce,
|
|
2927
|
-
signature
|
|
2928
|
-
};
|
|
2929
|
-
if (options.vaultAddress) {
|
|
2930
|
-
body.vaultAddress = normalizeAddress(options.vaultAddress);
|
|
2931
|
-
}
|
|
2932
|
-
if (typeof options.expiresAfter === "number") {
|
|
2933
|
-
body.expiresAfter = options.expiresAfter;
|
|
2934
|
-
}
|
|
2935
|
-
return postExchange(env, body);
|
|
2936
|
-
}
|
|
2937
|
-
async function setHyperliquidDexAbstraction(options) {
|
|
2938
|
-
const env = options.environment ?? "mainnet";
|
|
2939
|
-
if (!options.wallet?.account || !options.wallet.walletClient) {
|
|
2940
|
-
throw new Error("Wallet with signing capability is required for dex abstraction.");
|
|
2941
|
-
}
|
|
2942
|
-
const nonce = resolveRequiredExchangeNonce({
|
|
2943
|
-
nonce: options.nonce,
|
|
2944
|
-
nonceSource: options.nonceSource,
|
|
2945
|
-
walletNonceProvider: options.walletNonceProvider,
|
|
2946
|
-
wallet: options.wallet,
|
|
2947
|
-
action: "Hyperliquid dex abstraction"
|
|
2948
|
-
});
|
|
2949
|
-
const signatureChainId = getSignatureChainId(env);
|
|
2950
|
-
const hyperliquidChain = HL_CHAIN_LABEL[env];
|
|
2951
|
-
const user = normalizeAddress(options.user ?? options.wallet.address);
|
|
2952
|
-
const action = {
|
|
2953
|
-
type: "userDexAbstraction",
|
|
3138
|
+
type: "userPortfolioMargin",
|
|
2954
3139
|
enabled: Boolean(options.enabled),
|
|
2955
3140
|
hyperliquidChain,
|
|
2956
3141
|
signatureChainId,
|
|
2957
3142
|
user,
|
|
2958
3143
|
nonce
|
|
2959
3144
|
};
|
|
2960
|
-
const signature = await
|
|
3145
|
+
const signature = await signUserPortfolioMargin({
|
|
2961
3146
|
wallet: options.wallet,
|
|
2962
3147
|
action
|
|
2963
3148
|
});
|
|
@@ -3425,264 +3610,6 @@ function resolveHyperliquidStoreNetwork(environment) {
|
|
|
3425
3610
|
return environment === "mainnet" ? "hyperliquid" : "hyperliquid-testnet";
|
|
3426
3611
|
}
|
|
3427
3612
|
|
|
3428
|
-
// src/adapters/hyperliquid/symbols.ts
|
|
3429
|
-
var UNKNOWN_SYMBOL2 = "UNKNOWN";
|
|
3430
|
-
function extractHyperliquidDex(symbol) {
|
|
3431
|
-
const idx = symbol.indexOf(":");
|
|
3432
|
-
if (idx <= 0) return null;
|
|
3433
|
-
const dex = symbol.slice(0, idx).trim().toLowerCase();
|
|
3434
|
-
return dex || null;
|
|
3435
|
-
}
|
|
3436
|
-
function parseHyperliquidSymbol(value) {
|
|
3437
|
-
if (!value) return null;
|
|
3438
|
-
const trimmed = value.trim();
|
|
3439
|
-
if (!trimmed) return null;
|
|
3440
|
-
if (trimmed.startsWith("@")) {
|
|
3441
|
-
return {
|
|
3442
|
-
raw: trimmed,
|
|
3443
|
-
kind: "spotIndex",
|
|
3444
|
-
normalized: trimmed,
|
|
3445
|
-
routeTicker: trimmed,
|
|
3446
|
-
displaySymbol: trimmed,
|
|
3447
|
-
base: null,
|
|
3448
|
-
quote: null,
|
|
3449
|
-
pair: null,
|
|
3450
|
-
dex: null,
|
|
3451
|
-
leverageMode: "cross"
|
|
3452
|
-
};
|
|
3453
|
-
}
|
|
3454
|
-
const dex = extractHyperliquidDex(trimmed);
|
|
3455
|
-
const pair = resolveHyperliquidPair(trimmed);
|
|
3456
|
-
const base2 = normalizeHyperliquidBaseSymbol(trimmed);
|
|
3457
|
-
if (dex) {
|
|
3458
|
-
if (!base2) return null;
|
|
3459
|
-
return {
|
|
3460
|
-
raw: trimmed,
|
|
3461
|
-
kind: "perp",
|
|
3462
|
-
normalized: `${dex}:${base2}`,
|
|
3463
|
-
routeTicker: `${dex}:${base2}`,
|
|
3464
|
-
displaySymbol: `${dex.toUpperCase()}:${base2}-USDC`,
|
|
3465
|
-
base: base2,
|
|
3466
|
-
quote: null,
|
|
3467
|
-
pair: null,
|
|
3468
|
-
dex,
|
|
3469
|
-
leverageMode: "isolated"
|
|
3470
|
-
};
|
|
3471
|
-
}
|
|
3472
|
-
if (pair) {
|
|
3473
|
-
const [pairBase, pairQuote] = pair.split("/");
|
|
3474
|
-
return {
|
|
3475
|
-
raw: trimmed,
|
|
3476
|
-
kind: "spot",
|
|
3477
|
-
normalized: pair,
|
|
3478
|
-
routeTicker: pair.replace("/", "-"),
|
|
3479
|
-
displaySymbol: pair.replace("/", "-"),
|
|
3480
|
-
base: pairBase ?? null,
|
|
3481
|
-
quote: pairQuote ?? null,
|
|
3482
|
-
pair,
|
|
3483
|
-
dex: null,
|
|
3484
|
-
leverageMode: "cross"
|
|
3485
|
-
};
|
|
3486
|
-
}
|
|
3487
|
-
if (!base2) return null;
|
|
3488
|
-
return {
|
|
3489
|
-
raw: trimmed,
|
|
3490
|
-
kind: "perp",
|
|
3491
|
-
normalized: base2,
|
|
3492
|
-
routeTicker: base2,
|
|
3493
|
-
displaySymbol: `${base2}-USDC`,
|
|
3494
|
-
base: base2,
|
|
3495
|
-
quote: null,
|
|
3496
|
-
pair: null,
|
|
3497
|
-
dex: null,
|
|
3498
|
-
leverageMode: "cross"
|
|
3499
|
-
};
|
|
3500
|
-
}
|
|
3501
|
-
function normalizeSpotTokenName2(value) {
|
|
3502
|
-
const raw = (value ?? "").trim();
|
|
3503
|
-
if (!raw) return "";
|
|
3504
|
-
if (raw.endsWith("0") && raw.length > 1) {
|
|
3505
|
-
return raw.slice(0, -1);
|
|
3506
|
-
}
|
|
3507
|
-
return raw;
|
|
3508
|
-
}
|
|
3509
|
-
function normalizeHyperliquidBaseSymbol(value) {
|
|
3510
|
-
if (!value) return null;
|
|
3511
|
-
const trimmed = value.trim();
|
|
3512
|
-
if (!trimmed) return null;
|
|
3513
|
-
const withoutDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
3514
|
-
const base2 = withoutDex.split("-")[0] ?? withoutDex;
|
|
3515
|
-
const baseNoPair = base2.split("/")[0] ?? base2;
|
|
3516
|
-
const normalized = baseNoPair.trim().toUpperCase();
|
|
3517
|
-
if (!normalized || normalized === UNKNOWN_SYMBOL2) return null;
|
|
3518
|
-
return normalized;
|
|
3519
|
-
}
|
|
3520
|
-
function normalizeHyperliquidMetaSymbol(symbol) {
|
|
3521
|
-
const trimmed = symbol.trim();
|
|
3522
|
-
const noDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
3523
|
-
const noPair = noDex.split("-")[0] ?? noDex;
|
|
3524
|
-
return (noPair.split("/")[0] ?? noPair).trim();
|
|
3525
|
-
}
|
|
3526
|
-
function resolveHyperliquidPair(value) {
|
|
3527
|
-
if (!value) return null;
|
|
3528
|
-
const trimmed = value.trim();
|
|
3529
|
-
if (!trimmed) return null;
|
|
3530
|
-
const withoutDex = trimmed.includes(":") ? trimmed.split(":").slice(1).join(":") : trimmed;
|
|
3531
|
-
if (withoutDex.includes("/")) {
|
|
3532
|
-
return withoutDex.toUpperCase();
|
|
3533
|
-
}
|
|
3534
|
-
if (withoutDex.includes("-")) {
|
|
3535
|
-
const [base2, ...rest] = withoutDex.split("-");
|
|
3536
|
-
const quote = rest.join("-").trim();
|
|
3537
|
-
if (!base2 || !quote) return null;
|
|
3538
|
-
return `${base2.toUpperCase()}/${quote.toUpperCase()}`;
|
|
3539
|
-
}
|
|
3540
|
-
return null;
|
|
3541
|
-
}
|
|
3542
|
-
function resolveHyperliquidLeverageMode(symbol) {
|
|
3543
|
-
return symbol.includes(":") ? "isolated" : "cross";
|
|
3544
|
-
}
|
|
3545
|
-
function resolveHyperliquidProfileChain(environment) {
|
|
3546
|
-
return environment === "testnet" ? "hyperliquid-testnet" : "hyperliquid";
|
|
3547
|
-
}
|
|
3548
|
-
function buildHyperliquidProfileAssets(params) {
|
|
3549
|
-
const chain = resolveHyperliquidProfileChain(params.environment);
|
|
3550
|
-
return params.assets.map((asset) => {
|
|
3551
|
-
const symbols = asset.assetSymbols.map((symbol) => normalizeHyperliquidBaseSymbol(symbol)).filter((symbol) => Boolean(symbol));
|
|
3552
|
-
if (symbols.length === 0) return null;
|
|
3553
|
-
const explicitPair = typeof asset.pair === "string" ? resolveHyperliquidPair(asset.pair) : null;
|
|
3554
|
-
const derivedPair = symbols.length === 1 ? resolveHyperliquidPair(asset.assetSymbols[0] ?? symbols[0]) : null;
|
|
3555
|
-
const pair = explicitPair ?? derivedPair ?? void 0;
|
|
3556
|
-
const leverage = typeof asset.leverage === "number" && Number.isFinite(asset.leverage) && asset.leverage > 0 ? asset.leverage : void 0;
|
|
3557
|
-
const walletAddress = typeof asset.walletAddress === "string" && asset.walletAddress.trim().length > 0 ? asset.walletAddress.trim() : void 0;
|
|
3558
|
-
return {
|
|
3559
|
-
venue: "hyperliquid",
|
|
3560
|
-
chain,
|
|
3561
|
-
assetSymbols: symbols,
|
|
3562
|
-
...pair ? { pair } : {},
|
|
3563
|
-
...leverage ? { leverage } : {},
|
|
3564
|
-
...walletAddress ? { walletAddress } : {}
|
|
3565
|
-
};
|
|
3566
|
-
}).filter((asset) => asset !== null);
|
|
3567
|
-
}
|
|
3568
|
-
function parseSpotPairSymbol(symbol) {
|
|
3569
|
-
const trimmed = symbol.trim();
|
|
3570
|
-
if (!trimmed.includes("/")) return null;
|
|
3571
|
-
const [rawBase, rawQuote] = trimmed.split("/");
|
|
3572
|
-
const base2 = rawBase?.trim().toUpperCase() ?? "";
|
|
3573
|
-
const quote = rawQuote?.trim().toUpperCase() ?? "";
|
|
3574
|
-
if (!base2 || !quote) return null;
|
|
3575
|
-
return { base: base2, quote };
|
|
3576
|
-
}
|
|
3577
|
-
function isHyperliquidSpotSymbol(symbol) {
|
|
3578
|
-
const trimmed = symbol.trim();
|
|
3579
|
-
if (!trimmed) return false;
|
|
3580
|
-
if (trimmed.startsWith("@") || trimmed.includes("/")) return true;
|
|
3581
|
-
if (trimmed.includes(":")) return false;
|
|
3582
|
-
return resolveHyperliquidPair(trimmed) !== null;
|
|
3583
|
-
}
|
|
3584
|
-
function resolveHyperliquidMarketDataCoin(value) {
|
|
3585
|
-
if (!value) return null;
|
|
3586
|
-
const trimmed = value.trim();
|
|
3587
|
-
if (!trimmed) return null;
|
|
3588
|
-
if (trimmed.startsWith("@")) return trimmed;
|
|
3589
|
-
const pair = resolveHyperliquidPair(trimmed);
|
|
3590
|
-
if (pair && !extractHyperliquidDex(trimmed)) {
|
|
3591
|
-
return pair;
|
|
3592
|
-
}
|
|
3593
|
-
return trimmed;
|
|
3594
|
-
}
|
|
3595
|
-
function resolveSpotMidCandidates(baseSymbol) {
|
|
3596
|
-
const base2 = baseSymbol.trim().toUpperCase();
|
|
3597
|
-
if (!base2) return [];
|
|
3598
|
-
const candidates = [base2];
|
|
3599
|
-
if (base2.startsWith("U") && base2.length > 1) {
|
|
3600
|
-
candidates.push(base2.slice(1));
|
|
3601
|
-
}
|
|
3602
|
-
return Array.from(new Set(candidates));
|
|
3603
|
-
}
|
|
3604
|
-
function resolveSpotTokenCandidates(value) {
|
|
3605
|
-
const normalized = normalizeSpotTokenName2(value).toUpperCase();
|
|
3606
|
-
if (!normalized) return [];
|
|
3607
|
-
const candidates = [normalized];
|
|
3608
|
-
if (normalized.startsWith("U") && normalized.length > 1) {
|
|
3609
|
-
candidates.push(normalized.slice(1));
|
|
3610
|
-
}
|
|
3611
|
-
return Array.from(new Set(candidates));
|
|
3612
|
-
}
|
|
3613
|
-
function resolveHyperliquidOrderSymbol(value) {
|
|
3614
|
-
if (!value) return null;
|
|
3615
|
-
const trimmed = value.trim();
|
|
3616
|
-
if (!trimmed) return null;
|
|
3617
|
-
if (trimmed.startsWith("@")) return trimmed;
|
|
3618
|
-
if (trimmed.includes(":")) {
|
|
3619
|
-
const [rawDex, ...restParts] = trimmed.split(":");
|
|
3620
|
-
const dex = rawDex.trim().toLowerCase();
|
|
3621
|
-
const rest = restParts.join(":");
|
|
3622
|
-
const base2 = rest.split("/")[0]?.split("-")[0] ?? rest;
|
|
3623
|
-
const normalizedBase = base2.trim().toUpperCase();
|
|
3624
|
-
if (!dex || !normalizedBase || normalizedBase === UNKNOWN_SYMBOL2) {
|
|
3625
|
-
return null;
|
|
3626
|
-
}
|
|
3627
|
-
return `${dex}:${normalizedBase}`;
|
|
3628
|
-
}
|
|
3629
|
-
const pair = resolveHyperliquidPair(trimmed);
|
|
3630
|
-
if (pair) return pair;
|
|
3631
|
-
return normalizeHyperliquidBaseSymbol(trimmed);
|
|
3632
|
-
}
|
|
3633
|
-
function resolveHyperliquidSymbol(asset, override) {
|
|
3634
|
-
const raw = override && override.trim().length > 0 ? override.trim() : asset.trim();
|
|
3635
|
-
if (!raw) return raw;
|
|
3636
|
-
if (raw.startsWith("@")) return raw;
|
|
3637
|
-
if (raw.includes(":")) {
|
|
3638
|
-
const [dexRaw, ...restParts] = raw.split(":");
|
|
3639
|
-
const dex = dexRaw.trim().toLowerCase();
|
|
3640
|
-
const rest = restParts.join(":");
|
|
3641
|
-
const base3 = rest.split("/")[0]?.split("-")[0] ?? rest;
|
|
3642
|
-
const normalizedBase = base3.trim().toUpperCase();
|
|
3643
|
-
if (!dex) return normalizedBase;
|
|
3644
|
-
return `${dex}:${normalizedBase}`;
|
|
3645
|
-
}
|
|
3646
|
-
if (raw.includes("/")) {
|
|
3647
|
-
return raw.toUpperCase();
|
|
3648
|
-
}
|
|
3649
|
-
if (raw.includes("-")) {
|
|
3650
|
-
const [base3, ...rest] = raw.split("-");
|
|
3651
|
-
const quote = rest.join("-").trim();
|
|
3652
|
-
if (base3 && quote) {
|
|
3653
|
-
return `${base3.toUpperCase()}/${quote.toUpperCase()}`;
|
|
3654
|
-
}
|
|
3655
|
-
}
|
|
3656
|
-
const base2 = raw.split("-")[0] ?? raw;
|
|
3657
|
-
const baseNoPair = base2.split("/")[0] ?? base2;
|
|
3658
|
-
return baseNoPair.trim().toUpperCase();
|
|
3659
|
-
}
|
|
3660
|
-
function resolveHyperliquidPerpSymbol(asset) {
|
|
3661
|
-
const raw = asset.trim();
|
|
3662
|
-
if (!raw) return raw;
|
|
3663
|
-
const dex = extractHyperliquidDex(raw);
|
|
3664
|
-
const base2 = normalizeHyperliquidBaseSymbol(raw) ?? raw.toUpperCase();
|
|
3665
|
-
return dex ? `${dex}:${base2}` : base2;
|
|
3666
|
-
}
|
|
3667
|
-
function resolveHyperliquidSpotSymbol(asset, defaultQuote = "USDC") {
|
|
3668
|
-
const quote = defaultQuote.trim().toUpperCase() || "USDC";
|
|
3669
|
-
const raw = asset.trim().toUpperCase();
|
|
3670
|
-
if (!raw) {
|
|
3671
|
-
return { symbol: raw, base: raw, quote };
|
|
3672
|
-
}
|
|
3673
|
-
const pair = resolveHyperliquidPair(raw);
|
|
3674
|
-
if (pair) {
|
|
3675
|
-
const [base3, pairQuote] = pair.split("/");
|
|
3676
|
-
return {
|
|
3677
|
-
symbol: pair,
|
|
3678
|
-
base: base3?.trim() ?? raw,
|
|
3679
|
-
quote: pairQuote?.trim() ?? quote
|
|
3680
|
-
};
|
|
3681
|
-
}
|
|
3682
|
-
const base2 = normalizeHyperliquidBaseSymbol(raw) ?? raw;
|
|
3683
|
-
return { symbol: `${base2}/${quote}`, base: base2, quote };
|
|
3684
|
-
}
|
|
3685
|
-
|
|
3686
3613
|
// src/adapters/hyperliquid/strategy.ts
|
|
3687
3614
|
function clampDcaWeight(value) {
|
|
3688
3615
|
if (typeof value !== "number" || !Number.isFinite(value)) return 0;
|
|
@@ -4728,12 +4655,14 @@ async function placeHyperliquidOrder(options) {
|
|
|
4728
4655
|
const action = {
|
|
4729
4656
|
type: "order",
|
|
4730
4657
|
orders: preparedOrders,
|
|
4731
|
-
grouping
|
|
4732
|
-
|
|
4658
|
+
grouping
|
|
4659
|
+
};
|
|
4660
|
+
if (orders.every((intent) => supportsHyperliquidBuilderFee(intent))) {
|
|
4661
|
+
action.builder = {
|
|
4733
4662
|
b: normalizeAddress(BUILDER_CODE.address),
|
|
4734
4663
|
f: BUILDER_CODE.fee
|
|
4735
|
-
}
|
|
4736
|
-
}
|
|
4664
|
+
};
|
|
4665
|
+
}
|
|
4737
4666
|
const effectiveNonce = resolveRequiredNonce({
|
|
4738
4667
|
nonce,
|
|
4739
4668
|
nonceSource: options.nonceSource,
|
|
@@ -5158,7 +5087,6 @@ async function placeHyperliquidOrder2(options) {
|
|
|
5158
5087
|
expiresAfter,
|
|
5159
5088
|
nonce
|
|
5160
5089
|
} = options;
|
|
5161
|
-
const effectiveBuilder = BUILDER_CODE;
|
|
5162
5090
|
if (!wallet2?.account || !wallet2.walletClient) {
|
|
5163
5091
|
throw new Error("Hyperliquid order signing requires a wallet with signing capabilities.");
|
|
5164
5092
|
}
|
|
@@ -5210,10 +5138,10 @@ async function placeHyperliquidOrder2(options) {
|
|
|
5210
5138
|
orders: preparedOrders,
|
|
5211
5139
|
grouping
|
|
5212
5140
|
};
|
|
5213
|
-
if (
|
|
5141
|
+
if (orders.every((intent) => supportsHyperliquidBuilderFee(intent))) {
|
|
5214
5142
|
action.builder = {
|
|
5215
|
-
b: normalizeAddress(
|
|
5216
|
-
f:
|
|
5143
|
+
b: normalizeAddress(BUILDER_CODE.address),
|
|
5144
|
+
f: BUILDER_CODE.fee
|
|
5217
5145
|
};
|
|
5218
5146
|
}
|
|
5219
5147
|
const effectiveNonce = resolveRequiredNonce2({
|
|
@@ -7405,6 +7333,6 @@ function buildBacktestDecisionSeriesInput(request) {
|
|
|
7405
7333
|
};
|
|
7406
7334
|
}
|
|
7407
7335
|
|
|
7408
|
-
export { AIAbortError, AIError, AIFetchError, AIResponseError, BACKTEST_DECISION_MODE, DEFAULT_BASE_URL, DEFAULT_CHAIN, DEFAULT_FACILITATOR, DEFAULT_HYPERLIQUID_CADENCE_CRON, DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, DEFAULT_HYPERLIQUID_TPSL_MARKET_SLIPPAGE_BPS, DEFAULT_MODEL, DEFAULT_OPENPOND_GATEWAY_URL2 as DEFAULT_OPENPOND_GATEWAY_URL, DEFAULT_TIMEOUT_MS, DEFAULT_TOKENS, HTTP_METHODS2 as HTTP_METHODS, HyperliquidApiError, HyperliquidBuilderApprovalError, HyperliquidExchangeClient, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidTermsError, NewsSignalClient, PAYMENT_HEADERS, POLYMARKET_CHAIN_ID, POLYMARKET_CLOB_AUTH_DOMAIN, POLYMARKET_CLOB_DOMAIN, POLYMARKET_ENDPOINTS, POLYMARKET_EXCHANGE_ADDRESSES, PolymarketApiError, PolymarketAuthError, PolymarketExchangeClient, PolymarketInfoClient, SUPPORTED_CURRENCIES, StoreError, WEBSEARCH_TOOL_DEFINITION, WEBSEARCH_TOOL_NAME, X402BrowserClient, X402Client, X402PaymentRequiredError, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, backtestDecisionRequestSchema, batchModifyHyperliquidOrders, buildBacktestDecisionSeriesInput, buildHmacSignature, buildHyperliquidMarketIdentity, buildHyperliquidProfileAssets, buildHyperliquidSpotUsdPriceMap, buildL1Headers, buildL2Headers, buildPolymarketOrderAmounts, buildSignedOrderPayload, cancelAllHyperliquidOrders, cancelAllPolymarketOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, cancelMarketPolymarketOrders, cancelPolymarketOrder, cancelPolymarketOrders, chains, clampHyperliquidAbs, clampHyperliquidFloat, clampHyperliquidInt, computeHyperliquidMarketIocLimitPrice, createAIClient, createDevServer, createHyperliquidSubAccount, createMcpAdapter, createMonotonicNonceFactory, createPolymarketApiKey, createStdioServer, defineX402Payment, depositToHyperliquidBridge, derivePolymarketApiKey, ensureTextContent, estimateCountBack, estimateHyperliquidLiquidationPrice, evaluateNewsContinuationGate, executeTool, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidBars, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, fetchNewsEventSignal, fetchNewsPropositionSignal, fetchPolymarketMarket, fetchPolymarketMarkets, fetchPolymarketMidpoint, fetchPolymarketOrderbook, fetchPolymarketPrice, fetchPolymarketPriceHistory, flattenMessageContent, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, generateText, getHyperliquidMaxBuilderFee, getModelConfig, getMyPerformance, getMyTools, getRpcUrl, getX402PaymentContext, isHyperliquidSpotSymbol, isStreamingSupported, isToolCallingSupported, listModels, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidDcaEntries, normalizeHyperliquidIndicatorBars, normalizeHyperliquidMetaSymbol, normalizeModelName, normalizeNumberArrayish, normalizeSpotTokenName2 as normalizeSpotTokenName, normalizeStringArrayish, parseHyperliquidJson, parseHyperliquidSymbol, parseSpotPairSymbol, parseTimeToSeconds, payX402, payX402WithWallet, placeHyperliquidOrder2 as placeHyperliquidOrder, placeHyperliquidOrderWithTpSl, placeHyperliquidPositionTpSl, placeHyperliquidTwapOrder, placePolymarketOrder, planHyperliquidTrade, postAgentDigest, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, registry, requireX402Payment, reserveHyperliquidRequestWeight, resolutionToSeconds, resolveBacktestAccountValueUsd, resolveBacktestMode, resolveBacktestWindow, resolveConfig2 as resolveConfig, resolveExchangeAddress, resolveHyperliquidAbstractionFromMode, resolveHyperliquidBudgetUsd, resolveHyperliquidCadenceCron, resolveHyperliquidCadenceFromResolution, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidDcaSymbolEntries, resolveHyperliquidErrorDetail, resolveHyperliquidHourlyInterval, resolveHyperliquidIntervalCron, resolveHyperliquidLeverageMode, resolveHyperliquidMarketDataCoin, resolveHyperliquidMaxPerRunUsd, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidPerpSymbol, resolveHyperliquidProfileChain, resolveHyperliquidRpcEnvVar, resolveHyperliquidScheduleEvery, resolveHyperliquidScheduleUnit, resolveHyperliquidSpotSymbol, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolveHyperliquidTargetSize, resolveNewsGatewayBase, resolvePolymarketBaseUrl, resolveRuntimePath, resolveSpotMidCandidates, resolveSpotTokenCandidates, resolveToolset, responseToToolResponse, retrieve, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode,
|
|
7336
|
+
export { AIAbortError, AIError, AIFetchError, AIResponseError, BACKTEST_DECISION_MODE, DEFAULT_BASE_URL, DEFAULT_CHAIN, DEFAULT_FACILITATOR, DEFAULT_HYPERLIQUID_CADENCE_CRON, DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, DEFAULT_HYPERLIQUID_TPSL_MARKET_SLIPPAGE_BPS, DEFAULT_MODEL, DEFAULT_OPENPOND_GATEWAY_URL2 as DEFAULT_OPENPOND_GATEWAY_URL, DEFAULT_TIMEOUT_MS, DEFAULT_TOKENS, HTTP_METHODS2 as HTTP_METHODS, HyperliquidApiError, HyperliquidBuilderApprovalError, HyperliquidExchangeClient, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidTermsError, NewsSignalClient, PAYMENT_HEADERS, POLYMARKET_CHAIN_ID, POLYMARKET_CLOB_AUTH_DOMAIN, POLYMARKET_CLOB_DOMAIN, POLYMARKET_ENDPOINTS, POLYMARKET_EXCHANGE_ADDRESSES, PolymarketApiError, PolymarketAuthError, PolymarketExchangeClient, PolymarketInfoClient, SUPPORTED_CURRENCIES, StoreError, WEBSEARCH_TOOL_DEFINITION, WEBSEARCH_TOOL_NAME, X402BrowserClient, X402Client, X402PaymentRequiredError, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, backtestDecisionRequestSchema, batchModifyHyperliquidOrders, buildBacktestDecisionSeriesInput, buildHmacSignature, buildHyperliquidMarketIdentity, buildHyperliquidProfileAssets, buildHyperliquidSpotUsdPriceMap, buildL1Headers, buildL2Headers, buildPolymarketOrderAmounts, buildSignedOrderPayload, cancelAllHyperliquidOrders, cancelAllPolymarketOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, cancelMarketPolymarketOrders, cancelPolymarketOrder, cancelPolymarketOrders, chains, clampHyperliquidAbs, clampHyperliquidFloat, clampHyperliquidInt, computeHyperliquidMarketIocLimitPrice, createAIClient, createDevServer, createHyperliquidSubAccount, createMcpAdapter, createMonotonicNonceFactory, createPolymarketApiKey, createStdioServer, defineX402Payment, depositToHyperliquidBridge, derivePolymarketApiKey, ensureTextContent, estimateCountBack, estimateHyperliquidLiquidationPrice, evaluateNewsContinuationGate, executeTool, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidBars, fetchHyperliquidClearinghouseState, fetchHyperliquidDexMeta, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, fetchNewsEventSignal, fetchNewsPropositionSignal, fetchPolymarketMarket, fetchPolymarketMarkets, fetchPolymarketMidpoint, fetchPolymarketOrderbook, fetchPolymarketPrice, fetchPolymarketPriceHistory, flattenMessageContent, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, generateText, getHyperliquidMaxBuilderFee, getModelConfig, getMyPerformance, getMyTools, getRpcUrl, getX402PaymentContext, isHyperliquidSpotSymbol, isStreamingSupported, isToolCallingSupported, listModels, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidDcaEntries, normalizeHyperliquidIndicatorBars, normalizeHyperliquidMetaSymbol, normalizeModelName, normalizeNumberArrayish, normalizeSpotTokenName2 as normalizeSpotTokenName, normalizeStringArrayish, parseHyperliquidJson, parseHyperliquidSymbol, parseSpotPairSymbol, parseTimeToSeconds, payX402, payX402WithWallet, placeHyperliquidOrder2 as placeHyperliquidOrder, placeHyperliquidOrderWithTpSl, placeHyperliquidPositionTpSl, placeHyperliquidTwapOrder, placePolymarketOrder, planHyperliquidTrade, postAgentDigest, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, registry, requireX402Payment, reserveHyperliquidRequestWeight, resolutionToSeconds, resolveBacktestAccountValueUsd, resolveBacktestMode, resolveBacktestWindow, resolveConfig2 as resolveConfig, resolveExchangeAddress, resolveHyperliquidAbstractionFromMode, resolveHyperliquidBudgetUsd, resolveHyperliquidCadenceCron, resolveHyperliquidCadenceFromResolution, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidDcaSymbolEntries, resolveHyperliquidErrorDetail, resolveHyperliquidHourlyInterval, resolveHyperliquidIntervalCron, resolveHyperliquidLeverageMode, resolveHyperliquidMarketDataCoin, resolveHyperliquidMaxPerRunUsd, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidPerpSymbol, resolveHyperliquidProfileChain, resolveHyperliquidRpcEnvVar, resolveHyperliquidScheduleEvery, resolveHyperliquidScheduleUnit, resolveHyperliquidSpotSymbol, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolveHyperliquidTargetSize, resolveNewsGatewayBase, resolvePolymarketBaseUrl, resolveRuntimePath, resolveSpotMidCandidates, resolveSpotTokenCandidates, resolveToolset, responseToToolResponse, retrieve, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidPortfolioMargin, store, streamText, supportsHyperliquidBuilderFee, tokens, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, wallet, walletToolkit, withX402Payment, withdrawFromHyperliquid };
|
|
7409
7337
|
//# sourceMappingURL=index.js.map
|
|
7410
7338
|
//# sourceMappingURL=index.js.map
|