opentool 0.8.24 → 0.8.25
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/index.d.ts +161 -3
- package/dist/adapters/hyperliquid/index.js +944 -17
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/cli/index.js +31 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +975 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/package.json +1 -1
|
@@ -309,7 +309,7 @@ declare function cancelAllHyperliquidOrders(options: {
|
|
|
309
309
|
} & CommonActionOptions): Promise<HyperliquidExchangeResponse<unknown>>;
|
|
310
310
|
declare function scheduleHyperliquidCancel(options: {
|
|
311
311
|
wallet: WalletFullContext;
|
|
312
|
-
time
|
|
312
|
+
time?: number | null;
|
|
313
313
|
} & CommonActionOptions): Promise<HyperliquidExchangeResponse<unknown>>;
|
|
314
314
|
declare function modifyHyperliquidOrder(options: {
|
|
315
315
|
wallet: WalletFullContext;
|
|
@@ -360,6 +360,164 @@ declare function sendHyperliquidSpot(options: {
|
|
|
360
360
|
nonceSource?: NonceSource;
|
|
361
361
|
}): Promise<HyperliquidExchangeResponse<unknown>>;
|
|
362
362
|
|
|
363
|
+
type HyperliquidChain = "arbitrum" | "arbitrum-sepolia";
|
|
364
|
+
type HyperliquidStoreNetwork = "hyperliquid" | "hyperliquid-testnet";
|
|
365
|
+
declare function resolveHyperliquidChain(environment: HyperliquidEnvironment): HyperliquidChain;
|
|
366
|
+
declare function resolveHyperliquidRpcEnvVar(environment: HyperliquidEnvironment): "ARBITRUM_RPC_URL" | "ARBITRUM_SEPOLIA_RPC_URL";
|
|
367
|
+
declare function resolveHyperliquidChainConfig(environment: HyperliquidEnvironment, env?: Record<string, string | undefined>): {
|
|
368
|
+
chain: HyperliquidChain;
|
|
369
|
+
rpcUrl?: string;
|
|
370
|
+
};
|
|
371
|
+
declare function resolveHyperliquidStoreNetwork(environment: HyperliquidEnvironment): HyperliquidStoreNetwork;
|
|
372
|
+
|
|
373
|
+
declare function extractHyperliquidDex(symbol: string): string | null;
|
|
374
|
+
declare function normalizeSpotTokenName(value?: string | null): string;
|
|
375
|
+
declare function normalizeHyperliquidBaseSymbol(value?: string | null): string | null;
|
|
376
|
+
declare function normalizeHyperliquidMetaSymbol(symbol: string): string;
|
|
377
|
+
declare function resolveHyperliquidPair(value?: string | null): string | null;
|
|
378
|
+
declare function parseSpotPairSymbol(symbol: string): {
|
|
379
|
+
base: string;
|
|
380
|
+
quote: string;
|
|
381
|
+
} | null;
|
|
382
|
+
declare function isHyperliquidSpotSymbol(symbol: string): boolean;
|
|
383
|
+
declare function resolveSpotMidCandidates(baseSymbol: string): string[];
|
|
384
|
+
declare function resolveSpotTokenCandidates(value: string): string[];
|
|
385
|
+
declare function resolveHyperliquidOrderSymbol(value?: string | null): string | null;
|
|
386
|
+
declare function resolveHyperliquidSymbol(asset: string, override?: string): string;
|
|
387
|
+
|
|
388
|
+
type HyperliquidTickSize = {
|
|
389
|
+
tickSizeInt: bigint;
|
|
390
|
+
tickDecimals: number;
|
|
391
|
+
};
|
|
392
|
+
type HyperliquidMarketType = "perp" | "spot";
|
|
393
|
+
type HyperliquidOrderResponseLike = {
|
|
394
|
+
response?: {
|
|
395
|
+
data?: {
|
|
396
|
+
statuses?: Array<Record<string, unknown>>;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
declare function formatHyperliquidPrice(price: string | number, szDecimals: number, marketType?: HyperliquidMarketType): string;
|
|
401
|
+
declare function formatHyperliquidSize(size: string | number, szDecimals: number): string;
|
|
402
|
+
declare function formatHyperliquidOrderSize(value: number, szDecimals: number): string;
|
|
403
|
+
declare function roundHyperliquidPriceToTick(price: number, tick: HyperliquidTickSize, side: "buy" | "sell"): string;
|
|
404
|
+
declare function formatHyperliquidMarketablePrice(params: {
|
|
405
|
+
mid: number;
|
|
406
|
+
side: "buy" | "sell";
|
|
407
|
+
slippageBps: number;
|
|
408
|
+
tick?: HyperliquidTickSize | null;
|
|
409
|
+
}): string;
|
|
410
|
+
declare function extractHyperliquidOrderIds(responses: HyperliquidOrderResponseLike[]): {
|
|
411
|
+
cloids: string[];
|
|
412
|
+
oids: string[];
|
|
413
|
+
};
|
|
414
|
+
declare function resolveHyperliquidOrderRef(params: {
|
|
415
|
+
response?: HyperliquidOrderResponseLike | null;
|
|
416
|
+
fallbackCloid?: string | null;
|
|
417
|
+
fallbackOid?: string | null;
|
|
418
|
+
prefix?: string;
|
|
419
|
+
index?: number;
|
|
420
|
+
}): string;
|
|
421
|
+
declare function resolveHyperliquidErrorDetail(error: unknown): unknown | null;
|
|
422
|
+
|
|
423
|
+
declare function readHyperliquidNumber(value: unknown): number | null;
|
|
424
|
+
declare function readHyperliquidAccountValue(payload: unknown): number | null;
|
|
425
|
+
declare function readHyperliquidPerpPositionSize(payload: unknown, symbol: string, options?: {
|
|
426
|
+
prefixMatch?: boolean;
|
|
427
|
+
}): number;
|
|
428
|
+
declare function readHyperliquidPerpPosition(payload: unknown, symbol: string, options?: {
|
|
429
|
+
prefixMatch?: boolean;
|
|
430
|
+
}): {
|
|
431
|
+
size: number;
|
|
432
|
+
positionValue: number;
|
|
433
|
+
unrealizedPnl: number | null;
|
|
434
|
+
};
|
|
435
|
+
declare function readHyperliquidSpotBalanceSize(payload: unknown, symbol: string): number;
|
|
436
|
+
declare function readHyperliquidSpotBalance(payload: unknown, base: string): {
|
|
437
|
+
total: number;
|
|
438
|
+
entryNtl: number | null;
|
|
439
|
+
};
|
|
440
|
+
declare function readHyperliquidSpotAccountValue(params: {
|
|
441
|
+
balances: unknown;
|
|
442
|
+
pricesUsd: Map<string, number>;
|
|
443
|
+
}): number | null;
|
|
444
|
+
|
|
445
|
+
type SpotUniverseItem = {
|
|
446
|
+
name?: string;
|
|
447
|
+
index?: number;
|
|
448
|
+
tokens?: number[];
|
|
449
|
+
};
|
|
450
|
+
type SpotToken = {
|
|
451
|
+
name?: string;
|
|
452
|
+
index?: number;
|
|
453
|
+
szDecimals?: number;
|
|
454
|
+
};
|
|
455
|
+
type SpotAssetContext = {
|
|
456
|
+
markPx?: string | number;
|
|
457
|
+
midPx?: string | number;
|
|
458
|
+
oraclePx?: string | number;
|
|
459
|
+
};
|
|
460
|
+
type SpotMetaResponse = {
|
|
461
|
+
universe?: SpotUniverseItem[];
|
|
462
|
+
tokens?: SpotToken[];
|
|
463
|
+
};
|
|
464
|
+
type HyperliquidPerpMarketInfo = {
|
|
465
|
+
symbol: string;
|
|
466
|
+
price: number;
|
|
467
|
+
fundingRate: number | null;
|
|
468
|
+
szDecimals: number;
|
|
469
|
+
};
|
|
470
|
+
type HyperliquidSpotMarketInfo = {
|
|
471
|
+
symbol: string;
|
|
472
|
+
base: string;
|
|
473
|
+
quote: string;
|
|
474
|
+
assetId: number;
|
|
475
|
+
marketIndex: number;
|
|
476
|
+
price: number;
|
|
477
|
+
szDecimals: number;
|
|
478
|
+
};
|
|
479
|
+
declare function maxDecimals(values: string[]): number;
|
|
480
|
+
declare function toScaledInt(value: string, decimals: number): bigint;
|
|
481
|
+
declare function formatScaledInt(value: bigint, decimals: number): string;
|
|
482
|
+
declare function fetchHyperliquidAllMids(environment: HyperliquidEnvironment): Promise<Record<string, string | number>>;
|
|
483
|
+
declare function fetchHyperliquidTickSize(params: {
|
|
484
|
+
environment: HyperliquidEnvironment;
|
|
485
|
+
symbol: string;
|
|
486
|
+
}): Promise<HyperliquidTickSize>;
|
|
487
|
+
declare function fetchHyperliquidSpotTickSize(params: {
|
|
488
|
+
environment: HyperliquidEnvironment;
|
|
489
|
+
marketIndex: number;
|
|
490
|
+
}): Promise<HyperliquidTickSize>;
|
|
491
|
+
declare function fetchHyperliquidPerpMarketInfo(params: {
|
|
492
|
+
environment: HyperliquidEnvironment;
|
|
493
|
+
symbol: string;
|
|
494
|
+
}): Promise<HyperliquidPerpMarketInfo>;
|
|
495
|
+
declare function fetchHyperliquidSpotMarketInfo(params: {
|
|
496
|
+
environment: HyperliquidEnvironment;
|
|
497
|
+
base: string;
|
|
498
|
+
quote: string;
|
|
499
|
+
mids?: Record<string, string | number> | null;
|
|
500
|
+
}): Promise<HyperliquidSpotMarketInfo>;
|
|
501
|
+
declare function fetchHyperliquidSizeDecimals(params: {
|
|
502
|
+
environment: HyperliquidEnvironment;
|
|
503
|
+
symbol: string;
|
|
504
|
+
}): Promise<number>;
|
|
505
|
+
declare function buildHyperliquidSpotUsdPriceMap(params: {
|
|
506
|
+
meta: SpotMetaResponse;
|
|
507
|
+
ctxs: SpotAssetContext[];
|
|
508
|
+
mids?: Record<string, string | number> | null;
|
|
509
|
+
}): Map<string, number>;
|
|
510
|
+
declare function fetchHyperliquidSpotUsdPriceMap(environment: HyperliquidEnvironment): Promise<Map<string, number>>;
|
|
511
|
+
declare function fetchHyperliquidSpotAccountValue(params: {
|
|
512
|
+
environment: HyperliquidEnvironment;
|
|
513
|
+
balances: unknown;
|
|
514
|
+
}): Promise<number | null>;
|
|
515
|
+
declare const __hyperliquidMarketDataInternals: {
|
|
516
|
+
maxDecimals: typeof maxDecimals;
|
|
517
|
+
toScaledInt: typeof toScaledInt;
|
|
518
|
+
formatScaledInt: typeof formatScaledInt;
|
|
519
|
+
};
|
|
520
|
+
|
|
363
521
|
interface HyperliquidOrderOptions {
|
|
364
522
|
wallet: WalletFullContext;
|
|
365
523
|
orders: HyperliquidOrderIntent[];
|
|
@@ -383,7 +541,7 @@ type HyperliquidOrderStatus = {
|
|
|
383
541
|
};
|
|
384
542
|
} | {
|
|
385
543
|
error: string;
|
|
386
|
-
};
|
|
544
|
+
} | "waitingForFill" | "waitingForTrigger";
|
|
387
545
|
interface HyperliquidOrderResponse {
|
|
388
546
|
status: "ok";
|
|
389
547
|
response: {
|
|
@@ -472,4 +630,4 @@ declare const __hyperliquidInternals: {
|
|
|
472
630
|
splitSignature: typeof splitSignature;
|
|
473
631
|
};
|
|
474
632
|
|
|
475
|
-
export { DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, type HyperliquidAbstraction, type HyperliquidAccountMode, HyperliquidApiError, type HyperliquidApproveBuilderFeeOptions, type HyperliquidApproveBuilderFeeResponse, HyperliquidBuilderApprovalError, type HyperliquidBuilderApprovalRecordInput, type HyperliquidBuilderFee, type HyperliquidClearinghouseState, type HyperliquidDepositResult, type HyperliquidEnvironment, HyperliquidExchangeClient, type HyperliquidExchangeResponse, type HyperliquidGrouping, HyperliquidGuardError, HyperliquidInfoClient, type HyperliquidMarketIdentityInput, type HyperliquidOrderIntent, type HyperliquidOrderOptions, type HyperliquidOrderResponse, type HyperliquidOrderStatus, HyperliquidTermsError, type HyperliquidTermsRecordInput, type HyperliquidTimeInForce, type HyperliquidTriggerOptions, type HyperliquidTriggerType, type HyperliquidWithdrawResult, type MarketIdentity, type NonceSource, __hyperliquidInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHyperliquidMarketIdentity, cancelAllHyperliquidOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, computeHyperliquidMarketIocLimitPrice, createHyperliquidSubAccount, createMonotonicNonceFactory, depositToHyperliquidBridge, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPreTransferCheck, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, getHyperliquidMaxBuilderFee, modifyHyperliquidOrder, placeHyperliquidOrder, placeHyperliquidTwapOrder, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, reserveHyperliquidRequestWeight, resolveHyperliquidAbstractionFromMode, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, withdrawFromHyperliquid };
|
|
633
|
+
export { DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, type HyperliquidAbstraction, type HyperliquidAccountMode, HyperliquidApiError, type HyperliquidApproveBuilderFeeOptions, type HyperliquidApproveBuilderFeeResponse, HyperliquidBuilderApprovalError, type HyperliquidBuilderApprovalRecordInput, type HyperliquidBuilderFee, type HyperliquidChain, type HyperliquidClearinghouseState, type HyperliquidDepositResult, type HyperliquidEnvironment, HyperliquidExchangeClient, type HyperliquidExchangeResponse, type HyperliquidGrouping, HyperliquidGuardError, HyperliquidInfoClient, type HyperliquidMarketIdentityInput, type HyperliquidMarketType, type HyperliquidOrderIntent, type HyperliquidOrderOptions, type HyperliquidOrderResponse, type HyperliquidOrderStatus, type HyperliquidPerpMarketInfo, type HyperliquidSpotMarketInfo, type HyperliquidStoreNetwork, HyperliquidTermsError, type HyperliquidTermsRecordInput, type HyperliquidTickSize, type HyperliquidTimeInForce, type HyperliquidTriggerOptions, type HyperliquidTriggerType, type HyperliquidWithdrawResult, type MarketIdentity, type NonceSource, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHyperliquidMarketIdentity, buildHyperliquidSpotUsdPriceMap, cancelAllHyperliquidOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, computeHyperliquidMarketIocLimitPrice, createHyperliquidSubAccount, createMonotonicNonceFactory, depositToHyperliquidBridge, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, getHyperliquidMaxBuilderFee, isHyperliquidSpotSymbol, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidMetaSymbol, normalizeSpotTokenName, parseSpotPairSymbol, placeHyperliquidOrder, placeHyperliquidTwapOrder, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, reserveHyperliquidRequestWeight, resolveHyperliquidAbstractionFromMode, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidErrorDetail, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidRpcEnvVar, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolveSpotMidCandidates, resolveSpotTokenCandidates, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, withdrawFromHyperliquid };
|