@basedone/core 0.2.6 → 0.2.8

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.
@@ -1,2 +1 @@
1
- export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantEcommerceClient, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './chunk-CAU4QLVH.mjs';
2
- import './chunk-4UEJOM6W.mjs';
1
+ export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantBusinessType, MerchantEcommerceClient, MerchantReturnPolicyType, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './chunk-NKSQEISP.mjs';
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { SpotToken, MarginTables, PerpsAssetCtx, SpotMeta, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
2
- import { Hex } from '@nktkas/hyperliquid/types';
3
- export { A as AllPerpsMeta, d as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, c as PerpsInstrument, P as PerpsMeta, a as PerpsMetaAndAssetCtxs, b as PerpsUniverse, S as SpotInstrument, g as getAllPerpsMeta } from './client-CgmiTuEX.mjs';
4
- export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerSummary, DeleteBrowsingLocationResponse, 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, MediaAsset, MediaAssetResponse, Merchant, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantShippingSettings, MerchantStatus, Message, MessageResponse, MessageStatsResponse, 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, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.mjs';
1
+ import { SpotToken, MarginTables, PerpsAssetCtx, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
2
+ export { A as AllPerpsMeta, e as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, c as PerpDex, d as PerpsInstrument, P as PerpsMeta, a as PerpsMetaAndAssetCtxs, b as PerpsUniverse, S as SpotInstrument, g as getAllPerpsMeta } from './client-DMVXX1Gw.mjs';
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, 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, MediaAsset, MediaAssetResponse, Merchant, MerchantBusinessType, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantReturnPolicyType, MerchantShippingSettings, MerchantSocialLinks, MerchantStatus, Message, MessageResponse, MessageStatsResponse, 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, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.mjs';
5
4
  import 'axios';
6
5
 
7
6
  declare function encodeSlug(slug: string): bigint;
@@ -270,18 +269,6 @@ interface PerpsUniverse {
270
269
  marginMode?: "strictIsolated" | "noCross";
271
270
  }
272
271
 
273
- interface PerpDex {
274
- /** Short name of the perpetual dex. */
275
- name: string;
276
- /** Complete name of the perpetual dex. */
277
- fullName: string;
278
- /** Hex address of the dex deployer. */
279
- deployer: Hex;
280
- /** Hex address of the oracle updater, or null if not available. */
281
- oracleUpdater: Hex | null;
282
- feeRecipient: Hex | null;
283
- assetToStreamingOiCap: [string, string][];
284
- }
285
272
  /**
286
273
  * Market information for trading operations
287
274
  */
@@ -327,23 +314,6 @@ interface TokenInfo {
327
314
  weiDecimals: number;
328
315
  tokenId: string;
329
316
  }
330
- /**
331
- * Configuration for MetadataClient
332
- */
333
- interface MetadataClientConfig {
334
- /** List of HIP-3 DEX names to load metadata for */
335
- hip3Dexs?: string[];
336
- /** Whether to lazily initialize (fetch metadata on first use) */
337
- lazyInit?: boolean;
338
- /** Whether to use testnet (default: false for mainnet) */
339
- isTestnet?: boolean;
340
- /** Use static fallback data only, no API fetch */
341
- onlyUseStaticFallback?: boolean;
342
- /** Whether to use static fallback data if API fetch fails (default: true) */
343
- useStaticFallback?: boolean;
344
- /** Whether to enable debug logs (default: false) */
345
- debug?: boolean;
346
- }
347
317
  /**
348
318
  * MetadataClient - Handles Hyperliquid metadata for trading operations
349
319
  *
@@ -359,132 +329,6 @@ interface MetadataClientConfig {
359
329
  * - HIP-3: 100000 + perp_dex_index * 10000 + index_in_meta
360
330
  */
361
331
  declare const ROOT_DEX = "hyperliquid";
362
- /**@deprecated use react sdk instead */
363
- declare class MetadataClient {
364
- private infoClient;
365
- private config;
366
- private isTestnet;
367
- private spotMeta;
368
- private perpsMeta;
369
- private perpDexs;
370
- private staticMeta;
371
- private hip3DexsMeta;
372
- private perpsSymbolToIndex;
373
- private spotTokenNameToIndex;
374
- private spotPairToMarket;
375
- private baseTokenToMarkets;
376
- private quoteAssets;
377
- private coinToMarket;
378
- private hip3SymbolToMarket;
379
- private dexNameToIndex;
380
- private initialized;
381
- private initializing;
382
- constructor(config?: MetadataClientConfig);
383
- /**
384
- * Initialize metadata by fetching from Hyperliquid
385
- */
386
- initialize(): Promise<void>;
387
- /**
388
- * Load staticMeta.json for display overrides
389
- * This is always loaded regardless of config.useStaticFallback
390
- */
391
- private loadStaticMetaOverrides;
392
- /**
393
- * Load static metadata from bundled JSON files
394
- */
395
- private loadStaticMetadata;
396
- /**
397
- * Build optimized lookup maps from raw metadata
398
- * Called after metadata is loaded (from API or static files)
399
- */
400
- private buildLookupMaps;
401
- /**
402
- * Load metadata for a specific HIP-3 DEX
403
- * Also builds optimized lookups for this DEX's markets
404
- */
405
- loadHip3Metadata(dexName: string): Promise<DexInfo>;
406
- /**
407
- * Build optimized lookups for HIP-3 markets of a specific DEX
408
- */
409
- private buildHip3MarketsForDex;
410
- /**
411
- * Ensure metadata is loaded (for lazy init)
412
- */
413
- private ensureInitialized;
414
- /**
415
- * Get market information by symbol
416
- * Optimized: O(1) direct map lookup for most cases
417
- * Lazily initialize hip-3 metadata if not already initialized
418
- *
419
- * @param symbol - Market symbol (e.g., "BTC", "PURR/USDC", "vntls:ABC")
420
- * @param quoteAsset - Quote asset for spot markets (default: "USDC")
421
- * @returns Market information or null if not found
422
- */
423
- getMarketBySymbolAsync(symbol: string, quoteAsset?: string): Promise<MarketInfo | null>;
424
- getMarketByCoin(coin: string): MarketInfo | null;
425
- /**
426
- * Get perpetuals market information
427
- * Optimized: O(1) map lookup instead of O(n) array search
428
- */
429
- getPerpsMarket(symbol: string): MarketInfo | null;
430
- /**
431
- * Get spot market information
432
- * Optimized: O(1) map lookup instead of O(n) array searches
433
- *
434
- * @param baseSymbol - Base token symbol (e.g., "PURR", "UHYPE")
435
- * @param quoteSymbol - Quote token symbol (default: "USDC")
436
- */
437
- getSpotMarket(baseSymbol: string, quoteSymbol?: string): MarketInfo | null;
438
- /**
439
- * Get HIP-3 market information
440
- * Optimized: O(1) map lookup after DEX metadata is loaded
441
- *
442
- * @param symbol - HIP-3 market symbol (format: "dex:coin")
443
- */
444
- getHip3Market(symbol: string): Promise<MarketInfo | null>;
445
- getHip3Dex(dexName: string): Promise<DexInfo | null>;
446
- /**
447
- * Get all available markets for a base token
448
- * Optimized: O(1) map lookup instead of O(n) filter + map
449
- * Useful for showing all quote asset options
450
- */
451
- getAllMarketsForBase(baseSymbol: string): MarketInfo[];
452
- /**
453
- * Get spot token information
454
- * Optimized: O(1) map lookup instead of O(n) array search
455
- */
456
- getSpotTokenInfo(tokenSymbol: string): TokenInfo | null;
457
- /**
458
- * Get all available quote assets
459
- * Optimized: O(1) pre-computed array instead of O(n) computation
460
- */
461
- getAvailableQuoteAssets(): string[];
462
- /**
463
- * Get raw metadata (for advanced use cases)
464
- */
465
- getRawMetadata(): {
466
- spotMeta: SpotMeta | null;
467
- perpsMeta: PerpsMeta | null;
468
- perpDexs: (PerpDex | null)[];
469
- hip3DexsMeta: {
470
- [k: string]: DexInfo;
471
- };
472
- coinToMarket: {
473
- [k: string]: MarketInfo;
474
- };
475
- hip3SymbolToMarket: {
476
- [k: string]: MarketInfo;
477
- };
478
- };
479
- /**
480
- * Get network configuration
481
- */
482
- getNetworkInfo(): {
483
- isTestnet: boolean;
484
- useStaticFallback: boolean | undefined;
485
- initialized: boolean;
486
- };
487
- }
488
332
 
489
333
  declare const formatPriceAndSize: ({ px, sz, szDecimals, isSpot, }: {
490
334
  px: number;
@@ -652,4 +496,4 @@ declare function isStableQuoteToken(coin: string): boolean;
652
496
  declare function getDisplayMarketSymbol(coin: string | undefined, showCollateralTokenSymbol?: boolean, collateralTokenSymbol?: string): string | undefined;
653
497
  declare function getDexFromCollateralTokenSymbol(collateralTokenSymbol: string): string | undefined;
654
498
 
655
- export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo, MetadataClient, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDex, type PupEligibilityResult, ROOT_DEX, 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, UserDexAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, XP_BOOST_PERCENTAGES, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, stableQuoteTokens };
499
+ export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PupEligibilityResult, ROOT_DEX, 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, UserDexAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, XP_BOOST_PERCENTAGES, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, stableQuoteTokens };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { SpotToken, MarginTables, PerpsAssetCtx, SpotMeta, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
2
- import { Hex } from '@nktkas/hyperliquid/types';
3
- export { A as AllPerpsMeta, d as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, c as PerpsInstrument, P as PerpsMeta, a as PerpsMetaAndAssetCtxs, b as PerpsUniverse, S as SpotInstrument, g as getAllPerpsMeta } from './client-CgmiTuEX.js';
4
- export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerSummary, DeleteBrowsingLocationResponse, 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, MediaAsset, MediaAssetResponse, Merchant, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantShippingSettings, MerchantStatus, Message, MessageResponse, MessageStatsResponse, 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, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.js';
1
+ import { SpotToken, MarginTables, PerpsAssetCtx, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
2
+ export { A as AllPerpsMeta, e as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, c as PerpDex, d as PerpsInstrument, P as PerpsMeta, a as PerpsMetaAndAssetCtxs, b as PerpsUniverse, S as SpotInstrument, g as getAllPerpsMeta } from './client-DMVXX1Gw.js';
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, 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, MediaAsset, MediaAssetResponse, Merchant, MerchantBusinessType, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantReturnPolicyType, MerchantShippingSettings, MerchantSocialLinks, MerchantStatus, Message, MessageResponse, MessageStatsResponse, 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, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.js';
5
4
  import 'axios';
6
5
 
7
6
  declare function encodeSlug(slug: string): bigint;
@@ -270,18 +269,6 @@ interface PerpsUniverse {
270
269
  marginMode?: "strictIsolated" | "noCross";
271
270
  }
272
271
 
273
- interface PerpDex {
274
- /** Short name of the perpetual dex. */
275
- name: string;
276
- /** Complete name of the perpetual dex. */
277
- fullName: string;
278
- /** Hex address of the dex deployer. */
279
- deployer: Hex;
280
- /** Hex address of the oracle updater, or null if not available. */
281
- oracleUpdater: Hex | null;
282
- feeRecipient: Hex | null;
283
- assetToStreamingOiCap: [string, string][];
284
- }
285
272
  /**
286
273
  * Market information for trading operations
287
274
  */
@@ -327,23 +314,6 @@ interface TokenInfo {
327
314
  weiDecimals: number;
328
315
  tokenId: string;
329
316
  }
330
- /**
331
- * Configuration for MetadataClient
332
- */
333
- interface MetadataClientConfig {
334
- /** List of HIP-3 DEX names to load metadata for */
335
- hip3Dexs?: string[];
336
- /** Whether to lazily initialize (fetch metadata on first use) */
337
- lazyInit?: boolean;
338
- /** Whether to use testnet (default: false for mainnet) */
339
- isTestnet?: boolean;
340
- /** Use static fallback data only, no API fetch */
341
- onlyUseStaticFallback?: boolean;
342
- /** Whether to use static fallback data if API fetch fails (default: true) */
343
- useStaticFallback?: boolean;
344
- /** Whether to enable debug logs (default: false) */
345
- debug?: boolean;
346
- }
347
317
  /**
348
318
  * MetadataClient - Handles Hyperliquid metadata for trading operations
349
319
  *
@@ -359,132 +329,6 @@ interface MetadataClientConfig {
359
329
  * - HIP-3: 100000 + perp_dex_index * 10000 + index_in_meta
360
330
  */
361
331
  declare const ROOT_DEX = "hyperliquid";
362
- /**@deprecated use react sdk instead */
363
- declare class MetadataClient {
364
- private infoClient;
365
- private config;
366
- private isTestnet;
367
- private spotMeta;
368
- private perpsMeta;
369
- private perpDexs;
370
- private staticMeta;
371
- private hip3DexsMeta;
372
- private perpsSymbolToIndex;
373
- private spotTokenNameToIndex;
374
- private spotPairToMarket;
375
- private baseTokenToMarkets;
376
- private quoteAssets;
377
- private coinToMarket;
378
- private hip3SymbolToMarket;
379
- private dexNameToIndex;
380
- private initialized;
381
- private initializing;
382
- constructor(config?: MetadataClientConfig);
383
- /**
384
- * Initialize metadata by fetching from Hyperliquid
385
- */
386
- initialize(): Promise<void>;
387
- /**
388
- * Load staticMeta.json for display overrides
389
- * This is always loaded regardless of config.useStaticFallback
390
- */
391
- private loadStaticMetaOverrides;
392
- /**
393
- * Load static metadata from bundled JSON files
394
- */
395
- private loadStaticMetadata;
396
- /**
397
- * Build optimized lookup maps from raw metadata
398
- * Called after metadata is loaded (from API or static files)
399
- */
400
- private buildLookupMaps;
401
- /**
402
- * Load metadata for a specific HIP-3 DEX
403
- * Also builds optimized lookups for this DEX's markets
404
- */
405
- loadHip3Metadata(dexName: string): Promise<DexInfo>;
406
- /**
407
- * Build optimized lookups for HIP-3 markets of a specific DEX
408
- */
409
- private buildHip3MarketsForDex;
410
- /**
411
- * Ensure metadata is loaded (for lazy init)
412
- */
413
- private ensureInitialized;
414
- /**
415
- * Get market information by symbol
416
- * Optimized: O(1) direct map lookup for most cases
417
- * Lazily initialize hip-3 metadata if not already initialized
418
- *
419
- * @param symbol - Market symbol (e.g., "BTC", "PURR/USDC", "vntls:ABC")
420
- * @param quoteAsset - Quote asset for spot markets (default: "USDC")
421
- * @returns Market information or null if not found
422
- */
423
- getMarketBySymbolAsync(symbol: string, quoteAsset?: string): Promise<MarketInfo | null>;
424
- getMarketByCoin(coin: string): MarketInfo | null;
425
- /**
426
- * Get perpetuals market information
427
- * Optimized: O(1) map lookup instead of O(n) array search
428
- */
429
- getPerpsMarket(symbol: string): MarketInfo | null;
430
- /**
431
- * Get spot market information
432
- * Optimized: O(1) map lookup instead of O(n) array searches
433
- *
434
- * @param baseSymbol - Base token symbol (e.g., "PURR", "UHYPE")
435
- * @param quoteSymbol - Quote token symbol (default: "USDC")
436
- */
437
- getSpotMarket(baseSymbol: string, quoteSymbol?: string): MarketInfo | null;
438
- /**
439
- * Get HIP-3 market information
440
- * Optimized: O(1) map lookup after DEX metadata is loaded
441
- *
442
- * @param symbol - HIP-3 market symbol (format: "dex:coin")
443
- */
444
- getHip3Market(symbol: string): Promise<MarketInfo | null>;
445
- getHip3Dex(dexName: string): Promise<DexInfo | null>;
446
- /**
447
- * Get all available markets for a base token
448
- * Optimized: O(1) map lookup instead of O(n) filter + map
449
- * Useful for showing all quote asset options
450
- */
451
- getAllMarketsForBase(baseSymbol: string): MarketInfo[];
452
- /**
453
- * Get spot token information
454
- * Optimized: O(1) map lookup instead of O(n) array search
455
- */
456
- getSpotTokenInfo(tokenSymbol: string): TokenInfo | null;
457
- /**
458
- * Get all available quote assets
459
- * Optimized: O(1) pre-computed array instead of O(n) computation
460
- */
461
- getAvailableQuoteAssets(): string[];
462
- /**
463
- * Get raw metadata (for advanced use cases)
464
- */
465
- getRawMetadata(): {
466
- spotMeta: SpotMeta | null;
467
- perpsMeta: PerpsMeta | null;
468
- perpDexs: (PerpDex | null)[];
469
- hip3DexsMeta: {
470
- [k: string]: DexInfo;
471
- };
472
- coinToMarket: {
473
- [k: string]: MarketInfo;
474
- };
475
- hip3SymbolToMarket: {
476
- [k: string]: MarketInfo;
477
- };
478
- };
479
- /**
480
- * Get network configuration
481
- */
482
- getNetworkInfo(): {
483
- isTestnet: boolean;
484
- useStaticFallback: boolean | undefined;
485
- initialized: boolean;
486
- };
487
- }
488
332
 
489
333
  declare const formatPriceAndSize: ({ px, sz, szDecimals, isSpot, }: {
490
334
  px: number;
@@ -652,4 +496,4 @@ declare function isStableQuoteToken(coin: string): boolean;
652
496
  declare function getDisplayMarketSymbol(coin: string | undefined, showCollateralTokenSymbol?: boolean, collateralTokenSymbol?: string): string | undefined;
653
497
  declare function getDexFromCollateralTokenSymbol(collateralTokenSymbol: string): string | undefined;
654
498
 
655
- export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo, MetadataClient, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PerpDex, type PupEligibilityResult, ROOT_DEX, 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, UserDexAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, XP_BOOST_PERCENTAGES, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, stableQuoteTokens };
499
+ export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PupEligibilityResult, ROOT_DEX, 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, UserDexAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, XP_BOOST_PERCENTAGES, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, stableQuoteTokens };