@metamask-previews/perps-controller 2.0.0-preview-a37be9342 → 2.0.0-preview-26cb9fc

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.
Files changed (112) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/PerpsController.cjs.map +1 -1
  3. package/dist/PerpsController.d.cts.map +1 -1
  4. package/dist/PerpsController.d.mts.map +1 -1
  5. package/dist/PerpsController.mjs.map +1 -1
  6. package/dist/constants/eventNames.cjs +1 -0
  7. package/dist/constants/eventNames.cjs.map +1 -1
  8. package/dist/constants/eventNames.d.cts +1 -0
  9. package/dist/constants/eventNames.d.cts.map +1 -1
  10. package/dist/constants/eventNames.d.mts +1 -0
  11. package/dist/constants/eventNames.d.mts.map +1 -1
  12. package/dist/constants/eventNames.mjs +1 -0
  13. package/dist/constants/eventNames.mjs.map +1 -1
  14. package/dist/constants/perpsConfig.cjs +3 -0
  15. package/dist/constants/perpsConfig.cjs.map +1 -1
  16. package/dist/constants/perpsConfig.d.cts +1 -0
  17. package/dist/constants/perpsConfig.d.cts.map +1 -1
  18. package/dist/constants/perpsConfig.d.mts +1 -0
  19. package/dist/constants/perpsConfig.d.mts.map +1 -1
  20. package/dist/constants/perpsConfig.mjs +3 -0
  21. package/dist/constants/perpsConfig.mjs.map +1 -1
  22. package/dist/index.cjs +50 -56
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +2 -1
  25. package/dist/index.d.cts.map +1 -1
  26. package/dist/index.d.mts +2 -1
  27. package/dist/index.d.mts.map +1 -1
  28. package/dist/index.mjs +1 -1
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/providers/HyperLiquidProvider.cjs +18 -6
  31. package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
  32. package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
  33. package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
  34. package/dist/providers/HyperLiquidProvider.mjs +18 -6
  35. package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
  36. package/dist/services/HyperLiquidClientService.cjs +39 -16
  37. package/dist/services/HyperLiquidClientService.cjs.map +1 -1
  38. package/dist/services/HyperLiquidClientService.d.cts +2 -0
  39. package/dist/services/HyperLiquidClientService.d.cts.map +1 -1
  40. package/dist/services/HyperLiquidClientService.d.mts +2 -0
  41. package/dist/services/HyperLiquidClientService.d.mts.map +1 -1
  42. package/dist/services/HyperLiquidClientService.mjs +39 -16
  43. package/dist/services/HyperLiquidClientService.mjs.map +1 -1
  44. package/dist/services/HyperLiquidSubscriptionService.cjs +78 -13
  45. package/dist/services/HyperLiquidSubscriptionService.cjs.map +1 -1
  46. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +1 -1
  47. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +1 -1
  48. package/dist/services/HyperLiquidSubscriptionService.mjs +78 -13
  49. package/dist/services/HyperLiquidSubscriptionService.mjs.map +1 -1
  50. package/dist/services/TradingService.cjs +0 -1
  51. package/dist/services/TradingService.cjs.map +1 -1
  52. package/dist/services/TradingService.d.cts.map +1 -1
  53. package/dist/services/TradingService.d.mts.map +1 -1
  54. package/dist/services/TradingService.mjs +0 -1
  55. package/dist/services/TradingService.mjs.map +1 -1
  56. package/dist/types/index.cjs +3 -2
  57. package/dist/types/index.cjs.map +1 -1
  58. package/dist/types/index.d.cts.map +1 -1
  59. package/dist/types/index.d.mts.map +1 -1
  60. package/dist/types/index.mjs +3 -2
  61. package/dist/types/index.mjs.map +1 -1
  62. package/dist/types/transactionTypes.cjs +5 -4
  63. package/dist/types/transactionTypes.cjs.map +1 -1
  64. package/dist/types/transactionTypes.d.cts +0 -4
  65. package/dist/types/transactionTypes.d.cts.map +1 -1
  66. package/dist/types/transactionTypes.d.mts +0 -4
  67. package/dist/types/transactionTypes.d.mts.map +1 -1
  68. package/dist/types/transactionTypes.mjs +3 -2
  69. package/dist/types/transactionTypes.mjs.map +1 -1
  70. package/dist/utils/errorUtils.cjs +4 -3
  71. package/dist/utils/errorUtils.cjs.map +1 -1
  72. package/dist/utils/errorUtils.d.cts +0 -4
  73. package/dist/utils/errorUtils.d.cts.map +1 -1
  74. package/dist/utils/errorUtils.d.mts +0 -4
  75. package/dist/utils/errorUtils.d.mts.map +1 -1
  76. package/dist/utils/errorUtils.mjs +2 -1
  77. package/dist/utils/errorUtils.mjs.map +1 -1
  78. package/dist/utils/hyperLiquidAdapter.cjs +3 -2
  79. package/dist/utils/hyperLiquidAdapter.cjs.map +1 -1
  80. package/dist/utils/hyperLiquidAdapter.d.cts.map +1 -1
  81. package/dist/utils/hyperLiquidAdapter.d.mts.map +1 -1
  82. package/dist/utils/hyperLiquidAdapter.mjs +4 -3
  83. package/dist/utils/hyperLiquidAdapter.mjs.map +1 -1
  84. package/dist/utils/hyperLiquidValidation.cjs +4 -0
  85. package/dist/utils/hyperLiquidValidation.cjs.map +1 -1
  86. package/dist/utils/hyperLiquidValidation.d.cts.map +1 -1
  87. package/dist/utils/hyperLiquidValidation.d.mts.map +1 -1
  88. package/dist/utils/hyperLiquidValidation.mjs +4 -0
  89. package/dist/utils/hyperLiquidValidation.mjs.map +1 -1
  90. package/dist/utils/index.cjs +0 -1
  91. package/dist/utils/index.cjs.map +1 -1
  92. package/dist/utils/index.d.cts +0 -1
  93. package/dist/utils/index.d.cts.map +1 -1
  94. package/dist/utils/index.d.mts +0 -1
  95. package/dist/utils/index.d.mts.map +1 -1
  96. package/dist/utils/index.mjs +0 -1
  97. package/dist/utils/index.mjs.map +1 -1
  98. package/dist/utils/marketDataTransform.cjs +2 -1
  99. package/dist/utils/marketDataTransform.cjs.map +1 -1
  100. package/dist/utils/marketDataTransform.d.cts.map +1 -1
  101. package/dist/utils/marketDataTransform.d.mts.map +1 -1
  102. package/dist/utils/marketDataTransform.mjs +2 -1
  103. package/dist/utils/marketDataTransform.mjs.map +1 -1
  104. package/dist/utils/perpsConnectionAttemptContext.cjs +20 -0
  105. package/dist/utils/perpsConnectionAttemptContext.cjs.map +1 -0
  106. package/dist/utils/perpsConnectionAttemptContext.d.cts +7 -0
  107. package/dist/utils/perpsConnectionAttemptContext.d.cts.map +1 -0
  108. package/dist/utils/perpsConnectionAttemptContext.d.mts +7 -0
  109. package/dist/utils/perpsConnectionAttemptContext.d.mts.map +1 -0
  110. package/dist/utils/perpsConnectionAttemptContext.mjs +15 -0
  111. package/dist/utils/perpsConnectionAttemptContext.mjs.map +1 -0
  112. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"HyperLiquidSubscriptionService.d.cts","sourceRoot":"","sources":["../../src/services/HyperLiquidSubscriptionService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAUV,gBAAgB,EAIjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAG3E,OAAO,KAAK,EAEV,QAAQ,EACR,SAAS,EACT,KAAK,EAEL,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EAGxB,yBAAyB,EAE1B,2BAAiB;AAYlB;;;GAGG;AACH,qBAAa,8BAA8B;;gBAuMvC,aAAa,EAAE,wBAAwB,EACvC,aAAa,EAAE,wBAAwB,EACvC,oBAAoB,EAAE,yBAAyB,EAC/C,WAAW,CAAC,EAAE,OAAO,EACrB,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE;IA2I7B;;;;;;;;OAQG;IACI,eAAe,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;SACrB,EAAE,CAAC;KACL,GACA,IAAI;IAWP;;;;;;OAMG;IACI,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MAAM,GAAG,SAAS;IAIlD,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS1E;;;;;OAKG;IACI,cAAc,IAAI,SAAS,EAAE,GAAG,IAAI;IAI3C;;;;;;;;OAQG;IACI,0BAA0B,IAAI,SAAS,EAAE,GAAG,IAAI;IAkwBvD;;;;;;;OAOG;IACI,oBAAoB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,IAAI;IAmNzE;;;;;;OAMG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoMlD;;OAEG;IACI,QAAQ,IAAI,IAAI;CAsHxB"}
1
+ {"version":3,"file":"HyperLiquidSubscriptionService.d.cts","sourceRoot":"","sources":["../../src/services/HyperLiquidSubscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAUV,gBAAgB,EAIjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAG3E,OAAO,KAAK,EAEV,QAAQ,EACR,SAAS,EACT,KAAK,EAEL,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EAGxB,yBAAyB,EAE1B,2BAAiB;AAYlB;;;GAGG;AACH,qBAAa,8BAA8B;;gBAiNvC,aAAa,EAAE,wBAAwB,EACvC,aAAa,EAAE,wBAAwB,EACvC,oBAAoB,EAAE,yBAAyB,EAC/C,WAAW,CAAC,EAAE,OAAO,EACrB,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,gBAAgB,CAAC,EAAE,MAAM,EAAE;IA2I7B;;;;;;;;OAQG;IACI,eAAe,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;QACJ,QAAQ,EAAE;YAC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K,EAAE,GAAG,IAAI;IAIxC;;;;;OAKG;IACI,2BAA2B,IAAI,KAAK,EAAE,GAAG,IAAI;IAOpD;;;;;;OAMG;IACI,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIlD,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS1E;;;;;OAKG;IACI,cAAc,IAAI,SAAS,EAAE,GAAG,IAAI;IAI3C;;;;;;;;OAQG;IACI,0BAA0B,IAAI,SAAS,EAAE,GAAG,IAAI;IAs0BvD;;;;;;;OAOG;IACI,oBAAoB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,IAAI;IAmNzE;;;;;;OAMG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsMlD;;OAEG;IACI,QAAQ,IAAI,IAAI;CAwHxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"HyperLiquidSubscriptionService.d.mts","sourceRoot":"","sources":["../../src/services/HyperLiquidSubscriptionService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAUV,gBAAgB,EAIjB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAG3E,OAAO,KAAK,EAEV,QAAQ,EACR,SAAS,EACT,KAAK,EAEL,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EAGxB,yBAAyB,EAE1B,2BAAiB;AAYlB;;;GAGG;AACH,qBAAa,8BAA8B;;gBAuMvC,aAAa,EAAE,wBAAwB,EACvC,aAAa,EAAE,wBAAwB,EACvC,oBAAoB,EAAE,yBAAyB,EAC/C,WAAW,CAAC,EAAE,OAAO,EACrB,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,gBAAgB,CAAC,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,EAAE,qBAAqB,GAAG,MAAM,IAAI;IA8BnE;;;;;;OAMG;IACI,kBAAkB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI;IA8BrE;;;;OAIG;IACI,wBAAwB,IAAI,OAAO;IAI1C;;;;OAIG;IACI,2BAA2B,IAAI,OAAO;IAI7C;;;;OAIG;IACI,kBAAkB,IAAI,QAAQ,EAAE,GAAG,IAAI;IAI9C;;;;OAIG;IACI,eAAe,IAAI,KAAK,EAAE,GAAG,IAAI;IAIxC;;;;;OAKG;IACI,2BAA2B,IAAI,KAAK,EAAE,GAAG,IAAI;IAOpD;;;;;;OAMG;IACI,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIlD,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS1E;;;;;OAKG;IACI,cAAc,IAAI,SAAS,EAAE,GAAG,IAAI;IAI3C;;;;;;;;OAQG;IACI,0BAA0B,IAAI,SAAS,EAAE,GAAG,IAAI;IAs0BvD;;;;;;;OAOG;IACI,oBAAoB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,IAAI;IAmNzE;;;;;;OAMG;IACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsMlD;;OAEG;IACI,QAAQ,IAAI,IAAI;CAwHxB"}
@@ -9,7 +9,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _HyperLiquidSubscriptionService_instances, _HyperLiquidSubscriptionService_clientService, _HyperLiquidSubscriptionService_walletService, _HyperLiquidSubscriptionService_hip3Enabled, _HyperLiquidSubscriptionService_enabledDexs, _HyperLiquidSubscriptionService_allowlistMarkets, _HyperLiquidSubscriptionService_blocklistMarkets, _HyperLiquidSubscriptionService_discoveredDexNames, _HyperLiquidSubscriptionService_dexDiscoveryPromise, _HyperLiquidSubscriptionService_dexDiscoveryResolver, _HyperLiquidSubscriptionService_expectedDexs, _HyperLiquidSubscriptionService_initializedDexs, _HyperLiquidSubscriptionService_priceSubscribers, _HyperLiquidSubscriptionService_positionSubscribers, _HyperLiquidSubscriptionService_orderFillSubscribers, _HyperLiquidSubscriptionService_orderSubscribers, _HyperLiquidSubscriptionService_accountSubscribers, _HyperLiquidSubscriptionService_marketDataSubscribers, _HyperLiquidSubscriptionService_orderBookSubscribers, _HyperLiquidSubscriptionService_globalAllMidsSubscription, _HyperLiquidSubscriptionService_globalAllMidsPromise, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, _HyperLiquidSubscriptionService_globalBboSubscriptions, _HyperLiquidSubscriptionService_orderFillSubscriptions, _HyperLiquidSubscriptionService_symbolSubscriberCounts, _HyperLiquidSubscriptionService_dexSubscriberCounts, _HyperLiquidSubscriptionService_webData3Subscriptions, _HyperLiquidSubscriptionService_webData3SubscriptionPromise, _HyperLiquidSubscriptionService_positionSubscriberCount, _HyperLiquidSubscriptionService_orderSubscriberCount, _HyperLiquidSubscriptionService_accountSubscriberCount, _HyperLiquidSubscriptionService_oiCapSubscriberCount, _HyperLiquidSubscriptionService_dexPositionsCache, _HyperLiquidSubscriptionService_dexOrdersCache, _HyperLiquidSubscriptionService_dexAccountCache, _HyperLiquidSubscriptionService_cachedPositions, _HyperLiquidSubscriptionService_cachedOrders, _HyperLiquidSubscriptionService_cachedAccount, _HyperLiquidSubscriptionService_ordersCacheInitialized, _HyperLiquidSubscriptionService_positionsCacheInitialized, _HyperLiquidSubscriptionService_oiCapSubscribers, _HyperLiquidSubscriptionService_cachedOICaps, _HyperLiquidSubscriptionService_cachedOICapsHash, _HyperLiquidSubscriptionService_oiCapsCacheInitialized, _HyperLiquidSubscriptionService_cachedPriceData, _HyperLiquidSubscriptionService_allMidsSnapshots, _HyperLiquidSubscriptionService_cachedFills, _HyperLiquidSubscriptionService_fillsCacheInitialized, _HyperLiquidSubscriptionService_assetCtxsSubscriptions, _HyperLiquidSubscriptionService_dexAssetCtxsCache, _HyperLiquidSubscriptionService_assetCtxsSubscriptionPromises, _HyperLiquidSubscriptionService_dexAllMidsSubscriptions, _HyperLiquidSubscriptionService_dexAllMidsSubscriptionPromises, _HyperLiquidSubscriptionService_clearinghouseStateSubscriptions, _HyperLiquidSubscriptionService_openOrdersSubscriptions, _HyperLiquidSubscriptionService_pendingClearinghouseSubscriptions, _HyperLiquidSubscriptionService_pendingOpenOrdersSubscriptions, _HyperLiquidSubscriptionService_dexMetaCache, _HyperLiquidSubscriptionService_orderBookCache, _HyperLiquidSubscriptionService_marketDataCache, _HyperLiquidSubscriptionService_isClearing, _HyperLiquidSubscriptionService_restoreRetryTimeouts, _HyperLiquidSubscriptionService_deps, _HyperLiquidSubscriptionService_logErrorUnlessClearing, _HyperLiquidSubscriptionService_isTransientAssetCtxsError, _HyperLiquidSubscriptionService_scheduleRestoreRetry, _HyperLiquidSubscriptionService_getErrorContext, _HyperLiquidSubscriptionService_isDexEnabled, _HyperLiquidSubscriptionService_waitForDexDiscovery, _HyperLiquidSubscriptionService_hashPositions, _HyperLiquidSubscriptionService_hashOrders, _HyperLiquidSubscriptionService_hashAccountState, _HyperLiquidSubscriptionService_cachedPositionsHash, _HyperLiquidSubscriptionService_cachedOrdersHash, _HyperLiquidSubscriptionService_cachedAccountHash, _HyperLiquidSubscriptionService_extractTPSLFromOrders, _HyperLiquidSubscriptionService_mergeTPSLIntoPositions, _HyperLiquidSubscriptionService_aggregateAccountStates, _HyperLiquidSubscriptionService_ensureSharedWebData3Subscription, _HyperLiquidSubscriptionService_createUserDataSubscription, _HyperLiquidSubscriptionService_ensureClearinghouseStateSubscription, _HyperLiquidSubscriptionService_createClearinghouseSubscription, _HyperLiquidSubscriptionService_ensureOpenOrdersSubscription, _HyperLiquidSubscriptionService_createOpenOrdersSubscription, _HyperLiquidSubscriptionService_aggregateAndNotifySubscribers, _HyperLiquidSubscriptionService_cleanupSharedWebData3ISubscription, _HyperLiquidSubscriptionService_ensureOrderFillISubscription, _HyperLiquidSubscriptionService_createSubscription, _HyperLiquidSubscriptionService_createPriceUpdate, _HyperLiquidSubscriptionService_ensureGlobalAllMidsSubscription, _HyperLiquidSubscriptionService_ensureActiveAssetSubscription, _HyperLiquidSubscriptionService_cleanupActiveAssetSubscription, _HyperLiquidSubscriptionService_ensureAssetCtxsSubscription, _HyperLiquidSubscriptionService_ensureDexAllMidsSubscription, _HyperLiquidSubscriptionService_createDexAllMidsSubscription, _HyperLiquidSubscriptionService_createAssetCtxsSubscription, _HyperLiquidSubscriptionService_cleanupAssetCtxsSubscription, _HyperLiquidSubscriptionService_ensureBboSubscription, _HyperLiquidSubscriptionService_cleanupBboSubscription, _HyperLiquidSubscriptionService_processOrderBookData, _HyperLiquidSubscriptionService_notifyAllPriceSubscribers;
12
+ var _HyperLiquidSubscriptionService_instances, _HyperLiquidSubscriptionService_clientService, _HyperLiquidSubscriptionService_walletService, _HyperLiquidSubscriptionService_hip3Enabled, _HyperLiquidSubscriptionService_enabledDexs, _HyperLiquidSubscriptionService_allowlistMarkets, _HyperLiquidSubscriptionService_blocklistMarkets, _HyperLiquidSubscriptionService_discoveredDexNames, _HyperLiquidSubscriptionService_dexDiscoveryPromise, _HyperLiquidSubscriptionService_dexDiscoveryResolver, _HyperLiquidSubscriptionService_expectedDexs, _HyperLiquidSubscriptionService_initializedDexs, _HyperLiquidSubscriptionService_priceSubscribers, _HyperLiquidSubscriptionService_positionSubscribers, _HyperLiquidSubscriptionService_orderFillSubscribers, _HyperLiquidSubscriptionService_orderSubscribers, _HyperLiquidSubscriptionService_accountSubscribers, _HyperLiquidSubscriptionService_marketDataSubscribers, _HyperLiquidSubscriptionService_orderBookSubscribers, _HyperLiquidSubscriptionService_globalAllMidsSubscription, _HyperLiquidSubscriptionService_globalAllMidsPromise, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, _HyperLiquidSubscriptionService_globalBboSubscriptions, _HyperLiquidSubscriptionService_pendingBboPromises, _HyperLiquidSubscriptionService_orderFillSubscriptions, _HyperLiquidSubscriptionService_symbolSubscriberCounts, _HyperLiquidSubscriptionService_dexSubscriberCounts, _HyperLiquidSubscriptionService_webData3Subscriptions, _HyperLiquidSubscriptionService_webData3SubscriptionPromise, _HyperLiquidSubscriptionService_positionSubscriberCount, _HyperLiquidSubscriptionService_orderSubscriberCount, _HyperLiquidSubscriptionService_accountSubscriberCount, _HyperLiquidSubscriptionService_oiCapSubscriberCount, _HyperLiquidSubscriptionService_dexPositionsCache, _HyperLiquidSubscriptionService_dexOrdersCache, _HyperLiquidSubscriptionService_dexAccountCache, _HyperLiquidSubscriptionService_cachedPositions, _HyperLiquidSubscriptionService_cachedOrders, _HyperLiquidSubscriptionService_cachedAccount, _HyperLiquidSubscriptionService_ordersCacheInitialized, _HyperLiquidSubscriptionService_positionsCacheInitialized, _HyperLiquidSubscriptionService_oiCapSubscribers, _HyperLiquidSubscriptionService_cachedOICaps, _HyperLiquidSubscriptionService_cachedOICapsHash, _HyperLiquidSubscriptionService_oiCapsCacheInitialized, _HyperLiquidSubscriptionService_cachedPriceData, _HyperLiquidSubscriptionService_allMidsSnapshots, _HyperLiquidSubscriptionService_cachedFills, _HyperLiquidSubscriptionService_fillsCacheInitialized, _HyperLiquidSubscriptionService_assetCtxsSubscriptions, _HyperLiquidSubscriptionService_dexAssetCtxsCache, _HyperLiquidSubscriptionService_assetCtxsSubscriptionPromises, _HyperLiquidSubscriptionService_dexAllMidsSubscriptions, _HyperLiquidSubscriptionService_dexAllMidsSubscriptionPromises, _HyperLiquidSubscriptionService_clearinghouseStateSubscriptions, _HyperLiquidSubscriptionService_openOrdersSubscriptions, _HyperLiquidSubscriptionService_pendingClearinghouseSubscriptions, _HyperLiquidSubscriptionService_pendingOpenOrdersSubscriptions, _HyperLiquidSubscriptionService_dexMetaCache, _HyperLiquidSubscriptionService_orderBookCache, _HyperLiquidSubscriptionService_marketDataCache, _HyperLiquidSubscriptionService_isClearing, _HyperLiquidSubscriptionService_restoreRetryTimeouts, _HyperLiquidSubscriptionService_deps, _HyperLiquidSubscriptionService_logErrorUnlessClearing, _HyperLiquidSubscriptionService_isTransientAssetCtxsError, _HyperLiquidSubscriptionService_scheduleRestoreRetry, _HyperLiquidSubscriptionService_getErrorContext, _HyperLiquidSubscriptionService_isDexEnabled, _HyperLiquidSubscriptionService_waitForDexDiscovery, _HyperLiquidSubscriptionService_hashPositions, _HyperLiquidSubscriptionService_hashOrders, _HyperLiquidSubscriptionService_hashAccountState, _HyperLiquidSubscriptionService_cachedPositionsHash, _HyperLiquidSubscriptionService_cachedOrdersHash, _HyperLiquidSubscriptionService_cachedAccountHash, _HyperLiquidSubscriptionService_extractTPSLFromOrders, _HyperLiquidSubscriptionService_mergeTPSLIntoPositions, _HyperLiquidSubscriptionService_aggregateAccountStates, _HyperLiquidSubscriptionService_ensureSharedWebData3Subscription, _HyperLiquidSubscriptionService_createUserDataSubscription, _HyperLiquidSubscriptionService_ensureClearinghouseStateSubscription, _HyperLiquidSubscriptionService_createClearinghouseSubscription, _HyperLiquidSubscriptionService_ensureOpenOrdersSubscription, _HyperLiquidSubscriptionService_createOpenOrdersSubscription, _HyperLiquidSubscriptionService_aggregateAndNotifySubscribers, _HyperLiquidSubscriptionService_cleanupSharedWebData3ISubscription, _HyperLiquidSubscriptionService_ensureOrderFillISubscription, _HyperLiquidSubscriptionService_createSubscription, _HyperLiquidSubscriptionService_createPriceUpdate, _HyperLiquidSubscriptionService_ensureGlobalAllMidsSubscription, _HyperLiquidSubscriptionService_ensureActiveAssetSubscription, _HyperLiquidSubscriptionService_cleanupActiveAssetSubscription, _HyperLiquidSubscriptionService_ensureAssetCtxsSubscription, _HyperLiquidSubscriptionService_ensureDexAllMidsSubscription, _HyperLiquidSubscriptionService_createDexAllMidsSubscription, _HyperLiquidSubscriptionService_createAssetCtxsSubscription, _HyperLiquidSubscriptionService_cleanupAssetCtxsSubscription, _HyperLiquidSubscriptionService_ensureBboSubscription, _HyperLiquidSubscriptionService_cleanupBboSubscription, _HyperLiquidSubscriptionService_processOrderBookData, _HyperLiquidSubscriptionService_notifyAllPriceSubscribers;
13
+ import { hasProperty } from "@metamask/utils";
13
14
  import { TP_SL_CONFIG, PERPS_CONSTANTS } from "../constants/perpsConfig.mjs";
14
15
  import { WebSocketConnectionState } from "../types/index.mjs";
15
16
  import { calculateWeightedReturnOnEquity } from "../utils/accountUtils.mjs";
@@ -55,7 +56,12 @@ export class HyperLiquidSubscriptionService {
55
56
  _HyperLiquidSubscriptionService_globalAllMidsSubscription.set(this, void 0);
56
57
  _HyperLiquidSubscriptionService_globalAllMidsPromise.set(this, void 0); // Track in-progress subscription
57
58
  _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions.set(this, new Map());
59
+ // Track in-progress activeAssetCtx subscription promises to prevent leaks
60
+ // when cleanup fires before the async subscription resolves (#28141)
61
+ _HyperLiquidSubscriptionService_pendingActiveAssetPromises.set(this, new Map());
58
62
  _HyperLiquidSubscriptionService_globalBboSubscriptions.set(this, new Map());
63
+ // Track in-progress BBO subscription promises to prevent leaks (#28141)
64
+ _HyperLiquidSubscriptionService_pendingBboPromises.set(this, new Map());
59
65
  // Order fill subscriptions keyed by accountId (normalized: undefined -> 'default')
60
66
  _HyperLiquidSubscriptionService_orderFillSubscriptions.set(this, new Map());
61
67
  _HyperLiquidSubscriptionService_symbolSubscriberCounts.set(this, new Map());
@@ -699,6 +705,7 @@ export class HyperLiquidSubscriptionService {
699
705
  if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_marketDataSubscribers, "f").size > 0) {
700
706
  // Clear existing subscriptions (they're dead after reconnection)
701
707
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").clear();
708
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").clear();
702
709
  // Clear reference counts to prevent double-counting after reconnection
703
710
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").clear();
704
711
  // Re-establish subscriptions for all symbols with market data subscribers
@@ -711,6 +718,7 @@ export class HyperLiquidSubscriptionService {
711
718
  if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_orderBookSubscribers, "f").size > 0) {
712
719
  // Clear existing subscriptions (they're dead after reconnection)
713
720
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").clear();
721
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").clear();
714
722
  // Re-establish subscriptions for all symbols with order book subscribers
715
723
  const symbolsNeedingOrderBook = Array.from(__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_orderBookSubscribers, "f").keys());
716
724
  symbolsNeedingOrderBook.forEach((symbol) => {
@@ -840,7 +848,9 @@ export class HyperLiquidSubscriptionService {
840
848
  __classPrivateFieldSet(this, _HyperLiquidSubscriptionService_globalAllMidsSubscription, undefined, "f");
841
849
  __classPrivateFieldSet(this, _HyperLiquidSubscriptionService_globalAllMidsPromise, undefined, "f");
842
850
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").clear();
851
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").clear();
843
852
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").clear();
853
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").clear();
844
854
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_webData3Subscriptions, "f").clear();
845
855
  __classPrivateFieldSet(this, _HyperLiquidSubscriptionService_webData3SubscriptionPromise, undefined, "f");
846
856
  // HIP-3: Clear assetCtxs subscriptions (clearinghouseState no longer needed with webData3)
@@ -879,7 +889,7 @@ export class HyperLiquidSubscriptionService {
879
889
  });
880
890
  }
881
891
  }
882
- _HyperLiquidSubscriptionService_clientService = new WeakMap(), _HyperLiquidSubscriptionService_walletService = new WeakMap(), _HyperLiquidSubscriptionService_hip3Enabled = new WeakMap(), _HyperLiquidSubscriptionService_enabledDexs = new WeakMap(), _HyperLiquidSubscriptionService_allowlistMarkets = new WeakMap(), _HyperLiquidSubscriptionService_blocklistMarkets = new WeakMap(), _HyperLiquidSubscriptionService_discoveredDexNames = new WeakMap(), _HyperLiquidSubscriptionService_dexDiscoveryPromise = new WeakMap(), _HyperLiquidSubscriptionService_dexDiscoveryResolver = new WeakMap(), _HyperLiquidSubscriptionService_expectedDexs = new WeakMap(), _HyperLiquidSubscriptionService_initializedDexs = new WeakMap(), _HyperLiquidSubscriptionService_priceSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_positionSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderFillSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_accountSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_marketDataSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderBookSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_globalAllMidsSubscription = new WeakMap(), _HyperLiquidSubscriptionService_globalAllMidsPromise = new WeakMap(), _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_globalBboSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_orderFillSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_symbolSubscriberCounts = new WeakMap(), _HyperLiquidSubscriptionService_dexSubscriberCounts = new WeakMap(), _HyperLiquidSubscriptionService_webData3Subscriptions = new WeakMap(), _HyperLiquidSubscriptionService_webData3SubscriptionPromise = new WeakMap(), _HyperLiquidSubscriptionService_positionSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_orderSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_accountSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_oiCapSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_dexPositionsCache = new WeakMap(), _HyperLiquidSubscriptionService_dexOrdersCache = new WeakMap(), _HyperLiquidSubscriptionService_dexAccountCache = new WeakMap(), _HyperLiquidSubscriptionService_cachedPositions = new WeakMap(), _HyperLiquidSubscriptionService_cachedOrders = new WeakMap(), _HyperLiquidSubscriptionService_cachedAccount = new WeakMap(), _HyperLiquidSubscriptionService_ordersCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_positionsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_oiCapSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_cachedOICaps = new WeakMap(), _HyperLiquidSubscriptionService_cachedOICapsHash = new WeakMap(), _HyperLiquidSubscriptionService_oiCapsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_cachedPriceData = new WeakMap(), _HyperLiquidSubscriptionService_allMidsSnapshots = new WeakMap(), _HyperLiquidSubscriptionService_cachedFills = new WeakMap(), _HyperLiquidSubscriptionService_fillsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_assetCtxsSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexAssetCtxsCache = new WeakMap(), _HyperLiquidSubscriptionService_assetCtxsSubscriptionPromises = new WeakMap(), _HyperLiquidSubscriptionService_dexAllMidsSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexAllMidsSubscriptionPromises = new WeakMap(), _HyperLiquidSubscriptionService_clearinghouseStateSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_openOrdersSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingClearinghouseSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingOpenOrdersSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexMetaCache = new WeakMap(), _HyperLiquidSubscriptionService_orderBookCache = new WeakMap(), _HyperLiquidSubscriptionService_marketDataCache = new WeakMap(), _HyperLiquidSubscriptionService_isClearing = new WeakMap(), _HyperLiquidSubscriptionService_restoreRetryTimeouts = new WeakMap(), _HyperLiquidSubscriptionService_deps = new WeakMap(), _HyperLiquidSubscriptionService_cachedPositionsHash = new WeakMap(), _HyperLiquidSubscriptionService_cachedOrdersHash = new WeakMap(), _HyperLiquidSubscriptionService_cachedAccountHash = new WeakMap(), _HyperLiquidSubscriptionService_instances = new WeakSet(), _HyperLiquidSubscriptionService_logErrorUnlessClearing = function _HyperLiquidSubscriptionService_logErrorUnlessClearing(error, context) {
892
+ _HyperLiquidSubscriptionService_clientService = new WeakMap(), _HyperLiquidSubscriptionService_walletService = new WeakMap(), _HyperLiquidSubscriptionService_hip3Enabled = new WeakMap(), _HyperLiquidSubscriptionService_enabledDexs = new WeakMap(), _HyperLiquidSubscriptionService_allowlistMarkets = new WeakMap(), _HyperLiquidSubscriptionService_blocklistMarkets = new WeakMap(), _HyperLiquidSubscriptionService_discoveredDexNames = new WeakMap(), _HyperLiquidSubscriptionService_dexDiscoveryPromise = new WeakMap(), _HyperLiquidSubscriptionService_dexDiscoveryResolver = new WeakMap(), _HyperLiquidSubscriptionService_expectedDexs = new WeakMap(), _HyperLiquidSubscriptionService_initializedDexs = new WeakMap(), _HyperLiquidSubscriptionService_priceSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_positionSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderFillSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_accountSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_marketDataSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_orderBookSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_globalAllMidsSubscription = new WeakMap(), _HyperLiquidSubscriptionService_globalAllMidsPromise = new WeakMap(), _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingActiveAssetPromises = new WeakMap(), _HyperLiquidSubscriptionService_globalBboSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingBboPromises = new WeakMap(), _HyperLiquidSubscriptionService_orderFillSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_symbolSubscriberCounts = new WeakMap(), _HyperLiquidSubscriptionService_dexSubscriberCounts = new WeakMap(), _HyperLiquidSubscriptionService_webData3Subscriptions = new WeakMap(), _HyperLiquidSubscriptionService_webData3SubscriptionPromise = new WeakMap(), _HyperLiquidSubscriptionService_positionSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_orderSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_accountSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_oiCapSubscriberCount = new WeakMap(), _HyperLiquidSubscriptionService_dexPositionsCache = new WeakMap(), _HyperLiquidSubscriptionService_dexOrdersCache = new WeakMap(), _HyperLiquidSubscriptionService_dexAccountCache = new WeakMap(), _HyperLiquidSubscriptionService_cachedPositions = new WeakMap(), _HyperLiquidSubscriptionService_cachedOrders = new WeakMap(), _HyperLiquidSubscriptionService_cachedAccount = new WeakMap(), _HyperLiquidSubscriptionService_ordersCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_positionsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_oiCapSubscribers = new WeakMap(), _HyperLiquidSubscriptionService_cachedOICaps = new WeakMap(), _HyperLiquidSubscriptionService_cachedOICapsHash = new WeakMap(), _HyperLiquidSubscriptionService_oiCapsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_cachedPriceData = new WeakMap(), _HyperLiquidSubscriptionService_allMidsSnapshots = new WeakMap(), _HyperLiquidSubscriptionService_cachedFills = new WeakMap(), _HyperLiquidSubscriptionService_fillsCacheInitialized = new WeakMap(), _HyperLiquidSubscriptionService_assetCtxsSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexAssetCtxsCache = new WeakMap(), _HyperLiquidSubscriptionService_assetCtxsSubscriptionPromises = new WeakMap(), _HyperLiquidSubscriptionService_dexAllMidsSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexAllMidsSubscriptionPromises = new WeakMap(), _HyperLiquidSubscriptionService_clearinghouseStateSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_openOrdersSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingClearinghouseSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_pendingOpenOrdersSubscriptions = new WeakMap(), _HyperLiquidSubscriptionService_dexMetaCache = new WeakMap(), _HyperLiquidSubscriptionService_orderBookCache = new WeakMap(), _HyperLiquidSubscriptionService_marketDataCache = new WeakMap(), _HyperLiquidSubscriptionService_isClearing = new WeakMap(), _HyperLiquidSubscriptionService_restoreRetryTimeouts = new WeakMap(), _HyperLiquidSubscriptionService_deps = new WeakMap(), _HyperLiquidSubscriptionService_cachedPositionsHash = new WeakMap(), _HyperLiquidSubscriptionService_cachedOrdersHash = new WeakMap(), _HyperLiquidSubscriptionService_cachedAccountHash = new WeakMap(), _HyperLiquidSubscriptionService_instances = new WeakSet(), _HyperLiquidSubscriptionService_logErrorUnlessClearing = function _HyperLiquidSubscriptionService_logErrorUnlessClearing(error, context) {
883
893
  if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_isClearing, "f")) {
884
894
  return;
885
895
  }
@@ -1935,8 +1945,9 @@ async function _HyperLiquidSubscriptionService_ensureOrderFillISubscription(acco
1935
1945
  // Increment subscriber count
1936
1946
  const currentCount = __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").get(symbol) ?? 0;
1937
1947
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").set(symbol, currentCount + 1);
1938
- // If subscription already exists, just return
1939
- if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").has(symbol)) {
1948
+ // If subscription already exists or is being created, just return
1949
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").has(symbol) ||
1950
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").has(symbol)) {
1940
1951
  return;
1941
1952
  }
1942
1953
  const subscriptionClient = __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_clientService, "f").getSubscriptionClient();
@@ -1948,14 +1959,14 @@ async function _HyperLiquidSubscriptionService_ensureOrderFillISubscription(acco
1948
1959
  messagesReceived: 0,
1949
1960
  startTime: Date.now(),
1950
1961
  };
1951
- subscriptionClient
1962
+ const promise = subscriptionClient
1952
1963
  .activeAssetCtx({ coin: symbol }, (data) => {
1953
1964
  subscriptionMetrics.messagesReceived += 1;
1954
1965
  if (data.coin === symbol && data.ctx) {
1955
1966
  // Type guard using SDK types: check if this is perps (has funding) or spot (no funding)
1956
- const isPerpsContext = (event) => 'funding' in event.ctx &&
1957
- 'openInterest' in event.ctx &&
1958
- 'oraclePx' in event.ctx;
1967
+ const isPerpsContext = (event) => hasProperty(event.ctx, 'funding') &&
1968
+ hasProperty(event.ctx, 'openInterest') &&
1969
+ hasProperty(event.ctx, 'oraclePx');
1959
1970
  const { ctx } = data;
1960
1971
  // Cache market data for consolidation with price updates
1961
1972
  const ctxPrice = ctx.midPx ?? ctx.markPx;
@@ -1994,17 +2005,36 @@ async function _HyperLiquidSubscriptionService_ensureOrderFillISubscription(acco
1994
2005
  }
1995
2006
  })
1996
2007
  .then((sub) => {
2008
+ // Only clear pending ref if this is still the current promise.
2009
+ // A rapid away-and-back can replace the pending promise; blindly
2010
+ // deleting would remove the *newer* reference (#28141).
2011
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").get(symbol) === promise) {
2012
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").delete(symbol);
2013
+ }
2014
+ // Stale subscription: cleanup was called while pending, a newer
2015
+ // subscription already won the race, OR a different pending promise
2016
+ // exists (rapid away-and-back before this one resolved). (#28141)
2017
+ if ((__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").get(symbol) ?? 0) <= 0 ||
2018
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").has(symbol) ||
2019
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").has(symbol)) {
2020
+ return sub.unsubscribe();
2021
+ }
1997
2022
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").set(symbol, sub);
1998
2023
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_deps, "f").debugLogger.log(`HyperLiquid: Market data subscription established for ${symbol}`);
1999
2024
  return undefined;
2000
2025
  })
2001
2026
  .catch((error) => {
2027
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").get(symbol) === promise) {
2028
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").delete(symbol);
2029
+ }
2002
2030
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_instances, "m", _HyperLiquidSubscriptionService_logErrorUnlessClearing).call(this, ensureError(error, 'HyperLiquidSubscriptionService.ensureActiveAssetSubscription'), __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_instances, "m", _HyperLiquidSubscriptionService_getErrorContext).call(this, 'ensureActiveAssetSubscription', { symbol }));
2003
2031
  });
2032
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").set(symbol, promise);
2004
2033
  }, _HyperLiquidSubscriptionService_cleanupActiveAssetSubscription = function _HyperLiquidSubscriptionService_cleanupActiveAssetSubscription(symbol) {
2005
2034
  const currentCount = __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").get(symbol) ?? 0;
2006
2035
  if (currentCount <= 1) {
2007
2036
  // Last subscriber, cleanup subscription
2037
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").delete(symbol);
2008
2038
  const subscription = __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").get(symbol);
2009
2039
  if (subscription && typeof subscription.unsubscribe === 'function') {
2010
2040
  const unsubscribeResult = Promise.resolve(subscription.unsubscribe());
@@ -2012,14 +2042,17 @@ async function _HyperLiquidSubscriptionService_ensureOrderFillISubscription(acco
2012
2042
  // Ignore errors during cleanup
2013
2043
  });
2014
2044
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").delete(symbol);
2015
- __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").delete(symbol);
2016
2045
  }
2017
2046
  else if (subscription) {
2018
2047
  // Subscription exists but unsubscribe is not a function or doesn't return a Promise
2019
2048
  // Just clean up the reference
2020
2049
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalActiveAssetSubscriptions, "f").delete(symbol);
2021
- __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_symbolSubscriberCounts, "f").delete(symbol);
2022
2050
  }
2051
+ // If subscription is still pending (async), the .then() handler in
2052
+ // #ensureActiveAssetSubscription will check symbolSubscriberCounts
2053
+ // and unsubscribe immediately when it resolves (#28141)
2054
+ // Clean up the pending promise reference
2055
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingActiveAssetPromises, "f").delete(symbol);
2023
2056
  }
2024
2057
  else {
2025
2058
  // Still has subscribers, just decrement count
@@ -2114,6 +2147,11 @@ async function _HyperLiquidSubscriptionService_createDexAllMidsSubscription(dex)
2114
2147
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_allMidsSnapshots, "f").set(dex, data.mids);
2115
2148
  })
2116
2149
  .then((sub) => {
2150
+ // If a newer subscription already won the race, discard this one (#28141)
2151
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_dexAllMidsSubscriptions, "f").has(dex)) {
2152
+ resolve();
2153
+ return sub.unsubscribe();
2154
+ }
2117
2155
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_dexAllMidsSubscriptions, "f").set(dex, sub);
2118
2156
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_deps, "f").debugLogger.log(`allMids subscription established for DEX: ${dex}`);
2119
2157
  resolve();
@@ -2173,7 +2211,7 @@ async function _HyperLiquidSubscriptionService_createAssetCtxsSubscription(dex)
2173
2211
  // Use cached meta to map ctxs array indices to symbols (no REST API call!)
2174
2212
  validatedMeta.universe.forEach((asset, index) => {
2175
2213
  const ctx = data.ctxs[index];
2176
- if (ctx && 'funding' in ctx) {
2214
+ if (ctx && hasProperty(ctx, 'funding')) {
2177
2215
  // This is a perps context
2178
2216
  const ctxPrice = ctx.midPx ?? ctx.markPx;
2179
2217
  const openInterestUSD = calculateOpenInterestUSD(ctx.openInterest, ctxPrice);
@@ -2234,6 +2272,11 @@ async function _HyperLiquidSubscriptionService_createAssetCtxsSubscription(dex)
2234
2272
  };
2235
2273
  subscribeWithRetry()
2236
2274
  .then((sub) => {
2275
+ // If a newer subscription already won the race, discard this one (#28141)
2276
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_assetCtxsSubscriptions, "f").has(dexKey)) {
2277
+ resolve();
2278
+ return sub.unsubscribe();
2279
+ }
2237
2280
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_assetCtxsSubscriptions, "f").set(dexKey, sub);
2238
2281
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_deps, "f").debugLogger.log(`assetCtxs subscription established for ${dex ? `DEX: ${dex}` : 'main DEX'}`);
2239
2282
  resolve();
@@ -2280,14 +2323,16 @@ async function _HyperLiquidSubscriptionService_createAssetCtxsSubscription(dex)
2280
2323
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_dexSubscriberCounts, "f").set(dexKey, currentCount - 1);
2281
2324
  }
2282
2325
  }, _HyperLiquidSubscriptionService_ensureBboSubscription = function _HyperLiquidSubscriptionService_ensureBboSubscription(symbol) {
2283
- if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").has(symbol)) {
2326
+ // Skip if subscription already exists or is being created
2327
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").has(symbol) ||
2328
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").has(symbol)) {
2284
2329
  return;
2285
2330
  }
2286
2331
  const subscriptionClient = __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_clientService, "f").getSubscriptionClient();
2287
2332
  if (!subscriptionClient) {
2288
2333
  return;
2289
2334
  }
2290
- subscriptionClient
2335
+ const promise = subscriptionClient
2291
2336
  .bbo({ coin: symbol }, (data) => {
2292
2337
  processBboData({
2293
2338
  symbol,
@@ -2299,13 +2344,29 @@ async function _HyperLiquidSubscriptionService_createAssetCtxsSubscription(dex)
2299
2344
  });
2300
2345
  })
2301
2346
  .then((sub) => {
2347
+ // Only clear pending ref if this is still the current promise (#28141).
2348
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").get(symbol) === promise) {
2349
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").delete(symbol);
2350
+ }
2351
+ // Stale subscription: cleanup was called while pending, a newer
2352
+ // subscription already won the race, OR a different pending promise
2353
+ // exists (rapid away-and-back before this one resolved). (#28141)
2354
+ if ((__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_orderBookSubscribers, "f").get(symbol)?.size ?? 0) <= 0 ||
2355
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").has(symbol) ||
2356
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").has(symbol)) {
2357
+ return sub.unsubscribe();
2358
+ }
2302
2359
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").set(symbol, sub);
2303
2360
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_deps, "f").debugLogger.log(`HyperLiquid: BBO subscription established for ${symbol}`);
2304
2361
  return undefined;
2305
2362
  })
2306
2363
  .catch((error) => {
2364
+ if (__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").get(symbol) === promise) {
2365
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").delete(symbol);
2366
+ }
2307
2367
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_instances, "m", _HyperLiquidSubscriptionService_logErrorUnlessClearing).call(this, ensureError(error, 'HyperLiquidSubscriptionService.ensureBboSubscription'), __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_instances, "m", _HyperLiquidSubscriptionService_getErrorContext).call(this, 'ensureBboSubscription', { symbol }));
2308
2368
  });
2369
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").set(symbol, promise);
2309
2370
  }, _HyperLiquidSubscriptionService_cleanupBboSubscription = function _HyperLiquidSubscriptionService_cleanupBboSubscription(symbol) {
2310
2371
  // If anyone still wants order book (top-of-book) data for this symbol, keep the subscription alive.
2311
2372
  if ((__classPrivateFieldGet(this, _HyperLiquidSubscriptionService_orderBookSubscribers, "f").get(symbol)?.size ?? 0) > 0) {
@@ -2326,6 +2387,10 @@ async function _HyperLiquidSubscriptionService_createAssetCtxsSubscription(dex)
2326
2387
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_globalBboSubscriptions, "f").delete(symbol);
2327
2388
  __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_orderBookCache, "f").delete(symbol);
2328
2389
  }
2390
+ // If subscription is still pending (async), the .then() handler in
2391
+ // #ensureBboSubscription will check orderBookSubscribers and
2392
+ // unsubscribe immediately when it resolves (#28141)
2393
+ __classPrivateFieldGet(this, _HyperLiquidSubscriptionService_pendingBboPromises, "f").delete(symbol);
2329
2394
  }, _HyperLiquidSubscriptionService_processOrderBookData = function _HyperLiquidSubscriptionService_processOrderBookData(data, levels) {
2330
2395
  const bidsRaw = data?.levels?.[0] ?? [];
2331
2396
  const asksRaw = data?.levels?.[1] ?? [];