@pear-protocol/hyperliquid-sdk 0.1.2 → 0.1.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.
- package/dist/clients/positions.d.ts +1 -44
- package/dist/hooks/useAgentWallet.d.ts +1 -1
- package/dist/hooks/useAllUserBalances.d.ts +20 -6
- package/dist/hooks/useMarketData.d.ts +14 -8
- package/dist/hooks/usePosition.d.ts +2 -2
- package/dist/hooks/useTokenSelectionMetadata.d.ts +1 -1
- package/dist/hooks/useUserSelection.d.ts +16 -1
- package/dist/index.d.ts +203 -134
- package/dist/index.js +263 -213
- package/dist/store/tokenSelectionMetadataStore.d.ts +2 -3
- package/dist/types.d.ts +51 -3
- package/dist/utils/position-validator.d.ts +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -629,9 +629,9 @@ export interface AssetCtx {
|
|
|
629
629
|
* 0 = USDC
|
|
630
630
|
* 360 = USDH
|
|
631
631
|
* 235 = USDE
|
|
632
|
-
* 268 =
|
|
632
|
+
* 268 = USDT0
|
|
633
633
|
*/
|
|
634
|
-
export type CollateralToken = 'USDC' | 'USDH' | 'USDE' | '
|
|
634
|
+
export type CollateralToken = 'USDC' | 'USDH' | 'USDE' | 'USDT0';
|
|
635
635
|
/**
|
|
636
636
|
* Universe asset metadata
|
|
637
637
|
*/
|
|
@@ -806,6 +806,7 @@ export interface AssetMarketData {
|
|
|
806
806
|
export interface PairAssetDto {
|
|
807
807
|
asset: string;
|
|
808
808
|
weight: number;
|
|
809
|
+
metadata?: TokenMetadata | null;
|
|
809
810
|
}
|
|
810
811
|
export interface ActiveAssetGroupItem {
|
|
811
812
|
longAssets: PairAssetDto[];
|
|
@@ -819,7 +820,6 @@ export interface ActiveAssetGroupItem {
|
|
|
819
820
|
weightedRatio?: string;
|
|
820
821
|
weightedPrevRatio?: string;
|
|
821
822
|
weightedChange24h?: string;
|
|
822
|
-
collateralType: 'USDC' | 'USDH' | 'MIXED';
|
|
823
823
|
}
|
|
824
824
|
export interface ActiveAssetsResponse {
|
|
825
825
|
active: ActiveAssetGroupItem[];
|
|
@@ -899,3 +899,51 @@ export interface PerpDex {
|
|
|
899
899
|
lastDeployerFeeScaleChangeTime: string;
|
|
900
900
|
}
|
|
901
901
|
export type PerpDexsResponse = (PerpDex | null)[];
|
|
902
|
+
export interface SpotBalances {
|
|
903
|
+
[coin: string]: number;
|
|
904
|
+
}
|
|
905
|
+
export interface AvailableToTrades {
|
|
906
|
+
[collateralCoin: string]: number;
|
|
907
|
+
}
|
|
908
|
+
export type ExecutionType = "MARKET" | "TRIGGER" | "TWAP" | "LADDER" | "TP" | "SL" | "SPOT_MARKET" | "SPOT_LIMIT" | "SPOT_TWAP";
|
|
909
|
+
export type TpSlThresholdType = "PERCENTAGE" | "DOLLAR" | "POSITION_VALUE" | "PRICE" | "PRICE_RATIO" | "WEIGHTED_RATIO";
|
|
910
|
+
export interface PairAssetInput {
|
|
911
|
+
asset: string;
|
|
912
|
+
weight?: number;
|
|
913
|
+
}
|
|
914
|
+
export interface TpSlThresholdInput {
|
|
915
|
+
type: TpSlThresholdType;
|
|
916
|
+
value?: number;
|
|
917
|
+
isTrailing?: boolean;
|
|
918
|
+
trailingDeltaValue?: number;
|
|
919
|
+
trailingActivationValue?: number;
|
|
920
|
+
}
|
|
921
|
+
export interface LadderConfigInput {
|
|
922
|
+
ratioStart: number;
|
|
923
|
+
ratioEnd: number;
|
|
924
|
+
numberOfLevels: number;
|
|
925
|
+
}
|
|
926
|
+
export interface CreatePositionRequestInput {
|
|
927
|
+
slippage: number;
|
|
928
|
+
executionType: ExecutionType;
|
|
929
|
+
leverage: number;
|
|
930
|
+
usdValue: number;
|
|
931
|
+
longAssets?: PairAssetInput[];
|
|
932
|
+
shortAssets?: PairAssetInput[];
|
|
933
|
+
triggerValue?: string | number;
|
|
934
|
+
triggerType?: TriggerType;
|
|
935
|
+
direction?: "MORE_THAN" | "LESS_THAN";
|
|
936
|
+
assetName?: string;
|
|
937
|
+
marketCode?: string;
|
|
938
|
+
twapDuration?: number;
|
|
939
|
+
twapIntervalSeconds?: number;
|
|
940
|
+
randomizeExecution?: boolean;
|
|
941
|
+
referralCode?: string;
|
|
942
|
+
ladderConfig?: LadderConfigInput;
|
|
943
|
+
takeProfit?: TpSlThresholdInput | null;
|
|
944
|
+
stopLoss?: TpSlThresholdInput | null;
|
|
945
|
+
}
|
|
946
|
+
export interface CreatePositionResponseDto {
|
|
947
|
+
orderId: string;
|
|
948
|
+
fills?: ExternalFillDto[];
|
|
949
|
+
}
|