@basedone/core 0.3.0 → 0.3.1
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/{chunk-VBC6EQ7Q.mjs → chunk-OZPAOG43.mjs} +4 -1
- package/dist/{client-BQzYwHDY.d.mts → client-1sWFpTpK.d.mts} +21 -1
- package/dist/{client-BQzYwHDY.d.ts → client-1sWFpTpK.d.ts} +21 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +54 -8
- package/dist/index.mjs +48 -9
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +4 -1
- package/dist/react.mjs +1 -1
- package/lib/constants/admin.ts +14 -5
- package/lib/hip3/market-info.ts +66 -3
- package/lib/instrument/client.ts +7 -0
- package/lib/meta/types.ts +4 -0
- package/package.json +2 -2
|
@@ -181,7 +181,10 @@ var InstrumentClient = class {
|
|
|
181
181
|
type: "futures",
|
|
182
182
|
isDelisted: info.isDelisted,
|
|
183
183
|
dex: AssetIdUtils.extractDexName(info.name),
|
|
184
|
-
collateralTokenIndex: perpMeta.collateralToken
|
|
184
|
+
collateralTokenIndex: perpMeta.collateralToken,
|
|
185
|
+
category: info.category,
|
|
186
|
+
displayName: info.displayName,
|
|
187
|
+
keywords: info.keywords
|
|
185
188
|
};
|
|
186
189
|
this.addInstrument(instrument);
|
|
187
190
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { MarginTables, PerpDex as PerpDex$1, PerpsAssetCtx, InfoClient, SpotMeta, SpotToken } from '@nktkas/hyperliquid';
|
|
2
2
|
|
|
3
|
+
/** Payload entries from Hyperliquid `info` → `{ type: "perpConciseAnnotations" }`. */
|
|
4
|
+
interface PerpConciseAnnotationMeta {
|
|
5
|
+
category?: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
keywords?: string[];
|
|
8
|
+
}
|
|
9
|
+
type PerpConciseAnnotations = [string, PerpConciseAnnotationMeta][];
|
|
3
10
|
interface PerpsMeta {
|
|
4
11
|
collateralToken: number;
|
|
5
12
|
/** Trading universes available for perpetual trading. */
|
|
@@ -32,11 +39,20 @@ interface PerpsUniverse {
|
|
|
32
39
|
growthMode?: "enabled";
|
|
33
40
|
/** Margin mode for the universe. */
|
|
34
41
|
marginMode?: "strictIsolated" | "noCross";
|
|
42
|
+
/** From `perpConciseAnnotations` when present (search/display). */
|
|
43
|
+
category?: string;
|
|
44
|
+
displayName?: string;
|
|
45
|
+
keywords?: string[];
|
|
35
46
|
}
|
|
36
47
|
interface PerpDex extends PerpDex$1 {
|
|
37
48
|
deployerFeeScale: string;
|
|
38
49
|
}
|
|
39
50
|
type AllPerpsMeta = PerpsMeta[];
|
|
51
|
+
declare function getPerpConciseAnnotations(infoClient: InfoClient): Promise<PerpConciseAnnotations>;
|
|
52
|
+
/**
|
|
53
|
+
* Merges `perpConciseAnnotations` into each universe row by matching `name`.
|
|
54
|
+
*/
|
|
55
|
+
declare function enrichAllPerpsMetaWithAnnotations(metas: AllPerpsMeta, annotations: PerpConciseAnnotations): AllPerpsMeta;
|
|
40
56
|
declare function getAllPerpsMeta(infoClient: InfoClient): Promise<AllPerpsMeta>;
|
|
41
57
|
|
|
42
58
|
interface BaseInstrument {
|
|
@@ -53,6 +69,10 @@ interface PerpsInstrument extends BaseInstrument {
|
|
|
53
69
|
collateralTokenSymbol: string;
|
|
54
70
|
dex?: string;
|
|
55
71
|
collateralTokenIndex?: number;
|
|
72
|
+
/** From merged `perpConciseAnnotations` (display/search). */
|
|
73
|
+
category?: string;
|
|
74
|
+
displayName?: string;
|
|
75
|
+
keywords?: string[];
|
|
56
76
|
}
|
|
57
77
|
interface SpotInstrument extends BaseInstrument {
|
|
58
78
|
type: "spot";
|
|
@@ -179,4 +199,4 @@ declare class InstrumentClient {
|
|
|
179
199
|
private extractDexNameFromMeta;
|
|
180
200
|
}
|
|
181
201
|
|
|
182
|
-
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type
|
|
202
|
+
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpConciseAnnotationMeta as P, type SpotInstrument as S, AssetIdUtils as a, type PerpConciseAnnotations as b, type PerpDex as c, type PerpsInstrument as d, type PerpsMeta as e, type PerpsMetaAndAssetCtxs as f, type PerpsUniverse as g, enrichAllPerpsMetaWithAnnotations as h, getAllPerpsMeta as i, getPerpConciseAnnotations as j };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { MarginTables, PerpDex as PerpDex$1, PerpsAssetCtx, InfoClient, SpotMeta, SpotToken } from '@nktkas/hyperliquid';
|
|
2
2
|
|
|
3
|
+
/** Payload entries from Hyperliquid `info` → `{ type: "perpConciseAnnotations" }`. */
|
|
4
|
+
interface PerpConciseAnnotationMeta {
|
|
5
|
+
category?: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
keywords?: string[];
|
|
8
|
+
}
|
|
9
|
+
type PerpConciseAnnotations = [string, PerpConciseAnnotationMeta][];
|
|
3
10
|
interface PerpsMeta {
|
|
4
11
|
collateralToken: number;
|
|
5
12
|
/** Trading universes available for perpetual trading. */
|
|
@@ -32,11 +39,20 @@ interface PerpsUniverse {
|
|
|
32
39
|
growthMode?: "enabled";
|
|
33
40
|
/** Margin mode for the universe. */
|
|
34
41
|
marginMode?: "strictIsolated" | "noCross";
|
|
42
|
+
/** From `perpConciseAnnotations` when present (search/display). */
|
|
43
|
+
category?: string;
|
|
44
|
+
displayName?: string;
|
|
45
|
+
keywords?: string[];
|
|
35
46
|
}
|
|
36
47
|
interface PerpDex extends PerpDex$1 {
|
|
37
48
|
deployerFeeScale: string;
|
|
38
49
|
}
|
|
39
50
|
type AllPerpsMeta = PerpsMeta[];
|
|
51
|
+
declare function getPerpConciseAnnotations(infoClient: InfoClient): Promise<PerpConciseAnnotations>;
|
|
52
|
+
/**
|
|
53
|
+
* Merges `perpConciseAnnotations` into each universe row by matching `name`.
|
|
54
|
+
*/
|
|
55
|
+
declare function enrichAllPerpsMetaWithAnnotations(metas: AllPerpsMeta, annotations: PerpConciseAnnotations): AllPerpsMeta;
|
|
40
56
|
declare function getAllPerpsMeta(infoClient: InfoClient): Promise<AllPerpsMeta>;
|
|
41
57
|
|
|
42
58
|
interface BaseInstrument {
|
|
@@ -53,6 +69,10 @@ interface PerpsInstrument extends BaseInstrument {
|
|
|
53
69
|
collateralTokenSymbol: string;
|
|
54
70
|
dex?: string;
|
|
55
71
|
collateralTokenIndex?: number;
|
|
72
|
+
/** From merged `perpConciseAnnotations` (display/search). */
|
|
73
|
+
category?: string;
|
|
74
|
+
displayName?: string;
|
|
75
|
+
keywords?: string[];
|
|
56
76
|
}
|
|
57
77
|
interface SpotInstrument extends BaseInstrument {
|
|
58
78
|
type: "spot";
|
|
@@ -179,4 +199,4 @@ declare class InstrumentClient {
|
|
|
179
199
|
private extractDexNameFromMeta;
|
|
180
200
|
}
|
|
181
201
|
|
|
182
|
-
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type
|
|
202
|
+
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpConciseAnnotationMeta as P, type SpotInstrument as S, AssetIdUtils as a, type PerpConciseAnnotations as b, type PerpDex as c, type PerpsInstrument as d, type PerpsMeta as e, type PerpsMetaAndAssetCtxs as f, type PerpsUniverse as g, enrichAllPerpsMetaWithAnnotations as h, getAllPerpsMeta as i, getPerpConciseAnnotations as j };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpotToken, MarginTables, PerpsAssetCtx, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
|
|
2
|
-
export { A as AllPerpsMeta, a as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, P as
|
|
2
|
+
export { A as AllPerpsMeta, a as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, P as PerpConciseAnnotationMeta, b as PerpConciseAnnotations, c as PerpDex, d as PerpsInstrument, e as PerpsMeta, f as PerpsMetaAndAssetCtxs, g as PerpsUniverse, S as SpotInstrument, h as enrichAllPerpsMetaWithAnnotations, i as getAllPerpsMeta, j as getPerpConciseAnnotations } from './client-1sWFpTpK.mjs';
|
|
3
3
|
export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, CashAccountBalanceResponse, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerNotification, CustomerNotificationsResponse, CustomerSummary, DeleteBrowsingLocationResponse, DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, EcommerceClientConfig, ExpiringGemBatch, FlashSale, FlashSaleAllowanceInfo, FlashSaleItem, FlashSaleItemInput, FollowActionResponse, FollowStatusResponse, FollowedMerchantSummary, GemHistoryItem, GemHistoryType, GemHistoryTypeFilter, GemSource, GenerateTaxReportRequest, GetAnalyticsParams, GetAnalyticsResponse, GetBrowsingLocationResponse, GetCouponResponse, GetExpiringGemsParams, GetExpiringGemsResponse, GetFlashSaleAllowanceParams, GetFlashSaleAllowanceResponse, GetGemBalanceResponse, GetGemHistoryParams, GetGemHistoryResponse, GetOrderResponse, GetPaymentMethodsResponse, GetProductMetricsResponse, GetProductResponse, GetTaxReportResponse, InventoryAuditAction, InventoryAuditEntry, ListActiveBannersParams, ListActiveFlashSalesParams, ListBannersResponse, ListCouponsResponse, ListCustomersParams, ListCustomersResponse, ListFollowingParams, ListFollowingResponse, ListInventoryAuditResponse, ListMediaAssetsResponse, ListMerchantProductsParams, ListMessagesResponse, ListOrdersParams, ListOrdersResponse, ListProductVariantsResponse, ListProductsParams, ListProductsResponse, ListReturnsResponse, ListReviewsParams, ListReviewsResponse, ListShipmentsResponse, ListShippingAddressesResponse, ListShippingMethodsResponse, ListShippingRatesResponse, ListShippingZonesResponse, ListTaxNexusResponse, ListTaxReportsParams, ListTaxReportsResponse, ListTaxRulesResponse, MarkNotificationsReadResponse, MediaAsset, MediaAssetResponse, Merchant, MerchantBusinessType, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantReturnPolicyType, MerchantShippingSettings, MerchantSocialLinks, MerchantStatus, Message, MessageResponse, MessageStatsResponse, ORDER_STATUS_TRANSITIONS, Order, OrderEvent, OrderItem, OrderReceiptResponse, OrderStatus, OrdersByStatus, PaginatedResponse, PaginationParams, Payment, PaymentMethod, PaymentMethodInfo, PaymentStatus, ProcessPaymentRequest, ProcessPaymentResponse, Product, ProductDimensions, ProductDiscountsResponse, ProductMetrics, ProductResponse, ProductReview, ProductSortBy, ProductVariant, ProductVariantResponse, PublicMerchantProfile, PublicMerchantProfileResponse, RecentOrderSummary, RespondToReviewRequest, Return, ReturnItem, ReturnResponse, ReturnStatus, RevenueByDay, ReviewResponse, ReviewSortBy, ReviewStatus, SaveBrowsingLocationRequest, SaveBrowsingLocationResponse, SendMessageRequest, Settlement, Shipment, ShipmentResponse, ShipmentStatus, ShippingAddress, ShippingAddressRequest, ShippingAddressResponse, ShippingMethod, ShippingMethodResponse, ShippingOption, ShippingRate, ShippingRateResponse, ShippingSettingsResponse, ShippingZone, ShippingZoneResponse, SortOrder, SuccessResponse, TaxBehavior, TaxBreakdownItem, TaxNexus, TaxNexusResponse, TaxReport, TaxReportDetails, TaxReportPeriodType, TaxReportResponse, TaxReportStatus, TaxRule, TaxRuleResponse, TaxSettings, TaxSettingsResponse, TaxType, TopProduct, TrackBannerRequest, UpdateBannerRequest, UpdateCouponRequest, UpdateFlashSaleRequest, UpdateOrderResponse, UpdateOrderStatusRequest, UpdateProductRequest, UpdateProductVariantRequest, UpdateShipmentRequest, UpdateShippingMethodRequest, UpdateShippingRateRequest, UpdateShippingSettingsRequest, UpdateShippingZoneRequest, UpdateTaxNexusRequest, UpdateTaxReportStatusRequest, UpdateTaxRuleRequest, UpdateTaxSettingsRequest, UserShippingAddress, ValidateDiscountRequest, ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, canCancelOrder, formatPrice, getBackoffDelay, getNextStatuses, getStatusColor, getStatusLabel, getStatusProgress, isPickupOrder, isRetryableError, isValidAddress, isValidEmail, parseError, requiresTrackingInfo, retryWithBackoff, shouldNotifyCustomer, sleep, truncateAddress, validateStatusTransition } from './ecommerce.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
@@ -241,7 +241,9 @@ declare function getNextTierInfo(pupTokenAmount: number, normalizedAirDropAmount
|
|
|
241
241
|
declare const USDC_SPOT_TOKEN: SpotToken;
|
|
242
242
|
declare const TESTNET_USDC_SPOT_TOKEN: SpotToken;
|
|
243
243
|
|
|
244
|
+
declare const SUPER_ADMINS: string[];
|
|
244
245
|
declare const ADMINS: string[];
|
|
246
|
+
declare const ALL_ADMINS: string[];
|
|
245
247
|
declare const ADMIN_WALLETS: string[];
|
|
246
248
|
|
|
247
249
|
interface PerpsMeta {
|
|
@@ -270,6 +272,10 @@ interface PerpsUniverse {
|
|
|
270
272
|
growthMode?: "enabled";
|
|
271
273
|
/** Margin mode for the universe. */
|
|
272
274
|
marginMode?: "strictIsolated" | "noCross";
|
|
275
|
+
/** From Hyperliquid `perpConciseAnnotations` when merged into meta. */
|
|
276
|
+
category?: string;
|
|
277
|
+
displayName?: string;
|
|
278
|
+
keywords?: string[];
|
|
273
279
|
}
|
|
274
280
|
|
|
275
281
|
/**
|
|
@@ -606,4 +612,4 @@ interface LeadingVault {
|
|
|
606
612
|
name: string;
|
|
607
613
|
}
|
|
608
614
|
|
|
609
|
-
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, type AgentAbstractionCode, type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type LeadingVault, type MarketInfo, type MultiverseMeta, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDexAssetPosition, type PerpDexClearinghouseState, type PerpDexState, type PupEligibilityResult, ROOT_DEX, type SettableAbstractionMode, type SpotBalance, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, type TokenInfo, USDC_SPOT_TOKEN, type UpheavalApiResponse, type UpheavalPosition, type UpheavalSnapshot, type UserAbstractionMode, UserDexAbstractionTypes, UserSetAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, type WsWebData3, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
|
615
|
+
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, ALL_ADMINS, type AgentAbstractionCode, type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type LeadingVault, type MarketInfo, type MultiverseMeta, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDexAssetPosition, type PerpDexClearinghouseState, type PerpDexState, type PupEligibilityResult, ROOT_DEX, SUPER_ADMINS, type SettableAbstractionMode, type SpotBalance, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, type TokenInfo, USDC_SPOT_TOKEN, type UpheavalApiResponse, type UpheavalPosition, type UpheavalSnapshot, type UserAbstractionMode, UserDexAbstractionTypes, UserSetAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, type WsWebData3, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpotToken, MarginTables, PerpsAssetCtx, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
|
|
2
|
-
export { A as AllPerpsMeta, a as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, P as
|
|
2
|
+
export { A as AllPerpsMeta, a as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, P as PerpConciseAnnotationMeta, b as PerpConciseAnnotations, c as PerpDex, d as PerpsInstrument, e as PerpsMeta, f as PerpsMetaAndAssetCtxs, g as PerpsUniverse, S as SpotInstrument, h as enrichAllPerpsMetaWithAnnotations, i as getAllPerpsMeta, j as getPerpConciseAnnotations } from './client-1sWFpTpK.js';
|
|
3
3
|
export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, CashAccountBalanceResponse, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerNotification, CustomerNotificationsResponse, CustomerSummary, DeleteBrowsingLocationResponse, DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, EcommerceClientConfig, ExpiringGemBatch, FlashSale, FlashSaleAllowanceInfo, FlashSaleItem, FlashSaleItemInput, FollowActionResponse, FollowStatusResponse, FollowedMerchantSummary, GemHistoryItem, GemHistoryType, GemHistoryTypeFilter, GemSource, GenerateTaxReportRequest, GetAnalyticsParams, GetAnalyticsResponse, GetBrowsingLocationResponse, GetCouponResponse, GetExpiringGemsParams, GetExpiringGemsResponse, GetFlashSaleAllowanceParams, GetFlashSaleAllowanceResponse, GetGemBalanceResponse, GetGemHistoryParams, GetGemHistoryResponse, GetOrderResponse, GetPaymentMethodsResponse, GetProductMetricsResponse, GetProductResponse, GetTaxReportResponse, InventoryAuditAction, InventoryAuditEntry, ListActiveBannersParams, ListActiveFlashSalesParams, ListBannersResponse, ListCouponsResponse, ListCustomersParams, ListCustomersResponse, ListFollowingParams, ListFollowingResponse, ListInventoryAuditResponse, ListMediaAssetsResponse, ListMerchantProductsParams, ListMessagesResponse, ListOrdersParams, ListOrdersResponse, ListProductVariantsResponse, ListProductsParams, ListProductsResponse, ListReturnsResponse, ListReviewsParams, ListReviewsResponse, ListShipmentsResponse, ListShippingAddressesResponse, ListShippingMethodsResponse, ListShippingRatesResponse, ListShippingZonesResponse, ListTaxNexusResponse, ListTaxReportsParams, ListTaxReportsResponse, ListTaxRulesResponse, MarkNotificationsReadResponse, MediaAsset, MediaAssetResponse, Merchant, MerchantBusinessType, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantReturnPolicyType, MerchantShippingSettings, MerchantSocialLinks, MerchantStatus, Message, MessageResponse, MessageStatsResponse, ORDER_STATUS_TRANSITIONS, Order, OrderEvent, OrderItem, OrderReceiptResponse, OrderStatus, OrdersByStatus, PaginatedResponse, PaginationParams, Payment, PaymentMethod, PaymentMethodInfo, PaymentStatus, ProcessPaymentRequest, ProcessPaymentResponse, Product, ProductDimensions, ProductDiscountsResponse, ProductMetrics, ProductResponse, ProductReview, ProductSortBy, ProductVariant, ProductVariantResponse, PublicMerchantProfile, PublicMerchantProfileResponse, RecentOrderSummary, RespondToReviewRequest, Return, ReturnItem, ReturnResponse, ReturnStatus, RevenueByDay, ReviewResponse, ReviewSortBy, ReviewStatus, SaveBrowsingLocationRequest, SaveBrowsingLocationResponse, SendMessageRequest, Settlement, Shipment, ShipmentResponse, ShipmentStatus, ShippingAddress, ShippingAddressRequest, ShippingAddressResponse, ShippingMethod, ShippingMethodResponse, ShippingOption, ShippingRate, ShippingRateResponse, ShippingSettingsResponse, ShippingZone, ShippingZoneResponse, SortOrder, SuccessResponse, TaxBehavior, TaxBreakdownItem, TaxNexus, TaxNexusResponse, TaxReport, TaxReportDetails, TaxReportPeriodType, TaxReportResponse, TaxReportStatus, TaxRule, TaxRuleResponse, TaxSettings, TaxSettingsResponse, TaxType, TopProduct, TrackBannerRequest, UpdateBannerRequest, UpdateCouponRequest, UpdateFlashSaleRequest, UpdateOrderResponse, UpdateOrderStatusRequest, UpdateProductRequest, UpdateProductVariantRequest, UpdateShipmentRequest, UpdateShippingMethodRequest, UpdateShippingRateRequest, UpdateShippingSettingsRequest, UpdateShippingZoneRequest, UpdateTaxNexusRequest, UpdateTaxReportStatusRequest, UpdateTaxRuleRequest, UpdateTaxSettingsRequest, UserShippingAddress, ValidateDiscountRequest, ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, canCancelOrder, formatPrice, getBackoffDelay, getNextStatuses, getStatusColor, getStatusLabel, getStatusProgress, isPickupOrder, isRetryableError, isValidAddress, isValidEmail, parseError, requiresTrackingInfo, retryWithBackoff, shouldNotifyCustomer, sleep, truncateAddress, validateStatusTransition } from './ecommerce.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
@@ -241,7 +241,9 @@ declare function getNextTierInfo(pupTokenAmount: number, normalizedAirDropAmount
|
|
|
241
241
|
declare const USDC_SPOT_TOKEN: SpotToken;
|
|
242
242
|
declare const TESTNET_USDC_SPOT_TOKEN: SpotToken;
|
|
243
243
|
|
|
244
|
+
declare const SUPER_ADMINS: string[];
|
|
244
245
|
declare const ADMINS: string[];
|
|
246
|
+
declare const ALL_ADMINS: string[];
|
|
245
247
|
declare const ADMIN_WALLETS: string[];
|
|
246
248
|
|
|
247
249
|
interface PerpsMeta {
|
|
@@ -270,6 +272,10 @@ interface PerpsUniverse {
|
|
|
270
272
|
growthMode?: "enabled";
|
|
271
273
|
/** Margin mode for the universe. */
|
|
272
274
|
marginMode?: "strictIsolated" | "noCross";
|
|
275
|
+
/** From Hyperliquid `perpConciseAnnotations` when merged into meta. */
|
|
276
|
+
category?: string;
|
|
277
|
+
displayName?: string;
|
|
278
|
+
keywords?: string[];
|
|
273
279
|
}
|
|
274
280
|
|
|
275
281
|
/**
|
|
@@ -606,4 +612,4 @@ interface LeadingVault {
|
|
|
606
612
|
name: string;
|
|
607
613
|
}
|
|
608
614
|
|
|
609
|
-
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, type AgentAbstractionCode, type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type LeadingVault, type MarketInfo, type MultiverseMeta, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDexAssetPosition, type PerpDexClearinghouseState, type PerpDexState, type PupEligibilityResult, ROOT_DEX, type SettableAbstractionMode, type SpotBalance, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, type TokenInfo, USDC_SPOT_TOKEN, type UpheavalApiResponse, type UpheavalPosition, type UpheavalSnapshot, type UserAbstractionMode, UserDexAbstractionTypes, UserSetAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, type WsWebData3, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
|
615
|
+
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, ALL_ADMINS, type AgentAbstractionCode, type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type LeadingVault, type MarketInfo, type MultiverseMeta, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDexAssetPosition, type PerpDexClearinghouseState, type PerpDexState, type PupEligibilityResult, ROOT_DEX, SUPER_ADMINS, type SettableAbstractionMode, type SpotBalance, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, type TokenInfo, USDC_SPOT_TOKEN, type UpheavalApiResponse, type UpheavalPosition, type UpheavalSnapshot, type UserAbstractionMode, UserDexAbstractionTypes, UserSetAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, type WsWebData3, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
package/dist/index.js
CHANGED
|
@@ -551,31 +551,40 @@ var TESTNET_USDC_SPOT_TOKEN = {
|
|
|
551
551
|
};
|
|
552
552
|
|
|
553
553
|
// lib/constants/admin.ts
|
|
554
|
-
var
|
|
554
|
+
var SUPER_ADMINS = [
|
|
555
555
|
"did:privy:cmc3hycnb00pljs0m1z010geq",
|
|
556
556
|
"did:privy:cmc8w2ddl01rdju0nylb6rp1v",
|
|
557
557
|
"did:privy:cmc3oftiz005fjx0msox3xgey",
|
|
558
558
|
"did:privy:cmcbx7i4400q8l90mawdymaag",
|
|
559
559
|
"did:privy:cmctbwphs00vzjz0m3la3zm4c",
|
|
560
560
|
"did:privy:cmcblrplb009ol70mia13winn",
|
|
561
|
-
"did:privy:cmcmizpxm02xfju0oc81alfy0",
|
|
562
561
|
"did:privy:cmcd2bvft00w3l90ljeyb4wn6",
|
|
563
562
|
"did:privy:cmc4y13ka0119kv0nckvgla1u",
|
|
564
563
|
"did:privy:cmc8qc36g00c1l70nnutuscue",
|
|
565
564
|
"did:privy:cmc8f1tf9019zlh0myjpi420p",
|
|
566
565
|
"did:privy:cmc6bturg002ql80mhzqr1d76",
|
|
567
566
|
"did:privy:cmc8uyr4t01kljo0mk3unzjl3",
|
|
568
|
-
"did:privy:cmcke9v7h00yijy0o2a41nhms"
|
|
567
|
+
"did:privy:cmcke9v7h00yijy0o2a41nhms"
|
|
568
|
+
];
|
|
569
|
+
var ADMINS = [
|
|
569
570
|
"did:privy:cmgfcjt2y0024kz0cpymoqbmp",
|
|
571
|
+
// aayush
|
|
570
572
|
"did:privy:cmeqj8tsi01k6la0c3s7gsl6w",
|
|
571
573
|
// elroy
|
|
572
574
|
"did:privy:cmiwrno1i00cdl70c5ro13eyp",
|
|
573
575
|
// adele
|
|
574
576
|
"did:privy:cmkc0jyy200abji0d42a0syil",
|
|
575
577
|
// matthew
|
|
576
|
-
"did:privy:cmlgc2zjk005vjo0cct10trdl"
|
|
577
|
-
//
|
|
578
|
+
"did:privy:cmlgc2zjk005vjo0cct10trdl",
|
|
579
|
+
// marketing
|
|
580
|
+
"did:privy:cme2d56i90091i90bdhuyaj7e",
|
|
581
|
+
// jun
|
|
582
|
+
"did:privy:cmm4av80f00140cldz3uv7io2",
|
|
583
|
+
// shubit
|
|
584
|
+
"did:privy:cmcbndjjm02fvjr0mrs42yahs"
|
|
585
|
+
// zlace
|
|
578
586
|
];
|
|
587
|
+
var ALL_ADMINS = [...SUPER_ADMINS, ...ADMINS];
|
|
579
588
|
var ADMIN_WALLETS = [
|
|
580
589
|
"0x0c7582A67B8B6AD04Ea404A6C2A06aAc9E0d4e7c",
|
|
581
590
|
"0xDec587aDD20A6447fF0b29D70E95b10b197b1283",
|
|
@@ -819,11 +828,41 @@ function getDexFromCollateralTokenSymbol(collateralTokenSymbol) {
|
|
|
819
828
|
}
|
|
820
829
|
|
|
821
830
|
// lib/hip3/market-info.ts
|
|
822
|
-
async function
|
|
831
|
+
async function getPerpConciseAnnotations(infoClient) {
|
|
823
832
|
return infoClient.transport.request("info", {
|
|
824
|
-
type: "
|
|
833
|
+
type: "perpConciseAnnotations"
|
|
825
834
|
});
|
|
826
835
|
}
|
|
836
|
+
function enrichAllPerpsMetaWithAnnotations(metas, annotations) {
|
|
837
|
+
const map = new Map(annotations);
|
|
838
|
+
return metas.map((meta) => ({
|
|
839
|
+
...meta,
|
|
840
|
+
universe: meta.universe.map((u) => {
|
|
841
|
+
const ann = map.get(u.name);
|
|
842
|
+
if (!ann) return u;
|
|
843
|
+
return {
|
|
844
|
+
...u,
|
|
845
|
+
...ann.category != null && ann.category !== "" ? { category: ann.category } : {},
|
|
846
|
+
...ann.displayName != null && ann.displayName !== "" ? { displayName: ann.displayName } : {},
|
|
847
|
+
...ann.keywords != null && ann.keywords.length > 0 ? { keywords: ann.keywords } : {}
|
|
848
|
+
};
|
|
849
|
+
})
|
|
850
|
+
}));
|
|
851
|
+
}
|
|
852
|
+
async function getAllPerpsMeta(infoClient) {
|
|
853
|
+
const [metas, annotations] = await Promise.all([
|
|
854
|
+
infoClient.transport.request("info", {
|
|
855
|
+
type: "allPerpMetas"
|
|
856
|
+
}),
|
|
857
|
+
getPerpConciseAnnotations(infoClient).catch(() => {
|
|
858
|
+
return [];
|
|
859
|
+
})
|
|
860
|
+
]);
|
|
861
|
+
if (!annotations.length) {
|
|
862
|
+
return metas;
|
|
863
|
+
}
|
|
864
|
+
return enrichAllPerpsMetaWithAnnotations(metas, annotations);
|
|
865
|
+
}
|
|
827
866
|
|
|
828
867
|
// lib/abstraction/types.ts
|
|
829
868
|
var ABSTRACTION_MODE_TO_AGENT_CODE = {
|
|
@@ -1107,7 +1146,10 @@ var InstrumentClient = class {
|
|
|
1107
1146
|
type: "futures",
|
|
1108
1147
|
isDelisted: info.isDelisted,
|
|
1109
1148
|
dex: AssetIdUtils.extractDexName(info.name),
|
|
1110
|
-
collateralTokenIndex: perpMeta.collateralToken
|
|
1149
|
+
collateralTokenIndex: perpMeta.collateralToken,
|
|
1150
|
+
category: info.category,
|
|
1151
|
+
displayName: info.displayName,
|
|
1152
|
+
keywords: info.keywords
|
|
1111
1153
|
};
|
|
1112
1154
|
this.addInstrument(instrument);
|
|
1113
1155
|
}
|
|
@@ -4221,6 +4263,7 @@ exports.ABSTRACTION_MODE_TO_AGENT_CODE = ABSTRACTION_MODE_TO_AGENT_CODE;
|
|
|
4221
4263
|
exports.ADMINS = ADMINS;
|
|
4222
4264
|
exports.ADMIN_WALLETS = ADMIN_WALLETS;
|
|
4223
4265
|
exports.AGENT_CODE_TO_ABSTRACTION_MODE = AGENT_CODE_TO_ABSTRACTION_MODE;
|
|
4266
|
+
exports.ALL_ADMINS = ALL_ADMINS;
|
|
4224
4267
|
exports.AssetIdUtils = AssetIdUtils;
|
|
4225
4268
|
exports.BannerType = BannerType;
|
|
4226
4269
|
exports.BaseEcommerceClient = BaseEcommerceClient;
|
|
@@ -4249,6 +4292,7 @@ exports.ROOT_DEX = ROOT_DEX;
|
|
|
4249
4292
|
exports.ReturnStatus = ReturnStatus;
|
|
4250
4293
|
exports.ReviewSortBy = ReviewSortBy;
|
|
4251
4294
|
exports.ReviewStatus = ReviewStatus;
|
|
4295
|
+
exports.SUPER_ADMINS = SUPER_ADMINS;
|
|
4252
4296
|
exports.ShipmentStatus = ShipmentStatus;
|
|
4253
4297
|
exports.SortOrder = SortOrder;
|
|
4254
4298
|
exports.TARGET_APPROVED_MAX_BUILDER_FEE = TARGET_APPROVED_MAX_BUILDER_FEE;
|
|
@@ -4276,6 +4320,7 @@ exports.computeUnifiedAccountRatio = computeUnifiedAccountRatio;
|
|
|
4276
4320
|
exports.decodeSlug = decodeSlug;
|
|
4277
4321
|
exports.enableHip3DexAbstractionWithAgent = enableHip3DexAbstractionWithAgent;
|
|
4278
4322
|
exports.encodeSlug = encodeSlug;
|
|
4323
|
+
exports.enrichAllPerpsMetaWithAnnotations = enrichAllPerpsMetaWithAnnotations;
|
|
4279
4324
|
exports.floorUtcDay = floorUtcDay;
|
|
4280
4325
|
exports.floorUtcHour = floorUtcHour;
|
|
4281
4326
|
exports.floorUtcMinutes = floorUtcMinutes;
|
|
@@ -4298,6 +4343,7 @@ exports.getHip3DexAbstraction = getHip3DexAbstraction;
|
|
|
4298
4343
|
exports.getLatestCompletedWeek = getLatestCompletedWeek;
|
|
4299
4344
|
exports.getNextStatuses = getNextStatuses;
|
|
4300
4345
|
exports.getNextTierInfo = getNextTierInfo;
|
|
4346
|
+
exports.getPerpConciseAnnotations = getPerpConciseAnnotations;
|
|
4301
4347
|
exports.getPriceDecimals = getPriceDecimals;
|
|
4302
4348
|
exports.getStaticCollateralTokenByDex = getStaticCollateralTokenByDex;
|
|
4303
4349
|
exports.getStaticCollateralTokenSymbol = getStaticCollateralTokenSymbol;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantBusinessType, MerchantEcommerceClient, MerchantReturnPolicyType, MerchantStatus, ORDER_STATUS_TRANSITIONS, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, canCancelOrder, formatPrice, getBackoffDelay, getNextStatuses, getStatusColor, getStatusLabel, getStatusProgress, isPickupOrder, isRetryableError, isValidAddress, isValidEmail, parseError, requiresTrackingInfo, retryWithBackoff, shouldNotifyCustomer, sleep, truncateAddress, validateStatusTransition } from './chunk-35WGIB5F.mjs';
|
|
2
|
-
export { AssetIdUtils, InstrumentClient } from './chunk-
|
|
2
|
+
export { AssetIdUtils, InstrumentClient } from './chunk-OZPAOG43.mjs';
|
|
3
3
|
import Decimal, { Decimal as Decimal$1 } from 'decimal.js';
|
|
4
4
|
import { signL1Action, signUserSignedAction } from '@nktkas/hyperliquid/signing';
|
|
5
5
|
|
|
@@ -545,31 +545,40 @@ var TESTNET_USDC_SPOT_TOKEN = {
|
|
|
545
545
|
};
|
|
546
546
|
|
|
547
547
|
// lib/constants/admin.ts
|
|
548
|
-
var
|
|
548
|
+
var SUPER_ADMINS = [
|
|
549
549
|
"did:privy:cmc3hycnb00pljs0m1z010geq",
|
|
550
550
|
"did:privy:cmc8w2ddl01rdju0nylb6rp1v",
|
|
551
551
|
"did:privy:cmc3oftiz005fjx0msox3xgey",
|
|
552
552
|
"did:privy:cmcbx7i4400q8l90mawdymaag",
|
|
553
553
|
"did:privy:cmctbwphs00vzjz0m3la3zm4c",
|
|
554
554
|
"did:privy:cmcblrplb009ol70mia13winn",
|
|
555
|
-
"did:privy:cmcmizpxm02xfju0oc81alfy0",
|
|
556
555
|
"did:privy:cmcd2bvft00w3l90ljeyb4wn6",
|
|
557
556
|
"did:privy:cmc4y13ka0119kv0nckvgla1u",
|
|
558
557
|
"did:privy:cmc8qc36g00c1l70nnutuscue",
|
|
559
558
|
"did:privy:cmc8f1tf9019zlh0myjpi420p",
|
|
560
559
|
"did:privy:cmc6bturg002ql80mhzqr1d76",
|
|
561
560
|
"did:privy:cmc8uyr4t01kljo0mk3unzjl3",
|
|
562
|
-
"did:privy:cmcke9v7h00yijy0o2a41nhms"
|
|
561
|
+
"did:privy:cmcke9v7h00yijy0o2a41nhms"
|
|
562
|
+
];
|
|
563
|
+
var ADMINS = [
|
|
563
564
|
"did:privy:cmgfcjt2y0024kz0cpymoqbmp",
|
|
565
|
+
// aayush
|
|
564
566
|
"did:privy:cmeqj8tsi01k6la0c3s7gsl6w",
|
|
565
567
|
// elroy
|
|
566
568
|
"did:privy:cmiwrno1i00cdl70c5ro13eyp",
|
|
567
569
|
// adele
|
|
568
570
|
"did:privy:cmkc0jyy200abji0d42a0syil",
|
|
569
571
|
// matthew
|
|
570
|
-
"did:privy:cmlgc2zjk005vjo0cct10trdl"
|
|
571
|
-
//
|
|
572
|
+
"did:privy:cmlgc2zjk005vjo0cct10trdl",
|
|
573
|
+
// marketing
|
|
574
|
+
"did:privy:cme2d56i90091i90bdhuyaj7e",
|
|
575
|
+
// jun
|
|
576
|
+
"did:privy:cmm4av80f00140cldz3uv7io2",
|
|
577
|
+
// shubit
|
|
578
|
+
"did:privy:cmcbndjjm02fvjr0mrs42yahs"
|
|
579
|
+
// zlace
|
|
572
580
|
];
|
|
581
|
+
var ALL_ADMINS = [...SUPER_ADMINS, ...ADMINS];
|
|
573
582
|
var ADMIN_WALLETS = [
|
|
574
583
|
"0x0c7582A67B8B6AD04Ea404A6C2A06aAc9E0d4e7c",
|
|
575
584
|
"0xDec587aDD20A6447fF0b29D70E95b10b197b1283",
|
|
@@ -813,11 +822,41 @@ function getDexFromCollateralTokenSymbol(collateralTokenSymbol) {
|
|
|
813
822
|
}
|
|
814
823
|
|
|
815
824
|
// lib/hip3/market-info.ts
|
|
816
|
-
async function
|
|
825
|
+
async function getPerpConciseAnnotations(infoClient) {
|
|
817
826
|
return infoClient.transport.request("info", {
|
|
818
|
-
type: "
|
|
827
|
+
type: "perpConciseAnnotations"
|
|
819
828
|
});
|
|
820
829
|
}
|
|
830
|
+
function enrichAllPerpsMetaWithAnnotations(metas, annotations) {
|
|
831
|
+
const map = new Map(annotations);
|
|
832
|
+
return metas.map((meta) => ({
|
|
833
|
+
...meta,
|
|
834
|
+
universe: meta.universe.map((u) => {
|
|
835
|
+
const ann = map.get(u.name);
|
|
836
|
+
if (!ann) return u;
|
|
837
|
+
return {
|
|
838
|
+
...u,
|
|
839
|
+
...ann.category != null && ann.category !== "" ? { category: ann.category } : {},
|
|
840
|
+
...ann.displayName != null && ann.displayName !== "" ? { displayName: ann.displayName } : {},
|
|
841
|
+
...ann.keywords != null && ann.keywords.length > 0 ? { keywords: ann.keywords } : {}
|
|
842
|
+
};
|
|
843
|
+
})
|
|
844
|
+
}));
|
|
845
|
+
}
|
|
846
|
+
async function getAllPerpsMeta(infoClient) {
|
|
847
|
+
const [metas, annotations] = await Promise.all([
|
|
848
|
+
infoClient.transport.request("info", {
|
|
849
|
+
type: "allPerpMetas"
|
|
850
|
+
}),
|
|
851
|
+
getPerpConciseAnnotations(infoClient).catch(() => {
|
|
852
|
+
return [];
|
|
853
|
+
})
|
|
854
|
+
]);
|
|
855
|
+
if (!annotations.length) {
|
|
856
|
+
return metas;
|
|
857
|
+
}
|
|
858
|
+
return enrichAllPerpsMetaWithAnnotations(metas, annotations);
|
|
859
|
+
}
|
|
821
860
|
|
|
822
861
|
// lib/abstraction/types.ts
|
|
823
862
|
var ABSTRACTION_MODE_TO_AGENT_CODE = {
|
|
@@ -918,4 +957,4 @@ function computeUnifiedAccountRatio(multiverse, perpDexStates, spotBalances) {
|
|
|
918
957
|
return maxRatio;
|
|
919
958
|
}
|
|
920
959
|
|
|
921
|
-
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, CloidClientCode, CloidClientCodeNameById, DayOfWeek, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, ROOT_DEX, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, USDC_SPOT_TOKEN, UserDexAbstractionTypes, UserSetAbstractionTypes, WidgetType, WidgetTypeById, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getAllPerpsMeta, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
|
960
|
+
export { ABSTRACTION_MODE_TO_AGENT_CODE, ADMINS, ADMIN_WALLETS, AGENT_CODE_TO_ABSTRACTION_MODE, ALL_ADMINS, CloidClientCode, CloidClientCodeNameById, DayOfWeek, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, ROOT_DEX, SUPER_ADMINS, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, USDC_SPOT_TOKEN, UserDexAbstractionTypes, UserSetAbstractionTypes, WidgetType, WidgetTypeById, XP_BOOST_PERCENTAGES, agentSetAbstraction, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, computeUnifiedAccountRatio, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, enrichAllPerpsMetaWithAnnotations, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getAllPerpsMeta, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPerpConciseAnnotations, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getUserAbstraction, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, setUserAbstraction, stableQuoteTokens };
|
package/dist/react.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { SpotMeta } from '@nktkas/hyperliquid';
|
|
4
|
-
import { A as AllPerpsMeta, I as InstrumentClient } from './client-
|
|
4
|
+
import { A as AllPerpsMeta, I as InstrumentClient } from './client-1sWFpTpK.mjs';
|
|
5
5
|
|
|
6
6
|
interface InstrumentsProviderProps {
|
|
7
7
|
spotMeta: SpotMeta;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { SpotMeta } from '@nktkas/hyperliquid';
|
|
4
|
-
import { A as AllPerpsMeta, I as InstrumentClient } from './client-
|
|
4
|
+
import { A as AllPerpsMeta, I as InstrumentClient } from './client-1sWFpTpK.js';
|
|
5
5
|
|
|
6
6
|
interface InstrumentsProviderProps {
|
|
7
7
|
spotMeta: SpotMeta;
|
package/dist/react.js
CHANGED
|
@@ -188,7 +188,10 @@ var InstrumentClient = class {
|
|
|
188
188
|
type: "futures",
|
|
189
189
|
isDelisted: info.isDelisted,
|
|
190
190
|
dex: AssetIdUtils.extractDexName(info.name),
|
|
191
|
-
collateralTokenIndex: perpMeta.collateralToken
|
|
191
|
+
collateralTokenIndex: perpMeta.collateralToken,
|
|
192
|
+
category: info.category,
|
|
193
|
+
displayName: info.displayName,
|
|
194
|
+
keywords: info.keywords
|
|
192
195
|
};
|
|
193
196
|
this.addInstrument(instrument);
|
|
194
197
|
}
|
package/dist/react.mjs
CHANGED
package/lib/constants/admin.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
// Super admin Privy user IDs —
|
|
2
|
-
export const
|
|
1
|
+
// Super admin Privy user IDs — full unrestricted access
|
|
2
|
+
export const SUPER_ADMINS = [
|
|
3
3
|
"did:privy:cmc3hycnb00pljs0m1z010geq",
|
|
4
4
|
"did:privy:cmc8w2ddl01rdju0nylb6rp1v",
|
|
5
5
|
"did:privy:cmc3oftiz005fjx0msox3xgey",
|
|
6
6
|
"did:privy:cmcbx7i4400q8l90mawdymaag",
|
|
7
7
|
"did:privy:cmctbwphs00vzjz0m3la3zm4c",
|
|
8
8
|
"did:privy:cmcblrplb009ol70mia13winn",
|
|
9
|
-
"did:privy:cmcmizpxm02xfju0oc81alfy0",
|
|
10
9
|
"did:privy:cmcd2bvft00w3l90ljeyb4wn6",
|
|
11
10
|
"did:privy:cmc4y13ka0119kv0nckvgla1u",
|
|
12
11
|
"did:privy:cmc8qc36g00c1l70nnutuscue",
|
|
@@ -14,13 +13,23 @@ export const ADMINS = [
|
|
|
14
13
|
"did:privy:cmc6bturg002ql80mhzqr1d76",
|
|
15
14
|
"did:privy:cmc8uyr4t01kljo0mk3unzjl3",
|
|
16
15
|
"did:privy:cmcke9v7h00yijy0o2a41nhms",
|
|
17
|
-
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
// Regular admin Privy user IDs — restricted access (no payouts/airdrops/launchpads/API keys/cache)
|
|
19
|
+
export const ADMINS = [
|
|
20
|
+
"did:privy:cmgfcjt2y0024kz0cpymoqbmp", // aayush
|
|
18
21
|
"did:privy:cmeqj8tsi01k6la0c3s7gsl6w", // elroy
|
|
19
22
|
"did:privy:cmiwrno1i00cdl70c5ro13eyp", // adele
|
|
20
23
|
"did:privy:cmkc0jyy200abji0d42a0syil", // matthew
|
|
21
|
-
"did:privy:cmlgc2zjk005vjo0cct10trdl", //
|
|
24
|
+
"did:privy:cmlgc2zjk005vjo0cct10trdl", // marketing
|
|
25
|
+
"did:privy:cme2d56i90091i90bdhuyaj7e", // jun
|
|
26
|
+
"did:privy:cmm4av80f00140cldz3uv7io2", // shubit
|
|
27
|
+
"did:privy:cmcbndjjm02fvjr0mrs42yahs", // zlace
|
|
22
28
|
];
|
|
23
29
|
|
|
30
|
+
// All admin IDs combined — use for "is this user any kind of admin?" checks
|
|
31
|
+
export const ALL_ADMINS = [...SUPER_ADMINS, ...ADMINS];
|
|
32
|
+
|
|
24
33
|
// Global admin wallet addresses
|
|
25
34
|
export const ADMIN_WALLETS: string[] = [
|
|
26
35
|
"0x0c7582A67B8B6AD04Ea404A6C2A06aAc9E0d4e7c",
|
package/lib/hip3/market-info.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { InfoClient, PerpsAssetCtx, MarginTables, PerpDex as LegacyPerpDex } from "@nktkas/hyperliquid";
|
|
2
2
|
|
|
3
|
+
/** Payload entries from Hyperliquid `info` → `{ type: "perpConciseAnnotations" }`. */
|
|
4
|
+
export interface PerpConciseAnnotationMeta {
|
|
5
|
+
category?: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
keywords?: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type PerpConciseAnnotations = [string, PerpConciseAnnotationMeta][];
|
|
11
|
+
|
|
3
12
|
export interface PerpsMeta {
|
|
4
13
|
collateralToken: number;
|
|
5
14
|
/** Trading universes available for perpetual trading. */
|
|
@@ -32,6 +41,10 @@ export interface PerpsUniverse {
|
|
|
32
41
|
growthMode?: "enabled";
|
|
33
42
|
/** Margin mode for the universe. */
|
|
34
43
|
marginMode?: "strictIsolated" | "noCross";
|
|
44
|
+
/** From `perpConciseAnnotations` when present (search/display). */
|
|
45
|
+
category?: string;
|
|
46
|
+
displayName?: string;
|
|
47
|
+
keywords?: string[];
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
export interface PerpDex extends LegacyPerpDex {
|
|
@@ -40,10 +53,60 @@ export interface PerpDex extends LegacyPerpDex {
|
|
|
40
53
|
|
|
41
54
|
export type AllPerpsMeta = PerpsMeta[];
|
|
42
55
|
|
|
56
|
+
export async function getPerpConciseAnnotations(
|
|
57
|
+
infoClient: InfoClient,
|
|
58
|
+
): Promise<PerpConciseAnnotations> {
|
|
59
|
+
return infoClient.transport.request<PerpConciseAnnotations>("info", {
|
|
60
|
+
type: "perpConciseAnnotations",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Merges `perpConciseAnnotations` into each universe row by matching `name`.
|
|
66
|
+
*/
|
|
67
|
+
export function enrichAllPerpsMetaWithAnnotations(
|
|
68
|
+
metas: AllPerpsMeta,
|
|
69
|
+
annotations: PerpConciseAnnotations,
|
|
70
|
+
): AllPerpsMeta {
|
|
71
|
+
const map = new Map<string, PerpConciseAnnotationMeta>(annotations);
|
|
72
|
+
|
|
73
|
+
return metas.map((meta) => ({
|
|
74
|
+
...meta,
|
|
75
|
+
universe: meta.universe.map((u) => {
|
|
76
|
+
const ann = map.get(u.name);
|
|
77
|
+
if (!ann) return u;
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
...u,
|
|
81
|
+
...(ann.category != null && ann.category !== ""
|
|
82
|
+
? { category: ann.category }
|
|
83
|
+
: {}),
|
|
84
|
+
...(ann.displayName != null && ann.displayName !== ""
|
|
85
|
+
? { displayName: ann.displayName }
|
|
86
|
+
: {}),
|
|
87
|
+
...(ann.keywords != null && ann.keywords.length > 0
|
|
88
|
+
? { keywords: ann.keywords }
|
|
89
|
+
: {}),
|
|
90
|
+
};
|
|
91
|
+
}),
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
|
|
43
95
|
export async function getAllPerpsMeta(
|
|
44
96
|
infoClient: InfoClient,
|
|
45
97
|
): Promise<AllPerpsMeta> {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
98
|
+
const [metas, annotations] = await Promise.all([
|
|
99
|
+
infoClient.transport.request<AllPerpsMeta>("info", {
|
|
100
|
+
type: "allPerpMetas",
|
|
101
|
+
}),
|
|
102
|
+
getPerpConciseAnnotations(infoClient).catch((): PerpConciseAnnotations => {
|
|
103
|
+
return [];
|
|
104
|
+
}),
|
|
105
|
+
]);
|
|
106
|
+
|
|
107
|
+
if (!annotations.length) {
|
|
108
|
+
return metas;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return enrichAllPerpsMetaWithAnnotations(metas, annotations);
|
|
49
112
|
}
|
package/lib/instrument/client.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface PerpsInstrument extends BaseInstrument {
|
|
|
17
17
|
collateralTokenSymbol: string;
|
|
18
18
|
dex?: string; // HIP3 dex name (e.g., "xyz" for "xyz:MSTR")
|
|
19
19
|
collateralTokenIndex?: number;
|
|
20
|
+
/** From merged `perpConciseAnnotations` (display/search). */
|
|
21
|
+
category?: string;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
keywords?: string[];
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
// Spot-specific types (metadata only - no asset context data)
|
|
@@ -280,6 +284,9 @@ export class InstrumentClient {
|
|
|
280
284
|
isDelisted: info.isDelisted,
|
|
281
285
|
dex: AssetIdUtils.extractDexName(info.name),
|
|
282
286
|
collateralTokenIndex: perpMeta.collateralToken,
|
|
287
|
+
category: info.category,
|
|
288
|
+
displayName: info.displayName,
|
|
289
|
+
keywords: info.keywords,
|
|
283
290
|
};
|
|
284
291
|
|
|
285
292
|
this.addInstrument(instrument);
|
package/lib/meta/types.ts
CHANGED
|
@@ -33,4 +33,8 @@ export interface PerpsUniverse {
|
|
|
33
33
|
growthMode?: "enabled";
|
|
34
34
|
/** Margin mode for the universe. */
|
|
35
35
|
marginMode?: "strictIsolated" | "noCross";
|
|
36
|
+
/** From Hyperliquid `perpConciseAnnotations` when merged into meta. */
|
|
37
|
+
category?: string;
|
|
38
|
+
displayName?: string;
|
|
39
|
+
keywords?: string[];
|
|
36
40
|
}
|
package/package.json
CHANGED